GEOS  3.8.0dev
AbstractPreparedPolygonContains.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  *
14  **********************************************************************
15  *
16  * Last port: geom/prep/AbstractPreparedPolygonContains.java r388 (JTS-1.12)
17  *
18  **********************************************************************/
19 
20 #ifndef GEOS_GEOM_PREP_ABSTRACTPREPAREDPOLYGONCONTAINS_H
21 #define GEOS_GEOM_PREP_ABSTRACTPREPAREDPOLYGONCONTAINS_H
22 
23 #include <geos/geom/prep/PreparedPolygonPredicate.h> // inherited
24 
25 
26 // forward declarations
27 namespace geos {
28 namespace geom {
29 class Geometry;
30 
31 namespace prep {
32 class PreparedPolygon;
33 }
34 }
35 }
36 
37 
38 namespace geos {
39 namespace geom { // geos::geom
40 namespace prep { // geos::geom::prep
41 
66 private:
67  // information about geometric situation
68  bool hasSegmentIntersection;
69  bool hasProperIntersection;
70  bool hasNonProperIntersection;
71 
72  bool isProperIntersectionImpliesNotContainedSituation(const geom::Geometry* testGeom);
73 
79  bool isSingleShell(const geom::Geometry& geom);
80 
81  void findAndClassifyIntersections(const geom::Geometry* geom);
82 
83 protected:
91 
99  bool eval(const geom::Geometry* geom);
100 
108  virtual bool fullTopologicalPredicate(const geom::Geometry* geom) = 0;
109 
110 public:
111  AbstractPreparedPolygonContains(const PreparedPolygon* const p_prepPoly)
112  : PreparedPolygonPredicate(p_prepPoly),
113  hasSegmentIntersection(false),
114  hasProperIntersection(false),
115  hasNonProperIntersection(false),
116  requireSomePointInInterior(true)
117  { }
118 
119  AbstractPreparedPolygonContains(const PreparedPolygon* const p_prepPoly, bool p_requireSomePointInInterior)
120  : PreparedPolygonPredicate(p_prepPoly),
121  hasSegmentIntersection(false),
122  hasProperIntersection(false),
123  hasNonProperIntersection(false),
124  requireSomePointInInterior(p_requireSomePointInInterior)
125  { }
126 
127  ~AbstractPreparedPolygonContains() override
128  { }
129 
130 };
131 
132 } // geos::geom::prep
133 } // geos::geom
134 } // geos
135 
136 #endif // GEOS_GEOM_PREP_ABSTRACTPREPAREDPOLYGONCONTAINS_H
virtual bool fullTopologicalPredicate(const geom::Geometry *geom)=0
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:187
A base class for predicate operations on PreparedPolygons.
Definition: PreparedPolygonPredicate.h:57
bool requireSomePointInInterior
Definition: AbstractPreparedPolygonContains.h:90
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
A base class containing the logic for computes the contains and covers spatial relationship predicate...
Definition: AbstractPreparedPolygonContains.h:65
bool eval(const geom::Geometry *geom)
A prepared version of Polygon or MultiPolygon geometries.
Definition: PreparedPolygon.h:48