GEOS 3.6.2
IsSimpleOp.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2009 Sandro Santilli <strk@keybit.net>
7 * Copyright (C) 2005-2006 Refractions Research Inc.
8 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9 *
10 * This is free software; you can redistribute and/or modify it under
11 * the terms of the GNU Lesser General Public Licence as published
12 * by the Free Software Foundation.
13 * See the COPYING file for more information.
14 *
15 **********************************************************************
16 *
17 * Last port: operation/IsSimpleOp.java rev. 1.22 (JTS-1.10)
18 *
19 **********************************************************************/
20
21#ifndef GEOS_OPERATION_ISSIMPLEOP_H
22#define GEOS_OPERATION_ISSIMPLEOP_H
23
24#include <geos/export.h>
25#include <geos/geom/Coordinate.h> // for dtor visibility by auto_ptr (compos)
26
27#include <map>
28#include <memory> // for auto_ptr
29
30#ifdef _MSC_VER
31#pragma warning(push)
32#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
33#endif
34
35// Forward declarations
36namespace geos {
37 namespace algorithm {
38 class BoundaryNodeRule;
39 }
40 namespace geom {
41 class LineString;
42 class MultiLineString;
43 class MultiPoint;
44 class Geometry;
45 struct CoordinateLessThen;
46 }
47 namespace geomgraph {
48 class GeometryGraph;
49 }
50 namespace operation {
51 class EndpointInfo;
52 }
53}
54
55
56namespace geos {
57namespace operation { // geos.operation
58
93class GEOS_DLL IsSimpleOp
94{
95
96public:
97
105
114
123 const algorithm::BoundaryNodeRule& boundaryNodeRule);
124
130 bool isSimple();
131
143 {
144 return nonSimpleLocation.get();
145 }
146
155 bool isSimple(const geom::LineString *geom);
156
166
172 bool isSimple(const geom::MultiPoint *mp);
173
174 bool isSimpleLinearGeometry(const geom::Geometry *geom);
175
176private:
177
184 bool hasNonEndpointIntersection(geomgraph::GeometryGraph &graph);
185
194 bool hasClosedEndpointIntersection(geomgraph::GeometryGraph &graph);
195
199 void addEndpoint(std::map<const geom::Coordinate*, EndpointInfo*,
200 geom::CoordinateLessThen>&endPoints,
201 const geom::Coordinate *p, bool isClosed);
202
203 bool isClosedEndpointsInInterior;
204
205 bool isSimpleMultiPoint(const geom::MultiPoint& mp);
206
207 const geom::Geometry* geom;
208
209 std::auto_ptr<geom::Coordinate> nonSimpleLocation;
210};
211
212} // namespace geos.operation
213} // namespace geos
214
215#ifdef _MSC_VER
216#pragma warning(pop)
217#endif
218
219#endif
Definition BoundaryNodeRule.h:50
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:167
Definition LineString.h:70
Models a collection of (}s.
Definition MultiLineString.h:51
Definition MultiPoint.h:56
Definition GeometryGraph.h:74
IsSimpleOp(const geom::Geometry &geom)
Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule.
bool isSimple(const geom::MultiLineString *geom)
IsSimpleOp()
Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule.
IsSimpleOp(const geom::Geometry &geom, const algorithm::BoundaryNodeRule &boundaryNodeRule)
Creates a simplicity checker using a given algorithm::BoundaryNodeRule.
const geom::Coordinate * getNonSimpleLocation() const
Definition IsSimpleOp.h:142
bool isSimple(const geom::MultiPoint *mp)
bool isSimple(const geom::LineString *geom)
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:33
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that implement topology graphs.
Definition IndexedNestedRingTester.h:34
Provides classes for implementing operations on geometries.
Definition IndexedNestedRingTester.h:40
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25
Strict weak ordering Functor for Coordinate.
Definition Coordinate.h:127