xmsgrid  1.0
xms::TrAutoFixFourTrianglePtsImpl Class Reference

Used to delete points that are connected to 4 triangles and then retriangulate the void. More...

Inheritance diagram for xms::TrAutoFixFourTrianglePtsImpl:
xms::TrAutoFixFourTrianglePts

Public Member Functions

 TrAutoFixFourTrianglePtsImpl ()
 constructor
 
virtual void Fix (BSHP< TrTin > a_tin) override
 Removes any points in the tin that are connected to only 4 triangles. These points usually cause poorly formed elements in the mesher. More...
 
virtual void SetObserver (BSHP< Observer > a_) override
 Set the observer to use for feedback while processing. More...
 
virtual void SetUndeleteablePtIdxs (VecInt &a_ptIdx) override
 Set the indexes of points that can not be deleted. More...
 
void FillAdjTrisIfNeeded ()
 Makes sure the adjacent triangles exist in the TIN.
 
void GetPtsAndTrisToDelete ()
 Finds and removes the points connected to 4 triangles.
 
std::pair< int, int > EdgeOppositePt (int a_ptIdx, int a_tri, VecInt &a_tris)
 Finds and removes the points connected to 4 triangles. More...
 
void MakeTwoNewTriangles (VecPt3d &a_pts, std::map< int, int > a_edges, int a_tris[2][3])
 Makes 2 new triangles from the 4 edges passed into this method. More...
 
void ReplaceTriangle (int &a_tIdx, int a_newTri[3], VecInt &a_tris)
 Makes 2 new triangles from the 4 edges passed into this method. More...
 
void RenumberPts ()
 Renumbers the point indexes in the triangles.
 
void RenumberTris ()
 Renumbers the triangle indexes in the adjacent triangles.
 
void RemovePts ()
 Removes points from the points vector of the TIN.
 
void RemoveTris ()
 Removes triangles from the triangles vector in the TIN.
 
void ClearAdjTrisIfCreated ()
 Clears the adjacent triangles if this class created them.
 

Private Attributes

BSHP< TrTinm_tin
 tin
 
BSHP< Observerm_observer
 Observer.
 
bool m_removeAdjTris
 flag to remove adjacent tris when done
 
SetInt m_ptsToDelete
 points in the TIN that will be deleted
 
SetInt m_trisToDelete
 triangles that will be deleted
 
SetInt m_noDelete
 indexes of points that can't be deleted
 

Additional Inherited Members

- Static Public Member Functions inherited from xms::TrAutoFixFourTrianglePts
static BSHP< TrAutoFixFourTrianglePtsNew ()
 Creates a TrAutoFixFourTrianglePtsImpl object. More...
 

Detailed Description

Used to delete points that are connected to 4 triangles and then retriangulate the void.

Definition at line 41 of file TrAutoFixFourTrianglePts.cpp.

Member Function Documentation

◆ EdgeOppositePt()

std::pair< int, int > xms::TrAutoFixFourTrianglePtsImpl::EdgeOppositePt ( int  a_ptIdx,
int  a_tri,
VecInt a_tris 
)

Finds and removes the points connected to 4 triangles.

Parameters
[in]a_ptIdx: A point on a triangle
[in]a_tri: The index to the triangle
[in]a_tris: Array of triangles
Returns
a pair of ints that are the point indexes to the points on the edge opposite a_ptIdx

Definition at line 174 of file TrAutoFixFourTrianglePts.cpp.

Referenced by GetPtsAndTrisToDelete().

◆ Fix()

void xms::TrAutoFixFourTrianglePtsImpl::Fix ( BSHP< TrTin a_tin)
overridevirtual

Removes any points in the tin that are connected to only 4 triangles. These points usually cause poorly formed elements in the mesher.

Parameters
[in,out]a_tinThe tin to be modified.

Definition at line 113 of file TrAutoFixFourTrianglePts.cpp.

References ClearAdjTrisIfCreated(), FillAdjTrisIfNeeded(), GetPtsAndTrisToDelete(), m_tin, RemovePts(), RemoveTris(), RenumberPts(), and RenumberTris().

Referenced by TrAutoFixFourTrianglePtsUnitTests::test1().

◆ MakeTwoNewTriangles()

void xms::TrAutoFixFourTrianglePtsImpl::MakeTwoNewTriangles ( VecPt3d a_pts,
std::map< int, int >  a_edges,
int  a_tris[2][3] 
)

Makes 2 new triangles from the 4 edges passed into this method.

Parameters
[in]a_pts: Array of point locations in the TIN
[in]a_edges: A map of edges that surround the point that is being removed.
[out]a_tris: Array of point indexes that will define the new triangles

Definition at line 201 of file TrAutoFixFourTrianglePts.cpp.

References MdistSq(), xms::Pt3< T >::x, and xms::Pt3< T >::y.

Referenced by GetPtsAndTrisToDelete().

◆ ReplaceTriangle()

void xms::TrAutoFixFourTrianglePtsImpl::ReplaceTriangle ( int &  a_tIdx,
int  a_newTri[3],
VecInt a_tris 
)

Makes 2 new triangles from the 4 edges passed into this method.

Parameters
[in]a_tIdx: Index to a triangle that will be replaced
[in]a_newTri: Point indexes that define a new triangle
[in,out]a_tris: The triangles in the TIN

Definition at line 241 of file TrAutoFixFourTrianglePts.cpp.

Referenced by GetPtsAndTrisToDelete().

◆ SetObserver()

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

Set the observer to use for feedback while processing.

Parameters
a_The observer.

Definition at line 51 of file TrAutoFixFourTrianglePts.cpp.

References m_observer.

◆ SetUndeleteablePtIdxs()

virtual void xms::TrAutoFixFourTrianglePtsImpl::SetUndeleteablePtIdxs ( VecInt a_ptIdx)
inlineoverridevirtual

Set the indexes of points that can not be deleted.

Parameters
[in]a_ptIdx: The indexes of points that can't be deleted

Definition at line 54 of file TrAutoFixFourTrianglePts.cpp.

References m_noDelete.


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