wxArt2D
Public Member Functions | List of all members

Vector Path. More...

#include <polyver.h>

Inheritance diagram for a2dVpath:
Inheritance graph
[legend]
Collaboration diagram for a2dVpath:
Collaboration graph
[legend]

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
 
a2dVpathSegmentPtr Item (wxUint32 index)
 
a2dVpathSegmentPtr Item (wxUint32 index) const
 
void RemoveAt (size_t index)
 
void Insert (a2dVpathSegment *segment, size_t index)
 
void MoveTo (double x, double y)
 add a MoveTo command to the path More...
 
void LineTo (double x, double y, bool withStroke=true)
 add a LineTo command to the path More...
 
void QBCurveTo (double x1, double y1, double x2, double y2, bool withStroke=true)
 add a quadratic bezier segment to the path More...
 
void QBCurveTo (double x1, double y1, bool withStroke=true)
 add a quadratic bezier segment to the path, using the previous segment. More...
 
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 More...
 
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. More...
 
void ArcTo (double x1, double y1, double x2, double y2, bool withStroke=true)
 add an arc segment to the path More...
 
void ArcTo (double xc, double yc, double angle, bool withStroke=true)
 add an arc segment to the path, using the previous segment More...
 
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 More...
 
void Close (bool withStroke=true)
 Closing the path as a filled area. More...
 
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 More...
 
void Transform (const a2dAffineMatrix &world)
 transform all segments with given matrix More...
 
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 1211 of file polyver.h.

Member Function Documentation

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
x1x of arc endpoint
y1y of arc endpoint
x2x of arc midpoint
y2y of arc midpoint
withStrokeDo stroke or not this line segment

Definition at line 3950 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

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

Definition at line 3958 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
xcx of arc center
ycy of arc center
x1x of arc endpoint
y1y of arc endpoint
x2x (xc,yc) ( x2,y2) define a line which the arc will cross
y2y (xc,yc) ( x2,y2) define a line which the arc will cross
withStrokeDo 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 3966 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
x1endpoint of curve
y1endpoint of curve
x2first control point coming from previous segment in path
y2first control point coming from previous segment in path
x3second control point coming from previous segment in path
y3second control point coming from previous segment in path
withStrokeDo stroke or not this line segment

Definition at line 3934 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
x1endpoint of curve
y1endpoint of curve
x3second control point coming from previous segment in path
y3second control point coming from previous segment in path
withStrokeDo 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 3942 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
withStrokeDo stroke or not this line segment

Definition at line 3974 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 4429 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 4313 of file polyver.cpp.

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

add a LineTo command to the path

Parameters
xendpoint of line
yendpoint of line
withStrokeDo stroke or not this line segment

Definition at line 3911 of file polyver.cpp.

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

add a MoveTo command to the path

Parameters
xpoint to move to
ypoint to move to

Definition at line 3905 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
x1endpoint of curve
y1endpoint of curve
x2first control point coming from previous segment in path
y2first control point coming from previous segment in path
withStrokeDo stroke or not this line segment

Definition at line 3918 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
x1endpoint of curve
y1endpoint of curve
withStrokeDo stroke or not this line segment

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


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