.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.graphics

.. highlight:: python



.. _wx.lib.graphics.GraphicsPath:

==========================================================================================================================================
|phoenix_title|  **wx.lib.graphics.GraphicsPath**
==========================================================================================================================================

A GraphicsPath is a representation of a geometric path, essentially
a collection of lines and curves.  Paths can be used to define
areas to be stroked and filled on a GraphicsContext.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>GraphicsPath</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.graphics.GraphicsPath_inheritance.png" alt="Inheritance diagram of GraphicsPath" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.graphics.GraphicsPath.html" title="A GraphicsPath is a representation of a geometric path, essentially" alt="" coords="11,83,214,112"/> <area shape="rect" id="node2" href="wx.lib.graphics.GraphicsObject.html" title="Base class for the other ``Graphics*`` classes." alt="" coords="5,5,220,35"/> </map> 
   </p>

|


|super_classes| Known Superclasses
==================================

:class:`wx.lib.graphics.GraphicsObject`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.graphics.GraphicsPath.__init__`                                   
:meth:`~wx.lib.graphics.GraphicsPath.AddArc`                                     Adds an arc of a circle centering at (x,y) with radius, from
:meth:`~wx.lib.graphics.GraphicsPath.AddArcToPoint`                              Adds a an arc to two tangents connecting (current) to (x1,y1)
:meth:`~wx.lib.graphics.GraphicsPath.AddCircle`                                  Appends a new closed sub-path as a circle around (x,y).
:meth:`~wx.lib.graphics.GraphicsPath.AddCurveToPoint`                            Adds a cubic Bezier curve from the current point, using two
:meth:`~wx.lib.graphics.GraphicsPath.AddEllipse`                                 Appends an ellipse fitting into the given rectangle as a closed sub-path.
:meth:`~wx.lib.graphics.GraphicsPath.AddLineToPoint`                             Adds a straight line from the current point to (x,y)
:meth:`~wx.lib.graphics.GraphicsPath.AddPath`                                    Appends the given path to this path.
:meth:`~wx.lib.graphics.GraphicsPath.AddQuadCurveToPoint`                        Adds a quadratic Bezier curve from the current point, using a
:meth:`~wx.lib.graphics.GraphicsPath.AddRectangle`                               Adds a new rectangle as a closed sub-path.
:meth:`~wx.lib.graphics.GraphicsPath.AddRoundedRectangle`                        Adds a new rounded rectangle as a closed sub-path.
:meth:`~wx.lib.graphics.GraphicsPath.Clone`                                      Return a new path initialized with the current contents of this path.
:meth:`~wx.lib.graphics.GraphicsPath.CloseSubpath`                               Adds a line segment to the path from the current point to the
:meth:`~wx.lib.graphics.GraphicsPath.Contains`                                   Returns ``True`` if the point lies within the path.
:meth:`~wx.lib.graphics.GraphicsPath.GetBox`                                     Return the bounding box enclosing all points on this path.
:meth:`~wx.lib.graphics.GraphicsPath.GetCurrentPoint`                            Gets the current point of the path, which is conceptually the
:meth:`~wx.lib.graphics.GraphicsPath.GetNativePath`                              Returns the path as a ``cairo.Path`` object.
:meth:`~wx.lib.graphics.GraphicsPath.MoveToPoint`                                Begins a new sub-path at (x,y) by moving the "current point" there.
:meth:`~wx.lib.graphics.GraphicsPath.Transform`                                  Transforms each point in this path by the matrix
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: GraphicsPath(GraphicsObject)

   A GraphicsPath is a representation of a geometric path, essentially
   a collection of lines and curves.  Paths can be used to define
   areas to be stroked and filled on a GraphicsContext.

   .. method:: __init__(self)


   .. method:: AddArc(self, x, y, radius, startAngle, endAngle, clockwise=True)

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


   .. method:: AddArcToPoint(self, x1, y1 , x2, y2, radius )

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


   .. method:: AddCircle(self, x, y, radius)

      Appends a new closed sub-path as a circle around (x,y).


   .. method:: AddCurveToPoint(self, cx1, cy1, cx2, cy2, x, y)

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


   .. method:: AddEllipse(self, x, y, w, h)

      Appends an ellipse fitting into the given rectangle as a closed sub-path.


   .. method:: AddLineToPoint(self, x, y)

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


   .. method:: AddPath(self, path)

      Appends the given path to this path.


   .. method:: AddQuadCurveToPoint(self, cx, cy, x, y)

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


   .. method:: AddRectangle(self, x, y, w, h)

      Adds a new rectangle as a closed sub-path.


   .. method:: AddRoundedRectangle(self, x, y, w, h, radius)

      Adds a new rounded rectangle as a closed sub-path.


   .. method:: Clone(self)

      Return a new path initialized with the current contents of this path.


   .. method:: CloseSubpath(self)

      Adds a line segment to the path from the current point to the
      beginning of the current sub-path, and closes this sub-path.


   .. method:: Contains(self, x, y, fillStyle=wx.ODDEVEN_RULE)

      Returns ``True`` if the point lies within the path.


   .. method:: GetBox(self)

      Return the bounding box enclosing all points on this path.


   .. method:: GetCurrentPoint(self)

      Gets the current point of the path, which is conceptually the
      final point reached by the last path operation.


   .. method:: GetNativePath(self)

      Returns the path as a ``cairo.Path`` object.


   .. method:: MoveToPoint(self, x, y)

      Begins a new sub-path at (x,y) by moving the "current point" there.


   .. method:: Transform(self, matrix)

      Transforms each point in this path by the matrix


