00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GEOS_OPERATION_ISSIMPLEOP_H
00023 #define GEOS_OPERATION_ISSIMPLEOP_H
00024
00025
00026 #include <geos/export.h>
00027 #include <geos/geom/Coordinate.h>
00028
00029 #include <map>
00030 #include <memory>
00031
00032
00033 namespace geos {
00034 namespace algorithm {
00035 class BoundaryNodeRule;
00036 }
00037 namespace geom {
00038 class LineString;
00039 class MultiLineString;
00040 class MultiPoint;
00041 class Geometry;
00042 struct CoordinateLessThen;
00043 }
00044 namespace geomgraph {
00045 class GeometryGraph;
00046 }
00047 namespace operation {
00048 class EndpointInfo;
00049 }
00050 }
00051
00052
00053 namespace geos {
00054 namespace operation {
00055
00090 class GEOS_DLL IsSimpleOp
00091 {
00092
00093 public:
00094
00101 IsSimpleOp();
00102
00110 IsSimpleOp(const geom::Geometry& geom);
00111
00119 IsSimpleOp(const geom::Geometry& geom,
00120 const algorithm::BoundaryNodeRule& boundaryNodeRule);
00121
00127 bool isSimple();
00128
00139 const geom::Coordinate* getNonSimpleLocation() const
00140 {
00141 return nonSimpleLocation.get();
00142 }
00143
00152 bool isSimple(const geom::LineString *geom);
00153
00162 bool isSimple(const geom::MultiLineString *geom);
00163
00169 bool isSimple(const geom::MultiPoint *mp);
00170
00171 bool isSimpleLinearGeometry(const geom::Geometry *geom);
00172
00173 private:
00174
00181 bool hasNonEndpointIntersection(geomgraph::GeometryGraph &graph);
00182
00191 bool hasClosedEndpointIntersection(geomgraph::GeometryGraph &graph);
00192
00196 void addEndpoint(std::map<const geom::Coordinate*, EndpointInfo*,
00197 geom::CoordinateLessThen>&endPoints,
00198 const geom::Coordinate *p, bool isClosed);
00199
00200 bool isClosedEndpointsInInterior;
00201
00202 bool isSimpleMultiPoint(const geom::MultiPoint& mp);
00203
00204 const geom::Geometry* geom;
00205
00206 std::auto_ptr<geom::Coordinate> nonSimpleLocation;
00207 };
00208
00209 }
00210 }
00211
00212 #endif
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223