MIRA
Visualization2D.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 by
3  * MetraLabs GmbH (MLAB), GERMANY
4  * and
5  * Neuroinformatics and Cognitive Robotics Labs (NICR) at TU Ilmenau, GERMANY
6  * All rights reserved.
7  *
8  * Contact: info@mira-project.org
9  *
10  * Commercial Usage:
11  * Licensees holding valid commercial licenses may use this file in
12  * accordance with the commercial license agreement provided with the
13  * software or, alternatively, in accordance with the terms contained in
14  * a written agreement between you and MLAB or NICR.
15  *
16  * GNU General Public License Usage:
17  * Alternatively, this file may be used under the terms of the GNU
18  * General Public License version 3.0 as published by the Free Software
19  * Foundation and appearing in the file LICENSE.GPL3 included in the
20  * packaging of this file. Please review the following information to
21  * ensure the GNU General Public License version 3.0 requirements will be
22  * met: http://www.gnu.org/copyleft/gpl.html.
23  * Alternatively you may (at your option) use any later version of the GNU
24  * General Public License if such license has been publicly approved by
25  * MLAB and NICR (or its successors, if any).
26  *
27  * IN NO EVENT SHALL "MLAB" OR "NICR" BE LIABLE TO ANY PARTY FOR DIRECT,
28  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
29  * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLAB" OR
30  * "NICR" HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * "MLAB" AND "NICR" SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
33  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
34  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
35  * ON AN "AS IS" BASIS, AND "MLAB" AND "NICR" HAVE NO OBLIGATION TO
36  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
37  */
38 
47 #ifndef _MIRA_VISUALIZATION2D_H_
48 #define _MIRA_VISUALIZATION2D_H_
49 
50 #include <geometry/Point.h>
51 #include <math/Angle.h>
53 
55 
56 class QGraphicsScene;
57 class QGraphicsView;
58 class QGraphicsItem;
59 
60 namespace mira {
61 
63 
65 {
66 public:
67 
68  virtual QGraphicsScene* getSceneManager() = 0;
69  virtual QGraphicsView* getViewManager() = 0;
70 
71 public:
72 
74  {
75  public:
76 
77  Camera();
78 
79  template <typename Reflector>
80  void reflect(Reflector& r)
81  {
82  r.property("X", position.x(), "the position of the camera");
83  r.property("Y", position.y(), "the position of the camera");
84  r.property("Orientation", orientation, "Rotation of the camera w.r.t. the global coordinate system");
85  r.property("Scale", scale, "the scale factor");
86  }
87 
88  // The camera rotation and translation, specified by mouse interaction
89 
92  float scale;
93  };
94 
99  virtual const Camera& getCamera() const = 0;
100 
105  virtual void setCamera(const Camera& camera) = 0;
106 
111  virtual float getToolBaseZValue() const = 0;
112 };
113 
115 
121  public Visualization
122 {
124 public:
125 
126  Visualization2D();
127  virtual ~Visualization2D() {}
128 
129 public:
130 
142  virtual void init(IVisualizationSite* site);
143 
144 public:
145 
151  virtual IVisualization2DSite* getSite();
152 
153 public:
154 
162  virtual void setupScene(IVisualization2DSite* site) = 0;
163 
168  virtual QGraphicsItem* getItem() = 0;
169 
170 private:
171 
172  IVisualization2DSite* mSite;
173 
174 };
175 
177 
178 }
179 
180 #endif
void reflect(Reflector &r)
Definition: Visualization2D.h:80
virtual QGraphicsScene * getSceneManager()=0
Definition: Visualization2D.h:73
virtual void setCamera(const Camera &camera)=0
Sets the current camera settings (position, orientation, etc.) of the views own camera.
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
Abstract base class for all derived visualizations, namely Visualization3D and Visualization2D.
Definition: Visualization.h:90
virtual const Camera & getCamera() const =0
Obtains the current camera settings (position, orientation, etc.) of the views own camera...
Class for 2D, 3D and N-dimensional points.
virtual QGraphicsView * getViewManager()=0
Abstract base class for all 2D visualization that are used by Visualization2DView.
Definition: Visualization2D.h:120
virtual float getToolBaseZValue() const =0
Obtains the Z value all tools should adhere to to ensure that they will always be above regular visua...
The interface between a Visualization and the container of the visualization (e.g.
Definition: Visualization.h:75
#define MIRA_ABSTRACT_OBJECT(classIdentifier)
Use this MACRO instead of MIRA_OBJECT to declare the class as abstract.
Definition: FactoryMacros.h:239
virtual ~Visualization2D()
Definition: Visualization2D.h:127
The primary interface between a Visualization and the container of the visualization (e...
Definition: Visualization.h:65
float scale
Definition: Visualization2D.h:92
Declaration of Visualization and related classes.
Implementations of angles (values in periodic interval of width 2*pi) with arbitrary base type...
#define MIRA_GUI_VISUALIZATION_EXPORT
Definition: GuiVisualizationExports.h:61
Definition: Visualization2D.h:64
Degreef orientation
Definition: Visualization2D.h:91
Point2f position
Definition: Visualization2D.h:90