Chemical Data Processing Library Python API - Version 1.2.0
|
Specifies how to draw lines and outlines of shapes. More...
Classes | |
class | CapStyle |
Defines constants for supported line cap styles. More... | |
class | JoinStyle |
Defines constants for supported line join styles. More... | |
class | LineStyle |
Defines constants for supported line styles. More... | |
Public Member Functions | |
None | __init__ () |
Constructs a pen with line style Pen.SOLID_LINE, line width 1.0, cap style Pen.ROUND_CAP, join style Pen.ROUND_JOIN and color Color.BLACK. | |
None | __init__ (Pen pen) |
Initializes a copy of the Pen instance pen. More... | |
None | __init__ (LineStyle line_style) |
Constructs a pen with the specified line style, line width 1.0, cap style Pen.ROUND_CAP, join style Pen.ROUND_JOIN and color Color.BLACK. More... | |
None | __init__ (Color color, float width=1.0, LineStyle line_style=CDPL.Vis.LineStyle.SOLID_LINE, CapStyle cap_style=CDPL.Vis.CapStyle.ROUND_CAP, JoinStyle join_style=CDPL.Vis.JoinStyle.ROUND_JOIN) |
Constructs a pen with the specified color, line width, line style, cap style and join style. More... | |
int | getObjectID () |
Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
Pen | assign (Pen pen) |
Replaces the current state of self with a copy of the state of the Pen instance pen. More... | |
CapStyle | getCapStyle () |
Returns the line cap style. More... | |
None | setCapStyle (CapStyle cap_style) |
Sets the line cap style to cap_style. More... | |
Color | getColor () |
Returns the color of the pen. More... | |
None | setColor (Color color) |
Sets the pen's color to the specified value. More... | |
JoinStyle | getJoinStyle () |
Returns the line join style. More... | |
None | setJoinStyle (JoinStyle join_style) |
Sets the line join style to join_style. More... | |
LineStyle | getLineStyle () |
Returns the line style. More... | |
None | setLineStyle (LineStyle line_style) |
Sets the line style to line_style. More... | |
float | getWidth () |
Returns the line width. More... | |
None | setWidth (float width) |
Sets the line width to the specified value. More... | |
str | __str__ () |
Returns a string representation of the Pen instance. More... | |
bool | __eq__ (Pen pen) |
Equality comparison operator. More... | |
bool | __ne__ (Pen pen) |
Inequality comparison operator. More... | |
Properties | |
objectID = property(getObjectID) | |
capStyle = property(getCapStyle, setCapStyle) | |
lineStyle = property(getLineStyle, setLineStyle) | |
joinStyle = property(getJoinStyle, setJoinStyle) | |
color = property(getColor, setColor) | |
width = property(getWidth, setWidth) | |
Specifies how to draw lines and outlines of shapes.
A pen has a line style, width, color, cap style and join style attribute. The line style specifies how a line will look like (solid, dashed, ...). The default line style is Pen.SOLID_LINE. Setting the line style to Pen.NO_LINE tells the renderer not to draw lines or outlines. The pen color defines the color of lines and text. The default line color is Color.BLACK. The cap style specifies how the end points of lines are drawn and the join style defines how the joins between two or more connected have to be drawn. The default cap style is Pen.ROUND_CAP and the default join style is Pen.ROUND_JOIN.
None CDPL.Vis.Pen.__init__ | ( | Pen | pen | ) |
Initializes a copy of the Pen instance pen.
pen | The Pen instance to copy. |
None CDPL.Vis.Pen.__init__ | ( | LineStyle | line_style | ) |
Constructs a pen with the specified line style, line width 1.0, cap style Pen.ROUND_CAP, join style Pen.ROUND_JOIN and color Color.BLACK.
line_style | The line style. |
None CDPL.Vis.Pen.__init__ | ( | Color | color, |
float | width = 1.0 , |
||
LineStyle | line_style = CDPL.Vis.LineStyle.SOLID_LINE , |
||
CapStyle | cap_style = CDPL.Vis.CapStyle.ROUND_CAP , |
||
JoinStyle | join_style = CDPL.Vis.JoinStyle.ROUND_JOIN |
||
) |
Constructs a pen with the specified color, line width, line style, cap style and join style.
If width is negative, the line width is set to zero.
color | The pen color. |
width | The line width. |
line_style | The line style. |
cap_style | The line cap style. |
join_style | The line join style. |
int CDPL.Vis.Pen.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python Pen instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b
thus cannot tell reliably whether the two Pen instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID()
.
Replaces the current state of self with a copy of the state of the Pen instance pen.
pen | The Pen instance to copy. |
CapStyle CDPL.Vis.Pen.getCapStyle | ( | ) |
Returns the line cap style.
None CDPL.Vis.Pen.setCapStyle | ( | CapStyle | cap_style | ) |
Sets the line cap style to cap_style.
cap_style | The line cap style. |
Color CDPL.Vis.Pen.getColor | ( | ) |
Returns the color of the pen.
None CDPL.Vis.Pen.setColor | ( | Color | color | ) |
Sets the pen's color to the specified value.
color | The color of the pen. |
JoinStyle CDPL.Vis.Pen.getJoinStyle | ( | ) |
Returns the line join style.
None CDPL.Vis.Pen.setJoinStyle | ( | JoinStyle | join_style | ) |
Sets the line join style to join_style.
join_style | The line join style. |
LineStyle CDPL.Vis.Pen.getLineStyle | ( | ) |
Returns the line style.
None CDPL.Vis.Pen.setLineStyle | ( | LineStyle | line_style | ) |
Sets the line style to line_style.
line_style | The line style. |
float CDPL.Vis.Pen.getWidth | ( | ) |
Returns the line width.
None CDPL.Vis.Pen.setWidth | ( | float | width | ) |
Sets the line width to the specified value.
If width is negative, the line width is set to zero.
width | The line width. |
str CDPL.Vis.Pen.__str__ | ( | ) |
Returns a string representation of the Pen instance.
bool CDPL.Vis.Pen.__eq__ | ( | Pen | pen | ) |
Equality comparison operator.
pen | The other Pen object to be compared with. |
True
if all pen attributes compare equal, and False
otherwise.