Main MRPT website > C++ reference for MRPT 1.9.9
CAxis.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef opengl_CAxis_H
10 #define opengl_CAxis_H
11 
13 
14 namespace mrpt
15 {
16 namespace opengl
17 {
18 /** Draw a 3D world axis, with coordinate marks at some regular interval
19  * \sa opengl::COpenGLScene
20  *
21  * <div align="center">
22  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px;
23  * border-style: solid;">
24  * <tr> <td> mrpt::opengl::CAxis </td> <td> \image html preview_CAxis.png
25  * </td> </tr>
26  * </table>
27  * </div>
28  *
29  * \ingroup mrpt_opengl_grp
30  */
32 {
34  protected:
35  float m_xmin, m_ymin, m_zmin;
36  float m_xmax, m_ymax, m_zmax;
37  float m_frequency;
38  float m_lineWidth;
39  /** draw marks for X,Y,Z */
40  bool m_marks[3];
41  float m_textScale;
42  float m_textRot[3][3]; // {x,y,z},{yaw,pitch,roll}
43 
44  public:
45  void setAxisLimits(
46  float xmin, float ymin, float zmin, float xmax, float ymax, float zmax);
47  /** Changes the frequency of the "ticks" */
48  void setFrequency(float f);
49  float getFrequency() const;
50  void setLineWidth(float w);
51  float getLineWidth() const;
52  /** Changes the size of text labels (default:0.25) */
53  void setTextScale(float f);
54  float getTextScale() const;
55  /** axis: {0,1,2}=>{X,Y,Z} */
57  int axis, float yaw_deg, float pitch_deg, float roll_deg);
58  /** axis: {0,1,2}=>{X,Y,Z} */
60  int axis, float& yaw_deg, float& pitch_deg, float& roll_deg) const;
61 
62  void enableTickMarks(bool v = true);
63  void enableTickMarks(bool show_x, bool show_y, bool show_z);
64 
65  /** Class factory */
66  static CAxis::Ptr Create(
67  float xmin, float ymin, float zmin, float xmax, float ymax, float zmax,
68  float frecuency = 1, float lineWidth = 3, bool marks = false);
69 
70  /** Render */
71  void render_dl() const override;
72 
73  /** Evaluates the bounding box of this object (including possible children)
74  * in the coordinate frame of the object parent. */
75  void getBoundingBox(
76  mrpt::math::TPoint3D& bb_min,
77  mrpt::math::TPoint3D& bb_max) const override;
78 
79  /** Constructor */
80  CAxis(
81  float xmin = -1.0f, float ymin = -1.0f, float zmin = -1.0f,
82  float xmax = 1.0f, float ymax = 1.0f, float zmax = 1.0f,
83  float frecuency = 0.25f, float lineWidth = 3.0f, bool marks = false);
84 
85  /** Private, virtual destructor: only can be deleted from smart pointers */
86  virtual ~CAxis() {}
87 };
88 
89 } // end namespace
90 } // End of namespace
91 
92 #endif
float getFrequency() const
Definition: CAxis.cpp:261
bool m_marks[3]
draw marks for X,Y,Z
Definition: CAxis.h:40
float m_lineWidth
Definition: CAxis.h:38
virtual ~CAxis()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CAxis.h:86
static Ptr Create(Args &&... args)
Definition: CAxis.h:33
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
A renderizable object suitable for rendering with OpenGL&#39;s display lists.
float getTextScale() const
Definition: CAxis.cpp:286
float m_textRot[3][3]
Definition: CAxis.h:42
void enableTickMarks(bool v=true)
Definition: CAxis.cpp:268
void setLineWidth(float w)
Definition: CAxis.cpp:262
void render_dl() const override
Render.
Definition: CAxis.cpp:65
void getTextLabelOrientation(int axis, float &yaw_deg, float &pitch_deg, float &roll_deg) const
axis: {0,1,2}=>{X,Y,Z}
Definition: CAxis.cpp:306
CAxis(float xmin=-1.0f, float ymin=-1.0f, float zmin=-1.0f, float xmax=1.0f, float ymax=1.0f, float zmax=1.0f, float frecuency=0.25f, float lineWidth=3.0f, bool marks=false)
Constructor.
Definition: CAxis.cpp:27
float m_textScale
Definition: CAxis.h:41
GLclampd zmax
Definition: glext.h:7918
const GLdouble * v
Definition: glext.h:3678
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void setTextLabelOrientation(int axis, float yaw_deg, float pitch_deg, float roll_deg)
axis: {0,1,2}=>{X,Y,Z}
Definition: CAxis.cpp:298
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
float getLineWidth() const
Definition: CAxis.cpp:267
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
Definition: CAxis.cpp:239
float m_frequency
Definition: CAxis.h:37
Draw a 3D world axis, with coordinate marks at some regular interval.
Definition: CAxis.h:31
void setFrequency(float f)
Changes the frequency of the "ticks".
Definition: CAxis.cpp:255
Lightweight 3D point.
void setAxisLimits(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Definition: CAxis.cpp:287
void setTextScale(float f)
Changes the size of text labels (default:0.25)
Definition: CAxis.cpp:280



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019