xmsgrid  1.0
xms::TrOuterTriangleDeleterImpl Class Reference

Used to delete tin triangles that are outside given polygons. The polygons may include holes - polygons inside polygons. More...

Inheritance diagram for xms::TrOuterTriangleDeleterImpl:
xms::TrOuterTriangleDeleter

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< TrTinm_tin
 tin
 
BSHP< Observerm_observer
 Observer.
 

Additional Inherited Members

- Static Public Member Functions inherited from xms::TrOuterTriangleDeleter
static boost::shared_ptr< TrOuterTriangleDeleterNew ()
 Creates a TrOuterTriangleDeleterImpl object. More...
 

Detailed Description

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.

Member Function Documentation

◆ Delete()

void xms::TrOuterTriangleDeleterImpl::Delete ( const VecInt2d a_polys,
BSHP< TrTin a_tin 
)
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.

Parameters
[in]a_polysPolygon(s) (0-based indices of points in a_tin).
[in,out]a_tinThe tin to be modified.

Definition at line 107 of file TrOuterTriangleDeleter.cpp.

References FlagTrianglesAlongPolygon(), m_observer, m_polys, m_tin, MarkNeighbors(), and XM_ASSERT.

◆ FlagTrianglesAlongPolygon()

void xms::TrOuterTriangleDeleterImpl::FlagTrianglesAlongPolygon ( const VecInt a_poly,
VecInt a_flags 
)
private

Flag triangles along polygon as inside or outside the polygon.

Parameters
a_polyIndices of polygon points. Closed (last = first).
a_flagsBoundaryEnum flags size of number of triangles.

Definition at line 155 of file TrOuterTriangleDeleter.cpp.

References m_tin.

Referenced by Delete().

◆ MarkNeighbors()

void xms::TrOuterTriangleDeleterImpl::MarkNeighbors ( VecInt a_flags)
private

Flag all triangles as inside or outside the polygon, starting with those already flagged and working out. Compare to myiMarkNeighbors.

Parameters
a_flagsBoundaryEnum 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().

◆ SetObserver()

virtual void xms::TrOuterTriangleDeleterImpl::SetObserver ( BSHP< Observer a_)
inlineoverridevirtual

Set the observer to use for feedback while processing.

Parameters
a_The obserer.

Definition at line 62 of file TrOuterTriangleDeleter.cpp.

References m_observer.


The documentation for this class was generated from the following file: