xmsgrid
1.0
|
Wraps a boost polygon for point in poly, min distance from point to poly etc. More...
Public Member Functions | |
GmPolygonImpl () | |
Constructor. | |
virtual void | Setup (const VecPt3d &a_poly, const VecPt3d2d &a_inPolys) override |
Create a boost geometry polygon to use in point in polygon. More... | |
virtual void | GetPoints (VecPt3d &a_poly, VecPt3d2d &a_inPolys) const override |
Get the points from a boost polygon as vectors of Pt3d. More... | |
virtual bool | CoveredBy (Pt3d a_point) const override |
Tests if a_point is inside or on the polygon and not in a hole. More... | |
virtual bool | Within (Pt3d a_point) const override |
Tests if a_point is inside the polygon and not in a hole. More... | |
virtual double | MinDistanceToBoundary (Pt3d a_pt) const override |
Computes the min distance from a point to a polygon. More... | |
virtual void | Intersection (const GmPolygon &a_, std::vector< BSHP< GmPolygon >> &a_out) const override |
Performs a polygon intersection. More... | |
virtual void | Union (const GmPolygon &a_, std::vector< BSHP< GmPolygon >> &a_out) const override |
Performs a polygon union. More... | |
Public Member Functions inherited from xms::GmPolygon | |
GmPolygon () | |
Constructor. | |
virtual | ~GmPolygon () |
Destructor. | |
Private Attributes | |
GmBstPoly3d | m_poly |
The boost geom polygon. | |
Additional Inherited Members | |
Static Public Member Functions inherited from xms::GmPolygon | |
static BSHP< GmPolygon > | New () |
Creates a class. More... | |
Wraps a boost polygon for point in poly, min distance from point to poly etc.
gmPointInPolygon2D is faster, but if you need a boost polygon, consider using this class. This class is best if being used repeatedly for the same polygon as it takes time for setup due to it being allocated on the heap and creating a boost polygon under the hood, but the methods can then be called repeatedly at speed.
Definition at line 44 of file GmPolygon.cpp.
|
overridevirtual |
Tests if a_point is inside or on the polygon and not in a hole.
a_point | The location to test. |
gmPointInPolygon2D is faster.
Definition at line 168 of file GmPolygon.cpp.
References m_poly.
|
overridevirtual |
Get the points from a boost polygon as vectors of Pt3d.
a_outPoly | Outer polygon, clockwise. |
a_inPolys | Inner polygons (if any), counter clockwise. |
Definition at line 149 of file GmPolygon.cpp.
References m_poly.
|
overridevirtual |
Performs a polygon intersection.
a_ | Another polygon to do the intersection operation with |
a_out | Vector of polygons created from the intersection operation |
Definition at line 219 of file GmPolygon.cpp.
References m_poly, xms::GmPolygon::New(), and XM_ENSURE_TRUE.
|
overridevirtual |
Computes the min distance from a point to a polygon.
a_pt | The location from which the minimum distance is calculated. |
Definition at line 202 of file GmPolygon.cpp.
References xms::iDistanceToRing(), and m_poly.
Referenced by GmPolygonUnitTests::testMinDistanceToBoundary().
|
overridevirtual |
Create a boost geometry polygon to use in point in polygon.
The first point should be repeated as the last point but if not, it will get fixed automatically. Also, if the orientation of the polygons is not correct, it is automatically corrected.
a_outPoly | Outer polygon, clockwise. |
a_inPolys | Inner polygons (if any), counter clockwise. |
Definition at line 116 of file GmPolygon.cpp.
References m_poly.
Referenced by GmPolygonUnitTests::testMinDistanceToBoundary().
|
overridevirtual |
Performs a polygon union.
a_ | Another polygon to do the union operation with |
a_out | Vector of polygons created from the union operation |
Definition at line 246 of file GmPolygon.cpp.
References m_poly, xms::GmPolygon::New(), and XM_ENSURE_TRUE.
|
overridevirtual |
Tests if a_point is inside the polygon and not in a hole.
a_point | The location to test. |
gmPointInPolygon2D is faster.
Definition at line 187 of file GmPolygon.cpp.
References m_poly.