class ShapeDrawer(object):
Known subclasses: igraph.drawing.shapes.CircleDrawer
, igraph.drawing.shapes.DiamondDrawer
, igraph.drawing.shapes.DownTriangleDrawer
, igraph.drawing.shapes.NullDrawer
, igraph.drawing.shapes.RectangleDrawer
, igraph.drawing.shapes.UpTriangleDrawer
Static class, the ancestor of all vertex shape drawer classes.
Custom shapes must implement at least the draw_path method of the class. The method must not stroke or fill, it should just set up the current Cairo path appropriately.
Static Method | draw |
Draws the path of the shape on the given Cairo context, without stroking or filling it. |
Static Method | intersection |
Determines where the shape centered at (center_x, center_y) intersects with a line drawn from (source_x, source_y) to (center_x, center_y). |
igraph.drawing.shapes.CircleDrawer
, igraph.drawing.shapes.DiamondDrawer
, igraph.drawing.shapes.DownTriangleDrawer
, igraph.drawing.shapes.NullDrawer
, igraph.drawing.shapes.RectangleDrawer
, igraph.drawing.shapes.UpTriangleDrawer
Draws the path of the shape on the given Cairo context, without stroking or filling it.
This method must be overridden in derived classes implementing custom shapes and declared as a static method using staticmethod(...).
Parameters | |
ctx | the context to draw on |
center | the X coordinate of the center of the object |
center | the Y coordinate of the center of the object |
width | the width of the object |
height | the height of the object. If None, equals to the width. |
igraph.drawing.shapes.CircleDrawer
, igraph.drawing.shapes.DiamondDrawer
, igraph.drawing.shapes.DownTriangleDrawer
, igraph.drawing.shapes.RectangleDrawer
, igraph.drawing.shapes.UpTriangleDrawer
Determines where the shape centered at (center_x, center_y) intersects with a line drawn from (source_x, source_y) to (center_x, center_y).
Can be overridden in derived classes. Must always be defined as a static method using staticmethod(...)
Parameters | |
center | Undocumented |
center | Undocumented |
source | Undocumented |
source | Undocumented |
width | the width of the shape |
height | the height of the shape. If None, defaults to the width |
Returns | |
the intersection point (the closest to (source_x, source_y) if there are more than one) or (center_x, center_y) if there is no intersection |