contents up previous next

wxgraphicspath

a wxgraphicspath is a native representation of an geometric path. the contents are specific an private to the respective renderer. instances are ref counted and can therefore be assigned as usual. the only way to get a valid instance is via a createpath call on the graphics context or the renderer instance.

derived from

wxgraphicsobject

include files

<wx/graphics.h>

members

wxgraphicspath::movetopoint
wxgraphicspath::addarc
wxgraphicspath::addarctopoint
wxgraphicspath::addcircle
wxgraphicspath::addcurvetopoint
wxgraphicspath::addellipse
wxgraphicspath::addlinetopoint
wxgraphicspath::addpath
wxgraphicspath::addquadcurvetopoint
wxgraphicspath::addrectangle
wxgraphicspath::addroundedrectangle
wxgraphicspath::closesubpath
wxgraphicspath::contains
wxgraphicspath::getbox
wxgraphicspath::getcurrentpoint
wxgraphicspath::transform
wxgraphicspath::getnativepath
wxgraphicspath::ungetnativepath


wxgraphicspath::movetopoint

void movetopoint(wxdouble x, wxdouble y)

void movetopoint(const wxpoint2ddouble& p)

begins a new subpath at (x,y)


wxgraphicspath::addarc

void addarc(wxdouble x, wxdouble y, wxdouble r, wxdouble startangle, wxdouble endangle, bool clockwise)

adds an arc of a circle centering at (x,y) with radius (r) from startangle to endangle.

void addarc(const wxpoint2ddouble& c, wxdouble r, wxdouble startangle, wxdouble endangle, bool clockwise)


wxgraphicspath::addarctopoint

void addarctopoint(wxdouble x1, wxdouble y1, wxdouble x2, wxdouble y2, wxdouble r)

appends a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1).


wxgraphicspath::addcircle

void addcircle(wxdouble x, wxdouble y, wxdouble r)

appends a circle around (x,y) with radius r as a new closed subpath.


wxgraphicspath::addcurvetopoint

void addcurvetopoint(wxdouble cx1, wxdouble cy1, wxdouble cx2, wxdouble cy2, wxdouble x, wxdouble y)

adds a cubic bezier curve from the current point, using two control points and an end point.

void addcurvetopoint(const wxpoint2ddouble& c1, const wxpoint2ddouble& c2, const wxpoint2ddouble& e)


wxgraphicspath::addellipse

void addellipse(wxdouble x, wxdouble y, wxdouble w, wxdouble h)

appends an ellipse fitting into the passed in rectangle.


wxgraphicspath::addlinetopoint

void addlinetopoint(wxdouble x, wxdouble y)

adds a straight line from the current point to (x,y).

void addlinetopoint(const wxpoint2ddouble& p)


wxgraphicspath::addpath

void addpath(const wxgraphicspath& path)

adds another path.


wxgraphicspath::addquadcurvetopoint

void addquadcurvetopoint(wxdouble cx, wxdouble cy, wxdouble x, wxdouble y)

adds a quadratic bezier curve from the current point, using a control point and an end point.


wxgraphicspath::addrectangle

void addrectangle(wxdouble x, wxdouble y, wxdouble w, wxdouble h)

appends a rectangle as a new closed subpath.


wxgraphicspath::addroundedrectangle

void addroundedrectangle(wxdouble x, wxdouble y, wxdouble w, wxdouble h, wxdouble radius)

appends a rounded rectangle as a new closed subpath.


wxgraphicspath::closesubpath

void closesubpath()

closes the current sub-path.


wxgraphicspath::contains

bool contains(const wxpoint2ddouble& c, int fillstyle = wxoddeven_rule) const

bool contains(wxdouble x, wxdouble y, int fillstyle = wxoddeven_rule) const

returns true if the point is within the path.


wxgraphicspath::getbox

wxrect2ddouble getbox() const

void getbox(wxdouble* x, wxdouble* y, wxdouble* w, wxdouble* h) const

gets the bounding box enclosing all points (possibly including control points).


wxgraphicspath::getcurrentpoint

void getcurrentpoint(wxdouble* x, wxdouble* y) const

wxpoint2ddouble getcurrentpoint() const

gets the last point of the current path, (0,0) if not yet set.


wxgraphicspath::transform

void transform(const wxgraphicsmatrix& matrix)

transforms each point of this path by the matrix.


wxgraphicspath::getnativepath

void * getnativepath() const

returns the native path (cgpathref for core graphics, path pointer for gdiplus and a cairo_path_t pointer for cairo).


wxgraphicspath::ungetnativepath

void ungetnativepath(void* p) const

gives back the native path returned by getnativepath() because there might be some deallocations necessary (eg on cairo the native path returned by getnativepath is newly allocated each time).