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
mrpt::opengl::CAxis::getFrequency
float getFrequency() const
Definition: CAxis.cpp:261
zmax
GLclampd zmax
Definition: glext.h:7918
mrpt::opengl::CAxis::~CAxis
virtual ~CAxis()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CAxis.h:86
mrpt::opengl::CAxis::getLineWidth
float getLineWidth() const
Definition: CAxis.cpp:267
CRenderizableDisplayList.h
mrpt::opengl::CRenderizableDisplayList
A renderizable object suitable for rendering with OpenGL's display lists.
Definition: CRenderizableDisplayList.h:39
mrpt::opengl::CAxis::setTextLabelOrientation
void setTextLabelOrientation(int axis, float yaw_deg, float pitch_deg, float roll_deg)
axis: {0,1,2}=>{X,Y,Z}
Definition: CAxis.cpp:298
mrpt::opengl::CAxis::m_marks
bool m_marks[3]
draw marks for X,Y,Z
Definition: CAxis.h:40
mrpt::opengl::CAxis::m_ymin
float m_ymin
Definition: CAxis.h:35
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
w
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
mrpt::opengl::CAxis::getTextScale
float getTextScale() const
Definition: CAxis.cpp:286
mrpt::opengl::CAxis::m_textScale
float m_textScale
Definition: CAxis.h:41
mrpt::opengl::CAxis::setAxisLimits
void setAxisLimits(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Definition: CAxis.cpp:287
mrpt::opengl::CAxis::Create
static Ptr Create(Args &&... args)
Definition: CAxis.h:33
v
const GLdouble * v
Definition: glext.h:3678
mrpt::opengl::CAxis::m_xmin
float m_xmin
Definition: CAxis.h:35
mrpt::opengl::CAxis::setTextScale
void setTextScale(float f)
Changes the size of text labels (default:0.25)
Definition: CAxis.cpp:280
mrpt::opengl::CAxis::m_xmax
float m_xmax
Definition: CAxis.h:36
mrpt::opengl::CAxis::m_ymax
float m_ymax
Definition: CAxis.h:36
mrpt::opengl::CAxis::render_dl
void render_dl() const override
Render.
Definition: CAxis.cpp:65
mrpt::opengl::CAxis::getBoundingBox
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
mrpt::opengl::CAxis::Ptr
std::shared_ptr< CAxis > Ptr
Definition: CAxis.h:33
mrpt::opengl::CAxis::m_frequency
float m_frequency
Definition: CAxis.h:37
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
mrpt::opengl::CAxis::setLineWidth
void setLineWidth(float w)
Definition: CAxis.cpp:262
mrpt::opengl::CAxis::enableTickMarks
void enableTickMarks(bool v=true)
Definition: CAxis.cpp:268
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
mrpt::opengl::CAxis
Draw a 3D world axis, with coordinate marks at some regular interval.
Definition: CAxis.h:31
mrpt::opengl::CAxis::m_textRot
float m_textRot[3][3]
Definition: CAxis.h:42
mrpt::opengl::CAxis::m_lineWidth
float m_lineWidth
Definition: CAxis.h:38
mrpt::opengl::CAxis::setFrequency
void setFrequency(float f)
Changes the frequency of the "ticks".
Definition: CAxis.cpp:255
mrpt::opengl::CAxis::m_zmin
float m_zmin
Definition: CAxis.h:35
mrpt::opengl::CAxis::CAxis
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
mrpt::opengl::CAxis::m_zmax
float m_zmax
Definition: CAxis.h:36
mrpt::opengl::CAxis::getTextLabelOrientation
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



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST