Chemical Data Processing Library C++ API - Version 1.1.1
LineSegmentListPrimitive2D.hpp
Go to the documentation of this file.
1 /*
2  * LineSegmentListPrimitive2D.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_VIS_LINESEGMENTLISTPRIMITIVE2D_HPP
30 #define CDPL_VIS_LINESEGMENTLISTPRIMITIVE2D_HPP
31 
32 #include <memory>
33 
34 #include "CDPL/Vis/APIPrefix.hpp"
37 #include "CDPL/Vis/Pen.hpp"
38 
39 
40 namespace CDPL
41 {
42 
43  namespace Vis
44  {
45 
50  public GraphicsPrimitive2D
51  {
52 
53  public:
57  typedef std::shared_ptr<LineSegmentListPrimitive2D> SharedPointer;
58 
63 
64  void render(Renderer2D& renderer) const;
65 
70  void setPen(const Pen& pen);
71 
76  const Pen& getPen() const;
77 
79 
80  void getBounds(Rectangle2D& bounds, FontMetrics* font_mtrics = 0) const;
81 
82  private:
83  Pen pen;
84  };
85  } // namespace Vis
86 } // namespace CDPL
87 
88 #endif // CDPL_VIS_LINESEGMENTLISTPRIMITIVE2D_HPP
CDPL::Vis::Renderer2D
An interface that provides methods for low level 2D drawing operations.
Definition: Renderer2D.hpp:86
CDPL::Vis::GraphicsPrimitive2D::SharedPointer
std::shared_ptr< GraphicsPrimitive2D > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated GraphicsPrimitive2D instances.
Definition: GraphicsPrimitive2D.hpp:63
CDPL::Vis::LineSegmentListPrimitive2D::LineSegmentListPrimitive2D
LineSegmentListPrimitive2D()
Constructs an empty line segment list primitive.
Definition: LineSegmentListPrimitive2D.hpp:62
CDPL::Vis::LineSegmentListPrimitive2D::getBounds
void getBounds(Rectangle2D &bounds, FontMetrics *font_mtrics=0) const
Calculates the bounds of the graphics primitive.
CDPL::Vis::Pen
Specifies how to draw lines and outlines of shapes.
Definition: Pen.hpp:53
CDPL::Vis::PointArray2D
Stores a set of points in 2D space.
Definition: PointArray2D.hpp:48
CDPL::Vis::LineSegmentListPrimitive2D
A graphics primitive representing a list of disjoint line segments.
Definition: LineSegmentListPrimitive2D.hpp:51
CDPL::Vis::LineSegmentListPrimitive2D::render
void render(Renderer2D &renderer) const
Visualizes the graphics primitive by means of the Renderer2D instance renderer.
PointArray2D.hpp
Definition of the class CDPL::Vis::PointArray2D.
CDPL::Vis::LineSegmentListPrimitive2D::clone
GraphicsPrimitive2D::SharedPointer clone() const
Creates a dynamically allocated copy of the graphics primitive.
Pen.hpp
Definition of the class CDPL::Vis::Pen.
CDPL::Vis::LineSegmentListPrimitive2D::setPen
void setPen(const Pen &pen)
Sets the pen defining the color, width, line style and cap style of the line segments.
CDPL_VIS_API
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
GraphicsPrimitive2D.hpp
Definition of the class CDPL::Vis::GraphicsPrimitive2D.
CDPL::Vis::LineSegmentListPrimitive2D::SharedPointer
std::shared_ptr< LineSegmentListPrimitive2D > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated LineSegmentListPrimitive2D instan...
Definition: LineSegmentListPrimitive2D.hpp:57
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Vis::GraphicsPrimitive2D
The abstract base class of all 2D graphics primitives.
Definition: GraphicsPrimitive2D.hpp:57
CDPL::Vis::Rectangle2D
Specifies an axis aligned rectangular area in 2D space.
Definition: Rectangle2D.hpp:51
CDPL::Vis::FontMetrics
An interface class with methods that provide information about the metrics of a font.
Definition: FontMetrics.hpp:71
CDPL::Vis::LineSegmentListPrimitive2D::getPen
const Pen & getPen() const
Returns the pen defining the color, width, line style and cap style of the line segments.
APIPrefix.hpp
Definition of the preprocessor macro CDPL_VIS_API.