Chemical Data Processing Library Python API - Version 1.1.1
|
Implements the Renderer2D interface on top of the Cairo 2D Graphics Library. More...
Public Member Functions | |
None | __init__ (cairo.Context cairo_ctxt) |
Constructs a renderer object that operates on the Cairo cdrawing ontext specified by cairo_ctxt. More... | |
None | saveState () |
Saves the current renderer state. More... | |
None | restoreState () |
Restores the last renderer state saved by a call to saveState(). More... | |
None | setTransform (Math.Matrix3D xform) |
Sets the applied affine transformation matrix to xform. More... | |
None | transform (Math.Matrix3D xform) |
Multiplies the current affine transformation matrix by xform. More... | |
None | setPen (Vis.Pen pen) |
Sets the pen to be used in subsequent drawing operations. More... | |
None | setBrush (Vis.Brush brush) |
Sets the brush to be used in subsequent drawing operations. More... | |
None | setFont (Vis.Font font) |
Sets the font to be used in subsequent text drawing operations. More... | |
None | drawRectangle (float x, float y, float width, float height) |
Draws an axis aligned rectangle of the specified width and height whose upper-left corner is located at (x, y). More... | |
None | drawPolygon (Math.Vector2DArray points) |
Draws the polygon defined by points. More... | |
None | drawLine (float x1, float y1, float x2, float y2) |
Draws a line segment from (x1, y1) to (x2, y2). More... | |
None | drawPolyline (Math.Vector2DArray points) |
Draws the polyline defined by points. More... | |
None | drawLineSegments (Math.Vector2DArray points) |
Draws the sequence of disjoint line segments defined by points. More... | |
None | drawPoint (float x, float y) |
Draws a point at the position (x, y). More... | |
None | drawEllipse (float x, float y, float width, float height) |
Draws an ellipse with the given width and height around the center position (x, y). More... | |
None | drawText (float x, float y, str txt) |
Draws the specified text at the position (x, y). More... | |
None | drawPath (Vis.Path2D path) |
Draws the given path. More... | |
None | setClipPath (Vis.Path2D path) |
None | clearClipPath () |
Disables clipping. | |
Public Member Functions inherited from CDPL.Vis.Renderer2D | |
None | __init__ () |
Initializes the Renderer2D instance. | |
int | getObjectID () |
Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
None | setPen (Pen pen) |
Sets the pen to be used in subsequent drawing operations. More... | |
None | setBrush (Brush brush) |
Sets the brush to be used in subsequent drawing operations. More... | |
None | setFont (Font font) |
Sets the font to be used in subsequent text drawing operations. More... | |
None | drawPath (Path2D path) |
Draws the given path. More... | |
None | setClipPath (Path2D path) |
Additional Inherited Members | |
Properties inherited from CDPL.Vis.Renderer2D | |
objectID = property(getObjectID) | |
Implements the Renderer2D interface on top of the Cairo 2D Graphics Library.
For more information about the Cairo 2D Graphics Library see [CAIRO].
None CDPL.Vis.CairoBackend.CairoRenderer2D.__init__ | ( | cairo.Context | cairo_ctxt | ) |
Constructs a renderer object that operates on the Cairo cdrawing ontext specified by cairo_ctxt.
cairo_ctxt | The Cairo drawing context. |
Base.NullPointerException | if cairo_ctxt is None. |
None CDPL.Vis.CairoBackend.CairoRenderer2D.saveState | ( | ) |
Saves the current renderer state.
The method saves the current pen, brush, font and transformation matrix on an internal stack. The last saved state can be restored later on by a call to restoreState().
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.restoreState | ( | ) |
Restores the last renderer state saved by a call to saveState().
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.setTransform | ( | Math.Matrix3D | xform | ) |
Sets the applied affine transformation matrix to xform.
xform | The new affine transformation matrix. |
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.transform | ( | Math.Matrix3D | xform | ) |
Multiplies the current affine transformation matrix by xform.
xform | The matrix by which the current affine transformation matrix is multiplied. |
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.setPen | ( | Vis.Pen | pen | ) |
Sets the pen to be used in subsequent drawing operations.
pen | The new pen for subsequent drawing operations. |
None CDPL.Vis.CairoBackend.CairoRenderer2D.setBrush | ( | Vis.Brush | brush | ) |
Sets the brush to be used in subsequent drawing operations.
brush | The new brush for subsequent drawing operations. |
None CDPL.Vis.CairoBackend.CairoRenderer2D.setFont | ( | Vis.Font | font | ) |
Sets the font to be used in subsequent text drawing operations.
font | The new font used in subsequent text drawing operations. |
None CDPL.Vis.CairoBackend.CairoRenderer2D.drawRectangle | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
Draws an axis aligned rectangle of the specified width and height whose upper-left corner is located at (x, y).
The rectangle is filled as specified by the current brush and the outline will be drawn as specified by the current pen.
x | The x-coordinate of the upper-left corner. |
y | The y-coordinate of the upper-left corner. |
width | The width of the rectangle. |
height | The height of the rectangle. |
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.drawPolygon | ( | Math.Vector2DArray | points | ) |
Draws the polygon defined by points.
For a given set of \( N \) corner points \( p_i \) with \( i = 1, 2, \ldots, N \), the polygon's \( N \) edges are given by \( (p_1, p_2), (p_2, p_3), \ldots, (p_N, p_0) \). The polygon is filled as specified by the current brush and the outline will be drawn as specified by the current pen.
points | An array of points specifying the corners of the polygon. |
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.drawLine | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Draws a line segment from (x1, y1) to (x2, y2).
The line style, color, cap style and line width is specified by the current pen.
x1 | The x-coordinate of the starting point. |
y1 | The y-coordinate of the starting point. |
x2 | The x-coordinate of the end point. |
y2 | The y-coordinate of the end point. |
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.drawPolyline | ( | Math.Vector2DArray | points | ) |
Draws the polyline defined by points.
For a given set of \( N \) points \( p_i \) with \( i = 1, 2, \ldots, N \), \( N - 1 \) connected line segments \( (p_1, p_2), (p_2, p_3), \ldots, (p_{N - 1}, p_N) \) will be drawn. The line style, color, cap style, join style and line width is specified by the current pen.
points | An array of points defining the polyline. |
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.drawLineSegments | ( | Math.Vector2DArray | points | ) |
Draws the sequence of disjoint line segments defined by points.
For a given set of \( 2N \) points \( p_i \) with \( i = 1, 2, \ldots, 2N \), \( N \) disjoint line segments \( (p_1, p_2), (p_3, p_4), \ldots, (p_{2N - 1}, p_2N) \) will be drawn. The line style, color, cap style and line width is specified by the current pen.
points | An array of points defining the line segments. |
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.drawPoint | ( | float | x, |
float | y | ||
) |
Draws a point at the position (x, y).
The diameter and color of the point is specified by the current pen.
x | The x-coordinate of the point. |
y | The y-coordinate of the point. |
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.drawEllipse | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
Draws an ellipse with the given width and height around the center position (x, y).
The ellipse is filled as specified by the current brush and the outline will be drawn as specified by the current pen.
x | The x-coordinate of the center point. |
y | The y-coordinate of the center point. |
width | The width of the ellipse. |
height | The height of the ellipse. |
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.drawText | ( | float | x, |
float | y, | ||
str | txt | ||
) |
Draws the specified text at the position (x, y).
The text color is specified by the current pen. The font has to be specified by setFont().
x | The x-position of the drawn text. |
y | The y-position of the baseline. |
txt | The text to draw. |
Reimplemented from CDPL.Vis.Renderer2D.
None CDPL.Vis.CairoBackend.CairoRenderer2D.drawPath | ( | Vis.Path2D | path | ) |
Draws the given path.
The path is filled as specified by the current brush and the outline will be drawn as specified by the current pen.
path | The path to draw. |
None CDPL.Vis.CairoBackend.CairoRenderer2D.setClipPath | ( | Vis.Path2D | path | ) |
path |