a2dVertexList Class Reference

vertex list of line and arc segments. More...

#include <polyver.h>

Inheritance diagram for a2dVertexList:

Inheritance graph
[legend]
Collaboration diagram for a2dVertexList:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 a2dVertexList (const a2dVertexList &other)
 a2dVertexList (const a2dVertexArray &other)
a2dVertexListoperator= (const a2dVertexList &other)
a2dVertexListoperator= (const a2dVertexArray &other)
bool HasArcs () const
 return true if there are a2dArcSegment segments.
a2dVertexList::iterator GetPreviousAround (a2dVertexList::iterator iter)
 get the previous segment as a polygon ( --end() is no previous )
a2dVertexList::iterator GetNextAround (a2dVertexList::iterator iter)
 get the next segment as a polygon ( begin() is no next )
a2dVertexList::const_iterator GetPreviousAround (a2dVertexList::const_iterator iter) const
 get the previous segment as a polygon ( --end() is no previous )
a2dVertexList::const_iterator GetNextAround (a2dVertexList::const_iterator iter) const
 get the next segment as a polygon ( begin() is no next )
void MakeBegin (a2dVertexList::iterator iter)
 make the segmenet where iter point to the beginning of the list and shift the rest
double Length ()
 calculate length of path
int IndexOf (a2dLineSegment *object) const
 Find the index of a specific object.
void Insert (unsigned int index, a2dLineSegmentPtr segin)
 insert before segment with index given
void SetPointAdjustArcs (unsigned int n, double x, double y, bool polygon)
 sets a point of a segment and adjusts arc it midpoints.
void SetPointAdjustArcs (a2dLineSegmentPtr segin, double x, double y, bool polygon)
void ConvertToLines (double aberation=0)
 Convert complex segments to line segments.
void ConvertToLines (double dphi, int minseg)
double CalcArea () const
bool DirectionIsClockWise ()
bool CheckForOneCircle (a2dPoint2D &middle, double &radius)
void InsertArc (a2dVertexList::iterator &iter, int n, double center_x, double center_y)
void ConvertPolylineToArc (double aber, double Rmin, double Rmax)
void ConvertPolygonToArc (double aber, double Rmin, double Rmax)
int TestArc (a2dVertexList::iterator &iter, double aber, double Rmin, double Rmax, a2dPoint2D &center_p_old)
 a row of point (minimum 4 ) will be tested to see if its an arc.
a2dBoundingBox GetBbox (const a2dAffineMatrix &lworld=a2dIDENTITY_MATRIX)
 return a boundingbox of a transformed vertexarray
void Transform (const a2dAffineMatrix &world)
 transform all segments with given matrix
a2dVertexListConvertSplinedPolygon (double Aber) const
 Spline conversion for polygon.
a2dVertexListConvertSplinedPolyline (double Aber) const
 Spline conversion for polyline.
void ConvertIntoSplinedPolygon (double Aber)
void ConvertIntoSplinedPolyline (double Aber)
a2dVertexListConvertToContour (double distance, a2dPATH_END_TYPE pathtype, bool asPolygon=false)
 create a contour around polygon/polyline
a2dVpathConvertToVpath (bool arc, bool closed=false)
 return converted vector Vpath, arc segments stay intact if arc is true
void Contour (double distance, a2dPATH_END_TYPE pathtype, bool asPolygon=false)
 create a contour around polygon/polyline
void AddPoint (const a2dPoint2D &point, bool atEnd=true)
 add point to end or begin
void AddPoint (double x, double y, bool atEnd=true)
 add point to end or begin
void CreateArc (const a2dPoint2D &center, const a2dPoint2D &begin, const a2dPoint2D &end, double radius, bool clock, double aber, bool addAtFront)
 create an arc and add it to the graph
void CreateArc (const a2dPoint2D &center, const a2dLine &incoming, const a2dPoint2D &end, double radius, double aber, bool addAtFront)
 create an arc and add it to the graph
void OffsetContour_rounded (const a2dLine &currentline, const a2dLine &nextline, double factor, bool addAtFront)
 create a contour segements at a distance, using two segment
bool RemoveRedundant (bool polygon)
 line segments ( not arcs ) with same point are removed
a2dVertexListGetRedundant (bool polygon, double smallest=0)
 line segments ( not arcs ) with same point are returned
a2dHit HitTestPolygon (const a2dPoint2D &ptest, double margin)
 extensive hittesting on vertex list seen as polygon.
a2dHit HitTestPolyline (const a2dPoint2D &ptest, double margin)
 extensive hittesting on vertex list seen as polyline.

Friends

class a2dSmrtPtrBase


Detailed Description

vertex list of line and arc segments.

Holds a wxList of a2dLineSegment objects. Drawing the sequence of segments, represents the form of the shape. Shape depends on the type of segment and style of that segment. There are two type, straight line segments and arc segments

Definition at line 595 of file polyver.h.


Member Function Documentation

void a2dVertexList::ConvertToLines ( double  dphi,
int  minseg 
)

variation on ConvertToLines, this function converts an arc into segments were the number of segments is determined by dphi (maximum angle of a piece) and minseg (the arc will contain a minimum of minseg segments). e.g. if you specify dphi on 10 a circle will be converted into 36 segments, however if you specify minseg as 40, it will be converted to 40 segments.

Definition at line 2003 of file polyver.cpp.

double a2dVertexList::CalcArea (  )  const

calculate the area of simple polygons (not selfintersecting) coordinates may be negatif

Definition at line 2145 of file polyver.cpp.

bool a2dVertexList::DirectionIsClockWise (  ) 

determines the direction of the polygon, all polygons must be in a clockwise order to avoid conflics with certain algortihms. When the polygon is in a non-clockwise order the area of the polygon is in a clockwise order. returns true if the polygon is in clockwise order

Definition at line 2187 of file polyver.cpp.

void a2dVertexList::InsertArc ( a2dVertexList::iterator &  iter,
int  n,
double  center_x,
double  center_y 
)

The point on the polyline which form an arc meeting the constraints, will be replaced by an Arc segment. The Arc segment will be with the following 4 coordinates:

  • start point
  • end point
  • mid point (a point half way on the arc between start and end)
  • center point In principle only 3 point are need to define a circle, but if start and end point are the same, the center point will be needed to.

Parameters:
iter start of first point
n ( number of point2 to replace with arc )
center_x center_x (center point of the ARC)
center_y center_y (center point of the ARC)

Definition at line 2192 of file polyver.cpp.

void a2dVertexList::ConvertPolylineToArc ( double  aber,
double  Rmin,
double  Rmax 
)

De punten van de polygon worden getest of ze converteerd kunnen worden naar ARC's. Conversie vind plaats als; aberatie < aber Rmin < radius < Rmax

Definition at line 2363 of file polyver.cpp.

int a2dVertexList::TestArc ( a2dVertexList::iterator &  iter,
double  aber,
double  Rmin,
double  Rmax,
a2dPoint2D center_p_old 
)

a row of point (minimum 4 ) will be tested to see if its an arc.

3 options:

  • aber > 0 arc should be within this margin to all points
  • aber = 0 arc points should be exact on the arc. The largets distance of segments to arc is not important.
  • aber < 0 combines the first two options.

Abberation means maximum distance along a segment towards the perfect arc.

Parameters:
iter start testing here
aber see above
Rmin (minimum radius)
Rmax (maximum radius)
center_p_old (centerpunt van circelboog)
Returns:
number of points found to be an arc

Definition at line 2403 of file polyver.cpp.

void a2dVertexList::Transform ( const a2dAffineMatrix world  ) 

transform all segments with given matrix

Remarks:
complex segments will be broken down to lines.

Definition at line 1923 of file polyver.cpp.

void a2dVertexList::ConvertIntoSplinedPolygon ( double  Aber  ) 

circle segments are converted to lines first.

Definition at line 2859 of file polyver.cpp.

void a2dVertexList::CreateArc ( const a2dPoint2D center,
const a2dPoint2D begin,
const a2dPoint2D end,
double  radius,
bool  clock,
double  aber,
bool  addAtFront 
)

create an arc and add it to the graph

Parameters:
center of circle
begin point of arc
end point of arc
radius of arc
clock if true clockwise
aber aberation for generating the segments
addAtFront where to add this segment

Definition at line 3397 of file polyver.cpp.

void a2dVertexList::CreateArc ( const a2dPoint2D center,
const a2dLine incoming,
const a2dPoint2D end,
double  radius,
double  aber,
bool  addAtFront 
)

create an arc and add it to the graph

Parameters:
center of circle
incoming last segment starting this segment
end point of arc
radius of arc
aber aberation for generating the segments
addAtFront where to add this segment

Definition at line 3459 of file polyver.cpp.

void a2dVertexList::OffsetContour_rounded ( const a2dLine currentline,
const a2dLine nextline,
double  factor,
bool  addAtFront 
)

create a contour segements at a distance, using two segment

The angle of the two connected segments in combination with the factor is used to decide if the corner is rounded or straight.

Parameters:
currentline 
nextline 
factor 
addAtFront where to add this segment

Definition at line 3468 of file polyver.cpp.

a2dHit a2dVertexList::HitTestPolygon ( const a2dPoint2D ptest,
double  margin 
)

extensive hittesting on vertex list seen as polygon.

Parameters:
ptest point to test against polygon.
margin point with this margin around.

Definition at line 3040 of file polyver.cpp.

a2dHit a2dVertexList::HitTestPolyline ( const a2dPoint2D ptest,
double  margin 
)

extensive hittesting on vertex list seen as polyline.

Parameters:
ptest point to test against polyline.
margin point with this margin around.

Definition at line 3241 of file polyver.cpp.


The documentation for this class was generated from the following files:
a2dVertexList Class Reference -- Tue Aug 31 18:36:23 2010 -- 31 Aug 2010 -- 1.5.5 -- wxArt2D -- . -- Main Page Reference Documentation