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

A graphics primitive representing a polygon. More...

+ Inheritance diagram for CDPL.Vis.PolygonPrimitive2D:

Public Member Functions

None __init__ ()
 Constructs an undefined polygon primitive.
 
None __init__ (PolygonPrimitive2D prim)
 Initializes a copy of the PolygonPrimitive2D instance prim. More...
 
PolygonPrimitive2D assign (PolygonPrimitive2D prim)
 Replaces the current state of self with a copy of the state of the PolygonPrimitive2D instance prim. More...
 
None setPen (Pen pen)
 Sets the pen defining the color, width, line style, cap style and join style of the polygon outline. More...
 
Pen getPen ()
 Returns the pen defining the color, width, line style, cap style and join style of the polygon outline. More...
 
None setBrush (Brush brush)
 Sets the brush defining the fill color and fill pattern. More...
 
Brush getBrush ()
 Returns the brush defining the fill color and fill pattern. More...
 
- Public Member Functions inherited from CDPL.Vis.PointArray2D
None __init__ (PointArray2D array)
 Initializes a copy of the PointArray2D instance array. More...
 
None translate (Math.Vector2D vec)
 Translates all points by vec. More...
 
None getBounds (Rectangle2D bbox)
 
- Public Member Functions inherited from CDPL.Math.Vector2DArray
None __init__ (Vector2DArray array)
 Initializes a copy of the Vector2DArray instance array. More...
 
None __init__ (object a)
 Initializes the Vector2DArray instance. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
int getSize ()
 Returns the number of elements stored in the array. More...
 
bool isEmpty ()
 Tells whether the array is empty (getSize() == 0). More...
 
None resize (int num_elem, Vector2D value)
 Inserts or erases elements at the end so that the size becomes num_elem. More...
 
None reserve (int num_elem)
 Preallocates memory for (at least) num_elem elements. More...
 
int getCapacity ()
 Returns the number of elements for which memory has been allocated. More...
 
None clear ()
 Erases all elements.
 
Vector2DArray assign (Vector2DArray array)
 Replaces the current state of self with a copy of the state of the Vector2DArray instance array. More...
 
None assign (int num_elem, Vector2D value)
 This function fills the array with num_elem copies of the given value. More...
 
None assign (object a)
 Replaces the current state of self with a copy of the state of the object instance a. More...
 
None addElement (Vector2D value)
 Inserts a new element at the end of the array. More...
 
None addElements (Vector2DArray values)
 
None insertElement (int idx, Vector2D value)
 Inserts a new element before the location specified by the index idx. More...
 
None insertElements (int idx, int num_elem, Vector2D value)
 Inserts num_elem copies of value before the location specified by the index idx. More...
 
None insertElements (int index, Vector2DArray values)
 
None popLastElement ()
 Removes the last element of the array. More...
 
None removeElement (int idx)
 Removes the element at the position specified by the index idx. More...
 
None removeElements (int begin_idx, int end_idx)
 
Vector2D getFirstElement ()
 Returns a reference to the first element of the array. More...
 
Vector2D getLastElement ()
 Returns a reference to the last element of the array. More...
 
Vector2D getElement (int idx)
 Returns a reference to the element at index idx. More...
 
None setElement (int idx, Vector2D value)
 Assigns a new value to the element specified by the index idx. More...
 
object toArray (bool as_vec)
 
None __delitem__ (int idx)
 
Vector2D __getitem__ (int idx)
 
int __len__ ()
 
None __setitem__ (int index, Vector2D value)
 
bool __eq__ (object array)
 Returns the result of the comparison operation self == array. More...
 
bool __ne__ (object array)
 Returns the result of the comparison operation self != array. More...
 
- Public Member Functions inherited from CDPL.Vis.GraphicsPrimitive2D
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None render (Renderer2D renderer)
 Visualizes the graphics primitive by means of the Renderer2D instance renderer. More...
 
None getBounds (Rectangle2D bounds, FontMetrics font_metrics=0)
 Calculates the bounds of the graphics primitive. More...
 
GraphicsPrimitive2D clone ()
 Creates a dynamically allocated copy of the graphics primitive. More...
 

Properties

 pen = property(getPen, setPen)
 
 brush = property(getBrush, setBrush)
 
- Properties inherited from CDPL.Math.Vector2DArray
 objectID = property(getObjectID)
 
 size = property(getSize)
 
- Properties inherited from CDPL.Vis.GraphicsPrimitive2D
 objectID = property(getObjectID)
 

Detailed Description

A graphics primitive representing a polygon.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Vis.PolygonPrimitive2D.__init__ ( PolygonPrimitive2D  prim)

Initializes a copy of the PolygonPrimitive2D instance prim.

Parameters
primThe PolygonPrimitive2D instance to copy.

Member Function Documentation

◆ assign()

PolygonPrimitive2D CDPL.Vis.PolygonPrimitive2D.assign ( PolygonPrimitive2D  prim)

Replaces the current state of self with a copy of the state of the PolygonPrimitive2D instance prim.

Parameters
primThe PolygonPrimitive2D instance to copy.
Returns
self

◆ setPen()

None CDPL.Vis.PolygonPrimitive2D.setPen ( Pen  pen)

Sets the pen defining the color, width, line style, cap style and join style of the polygon outline.

Parameters
penThe pen defining the color, width, line style, cap style and join style of the polygon outline.

◆ getPen()

Pen CDPL.Vis.PolygonPrimitive2D.getPen ( )

Returns the pen defining the color, width, line style, cap style and join style of the polygon outline.

Returns
The pen defining the color, width, line style, cap style and join style of the polygon outline.

◆ setBrush()

None CDPL.Vis.PolygonPrimitive2D.setBrush ( Brush  brush)

Sets the brush defining the fill color and fill pattern.

Parameters
brushThe brush defining the fill color and fill pattern.

◆ getBrush()

Brush CDPL.Vis.PolygonPrimitive2D.getBrush ( )

Returns the brush defining the fill color and fill pattern.

Returns
The brush defining the fill color and fill pattern.