Chemical Data Processing Library C++ API - Version 1.1.1
|
The abstract base class of all 2D graphics primitives. More...
#include <GraphicsPrimitive2D.hpp>
Public Types | |
typedef std::shared_ptr< GraphicsPrimitive2D > | SharedPointer |
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... | |
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.
typedef std::shared_ptr<GraphicsPrimitive2D> CDPL::Vis::GraphicsPrimitive2D::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated GraphicsPrimitive2D
instances.
|
inlinevirtual |
Virtual destructor.
|
pure virtual |
Visualizes the graphics primitive by means of the Renderer2D instance renderer.
renderer | The renderer that performs the drawing operations. |
Implemented in CDPL::Vis::TextLabelPrimitive2D, CDPL::Vis::PolylinePrimitive2D, CDPL::Vis::PolygonPrimitive2D, CDPL::Vis::PointListPrimitive2D, CDPL::Vis::PathPrimitive2D, CDPL::Vis::LineSegmentListPrimitive2D, CDPL::Vis::LinePrimitive2D, CDPL::Vis::EllipsePrimitive2D, and CDPL::Vis::ClipPathPrimitive2D.
|
pure virtual |
Creates a dynamically allocated copy of the graphics primitive.
Implemented in CDPL::Vis::TextLabelPrimitive2D, CDPL::Vis::PolylinePrimitive2D, CDPL::Vis::PolygonPrimitive2D, CDPL::Vis::PointListPrimitive2D, CDPL::Vis::PathPrimitive2D, CDPL::Vis::LineSegmentListPrimitive2D, CDPL::Vis::LinePrimitive2D, CDPL::Vis::EllipsePrimitive2D, and CDPL::Vis::ClipPathPrimitive2D.
|
pure virtual |
Calculates the bounds of the graphics primitive.
bounds | The object storing the calculated bounding box. |
font_metrics | The 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, and CDPL::Vis::TextLabelPrimitive2D.