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 #include <geos/export.h>
00026 #include <geos/geom/Coordinate.h>
00027
00028 #include <map>
00029 #include <memory>
00030
00031 #ifdef _MSC_VER
00032 #pragma warning(push)
00033 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00034 #endif
00035
00036
00037 namespace geos {
00038 namespace algorithm {
00039 class BoundaryNodeRule;
00040 }
00041 namespace geom {
00042 class LineString;
00043 class MultiLineString;
00044 class MultiPoint;
00045 class Geometry;
00046 struct CoordinateLessThen;
00047 }
00048 namespace geomgraph {
00049 class GeometryGraph;
00050 }
00051 namespace operation {
00052 class EndpointInfo;
00053 }
00054 }
00055
00056
00057 namespace geos {
00058 namespace operation {
00059
00094 class GEOS_DLL IsSimpleOp
00095 {
00096
00097 public:
00098
00105 IsSimpleOp();
00106
00114 IsSimpleOp(const geom::Geometry& geom);
00115
00123 IsSimpleOp(const geom::Geometry& geom,
00124 const algorithm::BoundaryNodeRule& boundaryNodeRule);
00125
00131 bool isSimple();
00132
00143 const geom::Coordinate* getNonSimpleLocation() const
00144 {
00145 return nonSimpleLocation.get();
00146 }
00147
00156 bool isSimple(const geom::LineString *geom);
00157
00166 bool isSimple(const geom::MultiLineString *geom);
00167
00173 bool isSimple(const geom::MultiPoint *mp);
00174
00175 bool isSimpleLinearGeometry(const geom::Geometry *geom);
00176
00177 private:
00178
00185 bool hasNonEndpointIntersection(geomgraph::GeometryGraph &graph);
00186
00195 bool hasClosedEndpointIntersection(geomgraph::GeometryGraph &graph);
00196
00200 void addEndpoint(std::map<const geom::Coordinate*, EndpointInfo*,
00201 geom::CoordinateLessThen>&endPoints,
00202 const geom::Coordinate *p, bool isClosed);
00203
00204 bool isClosedEndpointsInInterior;
00205
00206 bool isSimpleMultiPoint(const geom::MultiPoint& mp);
00207
00208 const geom::Geometry* geom;
00209
00210 std::auto_ptr<geom::Coordinate> nonSimpleLocation;
00211 };
00212
00213 }
00214 }
00215
00216 #ifdef _MSC_VER
00217 #pragma warning(pop)
00218 #endif
00219
00220 #endif
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231