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

2D graphics primitive representing an ellipse. More...

#include <EllipsePrimitive2D.hpp>

+ Inheritance diagram for CDPL::Vis::EllipsePrimitive2D:

Public Types

typedef std::shared_ptr< EllipsePrimitive2DSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated EllipsePrimitive2D 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

 EllipsePrimitive2D ()
 Constructs an undefined ellipse primitive. More...
 
 EllipsePrimitive2D (const Math::Vector2D &pos, double width, double height)
 Constructs an ellipse primitive centered at pos with the given diameters. More...
 
void render (Renderer2D &renderer) const
 Renders the ellipse 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 ellipse outline. More...
 
const PengetPen () const
 Returns the pen defining the color, width, line style, cap style and join style of the ellipse 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...
 
void setPosition (const Math::Vector2D &pos)
 Sets the position of the ellipse center. More...
 
const Math::Vector2DgetPosition () const
 Returns the position of the ellipse center. More...
 
void setWidth (double width)
 Sets the diameter of the ellipse in x-direction. More...
 
double getWidth () const
 Returns the diameter of the ellipse in x-direction. More...
 
void setHeight (double height)
 Sets the diameter of the ellipse in y-direction. More...
 
double getHeight () const
 Returns the diameter of the ellipse in y-direction. 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 ellipse. More...
 
- Public Member Functions inherited from CDPL::Vis::GraphicsPrimitive2D
virtual ~GraphicsPrimitive2D ()
 Virtual destructor. More...
 

Detailed Description

2D graphics primitive representing an ellipse.

Member Typedef Documentation

◆ SharedPointer

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

Constructor & Destructor Documentation

◆ EllipsePrimitive2D() [1/2]

CDPL::Vis::EllipsePrimitive2D::EllipsePrimitive2D ( )
inline

Constructs an undefined ellipse primitive.

◆ EllipsePrimitive2D() [2/2]

CDPL::Vis::EllipsePrimitive2D::EllipsePrimitive2D ( const Math::Vector2D pos,
double  width,
double  height 
)
inline

Constructs an ellipse primitive centered at pos with the given diameters.

Parameters
posThe center position of the ellipse.
widthThe diameter of the ellipse in x-direction.
heightThe diameter of the ellipse in y-direction.

Member Function Documentation

◆ render()

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

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

Parameters
rendererThe renderer that performs the drawing operations.

Implements CDPL::Vis::GraphicsPrimitive2D.

◆ setPen()

void CDPL::Vis::EllipsePrimitive2D::setPen ( const Pen pen)

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

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

◆ getPen()

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

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

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

◆ setBrush()

void CDPL::Vis::EllipsePrimitive2D::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::EllipsePrimitive2D::getBrush ( ) const

Returns the brush defining the fill color and fill pattern.

Returns
The brush defining the fill color and fill pattern.

◆ setPosition()

void CDPL::Vis::EllipsePrimitive2D::setPosition ( const Math::Vector2D pos)

Sets the position of the ellipse center.

Parameters
posThe center position of the ellipse.

◆ getPosition()

const Math::Vector2D& CDPL::Vis::EllipsePrimitive2D::getPosition ( ) const

Returns the position of the ellipse center.

Returns
The center position of the ellipse.

◆ setWidth()

void CDPL::Vis::EllipsePrimitive2D::setWidth ( double  width)

Sets the diameter of the ellipse in x-direction.

Parameters
widthThe width of the ellipse.

◆ getWidth()

double CDPL::Vis::EllipsePrimitive2D::getWidth ( ) const

Returns the diameter of the ellipse in x-direction.

Returns
The width of the ellipse.

◆ setHeight()

void CDPL::Vis::EllipsePrimitive2D::setHeight ( double  height)

Sets the diameter of the ellipse in y-direction.

Parameters
heightThe height of the ellipse.

◆ getHeight()

double CDPL::Vis::EllipsePrimitive2D::getHeight ( ) const

Returns the diameter of the ellipse in y-direction.

Returns
The height of the ellipse.

◆ clone()

GraphicsPrimitive2D::SharedPointer CDPL::Vis::EllipsePrimitive2D::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::EllipsePrimitive2D::getBounds ( Rectangle2D bounds,
FontMetrics font_metrics = 0 
) const
virtual

Computes the axis-aligned bounding rectangle of the ellipse.

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

Implements CDPL::Vis::GraphicsPrimitive2D.


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