xmsgeom  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
xms::TrTinImpl Class Reference

Class to encapsulate a tin made simply of arrays of points, triangles and adjacency information. Also methods to manipulate it. More...

Inheritance diagram for xms::TrTinImpl:
xms::TrTin

Public Member Functions

 TrTinImpl ()
 constructor
 
virtual ~TrTinImpl ()
 destructor
 
virtual void SetPoints (BSHP< VecPt3d > a_pts) override
 Sets the tin points. More...
 
virtual void SetTriangles (BSHP< VecInt > a_tris) override
 Sets the tin triangles. More...
 
virtual void SetTrianglesAdjacentToPoints (BSHP< VecInt2d > a_trisAdjToPts) override
 Sets the adjacency info of triangles adjacent to points. More...
 
virtual void SetGeometry (BSHP< VecPt3d > a_pts, BSHP< VecInt > a_tris, BSHP< VecInt2d > a_trisAdjToPts) override
 Set all the tin geometry at once (points, triangles, adjacency). More...
 
virtual VecPt3dPoints () override
 Return the tin points. More...
 
virtual VecIntTriangles () override
 Return 0-based indices of triangle points (grouped by 3s). More...
 
virtual VecInt2dTrisAdjToPts () override
 Returns triangles adjacent to points (0-based). More...
 
virtual const VecPt3dPoints () const override
 Return the tin points. More...
 
virtual const VecIntTriangles () const override
 Return 0-based indices of triangle points (grouped by 3s). More...
 
virtual const VecInt2dTrisAdjToPts () const override
 Returns triangles adjacent to points (0-based). More...
 
virtual BSHP< VecPt3dPointsPtr () override
 Return the pointer to tin points. More...
 
virtual BSHP< VecIntTrianglesPtr () override
 Return the pointer to tin triangles. More...
 
virtual int NumPoints () const override
 Return the number of points. More...
 
virtual int NumTriangles () const override
 Return the number of triangles. More...
 
virtual bool TriangleFromEdge (int a_pt1, int a_pt2, int &a_tri, int &a_idx1, int &a_idx2) const override
 Finds the triangle with the edge defined by a_pt1 and a_pt2 and the local index of those points. Compare to trTinTriFromEdge. More...
 
virtual int TriangleAdjacentToEdge (int a_pt1, int a_pt2) const override
 Returns the triangle adjacent to the edge defined by a_pt1 and a_pt2. Compare to trTriangleAdjacentToEdge. More...
 
virtual int LocalIndex (int a_tri, int a_pt) const override
 Returns index (0-2) of point within triangle given global index. Compare to trIndex. More...
 
virtual int GlobalIndex (int a_triIdx, int a_localVtxIdx) const override
 Returns index into m_pts of a_localPt which is 0-2. More...
 
virtual bool VerticesAreAdjacent (int a_pt1, int a_pt2) const override
 Return true if vertices form the edge of a triangle. Compare to vrVerticesAreAdjacent. More...
 
virtual int CommonEdgeIndex (int a_tri, int a_adjTri) const override
 Return index of common edge between triangle and neighbor. Edge index is 0-2 based on a_tri. Compare to trCommonEdgeIndex. More...
 
virtual int AdjacentTriangle (int a_triIdx, int a_edgeIdx) const override
 Returns the triangle adjacent to a_triIdx across a_edgeIdx (0-2). Compare to trAdjacentTriangle. Example: a_edgeIdx 2 returns triangle adjacent to edge c. More...
 
virtual Pt3d TriangleCentroid (int a_tri) const override
 Calculate and return the centroid of a triangle. More...
 
virtual double TriangleArea (int a_tri) const override
 Calculate and return the area of a triangle. More...
 
virtual int NextBoundaryPoint (int a_point) const override
 Returns the next point CW from point on the boundary. CCW if in an inside hole. Compare to trNextBoundaryVertex (or trPreviousBoundaryVertex since order here is CW, not CCW). More...
 
virtual int PreviousBoundaryPoint (int a_point) const override
 Returns the next point CCW from point on the boundary. CW if in an inside hole. Compare to trPreviousBoundaryVertex (or trNextBoundaryVertex since order here is CW, not CCW). More...
 
virtual void GetBoundaryPoints (VecInt &a_boundaryPoints) const override
 Gives the 0-based indices of all points on any boundary, in no particular order. More...
 
virtual void GetBoundaryPolys (VecInt2d &a_polys) const override
 Gets exterior boundary and all interior voids as polygons of 0-based point indices. First point is not repeated as the last point. More...
 
virtual bool GetExtents (Pt3d &a_mn, Pt3d &a_mx) const override
 Computes the extents (min, max) of the tin. More...
 
virtual void ExportTinFile (std::ostream &a_os) const override
 Export in the .tin file format. Useful for debugging. More...
 
virtual bool SwapEdge (int a_triA, int a_triB, bool a_checkAngle=true) override
 Swap edges if triangles combine to form convex quad. Compare to trSwapEdge. More...
 
virtual void DeleteTriangles (const SetInt &a_trisToDelete) override
 Deletes the triangles specified in a_trisToDelete and updates and renumbers triangle adjacency info. More...
 
virtual void DeletePoints (const SetInt &a_points) override
 Deletes the points and any attached triangles, updates adjacency and renumbers things. More...
 
virtual bool OptimizeTriangulation () override
 Swaps triangle edges until they are a Delauney triangulation. More...
 
virtual void Clear () override
 Delete the memory.
 
virtual void BuildTrisAdjToPts () override
 Build array of triangles adjacent to points.
 
virtual std::string ToString () const override
 Use boost archive to get the TrTin as text. More...
 
virtual void FromString (const std::string &) override
 Use boost archive to turn the text into a TrTin. More...
 
template<typename Archive >
void serialize (Archive &archive, const unsigned int version)
 Boost serialize function. More...
 
- Public Member Functions inherited from xms::TrTin
virtual ~TrTin ()
 destructor
 

Private Member Functions

void InsertAdjacentTriangle (int a_pt, int a_tri)
 Adds a_tri as an adjacent triangle to a_pt and updates m_trisAdjToPts. More...
 
void DeleteAdjacentTriangle (int a_pt, int a_tri)
 Removes a_tri from a_pt's adjacent triangles. Compare to vrDeleteAdjacentTrianglePtr. More...
 
bool TriIndexFound (const int &a_triPt) const
 Predicate used in remove_if to get the index of the current item in the vector. More...
 
bool PointIndexFound (const Pt3d &a_point) const
 Predicate used in remove_if to get the index of the current item in the vector. More...
 
bool AdjacentIndexFound (const VecInt &a_point) const
 Predicate used in remove_if to get the index of the current item in the vector. More...
 
bool CheckAndSwap (int a_triA, int a_triB, bool a_propagate, const VecInt &a_flags)
 Swap edges if triangles combine to form convex quad. Compare to trCheckAndSwap. More...
 
bool PointIsInCircumcircle (int a_tri1, int a_tri2, int id)
 Returns true if a_localPt of a_tri2 is inside a_tri1's circumcircle. More...
 
void BuildTrisAdjToPtsConst () const
 A const function used only internally and needed to modify m_trisAdjToPts which is mutable.
 

Private Attributes

BSHP< VecPt3dm_pts
 tin points
 
BSHP< VecIntm_tris
 triangles, 0-based indices to m_pts, grouped by 3s
 
BSHP< VecInt2dm_trisAdjToPts
 triangles adjacent to points. 1st dim = size of m_pts
 
boost::unordered_set< int > m_toDelete
 Used only when deleting stuff.
 

Additional Inherited Members

- Static Public Member Functions inherited from xms::TrTin
static BSHP< TrTinNew ()
 Create a TrTinImpl object. More...
 
- Protected Member Functions inherited from xms::TrTin
 TrTin ()
 constructor
 

Detailed Description

Class to encapsulate a tin made simply of arrays of points, triangles and adjacency information. Also methods to manipulate it.

Definition at line 56 of file TrTin.cpp.

Member Function Documentation

bool xms::TrTinImpl::AdjacentIndexFound ( const VecInt a_adj) const
private

Predicate used in remove_if to get the index of the current item in the vector.

See Also
http://stackoverflow.com/questions/23122555/ This could be a lamda defined where it's used if we could figure out how to get that to work.
Parameters
[in]a_adjTriangles adjacent to a point.
Returns
true if found, else false.

Definition at line 977 of file TrTin.cpp.

References m_toDelete.

Referenced by DeletePoints().

int xms::TrTinImpl::AdjacentTriangle ( int  a_triIdx,
int  a_edgeIdx 
) const
overridevirtual

Returns the triangle adjacent to a_triIdx across a_edgeIdx (0-2). Compare to trAdjacentTriangle. Example: a_edgeIdx 2 returns triangle adjacent to edge c.

///              2
///             / \
///          c /   \ b
///           /     \
///          0-------1
///              a
/// 
Parameters
a_triIdxTriangle index (0-based).
a_edgeIdxLocal edge index (0-2) in a_tri.
Returns
Triangle adjacent to a_tri along it's a_edge or XM_NONE if there is no triangle adjacent to the edge.

Definition at line 630 of file TrTin.cpp.

References TriangleFromEdge(), and XM_NONE.

Referenced by CheckAndSwap(), CommonEdgeIndex(), GetBoundaryPoints(), NextBoundaryPoint(), OptimizeTriangulation(), and PreviousBoundaryPoint().

bool xms::TrTinImpl::CheckAndSwap ( int  a_triA,
int  a_triB,
bool  a_propagate,
const VecInt a_flags 
)
private

Swap edges if triangles combine to form convex quad. Compare to trCheckAndSwap.

a_triA and a_triB must be adjacent triangles.

           b2 * top
             / \
            /   \   a_triB
        b3 / --> \ b1
      lft *-------* rgt
           \ <-- / a3
            \   /   a_triA
             \ /
          btm * a2
Parameters
a_triAFirst triangle.
a_triBSecond triangle.
a_propagateIf true, recursively checks adjacent triangles, which will happen even if false if adjacent triangles flag is not zero.
a_flagsFlags to keep track of visited triangles.
Returns
true if swap was successful.

Definition at line 514 of file TrTin.cpp.

References AdjacentTriangle(), CommonEdgeIndex(), GlobalIndex(), LocalIndex(), PointIsInCircumcircle(), SwapEdge(), XM_ENSURE_TRUE_NO_ASSERT, and XM_NONE.

Referenced by OptimizeTriangulation().

int xms::TrTinImpl::CommonEdgeIndex ( int  a_tri,
int  a_adjTri 
) const
overridevirtual

Return index of common edge between triangle and neighbor. Edge index is 0-2 based on a_tri. Compare to trCommonEdgeIndex.

a_triIdx must be adjacent to neighbor.

Parameters
a_triTriangle index (0-based).
a_adjTriAdjacent triangle index (0-based).
Returns
Index of edge (0-2) in a_tri between a_tri and a_adTri, or XM_NONE if not adjacent.

Definition at line 595 of file TrTin.cpp.

References AdjacentTriangle(), and XM_NONE.

Referenced by CheckAndSwap(), and SwapEdge().

void xms::TrTinImpl::DeleteAdjacentTriangle ( int  a_pt,
int  a_tri 
)
private

Removes a_tri from a_pt's adjacent triangles. Compare to vrDeleteAdjacentTrianglePtr.

Parameters
[in]a_ptThe point from which we are removing an adjacent triangle.
[in]a_triThe triangle we are removing as an adjacent from point.

Definition at line 914 of file TrTin.cpp.

Referenced by SwapEdge().

void xms::TrTinImpl::DeletePoints ( const SetInt a_points)
overridevirtual

Deletes the points and any attached triangles, updates adjacency and renumbers things.

Parameters
[in]a_pointsThe set of points to delete.

Definition at line 1057 of file TrTin.cpp.

References AdjacentIndexFound(), DeleteTriangles(), m_toDelete, m_tris, m_trisAdjToPts, and PointIndexFound().

void xms::TrTinImpl::DeleteTriangles ( const SetInt a_trisToDelete)
overridevirtual

Deletes the triangles specified in a_trisToDelete and updates and renumbers triangle adjacency info.

Parameters
[in]a_trisToDeleteTriangles to be deleted.

Definition at line 987 of file TrTin.cpp.

References m_toDelete, NumTriangles(), TriIndexFound(), and XM_ENSURE_TRUE_VOID_NO_ASSERT.

Referenced by DeletePoints().

void xms::TrTinImpl::ExportTinFile ( std::ostream &  a_os) const
overridevirtual

Export in the .tin file format. Useful for debugging.

Parameters
[out]a_osThe stream to export to.

Definition at line 873 of file TrTin.cpp.

References NumTriangles(), and xms::STRstd().

void xms::TrTinImpl::FromString ( const std::string &  a_text)
overridevirtual

Use boost archive to turn the text into a TrTin.

Parameters
[in]a_textThe string.

Definition at line 1179 of file TrTin.cpp.

void xms::TrTinImpl::GetBoundaryPoints ( VecInt a_boundaryPoints) const
overridevirtual

Gives the 0-based indices of all points on any boundary, in no particular order.

Parameters
[out]a_boundaryPointsThe 0-based indices of all points on the boundary.

Definition at line 773 of file TrTin.cpp.

References AdjacentTriangle(), BuildTrisAdjToPtsConst(), m_tris, TrisAdjToPts(), and XM_NONE.

Referenced by GetBoundaryPolys().

void xms::TrTinImpl::GetBoundaryPolys ( VecInt2d a_polys) const
overridevirtual

Gets exterior boundary and all interior voids as polygons of 0-based point indices. First point is not repeated as the last point.

Parameters
[out]a_polysOuter polygon is CW, inner polys are CCW. First point is repeated at the end.

Definition at line 807 of file TrTin.cpp.

References GetBoundaryPoints(), NextBoundaryPoint(), xmlog::warning, and XM_LOG.

bool xms::TrTinImpl::GetExtents ( Pt3d a_mn,
Pt3d a_mx 
) const
overridevirtual

Computes the extents (min, max) of the tin.

Parameters
[out]a_mnMinimum xyz.
[out]a_mxMaximum xyz.
Returns
true if there are any points and the extents were computed.

Definition at line 854 of file TrTin.cpp.

References xms::XM_DBL_HIGHEST, and xms::XM_DBL_LOWEST.

int xms::TrTinImpl::GlobalIndex ( int  a_triIdx,
int  a_localPt 
) const
overridevirtual

Returns index into m_pts of a_localPt which is 0-2.

Parameters
a_triIdx= Triangle index (0-based).
a_localPt= Local index (0-2) of point within the triangle.
Returns
Global index into m_pts of a_localPt.

Definition at line 932 of file TrTin.cpp.

References m_tris, XM_ENSURE_TRUE, and XM_NONE.

Referenced by CheckAndSwap(), NextBoundaryPoint(), PointIsInCircumcircle(), PreviousBoundaryPoint(), and SwapEdge().

void xms::TrTinImpl::InsertAdjacentTriangle ( int  a_pt,
int  a_tri 
)
private

Adds a_tri as an adjacent triangle to a_pt and updates m_trisAdjToPts.

Parameters
[in]a_ptThe point that a_tri is adjacent to.
[in]a_triThe triangle adjacent to a_pt to add to list of adjacents.

Definition at line 902 of file TrTin.cpp.

References XM_ENSURE_TRUE_VOID.

Referenced by SwapEdge().

int xms::TrTinImpl::LocalIndex ( int  a_tri,
int  a_pt 
) const
overridevirtual

Returns index (0-2) of point within triangle given global index. Compare to trIndex.

Parameters
a_triTriangle index (0-based).
a_ptGlobal point index (0-based).
Returns
The local index (0-2) of the point a_pt in the triangle a_tri or XM_NONE if a_pt is not on a_tri.

Definition at line 358 of file TrTin.cpp.

References m_tris, and XM_NONE.

Referenced by CheckAndSwap(), NextBoundaryPoint(), PreviousBoundaryPoint(), SwapEdge(), TriangleAdjacentToEdge(), and TriangleFromEdge().

int xms::TrTinImpl::NextBoundaryPoint ( int  a_point) const
overridevirtual

Returns the next point CW from point on the boundary. CCW if in an inside hole. Compare to trNextBoundaryVertex (or trPreviousBoundaryVertex since order here is CW, not CCW).

Point must be on the boundary.

Parameters
[in]a_pointThe starting point.
Returns
The point index or XM_NONE if not found.

Definition at line 707 of file TrTin.cpp.

References AdjacentTriangle(), GlobalIndex(), LocalIndex(), m_trisAdjToPts, XM_ENSURE_TRUE_NO_ASSERT, and XM_NONE.

Referenced by GetBoundaryPolys().

int xms::TrTinImpl::NumPoints ( ) const
overridevirtual

Return the number of points.

Returns
Number of points.

Definition at line 277 of file TrTin.cpp.

int xms::TrTinImpl::NumTriangles ( ) const
overridevirtual

Return the number of triangles.

Returns
Number of triangles.

Definition at line 285 of file TrTin.cpp.

Referenced by DeleteTriangles(), ExportTinFile(), and OptimizeTriangulation().

bool xms::TrTinImpl::OptimizeTriangulation ( )
overridevirtual

Swaps triangle edges until they are a Delauney triangulation.

Returns
True if modified.

Definition at line 1103 of file TrTin.cpp.

References AdjacentTriangle(), CheckAndSwap(), NumTriangles(), and XM_NONE.

bool xms::TrTinImpl::PointIndexFound ( const Pt3d a_point) const
private

Predicate used in remove_if to get the index of the current item in the vector.

See Also
http://stackoverflow.com/questions/23122555/ This could be a lamda defined where it's used if we could figure out how to get that to work.
Parameters
[in]a_pointA point in a tin.
Returns
true if found, else false.

Definition at line 962 of file TrTin.cpp.

References m_toDelete.

Referenced by DeletePoints().

bool xms::TrTinImpl::PointIsInCircumcircle ( int  a_tri1,
int  a_tri2,
int  a_localPt 
)
private

Returns true if a_localPt of a_tri2 is inside a_tri1's circumcircle.

SPECIAL CASE - we want all square elements to have a "diagonal" that is connected from lower left to upper right corner, so if a_tri1 and a_tri2 form a square or rectangle, it will return TRUE if the "diagonal" edge is from upper left to lower right corner and FALSE if the "diagonal" edge is from lower left to upper right corner.

Parameters
a_tri1Triangle (0-based) adjacent to a_tri2.
a_tri2Triangle (0-based) adjacent to a_tri1.
a_localPtLocal index (0-2) of the point in a_tri2 that is opposite a_tri1.
Returns
true if a_localPt of a_tri2 is inside a_tri1's circumcircle, else false.
Precondition
Triangles must be adjacent
///
///        *------------*
///        |          / |
///        | a_tri1 /   |
///        |      /     |
///        |    /       |
///        |  /  a_tri2 |
///        *------------*
///                      a_localPt
/// 

Definition at line 579 of file TrTin.cpp.

References GlobalIndex(), and m_pts.

Referenced by CheckAndSwap().

VecPt3d & xms::TrTinImpl::Points ( )
overridevirtual

Return the tin points.

Returns
The points in the tin.

Definition at line 213 of file TrTin.cpp.

References m_pts.

const VecPt3d & xms::TrTinImpl::Points ( ) const
overridevirtual

Return the tin points.

Returns
The points in the tin.

Definition at line 237 of file TrTin.cpp.

References m_pts.

BSHP< VecPt3d > xms::TrTinImpl::PointsPtr ( )
overridevirtual

Return the pointer to tin points.

Returns
Shared pointer to the points vector.

Definition at line 261 of file TrTin.cpp.

References m_pts.

int xms::TrTinImpl::PreviousBoundaryPoint ( int  a_point) const
overridevirtual

Returns the next point CCW from point on the boundary. CW if in an inside hole. Compare to trPreviousBoundaryVertex (or trNextBoundaryVertex since order here is CW, not CCW).

Point must be on the boundary.

Parameters
[in]a_pointThe starting point.
Returns
The point index or XM_NONE if not found.

Definition at line 742 of file TrTin.cpp.

References AdjacentTriangle(), GlobalIndex(), LocalIndex(), m_trisAdjToPts, XM_ENSURE_TRUE_NO_ASSERT, and XM_NONE.

template<typename Archive >
void xms::TrTinImpl::serialize ( Archive &  archive,
const unsigned int  version 
)

Boost serialize function.

Parameters
archiveThe archive.
versionVersion number.

Definition at line 1193 of file TrTin.cpp.

References m_pts, m_tris, and m_trisAdjToPts.

void xms::TrTinImpl::SetGeometry ( BSHP< VecPt3d a_pts,
BSHP< VecInt a_tris,
BSHP< VecInt2d a_trisAdjToPts 
)
overridevirtual

Set all the tin geometry at once (points, triangles, adjacency).

Parameters
[in]a_ptsThe tin points.
[in]a_tris0-based indices of triangle points (grouped by 3s)
[in]a_trisAdjToPts0-based indices of triangles adjacent to points.

Definition at line 203 of file TrTin.cpp.

References m_pts, m_tris, and m_trisAdjToPts.

void xms::TrTinImpl::SetPoints ( BSHP< VecPt3d a_pts)
overridevirtual

Sets the tin points.

Parameters
[in]a_ptsThe points.

Definition at line 177 of file TrTin.cpp.

References m_pts.

void xms::TrTinImpl::SetTriangles ( BSHP< VecInt a_tris)
overridevirtual

Sets the tin triangles.

Parameters
[in]a_tris0-based indices of each triangle's points (grouped by 3s)

Definition at line 185 of file TrTin.cpp.

References m_tris.

void xms::TrTinImpl::SetTrianglesAdjacentToPoints ( BSHP< VecInt2d a_trisAdjToPts)
overridevirtual

Sets the adjacency info of triangles adjacent to points.

Parameters
[in]a_trisAdjToPts0-based indices of triangles adjacent to points.

Definition at line 193 of file TrTin.cpp.

References m_trisAdjToPts.

bool xms::TrTinImpl::SwapEdge ( int  a_triA,
int  a_triB,
bool  a_checkAngle = true 
)
overridevirtual

Swap edges if triangles combine to form convex quad. Compare to trSwapEdge.

a_triA and a_triB must be adjacent triangles.

           b2 * top
             / \
            /   \   a_triB
        b3 / --> \ b1
      lft *-------* rgt
           \ <-- / a3
            \   /   a_triA
             \ /
          btm * a2
Parameters
a_triAFirst triangle.
a_triBSecond triangle.
a_checkAngleIf true, won't swap if very thin triangle would be created.
Returns
true if swap was successful.

Definition at line 416 of file TrTin.cpp.

References CommonEdgeIndex(), DeleteAdjacentTriangle(), xmlog::error, GlobalIndex(), InsertAdjacentTriangle(), LocalIndex(), m_pts, m_tris, XM_ENSURE_TRUE_NO_ASSERT, XM_LOG, and XM_PI.

Referenced by CheckAndSwap().

std::string xms::TrTinImpl::ToString ( ) const
overridevirtual

Use boost archive to get the TrTin as text.

Returns
The string.

Definition at line 1166 of file TrTin.cpp.

int xms::TrTinImpl::TriangleAdjacentToEdge ( int  a_pt1,
int  a_pt2 
) const
overridevirtual

Returns the triangle adjacent to the edge defined by a_pt1 and a_pt2. Compare to trTriangleAdjacentToEdge.

Gives triangle on the right side of the edge.

Parameters
a_pt1First edge point index (0-based).
a_pt2Second edge point index (0-based).
Returns
The triangle adjacent to the edge.

Definition at line 331 of file TrTin.cpp.

References LocalIndex(), m_tris, and XM_NONE.

double xms::TrTinImpl::TriangleArea ( int  a_tri) const
overridevirtual

Calculate and return the area of a triangle.

Parameters
a_triTriangle index (0-based).
Returns
The area.

Definition at line 662 of file TrTin.cpp.

References m_pts, and m_tris.

xms::Pt3d xms::TrTinImpl::TriangleCentroid ( int  a_tri) const
overridevirtual

Calculate and return the centroid of a triangle.

Parameters
a_triTriangle index (0-based).
Returns
The centroid.

Definition at line 649 of file TrTin.cpp.

References m_pts, and m_tris.

bool xms::TrTinImpl::TriangleFromEdge ( int  a_pt1,
int  a_pt2,
int &  a_tri,
int &  a_localPt1,
int &  a_localPt2 
) const
overridevirtual

Finds the triangle with the edge defined by a_pt1 and a_pt2 and the local index of those points. Compare to trTinTriFromEdge.

Parameters
[in]a_pt1First edge point index (0-based).
[in]a_pt2Second edge point index (0-based).
[out]a_triIndex of triangle or XM_NONE if not found.
[out]a_localPt1Local pt (0-2) of a_pt1 in a_tri.
[out]a_localPt2Local pt (0-2) of a_pt2 in a_tri.
Returns
true if found.

Definition at line 299 of file TrTin.cpp.

References LocalIndex(), m_tris, and XM_NONE.

Referenced by AdjacentTriangle().

VecInt & xms::TrTinImpl::Triangles ( )
overridevirtual

Return 0-based indices of triangle points (grouped by 3s).

Returns
Triangles as 0-based indices of triangle points (grouped by 3s).

Definition at line 221 of file TrTin.cpp.

References m_tris.

const VecInt & xms::TrTinImpl::Triangles ( ) const
overridevirtual

Return 0-based indices of triangle points (grouped by 3s).

Returns
Triangles as 0-based indices of triangle points (grouped by 3s).

Definition at line 245 of file TrTin.cpp.

References m_tris.

BSHP< VecInt > xms::TrTinImpl::TrianglesPtr ( )
overridevirtual

Return the pointer to tin triangles.

Returns
Shared pointer to the triangle points vector.

Definition at line 269 of file TrTin.cpp.

References m_tris.

bool xms::TrTinImpl::TriIndexFound ( const int &  a_triPt) const
private

Predicate used in remove_if to get the index of the current item in the vector.

See Also
http://stackoverflow.com/questions/23122555/ This could be a lamda defined where it's used if we could figure out how to get that to work.
Parameters
[in]a_triPtIndex of a point on a triangle.
Returns
true if found, else false.

Definition at line 947 of file TrTin.cpp.

References m_toDelete.

Referenced by DeleteTriangles().

VecInt2d & xms::TrTinImpl::TrisAdjToPts ( )
overridevirtual

Returns triangles adjacent to points (0-based).

Returns
2D vector with triangles adjacent to points, size of num points.

Definition at line 229 of file TrTin.cpp.

References m_trisAdjToPts.

Referenced by GetBoundaryPoints().

const VecInt2d & xms::TrTinImpl::TrisAdjToPts ( ) const
overridevirtual

Returns triangles adjacent to points (0-based).

Returns
2D vector with triangles adjacent to points, size of num points.

Definition at line 253 of file TrTin.cpp.

References m_trisAdjToPts.

bool xms::TrTinImpl::VerticesAreAdjacent ( int  a_pt1,
int  a_pt2 
) const
overridevirtual

Return true if vertices form the edge of a triangle. Compare to vrVerticesAreAdjacent.

Parameters
a_pt1First point index (0-based).
a_pt2Second point index (0-based).
Returns
true if points are adjacent.

Definition at line 375 of file TrTin.cpp.

References m_tris.


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