00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_OPERATION_ISSIMPLEOP_H
00022 #define GEOS_OPERATION_ISSIMPLEOP_H
00023
00024 #include <geos/export.h>
00025 #include <geos/geom/Coordinate.h>
00026
00027 #include <map>
00028 #include <memory>
00029
00030 #ifdef _MSC_VER
00031 #pragma warning(push)
00032 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00033 #endif
00034
00035
00036 namespace geos {
00037 namespace algorithm {
00038 class BoundaryNodeRule;
00039 }
00040 namespace geom {
00041 class LineString;
00042 class MultiLineString;
00043 class MultiPoint;
00044 class Geometry;
00045 struct CoordinateLessThen;
00046 }
00047 namespace geomgraph {
00048 class GeometryGraph;
00049 }
00050 namespace operation {
00051 class EndpointInfo;
00052 }
00053 }
00054
00055
00056 namespace geos {
00057 namespace operation {
00058
00093 class GEOS_DLL IsSimpleOp
00094 {
00095
00096 public:
00097
00104 IsSimpleOp();
00105
00113 IsSimpleOp(const geom::Geometry& geom);
00114
00122 IsSimpleOp(const geom::Geometry& geom,
00123 const algorithm::BoundaryNodeRule& boundaryNodeRule);
00124
00130 bool isSimple();
00131
00142 const geom::Coordinate* getNonSimpleLocation() const
00143 {
00144 return nonSimpleLocation.get();
00145 }
00146
00155 bool isSimple(const geom::LineString *geom);
00156
00165 bool isSimple(const geom::MultiLineString *geom);
00166
00172 bool isSimple(const geom::MultiPoint *mp);
00173
00174 bool isSimpleLinearGeometry(const geom::Geometry *geom);
00175
00176 private:
00177
00184 bool hasNonEndpointIntersection(geomgraph::GeometryGraph &graph);
00185
00194 bool hasClosedEndpointIntersection(geomgraph::GeometryGraph &graph);
00195
00199 void addEndpoint(std::map<const geom::Coordinate*, EndpointInfo*,
00200 geom::CoordinateLessThen>&endPoints,
00201 const geom::Coordinate *p, bool isClosed);
00202
00203 bool isClosedEndpointsInInterior;
00204
00205 bool isSimpleMultiPoint(const geom::MultiPoint& mp);
00206
00207 const geom::Geometry* geom;
00208
00209 std::auto_ptr<geom::Coordinate> nonSimpleLocation;
00210 };
00211
00212 }
00213 }
00214
00215 #ifdef _MSC_VER
00216 #pragma warning(pop)
00217 #endif
00218
00219 #endif