xmsmesh  1.0
xms::MePolyOffsetterImpl Class Reference

Offsets a polyline (in or out). The polyline forms a closed loop. More...

Inheritance diagram for xms::MePolyOffsetterImpl:
xms::MePolyOffsetter

Public Member Functions

 MePolyOffsetterImpl ()
 constructor
 
virtual bool Offset (const std::vector< Pt3d > &a_input, MePolyOffsetter::polytype a_pType, MePolyOffsetterOutput &a_output, double a_xyTol) override
 Takes an input polyline and offsets it based on the distance of the segments that make up the polyline. More...
 
bool Offset (const std::vector< Pt3d > &a_input, MePolyOffsetter::polytype a_pType, std::vector< std::vector< Pt3d >> &a_output, std::vector< MePolyOffsetter::polytype > &a_outPolyType)
 Takes an input polyline and offsets it based on the distance of the segments that make up the polyline. More...
 
bool DoOffset (const std::vector< Pt3d > &a_input)
 buffers the polygon More...
 
void CheckToAddPoint (std::vector< Pt3d > &a_result, const Pt3d &a_pt)
 checks to see if a point can be added to the resulting line More...
 
void ProcessAngleSegmentEnd (int npt_end, double ang_end, int in1, int in2, int in3, double dx1, double dy1, const Pt3d *pts, std::vector< Pt3d > &a_result)
 handles inserting points around the end of a segment. More...
 
void SpecialRejection (const std::vector< Pt3d > &a_input, std::vector< Pt3d > &a_output)
 a special case for removing points. More...
 
void SelfIntersection (std::vector< Pt3d > &a_pLine)
 Self intersection of a polyline. More...
 
void FindDuplicatesAndOrderLoops (const std::vector< Pt3d > &a_input)
 Finds duplicate points and orders the loops. More...
 

Public Attributes

double m_xyTol
 tolerance for geometric comparisons
 
bool m_setOffsetToZero
 flag used in testing
 
BSHP< MePolyCleanerm_intersector
 class to clean the offset from the polygon
 
MePolyOffsetter::polytype m_pType
 the type of polygon being offset
 
MePolyOffsetterOutput m_output
 the new polygons created by this class
 

Additional Inherited Members

- Public Types inherited from xms::MePolyOffsetter
enum  polytype { OUTSIDE_POLY = 0, INSIDE_POLY, NEWOUT_POLY }
 enum to identify types of polygons created by this class
 
- Static Public Member Functions inherited from xms::MePolyOffsetter
static BSHP< MePolyOffsetterNew ()
 Creates a BufferPoly class. More...
 

Detailed Description

Offsets a polyline (in or out). The polyline forms a closed loop.

Definition at line 40 of file MePolyOffsetter.cpp.

Member Function Documentation

◆ CheckToAddPoint()

void xms::MePolyOffsetterImpl::CheckToAddPoint ( std::vector< Pt3d > &  a_result,
const Pt3d a_pt 
)

checks to see if a point can be added to the resulting line

Parameters
a_result???
a_ptThe point.

Definition at line 262 of file MePolyOffsetter.cpp.

Referenced by DoOffset(), and ProcessAngleSegmentEnd().

◆ DoOffset()

bool xms::MePolyOffsetterImpl::DoOffset ( const std::vector< Pt3d > &  a_input)

◆ FindDuplicatesAndOrderLoops()

void xms::MePolyOffsetterImpl::FindDuplicatesAndOrderLoops ( const std::vector< Pt3d > &  a_input)

Finds duplicate points and orders the loops.

Parameters
[in]a_inputVector of point locations

Definition at line 413 of file MePolyOffsetter.cpp.

References xms::MePolyOffsetterOutput::m_loops, m_output, and xms::MePolyOffsetterOutput::m_pts.

Referenced by DoOffset().

◆ Offset() [1/2]

bool xms::MePolyOffsetterImpl::Offset ( const std::vector< Pt3d > &  a_input,
MePolyOffsetter::polytype  a_pType,
MePolyOffsetterOutput a_out,
double  a_xyTol 
)
overridevirtual

Takes an input polyline and offsets it based on the distance of the segments that make up the polyline.

Parameters
a_inputThe input polyline.
a_pTypeThe type of polygon: outside polygon or inside polygon
a_outThe offset of the input polyline. This can be multiple polylines
a_xyTolTolerance for x,y plane for coincident points.
Returns
Returns false if the input polygon in invalid or the offset fails

Definition at line 125 of file MePolyOffsetter.cpp.

References DoOffset(), m_output, m_pType, and m_xyTol.

Referenced by MePolyOffsetterUnitTests::testBox0(), MePolyOffsetterUnitTests::testBox1(), MePolyOffsetterUnitTests::testBox1a(), MePolyOffsetterUnitTests::testCase1(), MePolyOffsetterUnitTests::testCase1a(), and MePolyOffsetterUnitTests::testCase1b().

◆ Offset() [2/2]

bool xms::MePolyOffsetterImpl::Offset ( const std::vector< Pt3d > &  a_input,
MePolyOffsetter::polytype  a_pType,
std::vector< std::vector< Pt3d >> &  a_output,
std::vector< MePolyOffsetter::polytype > &  a_outPolyType 
)

Takes an input polyline and offsets it based on the distance of the segments that make up the polyline.

Parameters
a_inputThe input polyline.
a_pTypeThe type of polygon: outside polygon or inside polygon
a_outputThe offset of the input polyline. This can be multiple polylines
a_outPolyTypeThe type of polygon in a_output it is either: OUTSIDE_POLY or INSIDE_POLY
Returns
Returns false if the input polygon in invalid or the offset fails

Definition at line 149 of file MePolyOffsetter.cpp.

References DoOffset(), xms::MePolyOffsetterOutput::m_loops, xms::MePolyOffsetterOutput::m_loopTypes, m_output, xms::MePolyOffsetterOutput::m_pts, and m_pType.

◆ ProcessAngleSegmentEnd()

void xms::MePolyOffsetterImpl::ProcessAngleSegmentEnd ( int  npt_end,
double  ang_end,
int  in1,
int  in2,
int  in3,
double  dx1,
double  dy1,
const Pt3d pts,
std::vector< Pt3d > &  a_result 
)

handles inserting points around the end of a segment.

Parameters
[in]npt_end???
[in]ang_end???
[in]in1???
[in]in2???
[in]in3???
[in]dx1???
[in]dy1???
[in]pts???
[in]a_result???

Definition at line 278 of file MePolyOffsetter.cpp.

References CheckToAddPoint(), Mdist(), PIOVER3, PIOVER6, SIN60, TWOPIOVER3, xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.

Referenced by DoOffset().

◆ SelfIntersection()

void xms::MePolyOffsetterImpl::SelfIntersection ( std::vector< Pt3d > &  a_pLine)

Self intersection of a polyline.

Parameters
a_pLineThe polyline.

Definition at line 405 of file MePolyOffsetter.cpp.

References m_intersector, m_output, m_pType, and m_xyTol.

Referenced by DoOffset().

◆ SpecialRejection()

void xms::MePolyOffsetterImpl::SpecialRejection ( const std::vector< Pt3d > &  a_input,
std::vector< Pt3d > &  a_out 
)

a special case for removing points.

Parameters
[in]a_input???
a_out???

Definition at line 377 of file MePolyOffsetter.cpp.

References gmPointInTriangleWithTol(), and m_xyTol.

Referenced by DoOffset().


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