xmsgrid
1.0
|
Used to delete tin triangles that are outside given polygons. The polygons may include holes - polygons inside polygons. More...
Public Types | |
enum | BoundaryEnum { BE_UNVISITED = 0, BE_VISITED = 1, BE_OUTSIDE = 2, BE_INSIDE = 4, BE_ONBOUNDARY = 8 } |
Flags used triangles. | |
Public Member Functions | |
TrOuterTriangleDeleterImpl () | |
constructor | |
virtual void | Delete (const VecInt2d &a_polys, BSHP< TrTin > a_tin) override |
Deletes triangles in a_tin that are outside a_polys or inside if the poly is a hole. More... | |
virtual void | SetObserver (BSHP< Observer > a_) override |
Set the observer to use for feedback while processing. More... | |
Private Member Functions | |
void | FlagTrianglesAlongPolygon (const VecInt &a_poly, VecInt &a_flags) |
Flag triangles along polygon as inside or outside the polygon. More... | |
void | MarkNeighbors (VecInt &a_flags) |
Flag all triangles as inside or outside the polygon, starting with those already flagged and working out. Compare to myiMarkNeighbors. More... | |
Private Attributes | |
VecInt2d | m_polys |
Polygons (boundary and holes) of tin. | |
BSHP< TrTin > | m_tin |
tin | |
BSHP< Observer > | m_observer |
Observer. | |
Additional Inherited Members | |
Static Public Member Functions inherited from xms::TrOuterTriangleDeleter | |
static boost::shared_ptr< TrOuterTriangleDeleter > | New () |
Creates a TrOuterTriangleDeleterImpl object. More... | |
Used to delete tin triangles that are outside given polygons. The polygons may include holes - polygons inside polygons.
Definition at line 43 of file TrOuterTriangleDeleter.cpp.
|
overridevirtual |
Deletes triangles in a_tin that are outside a_polys or inside if the poly is a hole.
Polygons should be CW for outside poly and CCW for inside poly. Last point is the first point repeated.
[in] | a_polys | Polygon(s) (0-based indices of points in a_tin). |
[in,out] | a_tin | The tin to be modified. |
Definition at line 107 of file TrOuterTriangleDeleter.cpp.
References FlagTrianglesAlongPolygon(), m_observer, m_polys, m_tin, MarkNeighbors(), and XM_ASSERT.
|
private |
Flag triangles along polygon as inside or outside the polygon.
a_poly | Indices of polygon points. Closed (last = first). |
a_flags | BoundaryEnum flags size of number of triangles. |
Definition at line 155 of file TrOuterTriangleDeleter.cpp.
References m_tin.
Referenced by Delete().
|
private |
Flag all triangles as inside or outside the polygon, starting with those already flagged and working out. Compare to myiMarkNeighbors.
a_flags | BoundaryEnum flags size of num triangles with triangles along polygon border already set. |
Definition at line 187 of file TrOuterTriangleDeleter.cpp.
References m_tin, xms::trIncrementIndex(), and XM_ENSURE_TRUE_VOID_NO_ASSERT.
Referenced by Delete().
|
inlineoverridevirtual |
Set the observer to use for feedback while processing.
a_ | The obserer. |
Definition at line 62 of file TrOuterTriangleDeleter.cpp.
References m_observer.