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 
109  bool evalPointTestGeom(const geom::Geometry* geom, geom::Location outermostLoc);
110 
118  virtual bool fullTopologicalPredicate(const geom::Geometry* geom) = 0;
119 
120 public:
121  AbstractPreparedPolygonContains(const PreparedPolygon* const p_prepPoly)
122  : PreparedPolygonPredicate(p_prepPoly),
123  hasSegmentIntersection(false),
124  hasProperIntersection(false),
125  hasNonProperIntersection(false),
126  requireSomePointInInterior(true)
127  { }
128 
129  AbstractPreparedPolygonContains(const PreparedPolygon* const p_prepPoly, bool p_requireSomePointInInterior)
130  : PreparedPolygonPredicate(p_prepPoly),
131  hasSegmentIntersection(false),
132  hasProperIntersection(false),
133  hasNonProperIntersection(false),
134  requireSomePointInInterior(p_requireSomePointInInterior)
135  { }
136 
137  ~AbstractPreparedPolygonContains() override
138  { }
139 
140 };
141 
142 } // geos::geom::prep
143 } // geos::geom
144 } // geos
145 
146 #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:188
A base class for predicate operations on PreparedPolygons.
Definition: PreparedPolygonPredicate.h:58
bool requireSomePointInInterior
Definition: AbstractPreparedPolygonContains.h:90
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:33
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
bool evalPointTestGeom(const geom::Geometry *geom, geom::Location outermostLoc)