Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | List of all members
CDPL.Vis.CairoBackend.CairoRenderer2D Class Reference

Implements the Renderer2D interface on top of the Cairo 2D Graphics Library. More...

+ Inheritance diagram for CDPL.Vis.CairoBackend.CairoRenderer2D:

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 ()
 Pushes the current pen, brush, font, transformation and clip path onto an internal state stack.
 
None restoreState ()
 Pops the topmost stack entry and restores the renderer to the saved state.
 
None setTransform (Math.Matrix3D xform)
 Replaces the current transformation matrix by xform. More...
 
None transform (Math.Matrix3D xform)
 Right-multiplies the current transformation matrix by xform. More...
 
None setPen (Vis.Pen pen)
 Sets the pen used for drawing outlines and lines. More...
 
None setBrush (Vis.Brush brush)
 Sets the brush used for filling shapes. More...
 
None setFont (Vis.Font font)
 Sets the font used for rendering text. More...
 
None drawRectangle (float x, float y, float width, float height)
 
None drawPolygon (Math.Vector2DArray points)
 Draws the (filled) polygon defined by the vertex sequence points. More...
 
None drawLine (float x1, float y1, float x2, float y2)
 Draws a single line segment from (x1, y1) to (x2, y2). More...
 
None drawPolyline (Math.Vector2DArray points)
 Draws the open polyline defined by the vertex sequence points. More...
 
None drawLineSegments (Math.Vector2DArray points)
 Draws the disjoint line segments defined by consecutive vertex pairs in points. More...
 
None drawPoint (float x, float y)
 Draws a single point at (x, y). More...
 
None drawEllipse (float x, float y, float width, float height)
 Draws an axis-aligned ellipse centered at (x, y) with the given width and height. More...
 
None drawText (float x, float y, str txt)
 Draws the text txt with its baseline starting at (x, y). More...
 
None drawPath (Vis.Path2D path)
 Draws (strokes and fills) the 2D path path. More...
 
None setClipPath (Vis.Path2D path)
 Sets the renderer's active clipping region to path. More...
 
None clearClipPath ()
 Disables any currently active clipping region.
 
- 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)
 Enables clipping and establishes a new clip region. More...
 

Additional Inherited Members

- Properties inherited from CDPL.Vis.Renderer2D
 objectID = property(getObjectID)
 

Detailed Description

Implements the Renderer2D interface on top of the Cairo 2D Graphics Library.

For more information about the Cairo 2D Graphics Library see [CAIRO].

Constructor & Destructor Documentation

◆ __init__()

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.

Parameters
cairo_ctxtThe Cairo drawing context.
Exceptions
Base.NullPointerExceptionif cairo_ctxt is None.

Member Function Documentation

◆ setTransform()

None CDPL.Vis.CairoBackend.CairoRenderer2D.setTransform ( Math.Matrix3D  xform)

Replaces the current transformation matrix by xform.

Parameters
xformThe new transformation matrix.

Reimplemented from CDPL.Vis.Renderer2D.

◆ transform()

None CDPL.Vis.CairoBackend.CairoRenderer2D.transform ( Math.Matrix3D  xform)

Right-multiplies the current transformation matrix by xform.

Parameters
xformThe transformation matrix to append.

Reimplemented from CDPL.Vis.Renderer2D.

◆ setPen()

None CDPL.Vis.CairoBackend.CairoRenderer2D.setPen ( Vis.Pen  pen)

Sets the pen used for drawing outlines and lines.

Parameters
penThe new pen.

◆ setBrush()

None CDPL.Vis.CairoBackend.CairoRenderer2D.setBrush ( Vis.Brush  brush)

Sets the brush used for filling shapes.

Parameters
brushThe new brush.

◆ setFont()

None CDPL.Vis.CairoBackend.CairoRenderer2D.setFont ( Vis.Font  font)

Sets the font used for rendering text.

Parameters
fontThe new font.

◆ drawRectangle()

None CDPL.Vis.CairoBackend.CairoRenderer2D.drawRectangle ( float  x,
float  y,
float  width,
float  height 
)
Parameters
x
y
width
height

Reimplemented from CDPL.Vis.Renderer2D.

◆ drawPolygon()

None CDPL.Vis.CairoBackend.CairoRenderer2D.drawPolygon ( Math.Vector2DArray  points)

Draws the (filled) polygon defined by the vertex sequence points.

Parameters
pointsThe polygon's vertex sequence.

Reimplemented from CDPL.Vis.Renderer2D.

◆ drawLine()

None CDPL.Vis.CairoBackend.CairoRenderer2D.drawLine ( float  x1,
float  y1,
float  x2,
float  y2 
)

Draws a single line segment from (x1, y1) to (x2, y2).

Parameters
x1The x-coordinate of the line's start point.
y1The y-coordinate of the line's start point.
x2The x-coordinate of the line's end point.
y2The y-coordinate of the line's end point.

Reimplemented from CDPL.Vis.Renderer2D.

◆ drawPolyline()

None CDPL.Vis.CairoBackend.CairoRenderer2D.drawPolyline ( Math.Vector2DArray  points)

Draws the open polyline defined by the vertex sequence points.

Parameters
pointsThe polyline's vertex sequence.

Reimplemented from CDPL.Vis.Renderer2D.

◆ drawLineSegments()

None CDPL.Vis.CairoBackend.CairoRenderer2D.drawLineSegments ( Math.Vector2DArray  points)

Draws the disjoint line segments defined by consecutive vertex pairs in points.

Parameters
pointsThe vertex sequence (size must be even).

Reimplemented from CDPL.Vis.Renderer2D.

◆ drawPoint()

None CDPL.Vis.CairoBackend.CairoRenderer2D.drawPoint ( float  x,
float  y 
)

Draws a single point at (x, y).

Parameters
xThe point's x-coordinate.
yThe point's y-coordinate.

Reimplemented from CDPL.Vis.Renderer2D.

◆ drawEllipse()

None CDPL.Vis.CairoBackend.CairoRenderer2D.drawEllipse ( float  x,
float  y,
float  width,
float  height 
)

Draws an axis-aligned ellipse centered at (x, y) with the given width and height.

Parameters
xThe x-coordinate of the ellipse's center.
yThe y-coordinate of the ellipse's center.
widthThe width of the ellipse.
heightThe height of the ellipse.

Reimplemented from CDPL.Vis.Renderer2D.

◆ drawText()

None CDPL.Vis.CairoBackend.CairoRenderer2D.drawText ( float  x,
float  y,
str  txt 
)

Draws the text txt with its baseline starting at (x, y).

Parameters
xThe baseline x-coordinate.
yThe baseline y-coordinate.
txtThe text to draw.

Reimplemented from CDPL.Vis.Renderer2D.

◆ drawPath()

None CDPL.Vis.CairoBackend.CairoRenderer2D.drawPath ( Vis.Path2D  path)

Draws (strokes and fills) the 2D path path.

Parameters
pathThe path to draw.

◆ setClipPath()

None CDPL.Vis.CairoBackend.CairoRenderer2D.setClipPath ( Vis.Path2D  path)

Sets the renderer's active clipping region to path.

Parameters
pathThe path defining the new clipping region.