wxArt2D
Public Member Functions | Friends | List of all members
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]

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. More...
 
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 More...
 
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 More...
 
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 More...
 
void OffsetContour_rounded (const a2dLine &currentline, const a2dLine &nextline, double factor, bool addAtFront)
 create a contour segements at a distance, using two segment More...
 
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. More...
 
a2dHit HitTestPolyline (const a2dPoint2D &ptest, double margin)
 extensive hittesting on vertex list seen as polyline. More...
 
- Public Member Functions inherited from a2dSmrtPtrList< a2dLineSegment >
itSmart Find (a2dLineSegment *object)
 Find a specific object.
 
const_itSmart Find (a2dLineSegment *object) const
 Find a specific object.
 
int IndexOf (a2dLineSegment *object) const
 Find the index of a specific object.
 
bool ReleaseObject (a2dLineSegment *object)
 release a certain object from the list
 
- Public Member Functions inherited from a2dlist< a2dSmrtPtr< a2dLineSegment > >
 a2dlist ()
 Default constructor.
 
 a2dlist (const a2dlist &other)
 Copy constructor.
 
 ~a2dlist ()
 Destructor.
 
a2dlist< a2dSmrtPtr
< a2dLineSegment >
>::const_iterator 
item (size_t index) const
 
a2dlist< a2dSmrtPtr
< a2dLineSegment > >::iterator 
item (size_t index)
 
a2dlist< a2dSmrtPtr
< a2dLineSegment >
>::reverse_iterator 
rerase (typename std::list< a2dSmrtPtr< a2dLineSegment >, std::allocator< a2dSmrtPtr< a2dLineSegment > > >::reverse_iterator iterr)
 
std::list< a2dSmrtPtr
< a2dLineSegment >
, std::allocator< a2dSmrtPtr
< a2dLineSegment >
> >::iterator 
GetPreviousAround (typename std::list< a2dSmrtPtr< a2dLineSegment >, std::allocator< a2dSmrtPtr< a2dLineSegment > > >::iterator iter)
 get the previous node ( –end() if no previous )
 
std::list< a2dSmrtPtr
< a2dLineSegment >
, std::allocator< a2dSmrtPtr
< a2dLineSegment >
> >::iterator 
GetNextAround (typename std::list< a2dSmrtPtr< a2dLineSegment >, std::allocator< a2dSmrtPtr< a2dLineSegment > > >::iterator iter)
 get the next node ( begin() if no next )
 

Friends

class a2dSmrtPtrBase
 

Additional Inherited Members

- Public Types inherited from a2dSmrtPtrList< a2dLineSegment >
typedef a2dlist< a2dSmrtPtr
< a2dLineSegment > >::iterator 
itSmart
 
typedef a2dlist< a2dSmrtPtr
< a2dLineSegment >
>::const_iterator 
const_itSmart
 

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 600 of file polyver.h.

Member Function Documentation

double a2dVertexList::CalcArea ( ) const

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

Definition at line 2151 of file polyver.cpp.

void a2dVertexList::ConvertIntoSplinedPolygon ( double  Aber)

circle segments are converted to lines first.

Definition at line 2869 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 2369 of file polyver.cpp.

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 2008 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
centerof circle
beginpoint of arc
endpoint of arc
radiusof arc
clockif true clockwise
aberaberation for generating the segments
addAtFrontwhere to add this segment

Definition at line 3407 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
centerof circle
incominglast segment starting this segment
endpoint of arc
radiusof arc
aberaberation for generating the segments
addAtFrontwhere to add this segment

Definition at line 3471 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 2193 of file polyver.cpp.

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

extensive hittesting on vertex list seen as polygon.

Parameters
ptestpoint to test against polygon.
marginpoint with this margin around.

Definition at line 3050 of file polyver.cpp.

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

extensive hittesting on vertex list seen as polyline.

Parameters
ptestpoint to test against polyline.
marginpoint with this margin around.

Definition at line 3251 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
iterstart of first point
n( number of point2 to replace with arc )
center_xcenter_x (center point of the ARC)
center_ycenter_y (center point of the ARC)

Definition at line 2198 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
addAtFrontwhere to add this segment

Definition at line 3480 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
iterstart testing here
abersee 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 2410 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 1928 of file polyver.cpp.


The documentation for this class was generated from the following files:
a2dVertexList Class Reference -- Sun Oct 12 2014 17:04:51 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation