Main MRPT website > C++ reference for MRPT 1.5.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-2017, 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 
19 
20  // This must be added to any CSerializable derived class:
21  DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CAxis, CRenderizableDisplayList, OPENGL_IMPEXP )
22 
23  /** Draw a 3D world axis, with coordinate marks at some regular interval
24  * \sa opengl::COpenGLScene
25  *
26  * <div align="center">
27  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px; border-style: solid;">
28  * <tr> <td> mrpt::opengl::CAxis </td> <td> \image html preview_CAxis.png </td> </tr>
29  * </table>
30  * </div>
31  *
32  * \ingroup mrpt_opengl_grp
33  */
35  {
37  protected:
38  float m_xmin,m_ymin,m_zmin;
39  float m_xmax,m_ymax,m_zmax;
40  float m_frequency;
41  float m_lineWidth;
42  bool m_marks[3]; //!< draw marks for X,Y,Z
43  float m_textScale;
44  float m_textRot[3][3]; // {x,y,z},{yaw,pitch,roll}
45 
46  public:
47  void setAxisLimits(float xmin,float ymin, float zmin, float xmax,float ymax, float zmax);
48  void setFrequency(float f); //!< Changes the frequency of the "ticks"
49  float getFrequency() const;
50  void setLineWidth(float w);
51  float getLineWidth() const;
52  void setTextScale(float f); //!< Changes the size of text labels (default:0.25)
53  float getTextScale() const;
54  void setTextLabelOrientation(int axis, float yaw_deg, float pitch_deg, float roll_deg); //!< axis: {0,1,2}=>{X,Y,Z}
55  void getTextLabelOrientation(int axis, float &yaw_deg, float &pitch_deg, float &roll_deg) const; //!< axis: {0,1,2}=>{X,Y,Z}
56 
57  void enableTickMarks(bool v=true);
58  void enableTickMarks(bool show_x, bool show_y, bool show_z);
59 
60  /** Class factory */
61  static CAxisPtr Create(
62  float xmin,float ymin, float zmin,
63  float xmax, float ymax, float zmax,
64  float frecuency = 1, float lineWidth = 3, bool marks=false);
65 
66  /** Render */
67  void render_dl() const MRPT_OVERRIDE;
68 
69  /** Evaluates the bounding box of this object (including possible children) in the coordinate frame of the object parent. */
70  void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const MRPT_OVERRIDE;
71  private:
72  /** Constructor */
73  CAxis(
74  float xmin=-1.0f,float ymin=-1.0f, float zmin=-1.0f,
75  float xmax=1.0f, float ymax=1.0f, float zmax=1.0f,
76  float frecuency = 0.25f, float lineWidth = 3.0f, bool marks=false);
77 
78  /** Private, virtual destructor: only can be deleted from smart pointers */
79  virtual ~CAxis() { }
80  };
81  DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE( CAxis, CRenderizableDisplayList, OPENGL_IMPEXP )
82 
83  } // end namespace
84 } // End of namespace
85 
86 #endif
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
float m_lineWidth
Definition: CAxis.h:41
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:3962
A renderizable object suitable for rendering with OpenGL&#39;s display lists.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
float m_textScale
Definition: CAxis.h:43
GLclampd zmax
Definition: glext.h:6808
const GLdouble * v
Definition: glext.h:3603
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
float m_frequency
Definition: CAxis.h:40
Draw a 3D world axis, with coordinate marks at some regular interval.
Definition: CAxis.h:34
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020