Chemical Data Processing Library C++ API - Version 1.2.0
Public Types | Public Member Functions | List of all members
CDPL::Vis::GraphicsPrimitive2D Class Referenceabstract

The abstract base class of all 2D graphics primitives. More...

#include <GraphicsPrimitive2D.hpp>

+ Inheritance diagram for CDPL::Vis::GraphicsPrimitive2D:

Public Types

typedef std::shared_ptr< GraphicsPrimitive2DSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated GraphicsPrimitive2D instances. More...
 

Public Member Functions

virtual ~GraphicsPrimitive2D ()
 Virtual destructor. More...
 
virtual void render (Renderer2D &renderer) const =0
 Visualizes the graphics primitive by means of the Renderer2D instance renderer. More...
 
virtual SharedPointer clone () const =0
 Creates a dynamically allocated copy of the graphics primitive. More...
 
virtual void getBounds (Rectangle2D &bounds, FontMetrics *font_metrics=0) const =0
 Calculates the bounds of the graphics primitive. More...
 

Detailed Description

The abstract base class of all 2D graphics primitives.

Graphics primitives are simple (atomic) geometrical objects which can be used as building blocks for larger and more complex drawings (e.g. the 2D depiction of a molecular structure). The actual type (e.g. point, line, polygon, ...) and look (e.g. color, font, ...) of an graphics primitive is defined by subclasses of GraphicsPrimitive2D. Subclasses have to implement the render() method that visualizes the primitive by means of a Renderer2D implementation instance.

Member Typedef Documentation

◆ SharedPointer

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

Constructor & Destructor Documentation

◆ ~GraphicsPrimitive2D()

virtual CDPL::Vis::GraphicsPrimitive2D::~GraphicsPrimitive2D ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ render()

virtual void CDPL::Vis::GraphicsPrimitive2D::render ( Renderer2D renderer) const
pure virtual

◆ clone()

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

◆ getBounds()

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

Calculates the bounds of the graphics primitive.

Parameters
boundsThe object storing the calculated bounding box.
font_metricsThe font metrics object to use for bounds calculation (if required).

Implemented in CDPL::Vis::LineSegmentListPrimitive2D, CDPL::Vis::PolylinePrimitive2D, CDPL::Vis::PolygonPrimitive2D, CDPL::Vis::PointListPrimitive2D, CDPL::Vis::PathPrimitive2D, CDPL::Vis::LinePrimitive2D, CDPL::Vis::EllipsePrimitive2D, CDPL::Vis::ClipPathPrimitive2D, CDPL::Vis::TextLabelPrimitive2D, and CDPL::Vis::TextBlockPrimitive2D.


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