xmsgrid
1.0
|
Adds breaklines to a triangulation. More...
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< TrTin > | m_tin |
The tin. | |
BSHP< Observer > | m_observer |
The observer. | |
double | m_xyTol |
Xy tolerance used with geom functions. | |
VecInt * | m_tris |
Pointer to m_tin triangles for convenience. | |
VecPt3d * | m_pts |
Pointer to m_tin points for convenience. | |
VecInt2d * | m_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< GmMultiPolyIntersector > | m_multiPolyIntersector |
Used to check if breakline crosses boundary. | |
BSHP< GmPtSearch > | m_searcher |
Used to check if breakline crosses boundary. | |
Additional Inherited Members | |
Static Public Member Functions inherited from xms::TrBreaklineAdder | |
static boost::shared_ptr< TrBreaklineAdder > | New () |
Create a TrBreaklineAdderImpl object. More... | |
Adds breaklines to a triangulation.
Definition at line 60 of file TrBreaklineAdder.cpp.
|
overridevirtual |
Add a breakline by swapping. Compare to bkProcessScatBySwapping.
Currently does not consider points that are coincident with the breakline.
a_breakline | The 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().
|
overridevirtual |
Add breaklines by swapping. Compare to bkProcessScatBySwapping.
Currently does not consider points that are coincident with the breakline.
a_breaklines | The 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.
|
private |
Returns true if the line connecting the two points crosses the tin boundary.
a_blpt1 | First point of breakline segment. |
a_blpt2 | Second point of breakline segment. |
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().
|
overridevirtual |
Returns the error message associated with the given number.
[in] | a_messageNumber | Number associated with an error message. |
Definition at line 225 of file TrBreaklineAdder.cpp.
References XM_ASSERT.
|
private |
Finds edge of triangle intersected by breakline and returns next edge in a_intpt1 and a_intpt2. Compare to bkiFindIntersectingScatEdgeFromEdge.
a_ept1 | First point of starting edge. |
a_ept2 | Second point of starting edge. |
a_blpt1 | First point of breakline segment. |
a_blpt2 | Second point of breakline segment. |
a_intpt1 | First point of intersecting edge, or -1 if not found. |
a_intpt2 | Second point of intersecting edge, or -1 if not found. |
a_x | x value of intersection. |
a_y | y value of intersection. |
a_z1 | z value of intersection. |
a_z2 | z 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().
|
private |
Finds edge opposite of a_blpt1 intersected by breakline segment a_blpt1, a_blpt2. Compare to bkiFindIntersectingEdgeFromVertex.
a_blpt1 | First breakline segment point. |
a_blpt2 | Second breakline segment point. |
a_intpt1 | First point on intersecting edge, or -1 if not found. |
a_intpt2 | Second point on intersecting edge, or -1 if not found. |
a_x | x value of intersection. |
a_y | y value of intersection. |
a_z1 | z value of intersection. |
a_z2 | z 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().
|
private |
Computes the extents (min, max) of the polygon.
Definition at line 522 of file TrBreaklineAdder.cpp.
References m_mn, m_mx, and m_tin.
Referenced by ComputeTolerance().
|
private |
Find triangle edges which intersect the breakline. Compare to bkiGetListOfIntersectingScatEdges.
a_blpt1 | First point of breakline segment. |
a_blpt2 | Second point of breakline segment. |
a_edges | Edges 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().
|
private |
Insert breakline segment into triangulation by swapping triangle edges. Compare to bkiProcessScatSegmentBySwapping.
a_blpt1 | First point of breakline segment. |
a_blpt2 | Second 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().
Set the observer to use for feedback while processing.
a_ | The observer. |
Definition at line 68 of file TrBreaklineAdder.cpp.
References m_observer.
Sets the tin that will have breaklines added to it.
a_tin | The tin to be modified. |
a_tol | Tolerance 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.