python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Package drawing :: Module shapes :: Class PolygonDrawer
[hide private]

Class PolygonDrawer

source code

                 object --+        
                          |        
 baseclasses.AbstractDrawer --+    
                              |    
baseclasses.AbstractCairoDrawer --+
                                  |
                                 PolygonDrawer

Class that is used to draw polygons.

The corner points of the polygon can be set by the points property of the drawer, or passed at construction time. Most drawing methods in this class also have an extra points argument that can be used to override the set of points in the points property.

Instance Methods [hide private]
 
__init__(self, context, bbox=(1, 1), points=[])
Constructs a new polygon drawer that draws on the given Cairo context.
source code
 
draw_path(self, points=None, corner_radius=0)
Sets up a Cairo path for the outline of a polygon on the given Cairo context.
source code
 
draw(self, points=None)
Draws the polygon using the current stroke of the Cairo context.
source code

Inherited from baseclasses.AbstractCairoDrawer (private): _mark_point

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from baseclasses.AbstractCairoDrawer: bbox

Inherited from object: __class__

Method Details [hide private]

__init__(self, context, bbox=(1, 1), points=[])
(Constructor)

source code 

Constructs a new polygon drawer that draws on the given Cairo context.

Parameters:
  • context - the Cairo context to draw on
  • bbox - ignored, leave it at its default value
  • points - the list of corner points
Overrides: object.__init__

draw_path(self, points=None, corner_radius=0)

source code 

Sets up a Cairo path for the outline of a polygon on the given Cairo context.

Parameters:
  • points - the coordinates of the corners of the polygon, in clockwise or counter-clockwise order, or None if we are about to use the points property of the class.
  • corner_radius - if zero, an ordinary polygon will be drawn. If positive, the corners of the polygon will be rounded with the given radius.

draw(self, points=None)

source code 

Draws the polygon using the current stroke of the Cairo context.

Parameters:
  • points - the coordinates of the corners of the polygon, in clockwise or counter-clockwise order, or None if we are about to use the points property of the class.
Overrides: baseclasses.AbstractDrawer.draw

   Home       Trees       Indices       Help