wx.GraphicsPath

Inheritance diagram for wx.GraphicsPath:



Description

A wx.GraphicsPath 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

Class API

Methods

__init__()
No docstrings available for this method.

AddArc(x, y, r, startAngle, endAngle, clockwise=True)

Adds an arc of a circle centering at (x, y) with radius r from startAngle to endAngle.

Parameters:

  • x (double)
  • y (double)
  • r (double)
  • startAngle (double)
  • endAngle (double)
  • clockwise (bool)

AddArcToPoint(x1, y1, x2, y2, r)

Appends 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).

Parameters:

  • x1 (double)
  • y1 (double)
  • x2 (double)
  • y2 (double)
  • r (double)

AddCircle(x, y, r)

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

Parameters:

  • x (double)
  • y (double)
  • r (double)

AddCurveToPoint(cx1, cy1, cx2, cy2, x, y)

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

Parameters:

  • cx1 (double)
  • cy1 (double)
  • cx2 (double)
  • cy2 (double)
  • x (double)
  • y (double)

AddEllipse(x, y, w, h)

Appends an ellipse fitting into the passed in rectangle.

Parameters:

  • x (double)
  • y (double)
  • w (double)
  • h (double)

AddLineToPoint(x, y)

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

Parameters:

  • x (double)
  • y (double)

AddPath(path)

Adds another path.

Parameters:


AddQuadCurveToPoint(cx, cy, x, y)

Adds a quadratic Bezier curve from the current point, using a control point and an end point.

Parameters:

  • cx (double)
  • cy (double)
  • x (double)
  • y (double)

AddRectangle(x, y, w, h)

Appends a rectangle as a new closed subpath.

Parameters:

  • x (double)
  • y (double)
  • w (double)
  • h (double)

AddRoundedRectangle(x, y, w, h, radius)

Appends a rounded rectangle as a new closed subpath.

Parameters:

  • x (double)
  • y (double)
  • w (double)
  • h (double)
  • radius (double)

CloseSubpath()
Closes the current sub-path.

Contains(c, fillStyle=wx.ODDEVEN_RULE)

Returns True if the point is within the path.

Parameters:

  • c (wx.Point2DDouble)
  • fillStyle (int)

Returns:

bool


GetBox()

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


Returns:

wx.Rect2DDouble


GetCurrentPoint()

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


Returns:

wx.Point2DDouble


GetNativePath()

Returns the native path (CGPathRef for Core Graphics, Path pointer for GDIPlus and a cairo_path_t pointer for cairo).


Returns:

void

Note

For wxPython we still need a way to make this value usable.


MoveToPoint(x, y)

Begins a new subpath at (x, y)

Parameters:

  • x (double)
  • y (double)

Transform(matrix)

Transforms each point of this path by the matrix.

Parameters:


UnGetNativePath(p)

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).

Parameters:

  • p (int)