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::opengl
15 {
16 /** Draw a 3D world axis, with coordinate marks at some regular interval
17  * \sa opengl::COpenGLScene
18  *
19  * <div align="center">
20  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px;
21  * border-style: solid;">
22  * <tr> <td> mrpt::opengl::CAxis </td> <td> \image html preview_CAxis.png
23  * </td> </tr>
24  * </table>
25  * </div>
26  *
27  * \ingroup mrpt_opengl_grp
28  */
30 {
32  protected:
33  float m_xmin, m_ymin, m_zmin;
34  float m_xmax, m_ymax, m_zmax;
35  float m_frequency;
36  float m_lineWidth;
37  /** draw marks for X,Y,Z */
38  bool m_marks[3];
39  float m_textScale;
40  float m_textRot[3][3]; // {x,y,z},{yaw,pitch,roll}
41 
42  public:
43  void setAxisLimits(
44  float xmin, float ymin, float zmin, float xmax, float ymax, float zmax);
45  /** Changes the frequency of the "ticks" */
46  void setFrequency(float f);
47  float getFrequency() const;
48  void setLineWidth(float w);
49  float getLineWidth() const;
50  /** Changes the size of text labels (default:0.25) */
51  void setTextScale(float f);
52  float getTextScale() const;
53  /** axis: {0,1,2}=>{X,Y,Z} */
55  int axis, float yaw_deg, float pitch_deg, float roll_deg);
56  /** axis: {0,1,2}=>{X,Y,Z} */
58  int axis, float& yaw_deg, float& pitch_deg, float& roll_deg) const;
59 
60  void enableTickMarks(bool v = true);
61  void enableTickMarks(bool show_x, bool show_y, bool show_z);
62 
63  /** Class factory */
64  static CAxis::Ptr Create(
65  float xmin, float ymin, float zmin, float xmax, float ymax, float zmax,
66  float frecuency = 1, float lineWidth = 3, bool marks = false);
67 
68  /** Render */
69  void render_dl() const override;
70 
71  /** Evaluates the bounding box of this object (including possible children)
72  * in the coordinate frame of the object parent. */
73  void getBoundingBox(
74  mrpt::math::TPoint3D& bb_min,
75  mrpt::math::TPoint3D& bb_max) const override;
76 
77  /** Constructor */
78  CAxis(
79  float xmin = -1.0f, float ymin = -1.0f, float zmin = -1.0f,
80  float xmax = 1.0f, float ymax = 1.0f, float zmax = 1.0f,
81  float frecuency = 0.25f, float lineWidth = 3.0f, bool marks = false);
82 
83  /** Private, virtual destructor: only can be deleted from smart pointers */
84  virtual ~CAxis() {}
85 };
86 
87 }
88 #endif
89 
90 
float getFrequency() const
Definition: CAxis.cpp:261
bool m_marks[3]
draw marks for X,Y,Z
Definition: CAxis.h:38
float m_lineWidth
Definition: CAxis.h:36
virtual ~CAxis()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CAxis.h:84
static Ptr Create(Args &&... args)
Definition: CAxis.h:31
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:40
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:39
GLclampd zmax
Definition: glext.h:7918
const GLdouble * v
Definition: glext.h:3678
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:35
Draw a 3D world axis, with coordinate marks at some regular interval.
Definition: CAxis.h:29
void setFrequency(float f)
Changes the frequency of the "ticks".
Definition: CAxis.cpp:255
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
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: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020