MIRA
AxesObject.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_AXESOBJECT_H_
48 #define _MIRA_AXESOBJECT_H_
49 
51 
52 namespace mira {
53 
55 
57 
59 {
60 public:
61  enum AxesFlags
62  {
63  NO_AXIS = 0x00,
64  X_AXIS = 0x01,
65  Y_AXIS = 0x02,
66  Z_AXIS = 0x04,
67  };
68 
69  AxesObject(Ogre::SceneManager* sceneManager, Ogre::SceneNode* parent = NULL);
70  virtual ~AxesObject();
71 
72  float getLength() const { return mAxisLength; }
73  void setLength(float length);
74 
75  float getRadius() const { return mAxisRadius; }
76  void setRadius(float radius);
77 
78  const Ogre::ColourValue& getXAxisColor() { return mXAxisColor; }
79  const Ogre::ColourValue& getYAxisColor() { return mYAxisColor; }
80  const Ogre::ColourValue& getZAxisColor() { return mZAxisColor; }
81  void setColor(const Ogre::ColourValue& xaxis, const Ogre::ColourValue& yaxis, const Ogre::ColourValue& zaxis);
82  void setColor(const Ogre::ColourValue& uniform);
83 
84  bool isShowingXAxis() const { return mShowXAxis; }
85  void showXAxis(bool show);
86  bool isShowingYAxis() const { return mShowYAxis; }
87  void showYAxis(bool show);
88  bool isShowingZAxis() const { return mShowZAxis; }
89  void showZAxis(bool show);
90 
91  bool isShowingArrows() const { return mShowArrows; }
92  void showArrows(bool show);
93 
94  float getAlpha() const { return mXAxisColor.a; }
95  void setAlpha(float alpha);
96 
97  bool isVisible() const { return mVisible; }
98  virtual void setVisible(bool visible, bool cascade=true);
99 
100 protected:
101 
102  void updateVisibility();
103  void updateScales();
104  void updateColor();
105 
106  bool mVisible;
111  float mAxisLength;
112  float mAxisRadius;
116 
117  Ogre::ColourValue mXAxisColor;
118  Ogre::ColourValue mYAxisColor;
119  Ogre::ColourValue mZAxisColor;
120 };
121 
123 
124 }
125 
126 #endif
Ogre::ColourValue mXAxisColor
Definition: AxesObject.h:117
Declaration of VisualizationObject.
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
AxesFlags
Definition: AxesObject.h:61
Ogre::ColourValue mYAxisColor
Definition: AxesObject.h:118
const Ogre::ColourValue & getZAxisColor()
Definition: AxesObject.h:80
Definition: VisualizationObject.h:71
bool isShowingYAxis() const
Definition: AxesObject.h:86
Definition: AxesObject.h:58
float getLength() const
Definition: AxesObject.h:72
Definition: ArrowObject.h:58
bool mShowYAxis
Definition: AxesObject.h:108
bool mShowXAxis
Definition: AxesObject.h:107
bool isVisible() const
Definition: AxesObject.h:97
bool isShowingXAxis() const
Definition: AxesObject.h:84
const Ogre::ColourValue & getYAxisColor()
Definition: AxesObject.h:79
bool mShowZAxis
Definition: AxesObject.h:109
ArrowObject * mZAxis
Definition: AxesObject.h:115
const Ogre::ColourValue & getXAxisColor()
Definition: AxesObject.h:78
#define MIRA_GUI_VISUALIZATION_EXPORT
Definition: GuiVisualizationExports.h:61
float getAlpha() const
Definition: AxesObject.h:94
float mAxisLength
Definition: AxesObject.h:111
float getRadius() const
Definition: AxesObject.h:75
bool isShowingArrows() const
Definition: AxesObject.h:91
ArrowObject * mXAxis
Definition: AxesObject.h:113
bool mVisible
Definition: AxesObject.h:106
float mAxisRadius
Definition: AxesObject.h:112
bool mShowArrows
Definition: AxesObject.h:110
ArrowObject * mYAxis
Definition: AxesObject.h:114
Ogre::ColourValue mZAxisColor
Definition: AxesObject.h:119
bool isShowingZAxis() const
Definition: AxesObject.h:88