Chemical Data Processing Library Python API - Version 1.2.0
Classes | Public Member Functions | Properties | List of all members
CDPL.Vis.Brush Class Reference

Specifies the fill pattern and fill color of shapes. More...

+ Inheritance diagram for CDPL.Vis.Brush:

Classes

class  Style
 Defines constants for supported fill pattern styles. More...
 

Public Member Functions

None __init__ ()
 Constructs a brush with fill pattern style Brush.NO_PATTERN and color Color.BLACK.
 
None __init__ (Brush brush)
 Initializes a copy of the Brush instance brush. More...
 
None __init__ (Style style)
 Constructs a brush with the specified fill pattern style and the color Color.BLACK. More...
 
None __init__ (Color color, Style style=CDPL.Vis.Style.SOLID_PATTERN)
 Constructs a brush with the specified fill pattern style and color. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
Brush assign (Brush brush)
 Replaces the current state of self with a copy of the state of the Brush instance brush. More...
 
Color getColor ()
 Returns the fill pattern color. More...
 
None setColor (Color color)
 Sets the fill pattern color. More...
 
Style getStyle ()
 Returns the fill pattern style. More...
 
None setStyle (Style style)
 Sets the fill pattern style. More...
 
str __str__ ()
 Returns a string representation of the Brush instance. More...
 
bool __eq__ (Brush brush)
 Equality comparison operator. More...
 
bool __ne__ (Brush brush)
 Inequality comparison operator. More...
 

Properties

 objectID = property(getObjectID)
 
 color = property(getColor, setColor)
 
 style = property(getStyle, setStyle)
 

Detailed Description

Specifies the fill pattern and fill color of shapes.

A brush has a style and a color attribute. The style defines the look of the fill pattern and the color attribute specifies the color of the specified fill pattern. The style of a default constructed Brush object is Brush.NO_PATTERN, which tells the renderer not to fill drawn shapes.

Constructor & Destructor Documentation

◆ __init__() [1/3]

None CDPL.Vis.Brush.__init__ ( Brush  brush)

Initializes a copy of the Brush instance brush.

Parameters
brushThe Brush instance to copy.

◆ __init__() [2/3]

None CDPL.Vis.Brush.__init__ ( Style  style)

Constructs a brush with the specified fill pattern style and the color Color.BLACK.

Parameters
styleThe style of the fill pattern.

◆ __init__() [3/3]

None CDPL.Vis.Brush.__init__ ( Color  color,
Style   style = CDPL.Vis.Style.SOLID_PATTERN 
)

Constructs a brush with the specified fill pattern style and color.

Parameters
colorThe fill pattern color.
styleThe fill pattern style .

Member Function Documentation

◆ getObjectID()

int CDPL.Vis.Brush.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python Brush 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 Brush 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().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign()

Brush CDPL.Vis.Brush.assign ( Brush  brush)

Replaces the current state of self with a copy of the state of the Brush instance brush.

Parameters
brushThe Brush instance to copy.
Returns
self

◆ getColor()

Color CDPL.Vis.Brush.getColor ( )

Returns the fill pattern color.

Returns
The fill pattern color.

◆ setColor()

None CDPL.Vis.Brush.setColor ( Color  color)

Sets the fill pattern color.

Parameters
colorThe fill pattern color.

◆ getStyle()

Style CDPL.Vis.Brush.getStyle ( )

Returns the fill pattern style.

Returns
The fill pattern style.

◆ setStyle()

None CDPL.Vis.Brush.setStyle ( Style  style)

Sets the fill pattern style.

Parameters
styleThe the fill pattern style.

◆ __str__()

str CDPL.Vis.Brush.__str__ ( )

Returns a string representation of the Brush instance.

Returns
The generated string representation.

◆ __eq__()

bool CDPL.Vis.Brush.__eq__ ( Brush  brush)

Equality comparison operator.

Parameters
brushThe other Brush object to be compared with.
Returns
True if the style and color attributes compare equal, and False otherwise.

◆ __ne__()

bool CDPL.Vis.Brush.__ne__ ( Brush  brush)

Inequality comparison operator.

The result is equivalent to !(self == brush).

Parameters
brushThe other Brush object to be compared with.
Returns
True if either the style or the color attributes compare non-equal, and False otherwise.