wxArt2D
|
vertex list of line and arc segments. More...
#include <polyver.h>
Public Member Functions | |
a2dVertexList (const a2dVertexList &other) | |
a2dVertexList (const a2dVertexArray &other) | |
a2dVertexList & | operator= (const a2dVertexList &other) |
a2dVertexList & | operator= (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 ¢er_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... | |
a2dVertexList * | ConvertSplinedPolygon (double Aber) const |
Spline conversion for polygon. | |
a2dVertexList * | ConvertSplinedPolyline (double Aber) const |
Spline conversion for polyline. | |
void | ConvertIntoSplinedPolygon (double Aber) |
void | ConvertIntoSplinedPolyline (double Aber) |
a2dVertexList * | ConvertToContour (double distance, a2dPATH_END_TYPE pathtype, bool asPolygon=false) |
create a contour around polygon/polyline | |
a2dVpath * | ConvertToVpath (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 ¢er, 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 ¢er, 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 ¤tline, 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 | |
a2dVertexList * | GetRedundant (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... | |
![]() | |
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 | |
![]() | |
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 | |
![]() | |
typedef a2dlist< a2dSmrtPtr < a2dLineSegment > >::iterator | itSmart |
typedef a2dlist< a2dSmrtPtr < a2dLineSegment > >::const_iterator | const_itSmart |
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
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
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 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
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 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.
ptest | point to test against polygon. |
margin | point 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.
ptest | point to test against polyline. |
margin | point 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:
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 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.
currentline | |
nextline | |
factor | |
addAtFront | where 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:
Abberation means maximum distance along a segment towards the perfect arc.
iter | start testing here |
aber | see above |
Rmin | (minimum radius) |
Rmax | (maximum radius) |
center_p_old | (centerpunt van circelboog) |
Definition at line 2410 of file polyver.cpp.
void a2dVertexList::Transform | ( | const a2dAffineMatrix & | world | ) |
transform all segments with given matrix
Definition at line 1928 of file polyver.cpp.