POLYLINE Class Reference

The POLYLINE class encapsulates a 2D or 3D polyline. More...

#include <mi32/polyline.h>

List of all members.

Classes

class  CLIP
 Clip() base callback class. More...
class  CONST_ITERATOR
 Constant iterator. More...
class  INTERSECTINFO
 Intersection information container class. More...
class  ITERATOR
 Non-const iterator. More...
class  SECTION
class  SPLIT
 IntersectSplitLine() base callback class. More...

Public Types

enum  BUFFERSIDE { BUFFERSIDE_In = 1, BUFFERSIDE_Out = 2, BUFFERSIDE_Both = 3 }
enum  COMBINERESULT {
  COMBINERESULT_Disjoint = 1, COMBINERESULT_OperInsideSrc = 2, COMBINERESULT_SrcInsideOper = 3, COMBINERESULT_Equal = 4,
  COMBINERESULT_Intersect = 5, COMBINERESULT_ClipOutside = COMBINERESULT_Disjoint, COMBINERESULT_ClipInside = COMBINERESULT_OperInsideSrc, COMBINERESULT_SrcInside = COMBINERESULT_SrcInsideOper
}
enum  COMPRESULT { COMPRESULT_Outside = 1, COMPRESULT_Inside, COMPRESULT_Intersect, COMPRESULT_Overlap }
enum  EXTRACT { EXTRACT_StartPoint = 1, EXTRACT_CenterPoint, EXTRACT_EndPoint }
enum  JOINTYPE { JOINTYPE_Miter = 0, JOINTYPE_Round, JOINTYPE_Bevel }
typedef DOUBLE_ARRAY< SECTIONSECTIONARRAY
enum  SPLINE { SPLINE_NoSpline = 0, SPLINE_Cubic, SPLINE_Quadratic, SPLINE_Bezier }
enum  SPLINEFLAGS { SPLINEFLAG_None = 0x0000, SPLINEFLAG_DontMoveEnds = 0x0001, SPLINEFLAG_UseMinDistance = 0x0002, SPLINEFLAG_TreatAsClosed = 0x0004 }
enum  THINMETHOD { THINMETHOD_MinRatio = 1, THINMETHOD_Minimum, THINMETHOD_Douglas }

Public Member Functions

 POLYLINE (const POLYLINE &rhs, INT32 StartVertex, INT32 EndVertex)
 POLYLINE (const POLYLINE &rhs)
 POLYLINE (const DOUBLE_ARRAY< DPOINT3D > &rhs, bool closed=false)
 POLYLINE (const LPOINT2D *points, INT32 NumPoints, bool closed=false, double ZValue=0.0)
 POLYLINE (const SIMPLE_ARRAY< LPOINT2D > &rhs, bool closed=false, double ZValue=0.0)
 POLYLINE (const DOUBLE_ARRAY< DPOINT2D > &rhs, bool closed=false, double ZValue=0.0)
 POLYLINE (DOUBLE_ARRAY< double > &rhs, bool closed=false, DIMENSION dimension=DIMENSION_2D, double ZValue=0.0)
 POLYLINE (const DPOINT2D *pts, INT32 NumPoints, bool closed=false, DIMENSION dimension=DIMENSION_2D, double ZValue=0.0)
 POLYLINE (const DPOLYGON &dpoly, bool closed=false, DIMENSION dimension=DIMENSION_2D, double ZValue=0.0)
 POLYLINE (const DRECT3D &rect)
 POLYLINE (const DRECT2D &rect, double ZValue=0.0)
 POLYLINE (bool closed, DIMENSION dimension=DIMENSION_2D, double ZValue=0.0, UINT32 ReservePoints=1)
 POLYLINE ()
 ~POLYLINE ()
 ~SECTIONS ()
 ~STRIPS ()
ERRVALUE AddVertex (const DPOINT3D &point, INT32 index=-1)
ERRVALUE AddVertex (const DPOINT2D &point, INT32 index=-1)
ERRVALUE Append (const POLYLINE &rhs, bool RemovePoints=true)
void ApplyZScale (double zscale)
ERRVALUE Assign (const DRECT3D &rect)
ERRVALUE Assign (const DRECT2D &rect, double ZValue=0.0)
ERRVALUE Assign (const DOUBLE_ARRAY< DPOINT3D > &rhs, bool closed=false)
ERRVALUE Assign (const DOUBLE_ARRAY< DPOINT2D > &rhs, bool closed=false, double ZValue=0.0)
ERRVALUE Assign (const LPOINT2D *rhs, int NumPoints, bool closed=false, double ZValue=0.0)
ERRVALUE Assign (const SIMPLE_ARRAY< LPOINT2D > &rhs, bool closed=false, double ZValue=0.0)
ERRVALUE Assign (const DPOINT2D *pts, INT32 NumPoints, bool closed=false, DIMENSION dimension=DIMENSION_2D, double ZValue=0.0)
ERRVALUE Assign (const DPOLYGON &dpoly, bool closed=false, DIMENSION dimension=DIMENSION_2D, double ZValue=0.0)
ERRVALUE AssignFromXML (const XMLNODE *topnode)
void Attach (MIDOUBLEARRAY &rhs, INT32 NumPoints, bool closed=false, DIMENSION dimension=DIMENSION_2D, double ZValue=0.0)
ITERATOR Begin ()
CONST_ITERATOR Begin () const
void Clear ()
void Clear ()
void Clear ()
void ClearOptimizations ()
void ClearPoints (INT32 StartPosn=0, INT32 EndPosn=INT32_MAX)
int Clip (const DRECT2D &ClipRect, CLIP &ClipTarget, CLIPMODE ClipMode=CLIPMODE_Inside)
int Clip (const DRECT2D &ClipRect, DELEGATE_ERRVALUE_POLYLINE DelegateOnClip, CLIPMODE ClipMode=CLIPMODE_Inside)
COMPRESULT CompareLineToLine (const POLYLINE &OtherLine) const
COMPRESULT CompareLineToPolygon (const DRECT2D &rect) const
COMPRESULT CompareLineToPolygon (const POLYLINE &Polygon) const
COMPRESULT ComparePolygonToPolygon (const POLYLINE &OtherPoly) const
double ComputeAngle () const
double ComputeArea () const
ERRVALUE ComputeBuffer (const double BufferDistance, POLYLINELIST &BufferLineList, const BUFFERSIDE BufferSide=BUFFERSIDE_Both) const
void ComputeCentroid (DPOINT3D &cent) const
void ComputeCentroid (DPOINT2D &cent) const
double ComputeDistance (const POLYLINE &OtherLine, bool ExtentsOverlap=true) const
INT32 ComputeDistPointAndVertexOnLine (double Distance, DPOINT3D &NewPoint, bool DistanceFromStart=true) const
bool ComputeDistPointOnLine (double Distance, DPOINT3D &NewPoint, bool DistanceFromStart=true) const
void ComputeExtents (DRECT2D &rect, INT32 StartVertex, INT32 EndVertex) const
void ComputeExtents (DRECT2D &rect) const
void ComputeExtents (DRECT3D &rect, INT32 StartVertex, INT32 EndVertex) const
void ComputeExtents (DRECT3D &rect) const
void ComputeInteriorPoint (DPOINT3D &pt) const
double ComputeLength (const DPOINT3D &point) const
double ComputeLength () const
double ComputeLongestSegmentLength () const
double ComputeMaxDimension () const
void ComputeMidPoint (DPOINT3D &MidPoint) const
ERRVALUE ComputeOffset (const SIMPLE_ARRAY< double > &OffsetDistance, POLYLINE &OffsetLine, JOINTYPE JoinType=JOINTYPE_Miter) const
ERRVALUE ComputeOffset (double StartOffsetDistance, double EndOffsetDistance, POLYLINE &OffsetLine, JOINTYPE JoinType=JOINTYPE_Miter) const
ERRVALUE ComputeOffset (double OffsetDistance, POLYLINE &OffsetLine, JOINTYPE JoinType=JOINTYPE_Miter) const
ORIENTATION ComputeOrientation () const
INT32 ComputePercentPointOnLine (double Percent, DPOINT3D &NewPoint, bool DistanceFromStart=true) const
ERRVALUE ComputeSections (const POLYLINE &PolyLine, INT32 NumVertices=64)
ORIENTATION ComputeStats (double *const area, DPOINT2D *const centroid) const
ERRVALUE ComputeStrips (const POLYLINE &PolyLine, INT32 NumDivs=0)
ERRVALUE ComputeStrips (const POLYLINE &PolyLine, const DRECT2D &PolyExtents, INT32 NumDivs=0)
ERRVALUE Conflate (POLYLINELIST &LineList, double thresh, bool &LineChanged, BITSET_UNOWNED &LineListSet)
ERRVALUE Conflate (double thresh, bool &LineChanged)
ERRVALUE ConvertForward (const SPATREF::COORDOP &Op)
void ConvertForward (const TRANS3D &t3d)
ERRVALUE ConvertForward (const TRANS2D_MAPGEN &tmg)
void ConvertForward (const TRANS2D_AFFINE &taf)
ERRVALUE ConvertForwardDense (const SPATREF::COORDOP &Op, double tolerance)
ERRVALUE ConvertForwardDense (const TRANS2D_MAPGEN &tmg)
void ConvertInverse (const TRANS3D &t3d)
ERRVALUE ConvertInverse (const TRANS2D_MAPGEN &tmg)
void ConvertInverse (const TRANS2D_AFFINE &taf)
ERRVALUE ConvertInverseDense (const TRANS2D_MAPGEN &tmg)
ERRVALUE ConvertReverse (const SPATREF::COORDOP &Op)
ERRVALUE ConvertReverseDense (const SPATREF::COORDOP &Op, double tolerance)
INT32 ConvertToLong (LPOINT2D *PointArray) const
ERRVALUE ConvertToLong (SIMPLE_ARRAY< LPOINT2D > &PointArray) const
INT32 ConvertToLongFloor (LPOINT2D *PointArray, const DPOINT2D &scale, const DPOINT2D &offset) const
INT32 ConvertToLongFloor (LPOINT2D *PointArray) const
ERRVALUE ConvertToLongFloor (SIMPLE_ARRAY< LPOINT2D > &PointArray) const
INT32 ConvertToLongNearInt (LPOINT2D *PointArray) const
ERRVALUE ConvertToLongNearInt (SIMPLE_ARRAY< LPOINT2D > &PointArray) const
INT32 ConvertToLongRound (LPOINT2D *PointArray) const
ERRVALUE ConvertToLongRound (SIMPLE_ARRAY< LPOINT2D > &PointArray) const
ERRVALUE ConvertToLongRoundKeepDups (SIMPLE_ARRAY< LPOINT2D > &PointArray) const
void DeleteVertex (int index)
void Detach (MIDOUBLEARRAY &rhs)
void DetachBuffer (MIDOUBLEARRAY &rhs)
void DumpCoords (MISTRING &result, int indent, bool maxprec=false) const
CONST_ITERATOR End () const
ITERATOR End ()
void Exchange (POLYLINE &other)
ERRVALUE ExclusiveUnion (POLYLINE &OperPoly, POLYLINELIST &PolyLineList, COMBINERESULT &CombineResult)
void Extract (INT32 StartPosn, INT32 NumPoints, POLYLINE &ExtractLine) const
void Extract (POLYLINE &NewLine, const DPOINT3D &StartPoint, const DPOINT3D &EndPoint) const
void Extract (POLYLINE &NewLine, const DPOINT3D &BasePoint, double Distance, EXTRACT ExtractPoint, bool ExtrudePastEnds=false) const
double FindClosestPoint (const DPOINT3D &point, double MaximumDistance, DPOINT3D &retpt, INT32 &Vertex) const
double FindClosestPoint (const DPOINT3D &point, DPOINT3D &retpt) const
double FindClosestPoint (const DPOINT2D &point, DPOINT2D &retpt) const
int FindClosestSegment (const DPOINT2D &point, double *distance=0) const
double FindClosestVertex (const DPOINT3D &point, INT32 &index) const
int FindClosestVertex (const DPOINT2D &point, double *distance=0) const
double FindClosestVertex (const DPOINT2D &point, INT32 &index) const
void GenerateExtentOptimization () const
void GenerateExtentOptimization (DRECT2D &Extents) const
void GenerateSectionOptimization (INT32 NumVertices=64) const
ERRVALUE GenerateSectionOptimization (SECTIONS *&Sections, INT32 NumVertices=64) const
ERRVALUE GenerateStripOptimization (INT32 NumDivs=0) const
ERRVALUE GenerateStripOptimization (STRIPS *&Strips, INT32 NumDivs=0) const
DIMENSION GetDimension () const
const DRECT2DGetExtentsIfKnown () const
INT32 GetNumPoints () const
const POLYLINE::SECTIONARRAYGetSectionArray () const
ERRVALUE GetStrip (double yinit, double ylast, SIMPLE_ARRAY< INT32_RANGE > &Strip) const
const SIMPLE_ARRAY< INT32_RANGE > & GetStrip (double y) const
void GetTestPoint (DPOINT3D &pt) const
const DPOINT2DGetVertex (INT32 index) const
void GetVertex3D (INT32 index, DPOINT3D &pt) const
double GetVertexX (INT32 index) const
double GetVertexY (INT32 index) const
double GetVertexZ (INT32 index) const
ERRVALUE GetVertices (DPOLYGON &dpoly) const
ERRVALUE GetVertices (DOUBLE_ARRAY< DPOINT3D > &vertices) const
ERRVALUE GetVertices (DOUBLE_ARRAY< DPOINT2D > &vertices) const
XMLNODEGetXML (XMLNODE *parentnode, const char *nodename=0) const
double GetZValue () const
bool HasSectionOptimization () const
bool HasStripOptimization () const
int Intersect (POLYLINE &OperPoly, POLYLINELIST &PolyLineList, COMBINERESULT &CombineResult)
void IntersectClean (INTERSECTINFO &IntsInfo) const
ERRVALUE IntersectSearch (INTERSECTINFO &IntsInfo, const POLYLINE &OtherLine, INTERSECTINFO *OtherIntsInfo, double threshold) const
ERRVALUE IntersectSearch (INTERSECTINFO &IntsInfo, double threshold) const
ERRVALUE IntersectSplitLine (INTERSECTINFO &IntsInfo, SPLIT &SplitInfo, double threshold, bool CallBadSegment=false) const
bool IsClosed () const
bool IsEqual (const POLYLINE &rhs) const
bool IsEquivalentTo (const POLYLINE &rhs, double threshold=0.0) const
bool IsPointInside (const DPOINT2D &pt) const
bool IsRectangle () const
bool IsValid () const
bool IsValid () const
void MoveVertex (int index, const DPOINT2D &delta, int FixedVertex1=-1, int FixedVertex2=-1)
POLYLINEoperator+= (const POLYLINE &rhs)
STRIPS & operator= (const STRIPS &rhs)
SECTIONS & operator= (const SECTIONS &rhs)
POLYLINEoperator= (const POLYLINE &rhs)
bool RemoveColinearVertices (double thresh=0.0, bool KeepEndPoints=false)
void RemoveDuplicates (double thresh=0.0, bool KeepEndPoints=false)
bool RemoveDuplicateVertices (double thresh=0.0)
ERRVALUE Replace (INT32 StartVertex, INT32 EndVertex, const POLYLINE &RepLine, INT32 RepLineStartVertex=0, INT32 RepLineEndVertex=INT32_MAX)
ERRVALUE Reserve (INT32 NumPoints)
void Reverse ()
 SECTIONS (const SECTIONS &rhs)
 SECTIONS ()
void SetClosed (bool closed)
ERRVALUE SetDimension (DIMENSION dimension)
void SetOrientation (ORIENTATION Orientation)
void SetPrecision (int Precision)
void SetSectionArray (const POLYLINE::SECTIONARRAY &SectionArray)
void SetupExtentOptimization (const DRECT2D &Extents) const
void SetupOrientationOptimization (ORIENTATION Orientation) const
void SetupSectionOptimization (const SECTIONS &Sections) const
void SetupStripOptimization (const STRIPS &Strips) const
void SetVertex (INT32 index, const DPOINT3D &pt)
void SetVertex (INT32 index, const DPOINT2D &pt)
void SetVertexX (INT32 index, double x)
void SetVertexY (INT32 index, double y)
void SetVertexZ (INT32 index, double z)
void SetZValue (double ZValue)
void Spline (SPLINE SplineType, INT32 NumKnots, double tolerance, SPLINEFLAGS flags=SPLINEFLAG_None)
void SplineZ (SPLINE SplineType, INT32 NumKnots, double tolerance, SPLINEFLAGS flags=SPLINEFLAG_None)
void Straighten ()
 STRIPS (const STRIPS &rhs)
 STRIPS ()
int Subtract (POLYLINE &OperPoly, POLYLINELIST &PolyLineList, COMBINERESULT &CombineResult)
void Thin (THINMETHOD Method, double Factor)
void TransferOwnerFrom (DOUBLE_ARRAY< DPOINT3D > &rhs)
void TransferOwnerFrom (DOUBLE_ARRAY< DPOINT2D > &rhs)
void TransferOwnerTo (DOUBLE_ARRAY< DPOINT3D > &rhs)
void TransferOwnerTo (DOUBLE_ARRAY< DPOINT2D > &rhs)
int Union (POLYLINE &OperPoly, POLYLINELIST &PolyLineList, COMBINERESULT &CombineResult)
int ValidatePolygon (CLIP &ClipTarget) const
int ValidatePolygon (DELEGATE_ERRVALUE_POLYLINE DelegateOnValidated) const
int ValidatePolygon () const

Detailed Description

The POLYLINE class encapsulates a 2D or 3D polyline.

POLYLINE strip information to improve performance of certain algorithms such as POLYLINE::IsPointInside().

POLYLINE section information to improve performance of certain algorithms such as POLYLINE::Conflate();.

Its primary use is for manipulation of coordinates whether in 2D or 3D. It does not maintain polygon topology (i.e. crossing segments are not resolved). The base storage method is a MIDOUBLEARRAY, by which alignment is maintained.

A POLYLINE instance can have associated with it certain optimization setups to improve some of the methods response times. They are currently "Extents", "Section", and "Strip" optimizations. The methods that can make use of these optimizations will state that in the documentation for that method.


Member Typedef Documentation


Member Enumeration Documentation

Enumeration of which side(s) of line to buffer.

Enumerator:
BUFFERSIDE_In 
BUFFERSIDE_Out 
BUFFERSIDE_Both 

Values returned for Union(), Intersect(), Subtract() and ExclusiveUnion().

Enumerator:
COMBINERESULT_Disjoint 

Polygons are disjoint.

COMBINERESULT_OperInsideSrc 

Operator polygon inside source polygon, may share border point(s).

COMBINERESULT_SrcInsideOper 

Source polygon inside operator polygon, may share border point(s).

COMBINERESULT_Equal 

Source polygon equals operator polygon.

COMBINERESULT_Intersect 

Source and operator polygons intersect.

COMBINERESULT_ClipOutside 
COMBINERESULT_ClipInside 
COMBINERESULT_SrcInside 

Comparison result enumeration.

Enumerator:
COMPRESULT_Outside 

Both elements are outside of each other.

COMPRESULT_Inside 

One element is completely inside the other.

COMPRESULT_Intersect 

Both elements intersect.

COMPRESULT_Overlap 

One element overlaps the other.

Enumerator:
EXTRACT_StartPoint 
EXTRACT_CenterPoint 
EXTRACT_EndPoint 
Enumerator:
JOINTYPE_Miter 
JOINTYPE_Round 
JOINTYPE_Bevel 
Enumerator:
SPLINE_NoSpline 
SPLINE_Cubic 
SPLINE_Quadratic 
SPLINE_Bezier 
Enumerator:
SPLINEFLAG_None 
SPLINEFLAG_DontMoveEnds 
SPLINEFLAG_UseMinDistance 
SPLINEFLAG_TreatAsClosed 
Enumerator:
THINMETHOD_MinRatio 
THINMETHOD_Minimum 
THINMETHOD_Douglas 

Constructor & Destructor Documentation

POLYLINE::POLYLINE (  ) 

Default constructor, creates empty unclosed 2D polyline.

POLYLINE::POLYLINE ( bool  closed,
DIMENSION  dimension = DIMENSION_2D,
double  ZValue = 0.0,
UINT32  ReservePoints = 1 
) [explicit]

Construct with specified attributes.

Parameters:
closed Create and maintain a closed polyline
dimension Create a 2D or 3D line
ZValue Initial Z value for POLYLINE if NumDim != 3
ReservePoints Initial number of points to reserve in buffer
POLYLINE::POLYLINE ( const DRECT2D rect,
double  ZValue = 0.0 
) [explicit]

Constructor from DRECT2D, sets closed flag.

Sets "Extents" optimization

Parameters:
rect DRECT2D to create a line from
ZValue Initial Z value for POLYLINE if NumDim != 3
POLYLINE::POLYLINE ( const DRECT3D rect  )  [explicit]

Constructor from DRECT3D, sets closed flag.

Sets "Extents" optimization

Parameters:
rect DRECT3D to create a line from
POLYLINE::POLYLINE ( const DPOLYGON dpoly,
bool  closed = false,
DIMENSION  dimension = DIMENSION_2D,
double  ZValue = 0.0 
) [explicit]

Constructor from legacy DPOLYGON.

Parameters:
dpoly Legacy DPOLYGON to create a line from
closed Create and maintain a closed polyline
dimension Create a 2D or 3D line
ZValue Initial Z value for POLYLINE if NumDim != 3
POLYLINE::POLYLINE ( const DPOINT2D pts,
INT32  NumPoints,
bool  closed = false,
DIMENSION  dimension = DIMENSION_2D,
double  ZValue = 0.0 
)

Constructor from DPOINT2D array and number of points.

Parameters:
closed Create and maintain a closed polyline
dimension Create a 2D or 3D line
ZValue Initial Z value for POLYLINE if NumDim != 3
POLYLINE::POLYLINE ( DOUBLE_ARRAY< double > &  rhs,
bool  closed = false,
DIMENSION  dimension = DIMENSION_2D,
double  ZValue = 0.0 
) [explicit]

Constructor from DOUBLE_ARRAY<double>.

This constructor transfers ownership from the DOUBLE_ARRAY<>

Parameters:
closed Create and maintain a closed polyline
dimension Create a 2D or 3D line
ZValue Initial Z value for POLYLINE if NumDim != 3
POLYLINE::POLYLINE ( const DOUBLE_ARRAY< DPOINT2D > &  rhs,
bool  closed = false,
double  ZValue = 0.0 
) [explicit]

Constructor from DOUBLE_ARRAY<DPOINT2D>.

Parameters:
closed Create and maintain a closed polyline
ZValue Initial Z value for POLYLINE if NumDim != 3
POLYLINE::POLYLINE ( const SIMPLE_ARRAY< LPOINT2D > &  rhs,
bool  closed = false,
double  ZValue = 0.0 
) [explicit]

Constructor from DOUBLE_ARRAY<DPOINT2D>.

Parameters:
closed Create and maintain a closed polyline
ZValue Initial Z value for POLYLINE if NumDim != 3
POLYLINE::POLYLINE ( const LPOINT2D points,
INT32  NumPoints,
bool  closed = false,
double  ZValue = 0.0 
) [explicit]

Constructor from an array of LPOINT2D.

Parameters:
closed Create and maintain a closed polyline
ZValue Initial Z value for POLYLINE if NumDim != 3
POLYLINE::POLYLINE ( const DOUBLE_ARRAY< DPOINT3D > &  rhs,
bool  closed = false 
) [explicit]

Constructor from DOUBLE_ARRAY<DPOINT3D>.

Parameters:
closed Create and maintain a closed polyline
POLYLINE::POLYLINE ( const POLYLINE rhs  ) 

Copy constructor Will use any optimizations associated with "rhs".

POLYLINE::POLYLINE ( const POLYLINE rhs,
INT32  StartVertex,
INT32  EndVertex 
)

Section copy constructor NO optimizations associated with "rhs" will be used.

Parameters:
rhs POLYLINE to copy from
StartVertex Start vertex of 'rhs
EndVertex End vertex of 'rhs' (Inclusive)
POLYLINE::~POLYLINE (  ) 

Destructor.

POLYLINE::~SECTIONS (  ) 
POLYLINE::~STRIPS (  ) 

Member Function Documentation

ERRVALUE POLYLINE::AddVertex ( const DPOINT3D point,
INT32  index = -1 
)

Add a vertex to the line.

Parameters:
point Point to add
index Default location is the end of the line
ERRVALUE POLYLINE::AddVertex ( const DPOINT2D point,
INT32  index = -1 
)

Add a vertex to the line.

Parameters:
point Point to add
index Default location is the end of the line
ERRVALUE POLYLINE::Append ( const POLYLINE rhs,
bool  RemovePoints = true 
)

Append a POLYLINE to this one, by default removing duplicates and collinear points at the joined section This method will update the "Extents" optimization for 'this' if both 'this' and 'rhs' have that optimization.

void POLYLINE::ApplyZScale ( double  zscale  ) 
Parameters:
zscale Z Scale factor to apply to z coordinate (pt[i].z *= zscale)
ERRVALUE POLYLINE::Assign ( const DRECT3D rect  ) 

Assign point values from a DRECT3D.

Parameters:
rect DRECT2D to crete a line from
ERRVALUE POLYLINE::Assign ( const DRECT2D rect,
double  ZValue = 0.0 
)

Assign point values from a DRECT2D.

Parameters:
rect DRECT2D to crete a line from
ZValue Initial Z value for POLYLINE
ERRVALUE POLYLINE::Assign ( const DOUBLE_ARRAY< DPOINT3D > &  rhs,
bool  closed = false 
)

Assign point values from DOUBLE_ARRAY<DPOINT3D> buffer.

Parameters:
closed Create and maintain a closed polyline
ERRVALUE POLYLINE::Assign ( const DOUBLE_ARRAY< DPOINT2D > &  rhs,
bool  closed = false,
double  ZValue = 0.0 
)

Assign point values from DOUBLE_ARRAY<DPOINT2D> buffer.

Parameters:
closed Create and maintain a closed polyline
ZValue Initial Z value for POLYLINE if NumDim != 3
ERRVALUE POLYLINE::Assign ( const LPOINT2D rhs,
int  NumPoints,
bool  closed = false,
double  ZValue = 0.0 
)

Assign point values from SIMPLE_ARRAY<LPOINT2D> buffer.

Parameters:
closed Create and maintain a closed polyline
ZValue Initial Z value for POLYLINE if NumDim != 3
ERRVALUE POLYLINE::Assign ( const SIMPLE_ARRAY< LPOINT2D > &  rhs,
bool  closed = false,
double  ZValue = 0.0 
)

Assign point values from SIMPLE_ARRAY<LPOINT2D> buffer.

Parameters:
closed Create and maintain a closed polyline
ZValue Initial Z value for POLYLINE if NumDim != 3
ERRVALUE POLYLINE::Assign ( const DPOINT2D pts,
INT32  NumPoints,
bool  closed = false,
DIMENSION  dimension = DIMENSION_2D,
double  ZValue = 0.0 
)

Assign point values from DPOINT2D array and number of points.

Parameters:
closed Create and maintain a closed polyline
dimension Create a 2D or 3D line
ZValue Initial Z value for POLYLINE if NumDim != 3
ERRVALUE POLYLINE::Assign ( const DPOLYGON dpoly,
bool  closed = false,
DIMENSION  dimension = DIMENSION_2D,
double  ZValue = 0.0 
)

Assign point values from legacy DPOLYGON structure.

Parameters:
closed Create and maintain a closed polyline
dimension Create a 2D or 3D line
ZValue Initial Z value for POLYLINE if NumDim != 3
ERRVALUE POLYLINE::AssignFromXML ( const XMLNODE topnode  ) 

Assign polyline from XMLNODE.

void POLYLINE::Attach ( MIDOUBLEARRAY rhs,
INT32  NumPoints,
bool  closed = false,
DIMENSION  dimension = DIMENSION_2D,
double  ZValue = 0.0 
)

Attach a MIDOUBLEARRAY instance to 'this' by taking ownership of the MIDOUBLEARRAY buffer.

After this call, the MIDOUBLEARRAY buffer is no longer valid

Parameters:
closed Create and maintain a closed polyline
dimension Create a 2D or 3D line
ZValue Initial Z value for POLYLINE if NumDim != 3
ITERATOR POLYLINE::Begin (  )  [inline]

Return an ITERATOR that refers to the beginning of the POLYLINE.

CONST_ITERATOR POLYLINE::Begin (  )  const [inline]

Return a CONST_ITERATOR that refers to the beginning of the POLYLINE.

void POLYLINE::Clear (  ) 

Clear Strip information.

void POLYLINE::Clear (  ) 

Clear Section information.

void POLYLINE::Clear (  ) 

Clear POLYLINE of point data.

void POLYLINE::ClearOptimizations (  ) 

Clear POLYLINE of all optimizations.

void POLYLINE::ClearPoints ( INT32  StartPosn = 0,
INT32  EndPosn = INT32_MAX 
)

Clear POLYLINE of point data.

Parameters:
EndPosn Inclusive
int POLYLINE::Clip ( const DRECT2D ClipRect,
CLIP ClipTarget,
CLIPMODE  ClipMode = CLIPMODE_Inside 
)

Clip a polyline to a rectangle, call the ClipTarget for each segment.

Returns:
TRUE if part of the line is inside the clipping area, FALSE if not, < 0 error.
Parameters:
ClipRect Rectangle to clip to
ClipMode Clipping mode
int POLYLINE::Clip ( const DRECT2D ClipRect,
DELEGATE_ERRVALUE_POLYLINE  DelegateOnClip,
CLIPMODE  ClipMode = CLIPMODE_Inside 
)

Clip a polyline to a rectangle, call delegate for each segment.

Returns:
TRUE if part of the line is inside the clipping area, FALSE if not, < 0 error.
Parameters:
ClipRect Rectangle to clip to
DelegateOnClip Delegate to call for each clipped polyline
COMPRESULT POLYLINE::CompareLineToLine ( const POLYLINE OtherLine  )  const

Compare the two lines and return the result of the comparison.

Uses "Extent" and "Section" optimizations

Returns:
COMPRESULT depending on the relationship of 'OtherLine' to 'this'
COMPRESULT POLYLINE::CompareLineToPolygon ( const DRECT2D rect  )  const

Compare the line against the polygon and return the result of the comparison.

Uses "Extent", "Section" and "Strip" optimizations

Returns:
COMPRESULT depending on the relationship of 'Polygon' to 'this'
COMPRESULT POLYLINE::CompareLineToPolygon ( const POLYLINE Polygon  )  const

Compare the line against the polygon and return the result of the comparison.

Uses "Extent", "Section" and "Strip" optimizations

Returns:
COMPRESULT depending on the relationship of 'Polygon' to 'this'
COMPRESULT POLYLINE::ComparePolygonToPolygon ( const POLYLINE OtherPoly  )  const

Compare the two polygons and return the result of the comparison.

Uses "Extent", "Section" and "Strip" optimizations

Returns:
COMPRESULT depending on the relationship of 'OtherPoly' to 'this'
double POLYLINE::ComputeAngle (  )  const

Compute the angle for the line using the sum of all the angles in the line.

Returns:
Angle summation of the angles between segments
double POLYLINE::ComputeArea (  )  const [inline]

Find area of polygon if the line is closed This method assumes that the polygon is topologically correct (i.e.

it does not cross itself)

Returns:
: Area of the polygon if a polygon, Zero otherwize
ERRVALUE POLYLINE::ComputeBuffer ( const double  BufferDistance,
POLYLINELIST BufferLineList,
const BUFFERSIDE  BufferSide = BUFFERSIDE_Both 
) const

Compute an buffer from the line using a buffer distance and a bufferside.

void POLYLINE::ComputeCentroid ( DPOINT3D cent  )  const

Compute 3D centroid.

If closed, X/Y values will be same as for 2D and Z will be center of Z range.

void POLYLINE::ComputeCentroid ( DPOINT2D cent  )  const

Compute 2D centroid of polygon or line.

This method assumes that the polygon is topologically correct (i.e. it does not cross itself)

double POLYLINE::ComputeDistance ( const POLYLINE OtherLine,
bool  ExtentsOverlap = true 
) const

Compute the shortest distance between the two lines.

If the lines cross, return zero. Uses "Section" optimization

Returns:
The shortest distance between the two lines
Parameters:
ExtentsOverlap Set to false if the extents of the two lines DO NOT overlap. If set to 'false' this method does not need to check for segment intersections
INT32 POLYLINE::ComputeDistPointAndVertexOnLine ( double  Distance,
DPOINT3D NewPoint,
bool  DistanceFromStart = true 
) const

Determine a point on the line given a distance from the start or end of the line.

Returns:
Vertex index closest to the point returned, based on direction searched, or -1 if not found.
Parameters:
NewPoint Computed point based on distance RETURNED
bool POLYLINE::ComputeDistPointOnLine ( double  Distance,
DPOINT3D NewPoint,
bool  DistanceFromStart = true 
) const

Determine a point on the line given a distance from the start or end of the line.

Returns:
: True if point found on the line, false if not
Parameters:
NewPoint Computed point based on distance RETURNED
void POLYLINE::ComputeExtents ( DRECT2D rect,
INT32  StartVertex,
INT32  EndVertex 
) const

Determine the extents of a sub-section of the line.

Parameters:
EndVertex Inclusive
void POLYLINE::ComputeExtents ( DRECT2D rect  )  const

Determine the extents of the line Uses and / or sets the "Extent" optimization.

void POLYLINE::ComputeExtents ( DRECT3D rect,
INT32  StartVertex,
INT32  EndVertex 
) const

Determine the extents of a sub-section of the line.

Parameters:
EndVertex Inclusive
void POLYLINE::ComputeExtents ( DRECT3D rect  )  const

Determine the extents of the line Uses and / or sets the "Extent" optimization.

void POLYLINE::ComputeInteriorPoint ( DPOINT3D pt  )  const

Compute point on interior of polygon or on line if not closed.

Parameters:
pt Point returned
double POLYLINE::ComputeLength ( const DPOINT3D point  )  const

Determine length of the line to the point specified.

Returns:
: Length of the line in line units to the point specified
Parameters:
point Compute distance from start of line to point given
double POLYLINE::ComputeLength (  )  const

Determine length of the line.

Returns:
: Length of the line in line units
double POLYLINE::ComputeLongestSegmentLength (  )  const

Determine length of the longest segment of the line.

Returns:
: Length of the longest segment of the line in line units
double POLYLINE::ComputeMaxDimension (  )  const

Determine maximum length between two vertices on the polygon Uses the "Section" and "Extent" optimizations.

Returns:
Maximum dimension of the polygon
void POLYLINE::ComputeMidPoint ( DPOINT3D MidPoint  )  const

Determine line mid-point.

Parameters:
MidPoint Computed mid-point RETURNED
ERRVALUE POLYLINE::ComputeOffset ( const SIMPLE_ARRAY< double > &  OffsetDistance,
POLYLINE OffsetLine,
JOINTYPE  JoinType = JOINTYPE_Miter 
) const

Compute an offset from the line using a start distance, end distance and a join type.

Positive buffer distances will result in a buffer to the right of the line assuming Cartesian coordinates (+ right/up, - left/down)

Parameters:
OffsetDistance One entry for each vertex in the line, sign of each distance needs to be the same
ERRVALUE POLYLINE::ComputeOffset ( double  StartOffsetDistance,
double  EndOffsetDistance,
POLYLINE OffsetLine,
JOINTYPE  JoinType = JOINTYPE_Miter 
) const

Compute an offset from the line using a start distance, end distance and a join type.

Positive buffer distances will result in a buffer to the right of the line assuming Cartesian coordinates (+ right/up, - left/down)

ERRVALUE POLYLINE::ComputeOffset ( double  OffsetDistance,
POLYLINE OffsetLine,
JOINTYPE  JoinType = JOINTYPE_Miter 
) const

Compute an offset from the line using a distance and a join type.

Positive buffer distances will result in a buffer to the right of the line assuming Cartesian coordinates (+ right/up, - left/down)

ORIENTATION POLYLINE::ComputeOrientation (  )  const [inline]

Find orientation of polygon if the line is closed This method assumes that the polygon is topologically correct (i.e.

it does not cross itself)

Returns:
: Orientation of the polygon, ORIENTATION_Unknown otherwize
INT32 POLYLINE::ComputePercentPointOnLine ( double  Percent,
DPOINT3D NewPoint,
bool  DistanceFromStart = true 
) const

Determine a point on the line given a percentage from the start or end of the line.

Returns:
Vertex index closest to the point returned, based on direction searched.
Parameters:
Percent Value between 0.0 and 1.0
NewPoint Computed point based on distance RETURNED
ERRVALUE POLYLINE::ComputeSections ( const POLYLINE PolyLine,
INT32  NumVertices = 64 
)

Create the sections given the POLYLINE and possibly the number of vertices to use in each section.

Parameters:
PolyLine POLYLINE to compute strips for
ORIENTATION POLYLINE::ComputeStats ( double *const   area,
DPOINT2D *const   centroid 
) const

Compute statistics for the polygon This method assumes that the polygon is topologically correct (i.e.

it does not cross itself)

Returns:
: Orientation of the polygon, ORIENTATION_Unknown otherwize
Parameters:
area Area value RETURNED, NULL if not needed
centroid Centroid value RETURNED, NULL if not needed
ERRVALUE POLYLINE::ComputeStrips ( const POLYLINE PolyLine,
INT32  NumDivs = 0 
)

Create the strip list given the POLYLINE and possibly the number of strips (divisions) to use.

Parameters:
PolyLine POLYLINE to compute strips for
NumDivs Default is # of points / 100
ERRVALUE POLYLINE::ComputeStrips ( const POLYLINE PolyLine,
const DRECT2D PolyExtents,
INT32  NumDivs = 0 
)

Create the strip list given the POLYLINE, the extents of the POLYLINE, and possibly the number of strips (divisions) to use.

Parameters:
PolyLine POLYLINE to compute strips for
NumDivs Default is # of points / 100
ERRVALUE POLYLINE::Conflate ( POLYLINELIST LineList,
double  thresh,
bool &  LineChanged,
BITSET_UNOWNED LineListSet 
)

Conflate a set of POLYLINE's with the changed vertex priority assigned to the set.

If there is a change to be made to get the lines to match along a set of segments, the 'LineList' will be picked to change its points before 'this' will. Uses the "Section" and "Extent" optimizations

Parameters:
LineListSet Matches the 'LineList' and tells which lines have been changed
ERRVALUE POLYLINE::Conflate ( double  thresh,
bool &  LineChanged 
)

Conflate a POLYLINE to itself with the changed vertex priority assigned to the set.

If there is a change to be made to get the line to match along a set of segments, the higher number vertices will be picked to change. Uses the "Section" optimization

ERRVALUE POLYLINE::ConvertForward ( const SPATREF::COORDOP Op  ) 

Convert point coordinates using generic transformation.

void POLYLINE::ConvertForward ( const TRANS3D t3d  ) 

Convert point coordinates using 3D perspective transformation.

ERRVALUE POLYLINE::ConvertForward ( const TRANS2D_MAPGEN tmg  ) 

Convert point coordinates using generic transformation.

void POLYLINE::ConvertForward ( const TRANS2D_AFFINE taf  ) 

Convert point coordinates using affine transformation.

ERRVALUE POLYLINE::ConvertForwardDense ( const SPATREF::COORDOP Op,
double  tolerance 
)

Convert point coordinates using generic transformation with densification.

ERRVALUE POLYLINE::ConvertForwardDense ( const TRANS2D_MAPGEN tmg  ) 

Convert point coordinates using generic transformation with densification.

void POLYLINE::ConvertInverse ( const TRANS3D t3d  ) 

Convert point coordinates using 3D perspective transformation.

ERRVALUE POLYLINE::ConvertInverse ( const TRANS2D_MAPGEN tmg  ) 

Convert point coordinates using generic transformation.

void POLYLINE::ConvertInverse ( const TRANS2D_AFFINE taf  ) 

Convert point coordinates using affine transformation.

ERRVALUE POLYLINE::ConvertInverseDense ( const TRANS2D_MAPGEN tmg  ) 

Convert point coordinates using generic transformation with densification.

ERRVALUE POLYLINE::ConvertReverse ( const SPATREF::COORDOP Op  ) 

Convert point coordinates using generic transformation.

ERRVALUE POLYLINE::ConvertReverseDense ( const SPATREF::COORDOP Op,
double  tolerance 
)

Convert point coordinates using generic transformation with densification.

INT32 POLYLINE::ConvertToLong ( LPOINT2D PointArray  )  const

Convert polygon from double's to INT32's (no rounding), removes colinear points.

Returns:
Number of points placed in 'PointArray'.
ERRVALUE POLYLINE::ConvertToLong ( SIMPLE_ARRAY< LPOINT2D > &  PointArray  )  const

Convert polygon from double's to INT32's (no rounding), removes colinear points.

INT32 POLYLINE::ConvertToLongFloor ( LPOINT2D PointArray,
const DPOINT2D scale,
const DPOINT2D offset 
) const

Convert polygon from double's to INT32's with scaling and offset (floor method), removes colinear points.

Returns:
Number of points placed in 'PointArray'.
Parameters:
PointArray Point array to contain result
scale Scaling factors
offset Offset values added after scaling
INT32 POLYLINE::ConvertToLongFloor ( LPOINT2D PointArray  )  const

Convert polygon from double's to INT32's (floor method), removes colinear points.

Returns:
Number of points placed in 'PointArray'.
ERRVALUE POLYLINE::ConvertToLongFloor ( SIMPLE_ARRAY< LPOINT2D > &  PointArray  )  const

Convert polygon from double's to INT32's (floor method), removes colinear points.

INT32 POLYLINE::ConvertToLongNearInt ( LPOINT2D PointArray  )  const

Convert polygon from double's to INT32's (NearInt truncating), removes colinear points.

Returns:
Number of points placed in 'PointArray'.
ERRVALUE POLYLINE::ConvertToLongNearInt ( SIMPLE_ARRAY< LPOINT2D > &  PointArray  )  const

Convert polygon from double's to INT32's (NearInt truncating), removes colinear points.

INT32 POLYLINE::ConvertToLongRound ( LPOINT2D PointArray  )  const

Convert polygon from double's to INT32's with rounding, removes colinear points.

Returns:
Number of points placed in 'PointArray'.
ERRVALUE POLYLINE::ConvertToLongRound ( SIMPLE_ARRAY< LPOINT2D > &  PointArray  )  const

Convert polygon from double's to INT32's with rounding, removes colinear points.

ERRVALUE POLYLINE::ConvertToLongRoundKeepDups ( SIMPLE_ARRAY< LPOINT2D > &  PointArray  )  const

Convert polygon from double's to INT32's with rounding, keep colinear points.

void POLYLINE::DeleteVertex ( int  index  ) 

Delete a line vertex If the line is a closed polygon and removing a vertex causes less than 4 vertices to remain, the line is opened.

Parameters:
index Remove a vertex from the line Index of vertex to remove
void POLYLINE::Detach ( MIDOUBLEARRAY rhs  ) 

Detach the MIDOUBLEARRAY from 'this' to 'rhs'. 'this' does not have control of the buffer after this call.

void POLYLINE::DetachBuffer ( MIDOUBLEARRAY rhs  ) 

Detach the MIDOUBLEARRAY from 'this' to 'rhs'. 'this' is not usable until Attach() is called, if you try, your process will die.

void POLYLINE::DumpCoords ( MISTRING result,
int  indent,
bool  maxprec = false 
) const

Dump coordinates to string.

Though intended for debugging, not for serialization, the format is compatible with AssignFromXML when maximum precision is used.

Parameters:
result String to append to
indent Amount to indent each coordinate
maxprec Use maximum precision
CONST_ITERATOR POLYLINE::End (  )  const [inline]

Return a CONST_ITERATOR that refers to the end of the POLYLINE, not a valid point.

ITERATOR POLYLINE::End (  )  [inline]

Return an ITERATOR that refers to the end of the POLYLINE, not a valid point.

void POLYLINE::Exchange ( POLYLINE other  ) 

Exchange two polylines.

All iterators associated with either polyline will become invalid.

Parameters:
other Other polyline to exchange with
ERRVALUE POLYLINE::ExclusiveUnion ( POLYLINE OperPoly,
POLYLINELIST PolyLineList,
COMBINERESULT CombineResult 
)

Exclusive Union (XOR) operator polygon with 'this' 'this' and 'PolyLineList' must be conflated using POLYLINE::Conflate() "PolyLineList" will contain ORIENTATION_Clockwise for shell polygons and ORIENTATION_CounterClockwise for islands.

Parameters:
PolyLineList Results of operation returned here
void POLYLINE::Extract ( INT32  StartPosn,
INT32  NumPoints,
POLYLINE ExtractLine 
) const

Extract a portion of the line into a new line based on position and number of points.

void POLYLINE::Extract ( POLYLINE NewLine,
const DPOINT3D StartPoint,
const DPOINT3D EndPoint 
) const

Extract a portion of the line into a new line based on two point on the line.

Parameters:
NewLine Result of extraction
StartPoint Point to start extraction from
EndPoint Point to end extraction from
void POLYLINE::Extract ( POLYLINE NewLine,
const DPOINT3D BasePoint,
double  Distance,
EXTRACT  ExtractPoint,
bool  ExtrudePastEnds = false 
) const

Extract a portion of the line into a new line based on a basepoint and distance from that basepoint.

Parameters:
NewLine Result of extraction
BasePoint Point to extract from based on "ExtractPoint"
double POLYLINE::FindClosestPoint ( const DPOINT3D point,
double  MaximumDistance,
DPOINT3D retpt,
INT32 Vertex 
) const

Find closest point on the line (not necessarily at a vertex) to specified point.

This method uses linear interpolation to determine the correct z value. This method is faster than the above 'FindClosestPoint' methods because it will make less calls to DistPointLineSegD().

Returns:
: Distance to closest point on the line, may not be smaller than 'MaxmimumDistance'
Parameters:
point Point to check
MaximumDistance Maximum distance allowed between point on the line and 'point'
retpt Point on line found RETURNED
Vertex Index of vertex BEFORE the location of the point RETURNED
double POLYLINE::FindClosestPoint ( const DPOINT3D point,
DPOINT3D retpt 
) const

Find closest point on the line (not necessarily at a vertex) to specified point.

This method uses linear interpolation to determine the correct z value.

Returns:
: Distance to closest point on the line, not necessarily a vertex point
Parameters:
point Point to check
retpt Point on line found RETURNED
double POLYLINE::FindClosestPoint ( const DPOINT2D point,
DPOINT2D retpt 
) const

Find closest point on the line (not necessarily at a vertex) to specified point.

Returns:
: Distance to closest point on the line, not necessarily a vertex point
Parameters:
point Point to check
retpt Point on line found RETURNED
int POLYLINE::FindClosestSegment ( const DPOINT2D point,
double *  distance = 0 
) const

Find closest segment to specified point.

Returns:
Index of first vertex of segment, may be last polyline vertex if closed.
Parameters:
point Point to check
distance Distance returned, 0 if don't need
double POLYLINE::FindClosestVertex ( const DPOINT3D point,
INT32 index 
) const

Find closest vertex to specified 3D point.

This method uses linear interpolation to determine the Z value.

Returns:
: Distance to closest vertex on the line
Parameters:
point Point to check
index Index of closest vertex returned
int POLYLINE::FindClosestVertex ( const DPOINT2D point,
double *  distance = 0 
) const

Find closest vertex to specified 2D point.

Returns:
: Index of closest vertex.
Parameters:
point Point to check
distance Distance returned, 0 if don't need
double POLYLINE::FindClosestVertex ( const DPOINT2D point,
INT32 index 
) const

Find closest vertex to specified 2D point.

Returns:
: Distance to closest vertex on the line.
Parameters:
point Point to check
index Index of closest vertex returned
void POLYLINE::GenerateExtentOptimization (  )  const

Generate the "Extent" optimization.

Used mostly for Compare...() methods and to setup the "Stript" optimization

void POLYLINE::GenerateExtentOptimization ( DRECT2D Extents  )  const

Generate the "Extent" optimization.

Used mostly for Compare...() methods and to setup the "Strip" optimization

void POLYLINE::GenerateSectionOptimization ( INT32  NumVertices = 64  )  const

Generate the "Section" optimization.

Used for many methods. A "Section" is defined as piece of the source line (defined by "NumVertices") and that sections extents.

ERRVALUE POLYLINE::GenerateSectionOptimization ( SECTIONS *&  Sections,
INT32  NumVertices = 64 
) const

Generate the "Section" optimization.

Used for many methods. A "Section" is defined as piece of the source line (defined by "NumVertices") and that sections extents.

Parameters:
Sections Section information RETURNED, you must free pointer
ERRVALUE POLYLINE::GenerateStripOptimization ( INT32  NumDivs = 0  )  const

Generate the "Strip" optimization.

Used for IsPointInside() method. A "Strip" is defined as a list of segments that fall within a range of y values.

ERRVALUE POLYLINE::GenerateStripOptimization ( STRIPS *&  Strips,
INT32  NumDivs = 0 
) const

Generate the "Strip" optimization.

Used for IsPointInside() method. A "Strip" is defined as a list of segments that fall within a range of y values.

Parameters:
Strips Strip information RETURNED, you must free pointer
DIMENSION POLYLINE::GetDimension (  )  const [inline]

Get current line dimension.

const DRECT2D* POLYLINE::GetExtentsIfKnown (  )  const

Get the extents of the POLYLINE if known, this method will NOT compute the extents.

Returns:
Pointer to extents or NULL if not known.
INT32 POLYLINE::GetNumPoints (  )  const [inline]

Get the number of points in the line.

Returns:
: Number of points in the line
const POLYLINE::SECTIONARRAY& POLYLINE::GetSectionArray (  )  const
ERRVALUE POLYLINE::GetStrip ( double  yinit,
double  ylast,
SIMPLE_ARRAY< INT32_RANGE > &  Strip 
) const

Get a strip cooresponding to the y range.

const SIMPLE_ARRAY<INT32_RANGE>& POLYLINE::GetStrip ( double  y  )  const

Get a strip cooresponding to the y coordinate of the point.

void POLYLINE::GetTestPoint ( DPOINT3D pt  )  const

Get Test Point Obtains valid test point for the line, either the middle vertex or.

if a two point line, the midpoint

const DPOINT2D& POLYLINE::GetVertex ( INT32  index  )  const [inline]

Get 2D vertex.

Returns:
: Constant reference to a 2D point
void POLYLINE::GetVertex3D ( INT32  index,
DPOINT3D pt 
) const [inline]

Get a 3D point.

double POLYLINE::GetVertexX ( INT32  index  )  const [inline]

Get 'X' coordinate of a vertex.

Returns:
: 'X' coordinate
double POLYLINE::GetVertexY ( INT32  index  )  const [inline]

Get 'Y' coordinate of a vertex.

Returns:
: 'Y' coordinate
double POLYLINE::GetVertexZ ( INT32  index  )  const [inline]

Get 'Z' coordinate of a vertex.

Returns:
: 'Z' coordinate
ERRVALUE POLYLINE::GetVertices ( DPOLYGON dpoly  )  const

Get vertices into DPOLYGON.

ERRVALUE POLYLINE::GetVertices ( DOUBLE_ARRAY< DPOINT3D > &  vertices  )  const

Get vertices into DOUBLE_ARRAY<DPOINT3D> array.

Parameters:
vertices Vertices returned
ERRVALUE POLYLINE::GetVertices ( DOUBLE_ARRAY< DPOINT2D > &  vertices  )  const

Get vertices into DOUBLE_ARRAY<DPOINT2D> array.

Parameters:
vertices Vertices returned
XMLNODE* POLYLINE::GetXML ( XMLNODE parentnode,
const char *  nodename = 0 
) const

Get XML representation.

Parameters:
parentnode Parent node
nodename Node name, default will be "Polygon" or "Line" depending on whether closed or not
double POLYLINE::GetZValue (  )  const [inline]

Get polyline Z value, only useful for 2D lines.

bool POLYLINE::HasSectionOptimization (  )  const

Does 'this' have strip optimization.

bool POLYLINE::HasStripOptimization (  )  const

Does 'this' have strip optimization.

int POLYLINE::Intersect ( POLYLINE OperPoly,
POLYLINELIST PolyLineList,
COMBINERESULT CombineResult 
)

Intersect operator polygon with 'this' "PolyLineList" will contain ORIENTATION_Clockwise for shell polygons and ORIENTATION_CounterClockwise for islands 'this' and 'PolyLineList' must be conflated using POLYLINE::Conflate().

Returns:
'1' if "PolylineList" has one entry and is the same as 'this', 0 for all other cases, < 0 error
Parameters:
PolyLineList Results of operation returned here
void POLYLINE::IntersectClean ( INTERSECTINFO IntsInfo  )  const

Remove redundant and overlapping intersection entries from INTERSECTINFO.

ERRVALUE POLYLINE::IntersectSearch ( INTERSECTINFO IntsInfo,
const POLYLINE OtherLine,
INTERSECTINFO OtherIntsInfo,
double  threshold 
) const

Search for intersections against another line.

Intersection information is stored in the INTERSECTINFO instance. If information already exists in the INTERSECTINFO, any new intersection information will be appended. Uses the "Section" and "Extent" optimizations

Parameters:
OtherIntsInfo Optional, used if you want to keep intersection info about OtherLine'
ERRVALUE POLYLINE::IntersectSearch ( INTERSECTINFO IntsInfo,
double  threshold 
) const

Search for intersections against itself.

Intersection information is stored in the INTERSECTINFO Uses the "Section" and "Extent" optimizations

ERRVALUE POLYLINE::IntersectSplitLine ( INTERSECTINFO IntsInfo,
SPLIT SplitInfo,
double  threshold,
bool  CallBadSegment = false 
) const

Split the line according to the INTERSECTINFO information.

Parameters:
SplitInfo Callback base class for line splitting
CallBadSegment Set to true if an intersection causes invalid lines to be generated
bool POLYLINE::IsClosed (  )  const [inline]

Check if the line is marked closed.

Returns:
: True if the line is marked closed
bool POLYLINE::IsEqual ( const POLYLINE rhs  )  const

Determine if the two lines are exactly equal This method uses "Exact" point comparisons.

Returns:
'True' if they are, 'False' if not
bool POLYLINE::IsEquivalentTo ( const POLYLINE rhs,
double  threshold = 0.0 
) const

Determine if the two lines are equivalent This method uses "Fuzzy" point comparisons and the direction of the lines are not relevant.

Returns:
'True' if they are, 'False' if not
bool POLYLINE::IsPointInside ( const DPOINT2D pt  )  const

Check if the point is inside the polygon Uses the "Strip" optimization if exists.

Returns:
: True if the point is in, False if not or the line is not closed
Parameters:
pt Point to check
bool POLYLINE::IsRectangle (  )  const

Returns true if the POLYLINE describes a simple, unrotated rectangle.

bool POLYLINE::IsValid (  )  const

Has the strip list been computed?

bool POLYLINE::IsValid (  )  const

Has the section list been computed?

void POLYLINE::MoveVertex ( int  index,
const DPOINT2D delta,
int  FixedVertex1 = -1,
int  FixedVertex2 = -1 
)

Move a vertex by some dx,dy If FixedVertex1 and/or FixedVertex2 are specified, all points between the vertex being moved and the fixed verticies will also be moved by an ammount inversely proportional to their distance from the vertex being moved.

If you specify two fixed verticies, one had better be less than index and one greater than index or you will get weird results. Also, specifying a FixedVertex which is just index +/- 1 is the same as not specifying it.

Parameters:
index Vertex to move
delta Move distance
FixedVertex1 Vertex to keep in place
FixedVertex2 Vertex to keep in place
POLYLINE& POLYLINE::operator+= ( const POLYLINE rhs  ) 

Append 'rhs' to 'this' If both 'rhs' and 'this' have "Extents" optimization, this method update 'this' Extents optimization.

STRIPS& POLYLINE::operator= ( const STRIPS &  rhs  ) 
SECTIONS& POLYLINE::operator= ( const SECTIONS &  rhs  ) 
POLYLINE& POLYLINE::operator= ( const POLYLINE rhs  ) 

Assignment Will keep any optimizations associated with "rhs" If POLYLINE::Reserved() was called on 'this' to pre-allocate the point buffer, do not call this method, call POLYLINE::operator+=() or POLYLINE::Append().

bool POLYLINE::RemoveColinearVertices ( double  thresh = 0.0,
bool  KeepEndPoints = false 
)

Remove colinear and duplicate vertices along the line.

Returns:
True if line changed, false if not
Parameters:
thresh Threshold value to test for same point or colinear point
void POLYLINE::RemoveDuplicates ( double  thresh = 0.0,
bool  KeepEndPoints = false 
)

Remove duplicate and colinear points along the line.

Deprecated:
Use RemoveColinearVertices instead.
Parameters:
thresh Threshold value to test for same point or colinear point
bool POLYLINE::RemoveDuplicateVertices ( double  thresh = 0.0  ) 

Remove duplicate vertices along the line.

Returns:
True if line changed, false if not
Parameters:
thresh Threshold value to test for same point
ERRVALUE POLYLINE::Replace ( INT32  StartVertex,
INT32  EndVertex,
const POLYLINE RepLine,
INT32  RepLineStartVertex = 0,
INT32  RepLineEndVertex = INT32_MAX 
)

Replace a section of 'this' with a section of 'RepLine'.

Parameters:
EndVertex Inclusive
ERRVALUE POLYLINE::Reserve ( INT32  NumPoints  ) 

Reserve space for given number of points The POLYLINE::operator=() will not use the reserved buffer, call POLYLINE::Clear() then POLYLINE::operator+=() or POLYLINE::Append() to use the reserved buffer.

void POLYLINE::Reverse (  ) 

Reverse the vertices of the line This method will retain the "Extents" and "Orientation" optimizations.

POLYLINE::SECTIONS ( const SECTIONS &  rhs  ) 
POLYLINE::SECTIONS (  ) 
void POLYLINE::SetClosed ( bool  closed  ) 

Close or open the line Will add closure point if set to 'true'.

ERRVALUE POLYLINE::SetDimension ( DIMENSION  dimension  ) 

Set line dimension from 2D->3D or 3D->2D.

void POLYLINE::SetOrientation ( ORIENTATION  Orientation  ) 

Set polygon orientation Uses the "Orientation" optimization.

void POLYLINE::SetPrecision ( int  Precision  ) 

Set the precision of the coordinates in the POLYLINE 'Precision' is the number of decimal places to keep, '0' for precision of whole numbers, < '0' for the left of the decimal point, > '0' for right of the decimal point.

void POLYLINE::SetSectionArray ( const POLYLINE::SECTIONARRAY SectionArray  ) 
void POLYLINE::SetupExtentOptimization ( const DRECT2D Extents  )  const

Setup the "Extent" optimization.

Used mostly for Compare...() methods and to setup the "Strip" optimization

void POLYLINE::SetupOrientationOptimization ( ORIENTATION  Orientation  )  const

Setup the "Orientation" optimization.

Used mostly for SetOrientation(), Intersect(), Union(), Subtract(), and ExclusiveUnion() methods

void POLYLINE::SetupSectionOptimization ( const SECTIONS &  Sections  )  const

Setup the "Section" optimization.

Used for many methods. A "Section" is defined as piece of the source line (defined by "NumVertices") and that sections extents.

Parameters:
Sections Sections from GenerateSectionOptimization()
void POLYLINE::SetupStripOptimization ( const STRIPS &  Strips  )  const

Setup the "Strip" optimization.

Used for IsPointInside() method. A "Strip" is defined as a list of segments that fall within a range of y values.

void POLYLINE::SetVertex ( INT32  index,
const DPOINT3D pt 
)

Set a vertex on the line to a specified 3D point.

Parameters:
index Vertex to set
pt Point to set vertex to
void POLYLINE::SetVertex ( INT32  index,
const DPOINT2D pt 
)

Set a vertex on the line to a specified 2D point.

Parameters:
index Vertex to set
pt Point to set vertex to
void POLYLINE::SetVertexX ( INT32  index,
double  x 
)

Set X coordinate for specified vertex.

Parameters:
index Vertex to set
x 'X' coordinate to set vertex to
void POLYLINE::SetVertexY ( INT32  index,
double  y 
)

Set Y coordinate for specified vertex.

Parameters:
index Vertex to set
y 'Y' coordinate to set vertex to
void POLYLINE::SetVertexZ ( INT32  index,
double  z 
)

Set Z coordinate for specified vertex.

Parameters:
index Vertex to set
z 'Z' coordinate to set vertex to
void POLYLINE::SetZValue ( double  ZValue  )  [inline]

Set polyline Z value, only useful for 2D lines.

void POLYLINE::Spline ( SPLINE  SplineType,
INT32  NumKnots,
double  tolerance,
SPLINEFLAGS  flags = SPLINEFLAG_None 
)

Spline the line according to the SPLINE.

Parameters:
NumKnots Number of points between points (Bezier - Number of points in the line)
void POLYLINE::SplineZ ( SPLINE  SplineType,
INT32  NumKnots,
double  tolerance,
SPLINEFLAGS  flags = SPLINEFLAG_None 
)

Spline the line using (distance, z) ordering according to the SPLINE. Used to spline the z values of a line.

Parameters:
NumKnots Number of points between points (Bezier - Number of points in the line)
void POLYLINE::Straighten (  ) 

Take the first and last points in the line and make a two point line from them.

POLYLINE::STRIPS ( const STRIPS &  rhs  ) 
POLYLINE::STRIPS (  ) 
int POLYLINE::Subtract ( POLYLINE OperPoly,
POLYLINELIST PolyLineList,
COMBINERESULT CombineResult 
)

Subtract operator polygon from 'this' "PolyLineList" will contain ORIENTATION_Clockwise for shell polygons and ORIENTATION_CounterClockwise for islands 'this' and 'PolyLineList' must be conflated using POLYLINE::Conflate().

Returns:
'1' if "PolylineList" has one entry and is the same as 'this', 0 for all other cases, < 0 error
Parameters:
PolyLineList Results of operation returned here
void POLYLINE::Thin ( THINMETHOD  Method,
double  Factor 
)

Thin the line points based on method and factor.

void POLYLINE::TransferOwnerFrom ( DOUBLE_ARRAY< DPOINT3D > &  rhs  ) 

Transfer polyline data ownership from the DOUBLE_ARRAY<> to itself.

Parameters:
rhs Point list to transfer ownership from
void POLYLINE::TransferOwnerFrom ( DOUBLE_ARRAY< DPOINT2D > &  rhs  ) 

Transfer polyline data ownership from the DOUBLE_ARRAY<> to itself.

Parameters:
rhs Point list to transfer ownership from
void POLYLINE::TransferOwnerTo ( DOUBLE_ARRAY< DPOINT3D > &  rhs  ) 

Transfer polyline data ownership from itself to the DOUBLE_ARRAY<>.

Parameters:
rhs Point list to transfer ownership to
void POLYLINE::TransferOwnerTo ( DOUBLE_ARRAY< DPOINT2D > &  rhs  ) 

Transfer polyline data ownership from itself to the DOUBLE_ARRAY<>.

Parameters:
rhs Point list to transfer ownership to
int POLYLINE::Union ( POLYLINE OperPoly,
POLYLINELIST PolyLineList,
COMBINERESULT CombineResult 
)

Union (ADD) operator polygon to 'this' "PolyLineList" will contain ORIENTATION_Clockwise for shell polygons and ORIENTATION_CounterClockwise for islands 'this' and 'PolyLineList' must be conflated using POLYLINE::Conflate().

Returns:
'1' if "PolylineList" has one entry and is the same as 'this', 0 for all other cases, < 0 error
Parameters:
PolyLineList Results of operation returned here
int POLYLINE::ValidatePolygon ( CLIP ClipTarget  )  const

Validate that the polygon does not intersect itself, resolve intersections if needed and call ClipTarget for each resulting validated polygon.

Returns:
TRUE if the polygon was already valid, FALSE if new polygons were generated, < 0 error
Parameters:
ClipTarget Target for resulting validated polygon, will be called for original polygon if already valid
int POLYLINE::ValidatePolygon ( DELEGATE_ERRVALUE_POLYLINE  DelegateOnValidated  )  const

Validate that the polygon does not intersect itself, resolve intersections if needed and call delegate for each resulting validated polygon.

Returns:
TRUE if the polygon was already valid, FALSE if new polygons were generated, < 0 error
Parameters:
DelegateOnValidated Delegate to call for each validated polygon, will be called for original polygon if already valid
int POLYLINE::ValidatePolygon (  )  const

Validate that the polygon does not intersect itself.

Returns:
TRUE if the polygon was valid, FALSE if not, < 0 error

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

Generated on Sun Oct 7 21:33:42 2012 for TNTsdk 2012 by  doxygen 1.6.1