Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | List of all members
CDPL::Vis::PolygonPrimitive2D Class Reference

2D graphics primitive representing a polygon. More...

#include <PolygonPrimitive2D.hpp>

+ Inheritance diagram for CDPL::Vis::PolygonPrimitive2D:

Public Types

typedef std::shared_ptr< PolygonPrimitive2DSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated PolygonPrimitive2D instances. More...
 
- Public Types inherited from CDPL::Vis::PointArray2D
typedef std::shared_ptr< PointArray2DSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated PointArray2D instances. More...
 
- Public Types inherited from CDPL::Vis::GraphicsPrimitive2D
typedef std::shared_ptr< GraphicsPrimitive2DSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated GraphicsPrimitive2D instances. More...
 

Public Member Functions

 PolygonPrimitive2D ()
 Constructs an undefined polygon primitive. More...
 
void render (Renderer2D &renderer) const
 Renders the polygon via renderer using the configured pen and brush. More...
 
void setPen (const Pen &pen)
 Sets the pen defining the color, width, line style, cap style and join style of the polygon outline. More...
 
const PengetPen () const
 Returns the pen defining the color, width, line style, cap style and join style of the polygon outline. More...
 
void setBrush (const Brush &brush)
 Sets the brush defining the fill color and fill pattern. More...
 
const BrushgetBrush () const
 Returns the brush defining the fill color and fill pattern. More...
 
GraphicsPrimitive2D::SharedPointer clone () const
 Creates a dynamically allocated copy of this primitive. More...
 
void getBounds (Rectangle2D &bounds, FontMetrics *font_metrics=0) const
 Computes the axis-aligned bounding rectangle of the polygon. More...
 
- Public Member Functions inherited from CDPL::Vis::PointArray2D
void translate (const Math::Vector2D &vec)
 Translates all points by vec. More...
 
void getBounds (Rectangle2D &bounds) const
 Computes the axis-aligned bounding rectangle that contains all stored points. More...
 
- Public Member Functions inherited from CDPL::Vis::GraphicsPrimitive2D
virtual ~GraphicsPrimitive2D ()
 Virtual destructor. More...
 

Detailed Description

2D graphics primitive representing a polygon.

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated PolygonPrimitive2D instances.

Constructor & Destructor Documentation

◆ PolygonPrimitive2D()

CDPL::Vis::PolygonPrimitive2D::PolygonPrimitive2D ( )
inline

Constructs an undefined polygon primitive.

Member Function Documentation

◆ render()

void CDPL::Vis::PolygonPrimitive2D::render ( Renderer2D renderer) const
virtual

Renders the polygon via renderer using the configured pen and brush.

Parameters
rendererThe renderer that performs the drawing operations.

Implements CDPL::Vis::GraphicsPrimitive2D.

◆ setPen()

void CDPL::Vis::PolygonPrimitive2D::setPen ( const 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()

const Pen& CDPL::Vis::PolygonPrimitive2D::getPen ( ) const

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()

void CDPL::Vis::PolygonPrimitive2D::setBrush ( const Brush brush)

Sets the brush defining the fill color and fill pattern.

Parameters
brushThe brush defining the fill color and fill pattern.

◆ getBrush()

const Brush& CDPL::Vis::PolygonPrimitive2D::getBrush ( ) const

Returns the brush defining the fill color and fill pattern.

Returns
The brush defining the fill color and fill pattern.

◆ clone()

GraphicsPrimitive2D::SharedPointer CDPL::Vis::PolygonPrimitive2D::clone ( ) const
virtual

Creates a dynamically allocated copy of this primitive.

Returns
A smart pointer to the copy.

Implements CDPL::Vis::GraphicsPrimitive2D.

◆ getBounds()

void CDPL::Vis::PolygonPrimitive2D::getBounds ( Rectangle2D bounds,
FontMetrics font_metrics = 0 
) const
virtual

Computes the axis-aligned bounding rectangle of the polygon.

Parameters
boundsThe Rectangle2D instance storing the result.
font_metricsUnused for polygons; included to satisfy the GraphicsPrimitive2D interface.

Implements CDPL::Vis::GraphicsPrimitive2D.


The documentation for this class was generated from the following file: