xmsgrid  1.0
xms::TrBreaklineAdderImpl Class Reference

Adds breaklines to a triangulation. More...

Inheritance diagram for xms::TrBreaklineAdderImpl:
xms::TrBreaklineAdder

Public Member Functions

virtual void SetObserver (BSHP< Observer > a_) override
 Set the observer to use for feedback while processing. More...
 
virtual void SetTin (BSHP< TrTin > a_tin, double a_tol=-1) override
 Sets the tin that will have breaklines added to it. More...
 
virtual void AddBreakline (const VecInt &a_breakline) override
 Add a breakline by swapping. Compare to bkProcessScatBySwapping. More...
 
virtual void AddBreaklines (const VecInt2d &a_breakline) override
 Add breaklines by swapping. Compare to bkProcessScatBySwapping. More...
 
virtual std::string ErrorMessage (int) const override
 Returns the error message associated with the given number. More...
 

Private Member Functions

bool GetExtents ()
 Computes the extents (min, max) of the polygon. More...
 
void ComputeTolerance ()
 Computes a tolerance to use based on point extents.
 
bool CrossesBoundary (int a_blpt1, int a_blpt2)
 Returns true if the line connecting the two points crosses the tin boundary. More...
 
void ProcessSegmentBySwapping (int a_vtx1, int a_vtx2)
 Insert breakline segment into triangulation by swapping triangle edges. Compare to bkiProcessScatSegmentBySwapping. More...
 
void GetIntersectingEdges (int a_blpt1, int a_blpt2, VecEdge &a_edges)
 Find triangle edges which intersect the breakline. Compare to bkiGetListOfIntersectingScatEdges. More...
 
void FindIntersectingEdgeFromPoint (int a_blpt1, int a_blpt2, int *a_intpt1, int *a_intpt2, double *a_x, double *a_y, double *a_z1, double *a_z2)
 Finds edge opposite of a_blpt1 intersected by breakline segment a_blpt1, a_blpt2. Compare to bkiFindIntersectingEdgeFromVertex. More...
 
void FindIntersectingEdgeFromEdge (int a_ept1, int a_ept2, int a_blpt1, int a_blpt2, int *a_intpt1, int *a_intpt2, double *a_x, double *a_y, double *a_z1, double *a_z2)
 Finds edge of triangle intersected by breakline and returns next edge in a_intpt1 and a_intpt2. Compare to bkiFindIntersectingScatEdgeFromEdge. More...
 

Private Attributes

BSHP< TrTinm_tin
 The tin.
 
BSHP< Observerm_observer
 The observer.
 
double m_xyTol
 Xy tolerance used with geom functions.
 
VecIntm_tris
 Pointer to m_tin triangles for convenience.
 
VecPt3dm_pts
 Pointer to m_tin points for convenience.
 
VecInt2dm_trisAdjToPts
 Pointer to m_tin trisAdjToPts for convenience.
 
Pt3d m_mn
 Minimum extent of all points.
 
Pt3d m_mx
 Maximum extent of all points.
 
BSHP< GmMultiPolyIntersectorm_multiPolyIntersector
 Used to check if breakline crosses boundary.
 
BSHP< GmPtSearchm_searcher
 Used to check if breakline crosses boundary.
 

Additional Inherited Members

- Static Public Member Functions inherited from xms::TrBreaklineAdder
static boost::shared_ptr< TrBreaklineAdderNew ()
 Create a TrBreaklineAdderImpl object. More...
 

Detailed Description

Adds breaklines to a triangulation.

Definition at line 60 of file TrBreaklineAdder.cpp.

Member Function Documentation

◆ AddBreakline()

void xms::TrBreaklineAdderImpl::AddBreakline ( const VecInt a_breakline)
overridevirtual

Add a breakline by swapping. Compare to bkProcessScatBySwapping.

Currently does not consider points that are coincident with the breakline.

Parameters
a_breaklineThe breakline to add as indices of m_tin->Points().

Definition at line 177 of file TrBreaklineAdder.cpp.

References m_tin, ProcessSegmentBySwapping(), xms::Progress::ProgressStatus(), and XM_ENSURE_TRUE_T_NO_ASSERT.

Referenced by AddBreaklines().

◆ AddBreaklines()

void xms::TrBreaklineAdderImpl::AddBreaklines ( const VecInt2d a_breaklines)
overridevirtual

Add breaklines by swapping. Compare to bkProcessScatBySwapping.

Currently does not consider points that are coincident with the breakline.

Parameters
a_breaklinesThe breaklines to add as indices of m_tin->Points().

Definition at line 202 of file TrBreaklineAdder.cpp.

References AddBreakline(), m_tin, xms::Progress::ProgressStatus(), and XM_ENSURE_TRUE_T_NO_ASSERT.

◆ CrossesBoundary()

bool xms::TrBreaklineAdderImpl::CrossesBoundary ( int  a_blpt1,
int  a_blpt2 
)
private

Returns true if the line connecting the two points crosses the tin boundary.

Parameters
a_blpt1First point of breakline segment.
a_blpt2Second point of breakline segment.
Returns
true if the line connecting the two points crosses a boundary.

Definition at line 246 of file TrBreaklineAdder.cpp.

References m_multiPolyIntersector, m_searcher, m_tin, m_xyTol, xms::GmPtSearch::New(), and xms::GmMultiPolyIntersector::New().

Referenced by ProcessSegmentBySwapping().

◆ ErrorMessage()

std::string xms::TrBreaklineAdderImpl::ErrorMessage ( int  a_messageNumber) const
overridevirtual

Returns the error message associated with the given number.

Parameters
[in]a_messageNumberNumber associated with an error message.
Returns
The error message.

Definition at line 225 of file TrBreaklineAdder.cpp.

References XM_ASSERT.

◆ FindIntersectingEdgeFromEdge()

void xms::TrBreaklineAdderImpl::FindIntersectingEdgeFromEdge ( int  a_ept1,
int  a_ept2,
int  a_blpt1,
int  a_blpt2,
int *  a_intpt1,
int *  a_intpt2,
double *  a_x,
double *  a_y,
double *  a_z1,
double *  a_z2 
)
private

Finds edge of triangle intersected by breakline and returns next edge in a_intpt1 and a_intpt2. Compare to bkiFindIntersectingScatEdgeFromEdge.

Parameters
a_ept1First point of starting edge.
a_ept2Second point of starting edge.
a_blpt1First point of breakline segment.
a_blpt2Second point of breakline segment.
a_intpt1First point of intersecting edge, or -1 if not found.
a_intpt2Second point of intersecting edge, or -1 if not found.
a_xx value of intersection.
a_yy value of intersection.
a_z1z value of intersection.
a_z2z value of intersection.

Definition at line 471 of file TrBreaklineAdder.cpp.

References xms::gmIntersectLineSegmentsWithTol(), m_pts, m_tin, m_xyTol, xms::trIncrementIndex(), and XM_ENSURE_TRUE_T_NO_ASSERT.

Referenced by GetIntersectingEdges().

◆ FindIntersectingEdgeFromPoint()

void xms::TrBreaklineAdderImpl::FindIntersectingEdgeFromPoint ( int  a_blpt1,
int  a_blpt2,
int *  a_intpt1,
int *  a_intpt2,
double *  a_x,
double *  a_y,
double *  a_z1,
double *  a_z2 
)
private

Finds edge opposite of a_blpt1 intersected by breakline segment a_blpt1, a_blpt2. Compare to bkiFindIntersectingEdgeFromVertex.

Parameters
a_blpt1First breakline segment point.
a_blpt2Second breakline segment point.
a_intpt1First point on intersecting edge, or -1 if not found.
a_intpt2Second point on intersecting edge, or -1 if not found.
a_xx value of intersection.
a_yy value of intersection.
a_z1z value of intersection.
a_z2z value of intersection.

Definition at line 425 of file TrBreaklineAdder.cpp.

References xms::gmIntersectLineSegmentsWithTol(), m_pts, m_tin, m_xyTol, and xms::trIncrementIndex().

Referenced by GetIntersectingEdges().

◆ GetExtents()

bool xms::TrBreaklineAdderImpl::GetExtents ( )
private

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

Returns
true if there are any points and the extents were computed.

Definition at line 522 of file TrBreaklineAdder.cpp.

References m_mn, m_mx, and m_tin.

Referenced by ComputeTolerance().

◆ GetIntersectingEdges()

void xms::TrBreaklineAdderImpl::GetIntersectingEdges ( int  a_blpt1,
int  a_blpt2,
VecEdge a_edges 
)
private

Find triangle edges which intersect the breakline. Compare to bkiGetListOfIntersectingScatEdges.

Parameters
a_blpt1First point of breakline segment.
a_blpt2Second point of breakline segment.
a_edgesEdges which intersect the breakline.

Definition at line 378 of file TrBreaklineAdder.cpp.

References FindIntersectingEdgeFromEdge(), FindIntersectingEdgeFromPoint(), xms::edgerecord::intersection, xms::edgerecord::pt1, xms::edgerecord::pt2, xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.

Referenced by ProcessSegmentBySwapping().

◆ ProcessSegmentBySwapping()

void xms::TrBreaklineAdderImpl::ProcessSegmentBySwapping ( int  a_blpt1,
int  a_blpt2 
)
private

Insert breakline segment into triangulation by swapping triangle edges. Compare to bkiProcessScatSegmentBySwapping.

Parameters
a_blpt1First point of breakline segment.
a_blpt2Second point of breakline segment.

Definition at line 293 of file TrBreaklineAdder.cpp.

References CrossesBoundary(), GetIntersectingEdges(), xms::gmIntersectLineSegmentsWithTol(), m_pts, m_tin, m_xyTol, xms::trIncrementIndex(), xmlog::warning, and XM_LOG.

Referenced by AddBreakline().

◆ SetObserver()

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

Set the observer to use for feedback while processing.

Parameters
a_The observer.

Definition at line 68 of file TrBreaklineAdder.cpp.

References m_observer.

◆ SetTin()

void xms::TrBreaklineAdderImpl::SetTin ( BSHP< TrTin a_tin,
double  a_tol = -1 
)
overridevirtual

Sets the tin that will have breaklines added to it.

Parameters
a_tinThe tin to be modified.
a_tolTolerance used when intersecting line segments. Optional. If not specified, one is computed from the tin extents.

Definition at line 148 of file TrBreaklineAdder.cpp.

References ComputeTolerance(), m_pts, m_tin, m_tris, m_trisAdjToPts, m_xyTol, and XM_ENSURE_TRUE_T_NO_ASSERT.


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