a2dVpath Class Reference
[vector path a2dCanvasObject plus segment classes]

Vector Path. More...

#include <polyver.h>

List of all members.

Public Member Functions

 a2dVpath (a2dVertexArray &vertexArray, bool moveToFirst=true, bool closeLast=false)
 a2dVpath (a2dVertexList &vertexList, bool moveToFirst=true, bool closeLast=false)
 ~a2dVpath ()
 destructor
a2dVpathoperator= (const a2dVpath &other)
 operator =
double Length ()
 calculate length of path, assuming continues path.
bool IsPolygon (bool allowArc=true)
 test if closed polygon ( a2dPATHSEG_MOVETO, a2dPATHSEG_LINETO, a2dPATHSEG_ARCTO )
bool IsPolyline (bool allowArc=true)
 test if polyline ( a2dPATHSEG_MOVETO, a2dPATHSEG_LINETO, a2dPATHSEG_ARCTO )
void Add (a2dVpathSegment *seg)
 add a segment
void Add (a2dVertexArray &vertexArray, bool moveToFirst=true, bool closeLast=false)
 add a vertexArray to an existing path
void Add (a2dVertexList &vertexList, bool moveToFirst=true, bool closeLast=false)
 add a vertexlist to an existing path
void MoveTo (double x, double y)
 add a MoveTo command to the path
void LineTo (double x, double y, bool withStroke=true)
 add a LineTo command to the path
void QBCurveTo (double x1, double y1, double x2, double y2, bool withStroke=true)
 add a quadratic bezier segment to the path
void QBCurveTo (double x1, double y1, bool withStroke=true)
 add a quadratic bezier segment to the path, using the previous segment.
void CBCurveTo (double x1, double y1, double x2, double y2, double x3, double y3, bool withStroke=true)
 add a quadratic bezier segment to the path
void CBCurveTo (double x1, double y1, double x3, double y3, bool withStroke=true)
 add a quadratic bezier segment to the path, using the previous segment.
void ArcTo (double x1, double y1, double x2, double y2, bool withStroke=true)
 add an arc segment to the path
void ArcTo (double xc, double yc, double angle, bool withStroke=true)
 add an arc segment to the path, using the previous segment
void ArcTo (double xc, double yc, double x1, double y1, double x2, double y2, bool withStroke=true)
 add an arc segment to the path, using the previous segment
void Close (bool withStroke=true)
 Closing the path as a filled area.
void ConvertToLines ()
 Convert complex segments to line segments.
void ConvertToPolygon (a2dListOfa2dVertexList &addTo, bool arc=true)
void Contour (double distance, a2dPATH_END_TYPE pathtype)
 create an offset contour at distance
void Transform (const a2dAffineMatrix &world)
 transform all segments with given matrix
a2dBoundingBox GetBbox (const a2dAffineMatrix &lworld=a2dIDENTITY_MATRIX)
 return a boundingbox of a transformed a2dVpath


Detailed Description

Vector Path.

Holds a wxArray of a2dVpathSegment objects. Drawing the sequence of segments, represents the form of the shape. Shape depends on the type of segment and style of that segment.

With Vpath very complex shapes can be generated, also disjoint. e.g. polygons with holes, donuts.

a2dVpathSegment is the baseclass for several types of segments.

See also:
a2dVpathQBCurveSegment

a2dVpathCBCurveSegment

a2dVpathArcSegment

Remarks:
do use Shrink() after filling a a2dVpath, to reduce memory usage

Definition at line 1172 of file polyver.h.


Member Function Documentation

void a2dVpath::MoveTo ( double  x,
double  y 
)

add a MoveTo command to the path

Parameters:
x point to move to
y point to move to

Definition at line 3891 of file polyver.cpp.

void a2dVpath::LineTo ( double  x,
double  y,
bool  withStroke = true 
)

add a LineTo command to the path

Parameters:
x endpoint of line
y endpoint of line
withStroke Do stroke or not this line segment

Definition at line 3897 of file polyver.cpp.

void a2dVpath::QBCurveTo ( double  x1,
double  y1,
double  x2,
double  y2,
bool  withStroke = true 
)

add a quadratic bezier segment to the path

Parameters:
x1 endpoint of curve
y1 endpoint of curve
x2 first control point coming from previous segment in path
y2 first control point coming from previous segment in path
withStroke Do stroke or not this line segment

Definition at line 3904 of file polyver.cpp.

void a2dVpath::QBCurveTo ( double  x1,
double  y1,
bool  withStroke = true 
)

add a quadratic bezier segment to the path, using the previous segment.

Parameters:
x1 endpoint of curve
y1 endpoint of curve
withStroke Do stroke or not this line segment

Definition at line 3912 of file polyver.cpp.

void a2dVpath::CBCurveTo ( double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3,
bool  withStroke = true 
)

add a quadratic bezier segment to the path

Parameters:
x1 endpoint of curve
y1 endpoint of curve
x2 first control point coming from previous segment in path
y2 first control point coming from previous segment in path
x3 second control point coming from previous segment in path
y3 second control point coming from previous segment in path
withStroke Do stroke or not this line segment

Definition at line 3920 of file polyver.cpp.

void a2dVpath::CBCurveTo ( double  x1,
double  y1,
double  x3,
double  y3,
bool  withStroke = true 
)

add a quadratic bezier segment to the path, using the previous segment.

Parameters:
x1 endpoint of curve
y1 endpoint of curve
x3 second control point coming from previous segment in path
y3 second control point coming from previous segment in path
withStroke Do stroke or not this line segment
Remarks:
x2 first control point is mirror of second control point of previous segment in path, if Cubic else last endpoint

y2 first control point is mirror of second control point of previous segment in path, if Cubic else last endpoint

Definition at line 3928 of file polyver.cpp.

void a2dVpath::ArcTo ( double  x1,
double  y1,
double  x2,
double  y2,
bool  withStroke = true 
)

add an arc segment to the path

Begin point of arc is position/endpoint of previous segment

Parameters:
x1 x of arc endpoint
y1 y of arc endpoint
x2 x of arc midpoint
y2 y of arc midpoint
withStroke Do stroke or not this line segment

Definition at line 3936 of file polyver.cpp.

void a2dVpath::ArcTo ( double  xc,
double  yc,
double  angle,
bool  withStroke = true 
)

add an arc segment to the path, using the previous segment

Begin point of arc is position/endpoint of previous segment

Parameters:
xc x of arc center
yc y of arc center
angle angle of arc in degrees relative from the previous segment endpoint (negatif for clockwise)
withStroke Do stroke or not this line segment

Definition at line 3944 of file polyver.cpp.

void a2dVpath::ArcTo ( double  xc,
double  yc,
double  x1,
double  y1,
double  x2,
double  y2,
bool  withStroke = true 
)

add an arc segment to the path, using the previous segment

Begin point of arc is position/endpoint of previous segment

Parameters:
xc x of arc center
yc y of arc center
x1 x of arc endpoint
y1 y of arc endpoint
x2 x (xc,yc) ( x2,y2) define a line which the arc will cross
y2 y (xc,yc) ( x2,y2) define a line which the arc will cross
withStroke Do stroke or not this line segment
Remarks:
radius is defined by prev segment endpoint and (xc,yc), x1,y1 is adjusted to fit radius.

Definition at line 3952 of file polyver.cpp.

void a2dVpath::Close ( bool  withStroke = true  ) 

Closing the path as a filled area.

The part sinve the last move is close to that move vertex.

Parameters:
withStroke Do stroke or not this line segment

Definition at line 3960 of file polyver.cpp.

void a2dVpath::ConvertToPolygon ( a2dListOfa2dVertexList addTo,
bool  arc = true 
)

Convert to a a2dVertexList, taking and assuming it has only closed contours in path. Replacing non line (and arc segments if arc is true) with line segments.

Definition at line 4270 of file polyver.cpp.

void a2dVpath::Contour ( double  distance,
a2dPATH_END_TYPE  pathtype 
)

create an offset contour at distance

From all path parts a version is created that surrounds the original part at the given distance.

Definition at line 4386 of file polyver.cpp.

void a2dVpath::Transform ( const a2dAffineMatrix world  ) 

transform all segments with given matrix

Remarks:
complex segments will be broken down to lines.

Definition at line 4032 of file polyver.cpp.


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