Main MRPT website > C++ reference for MRPT 1.9.9
CRenderizable.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_CRenderizable_H
10 #define opengl_CRenderizable_H
11 
13 #include <mrpt/img/TColor.h>
14 #include <mrpt/math/math_frwds.h>
15 #include <mrpt/poses/CPose3D.h>
18 #include <deque>
19 
20 namespace mrpt
21 {
22 namespace opengl
23 {
24 class COpenGLViewport;
25 class CSetOfObjects;
26 
27 /** The base class of 3D objects that can be directly rendered through OpenGL.
28  * In this class there are a set of common properties to all 3D objects,
29  *mainly:
30  * - A name (m_name): A name that can be optionally asigned to objects for
31  *easing its reference.
32  * - 6D coordinates (x,y,z,yaw,pitch,roll), relative to the "current"
33  *reference framework. By default, any object is referenced to global scene
34  *coordinates.
35  * - A RGB color: This field will be used in simple elements (points,
36  *lines,
37  *text,...) but is ignored in more complex objects that carry their own color
38  *information (triangle sets,...)
39  * See the main class opengl::COpenGLScene
40  * \sa opengl::COpenGLScene, mrpt::opengl
41  * \ingroup mrpt_opengl_grp
42  */
44 {
46 
47  friend class mrpt::opengl::COpenGLViewport;
48  friend class mrpt::opengl::CSetOfObjects;
49 
50  protected:
51  std::string m_name;
53  /** Color components in the range [0,255] */
54  mrpt::img::TColor m_color;
55  /** 6D pose wrt the parent coordinate reference. This class automatically
56  * holds the cached 3x3 rotation matrix for quick load into opengl stack. */
57  mrpt::poses::CPose3D m_pose;
58  /** Scale components to apply to the object (default=1) */
60  /** Is the object visible? (default=true) */
61  bool m_visible;
62 
63  public:
64  /** @name Changes the appearance of the object to render
65  @{ */
66 
67  /** Changes the name of the object */
68  void setName(const std::string& n) { m_name = n; }
69  /** Returns the name of the object */
70  const std::string& getName() const { return m_name; }
71  inline bool isVisible()
72  const /** Is the object visible? \sa setVisibility */
73  {
74  return m_visible;
75  }
76  inline void setVisibility(
77  bool visible =
78  true) /** Set object visibility (default=true) \sa isVisible */
79  {
80  m_visible = visible;
81  }
82 
83  /** Enables or disables showing the name of the object as a label when
84  * rendering */
85  inline void enableShowName(bool showName = true) { m_show_name = showName; }
86  /** \sa enableShowName */
87  inline bool isShowNameEnabled() const { return m_show_name; }
88  /** Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to
89  * this) */
91  /** Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to
92  * this) */
94  /** Set the 3D pose from a mrpt::math::TPose3D object (return a ref to
95  * this) */
97  /** Set the 3D pose from a mrpt::math::TPose3D object (return a ref to
98  * this) */
100  /** Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to
101  * this) */
103  /** Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to
104  * this) */
106 
107  /** Returns the 3D pose of the object as TPose3D */
109  /** Returns a const ref to the 3D pose of the object as mrpt::poses::CPose3D
110  * (which explicitly contains the 3x3 rotation matrix) */
111  inline const mrpt::poses::CPose3D& getPoseRef() const { return m_pose; }
112  /** Changes the location of the object, keeping untouched the orientation
113  * \return a ref to this */
114  inline CRenderizable& setLocation(double x, double y, double z)
115  {
116  m_pose.x(x);
117  m_pose.y(y);
118  m_pose.z(z);
119  return *this;
120  }
121 
122  /** Changes the location of the object, keeping untouched the orientation
123  * \return a ref to this */
125  {
126  m_pose.x(p.x);
127  m_pose.y(p.y);
128  m_pose.z(p.z);
129  return *this;
130  }
131 
132  /** Translation relative to parent coordinate origin. */
133  inline double getPoseX() const { return m_pose.x(); }
134  /** Translation relative to parent coordinate origin. */
135  inline double getPoseY() const { return m_pose.y(); }
136  /** Translation relative to parent coordinate origin. */
137  inline double getPoseZ() const { return m_pose.z(); }
138  /** Rotation relative to parent coordinate origin, in **DEGREES**. */
139  inline double getPoseYaw() const { return mrpt::RAD2DEG(m_pose.yaw()); }
140  /** Rotation relative to parent coordinate origin, in **DEGREES**. */
141  inline double getPosePitch() const { return mrpt::RAD2DEG(m_pose.pitch()); }
142  /** Rotation relative to parent coordinate origin, in **DEGREES**. */
143  inline double getPoseRoll() const { return mrpt::RAD2DEG(m_pose.roll()); }
144  /** Rotation relative to parent coordinate origin, in radians. */
145  inline double getPoseYawRad() const { return m_pose.yaw(); }
146  /** Rotation relative to parent coordinate origin, in radians. */
147  inline double getPosePitchRad() const { return m_pose.pitch(); }
148  /** Rotation relative to parent coordinate origin, in radians. */
149  inline double getPoseRollRad() const { return m_pose.roll(); }
150  /** Color components in the range [0,1] */
151  inline double getColorR() const { return m_color.R / 255.; }
152  /** Color components in the range [0,1] */
153  inline double getColorG() const { return m_color.G / 255.; }
154  /** Color components in the range [0,1] */
155  inline double getColorB() const { return m_color.B / 255.; }
156  /** Color components in the range [0,1] */
157  inline double getColorA() const { return m_color.A / 255.; }
158  /** Color components in the range [0,255] */
159  inline uint8_t getColorR_u8() const { return m_color.R; }
160  /** Color components in the range [0,255] */
161  inline uint8_t getColorG_u8() const { return m_color.G; }
162  /** Color components in the range [0,255] */
163  inline uint8_t getColorB_u8() const { return m_color.B; }
164  /** Color components in the range [0,255] */
165  inline uint8_t getColorA_u8() const { return m_color.A; }
166  /**Color components in the range [0,1] \return a ref to this */
167  CRenderizable& setColorR(const double r)
168  {
169  return setColorR_u8(static_cast<uint8_t>(255 * r));
170  }
171  /**Color components in the range [0,1] \return a ref to this */
172  CRenderizable& setColorG(const double g)
173  {
174  return setColorG_u8(static_cast<uint8_t>(255 * g));
175  }
176  /**Color components in the range [0,1] \return a ref to this */
177  CRenderizable& setColorB(const double b)
178  {
179  return setColorB_u8(static_cast<uint8_t>(255 * b));
180  }
181  /**Color components in the range [0,1] \return a ref to this */
182  CRenderizable& setColorA(const double a)
183  {
184  return setColorA_u8(static_cast<uint8_t>(255 * a));
185  }
186  /**Color components in the range [0,255] \return a ref to this */
188  {
189  m_color.R = r;
190  return *this;
191  }
192  /**Color components in the range [0,255] \return a ref to this */
194  {
195  m_color.G = g;
196  return *this;
197  }
198  /**Color components in the range [0,255] \return a ref to this */
200  {
201  m_color.B = b;
202  return *this;
203  }
204  /**Color components in the range [0,255] \return a ref to this */
206  {
207  m_color.A = a;
208  return *this;
209  }
210 
211  /** Scale to apply to the object, in all three axes (default=1) \return a
212  * ref to this */
213  inline CRenderizable& setScale(float s)
214  {
216  return *this;
217  }
218  /** Scale to apply to the object in each axis (default=1) \return a ref to
219  * this */
220  inline CRenderizable& setScale(float sx, float sy, float sz)
221  {
222  m_scale_x = sx;
223  m_scale_y = sy;
224  m_scale_z = sz;
225  return *this;
226  }
227  /** Get the current scaling factor in one axis */
228  inline float getScaleX() const { return m_scale_x; }
229  /** Get the current scaling factor in one axis */
230  inline float getScaleY() const { return m_scale_y; }
231  /** Get the current scaling factor in one axis */
232  inline float getScaleZ() const { return m_scale_z; }
233  /** Returns the object color property as a TColorf */
235  {
236  return mrpt::img::TColorf(m_color);
237  }
238  /** Changes the default object color \return a ref to this */
240  {
241  return setColor_u8(
243  c.R * 255.f, c.G * 255.f, c.B * 255.f, c.A * 255.f));
244  }
245 
246  /** Set the color components of this object (R,G,B,Alpha, in the range 0-1)
247  * \return a ref to this */
248  inline CRenderizable& setColor(double R, double G, double B, double A = 1)
249  {
250  return setColor_u8(R * 255, G * 255, B * 255, A * 255);
251  }
252 
253  /** Returns the object color property as a TColor */
254  inline const mrpt::img::TColor& getColor_u8() const { return m_color; }
255  /*** Changes the default object color \return a ref to this */
256  virtual CRenderizable& setColor_u8(const mrpt::img::TColor& c);
257 
258  /** Set the color components of this object (R,G,B,Alpha, in the range
259  * 0-255) \return a ref to this */
261  {
262  return setColor_u8(mrpt::img::TColor(R, G, B, A));
263  }
264 
265  /** @} */
266 
267  /** Default constructor: */
268  CRenderizable();
269  virtual ~CRenderizable();
270 
271  /** Implements the rendering of 3D objects in each class derived from
272  * CRenderizable.
273  */
274  virtual void render() const = 0;
275 
276  /** Simulation of ray-trace, given a pose. Returns true if the ray
277  * effectively collisions with the object (returning the distance to the
278  * origin of the ray in "dist"), or false in other case. "dist" variable
279  * yields undefined behaviour when false is returned
280  */
281  virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const;
282 
283  /** This method is safe for calling from within ::render() methods \sa
284  * renderTextBitmap, mrpt::opengl::gl_utils */
285  static void renderTextBitmap(const char* str, void* fontStyle);
286 
287  /** Return the exact width in pixels for a given string, as will be rendered
288  * by renderTextBitmap().
289  * \sa renderTextBitmap, mrpt::opengl::gl_utils
290  */
291  static int textBitmapWidth(
292  const std::string& str,
295 
296  /** Render a text message in the current rendering context, creating a
297  * glViewport in the way (do not call within ::render() methods)
298  * - Coordinates (x,y) are 2D pixels, starting at bottom-left of the
299  * viewport. Negative numbers will wrap to the opposite side of the viewport
300  * (e.g. x=-10 means 10px fromt the right).
301  * - The text color is defined by (color_r,color_g,color_b), each float
302  * numbers in the range [0,1].
303  * \sa renderTextBitmap, textBitmapWidth, mrpt::opengl::gl_utils
304  */
305  static void renderTextBitmap(
306  int screen_x, int screen_y, const std::string& str, float color_r = 1,
307  float color_g = 1, float color_b = 1,
310 
311  /** Evaluates the bounding box of this object (including possible children)
312  * in the coordinate frame of the object parent. */
313  virtual void getBoundingBox(
314  mrpt::math::TPoint3D& bb_min, mrpt::math::TPoint3D& bb_max) const = 0;
315 
316  protected:
317  /** Checks glGetError and throws an exception if an error situation is found
318  */
319  static void checkOpenGLError();
320 
323 
324  /** Returns the lowest next free texture name (avoid using OpenGL's own
325  * function since we may call them from different threads and seem it's not
326  * cool). */
327  static unsigned int getNewTextureNumber();
328  static void releaseTextureName(unsigned int i);
329 };
330 /** A list of objects pointers, automatically managing memory free at
331  * destructor, and managing copies correctly. */
332 using CListOpenGLObjects = std::deque<CRenderizable::Ptr>;
333 
334 /** Applies a mrpt::poses::CPose3D transformation to the object. Note that this
335  * method doesn't <i>set</i> the pose to the given value, but <i>combines</i> it
336  * with the existing one.
337  * \sa setPose */
340 
341 } // namespace opengl
342 } // namespace mrpt
343 
344 #endif
n
GLenum GLsizei n
Definition: glext.h:5074
mrpt::opengl::TOpenGLFont
TOpenGLFont
Existing fonts for 2D texts in mrpt::opengl methods.
Definition: opengl_fonts.h:25
mrpt::opengl::CRenderizable::getNewTextureNumber
static unsigned int getNewTextureNumber()
Returns the lowest next free texture name (avoid using OpenGL's own function since we may call them f...
Definition: CRenderizable.cpp:71
mrpt::opengl::CRenderizable::~CRenderizable
virtual ~CRenderizable()
Definition: CRenderizable.cpp:68
mrpt::opengl::CRenderizable::setColor_u8
CRenderizable & setColor_u8(uint8_t R, uint8_t G, uint8_t B, uint8_t A=255)
Set the color components of this object (R,G,B,Alpha, in the range 0-255)
Definition: CRenderizable.h:260
mrpt::opengl::CRenderizable::setColorG_u8
virtual CRenderizable & setColorG_u8(const uint8_t g)
Color components in the range [0,255].
Definition: CRenderizable.h:193
mrpt::opengl::CRenderizable::setPose
CRenderizable & setPose(const mrpt::poses::CPose3D &o)
Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)
Definition: CRenderizable.cpp:309
mrpt::opengl::CRenderizable::setColorA
CRenderizable & setColorA(const double a)
Color components in the range [0,1].
Definition: CRenderizable.h:182
s
GLdouble s
Definition: glext.h:3676
mrpt::opengl::CRenderizable::getPosePitch
double getPosePitch() const
Rotation relative to parent coordinate origin, in DEGREES.
Definition: CRenderizable.h:141
G
const double G
Definition: vision_stereo_rectify/test.cpp:31
mrpt::poses::CPose3D::pitch
double pitch() const
Get the PITCH angle (in radians)
Definition: CPose3D.h:534
mrpt::opengl::CRenderizable::renderTextBitmap
static void renderTextBitmap(const char *str, void *fontStyle)
This method is safe for calling from within ::render() methods.
Definition: CRenderizable.cpp:367
mrpt::opengl::CRenderizable::getColorG
double getColorG() const
Color components in the range [0,1].
Definition: CRenderizable.h:153
mrpt::opengl::CRenderizable::readFromStreamRender
void readFromStreamRender(mrpt::serialization::CArchive &in)
Definition: CRenderizable.cpp:164
mrpt::opengl::CRenderizable::getColorB_u8
uint8_t getColorB_u8() const
Color components in the range [0,255].
Definition: CRenderizable.h:163
mrpt::opengl::CRenderizable::CRenderizable
CRenderizable()
Default constructor:
Definition: CRenderizable.cpp:55
mrpt::opengl::CRenderizable
The base class of 3D objects that can be directly rendered through OpenGL.
Definition: CRenderizable.h:43
c
const GLubyte * c
Definition: glext.h:6313
mrpt::opengl::CRenderizable::setScale
CRenderizable & setScale(float s)
Scale to apply to the object, in all three axes (default=1)
Definition: CRenderizable.h:213
mrpt::opengl::CRenderizable::textBitmapWidth
static int textBitmapWidth(const std::string &str, mrpt::opengl::TOpenGLFont font=mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24)
Return the exact width in pixels for a given string, as will be rendered by renderTextBitmap().
Definition: CRenderizable.cpp:376
mrpt::opengl::CRenderizable::releaseTextureName
static void releaseTextureName(unsigned int i)
Definition: CRenderizable.cpp:99
mrpt::opengl::CRenderizable::getScaleX
float getScaleX() const
Get the current scaling factor in one axis.
Definition: CRenderizable.h:228
mrpt::opengl::CRenderizable::traceRay
virtual bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const
Simulation of ray-trace, given a pose.
Definition: CRenderizable.cpp:344
mrpt::opengl::CRenderizable::setColorA_u8
virtual CRenderizable & setColorA_u8(const uint8_t a)
Color components in the range [0,255].
Definition: CRenderizable.h:205
mrpt::img::TColor::R
uint8_t R
Definition: TColor.h:48
mrpt::opengl::CRenderizable::getBoundingBox
virtual void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const =0
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
mrpt::opengl::CRenderizable::isShowNameEnabled
bool isShowNameEnabled() const
Definition: CRenderizable.h:87
mrpt::opengl::CRenderizable::setLocation
CRenderizable & setLocation(const mrpt::math::TPoint3D &p)
Changes the location of the object, keeping untouched the orientation.
Definition: CRenderizable.h:124
mrpt::opengl::CRenderizable::setColorB_u8
virtual CRenderizable & setColorB_u8(const uint8_t b)
Color components in the range [0,255].
Definition: CRenderizable.h:199
mrpt::opengl::CRenderizable::getColorA
double getColorA() const
Color components in the range [0,1].
Definition: CRenderizable.h:157
mrpt::opengl::CRenderizable::setColor
CRenderizable & setColor(const mrpt::img::TColorf &c)
Changes the default object color.
Definition: CRenderizable.h:239
mrpt::opengl::CRenderizable::Ptr
std::shared_ptr< CRenderizable > Ptr
Definition: CRenderizable.h:45
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
g
GLubyte g
Definition: glext.h:6279
mrpt::opengl::CRenderizable::setColorR_u8
virtual CRenderizable & setColorR_u8(const uint8_t r)
Color components in the range [0,255].
Definition: CRenderizable.h:187
mrpt::opengl::CRenderizable::m_name
std::string m_name
Definition: CRenderizable.h:51
mrpt::opengl::CRenderizable::getScaleZ
float getScaleZ() const
Get the current scaling factor in one axis.
Definition: CRenderizable.h:232
uint8_t
unsigned char uint8_t
Definition: rptypes.h:41
mrpt::opengl::CRenderizable::getPoseZ
double getPoseZ() const
Translation relative to parent coordinate origin.
Definition: CRenderizable.h:137
R
const float R
Definition: CKinematicChain.cpp:138
p
GLfloat GLfloat p
Definition: glext.h:6305
mrpt::RAD2DEG
double RAD2DEG(const double x)
Radians to degrees.
Definition: core/include/mrpt/core/bits_math.h:48
mrpt::opengl::CRenderizable::setColorB
CRenderizable & setColorB(const double b)
Color components in the range [0,1].
Definition: CRenderizable.h:177
mrpt::opengl::CRenderizable::getPosePitchRad
double getPosePitchRad() const
Rotation relative to parent coordinate origin, in radians.
Definition: CRenderizable.h:147
mrpt::opengl::CRenderizable::setLocation
CRenderizable & setLocation(double x, double y, double z)
Changes the location of the object, keeping untouched the orientation.
Definition: CRenderizable.h:114
mrpt::opengl::CRenderizable::getColorB
double getColorB() const
Color components in the range [0,1].
Definition: CRenderizable.h:155
mrpt::serialization::CArchive
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:48
lightweight_geom_data.h
mrpt::opengl::CRenderizable::enableShowName
void enableShowName(bool showName=true)
Enables or disables showing the name of the object as a label when rendering.
Definition: CRenderizable.h:85
mrpt::opengl::CRenderizable::getPose
mrpt::math::TPose3D getPose() const
Returns the 3D pose of the object as TPose3D.
Definition: CRenderizable.cpp:343
r
GLdouble GLdouble GLdouble r
Definition: glext.h:3705
mrpt::img::TColor::B
uint8_t B
Definition: TColor.h:48
mrpt::opengl::CSetOfObjects
A set of object, which are referenced to the coordinates framework established in this object.
Definition: CSetOfObjects.h:28
mrpt::opengl::CRenderizable::getPoseY
double getPoseY() const
Translation relative to parent coordinate origin.
Definition: CRenderizable.h:135
mrpt::opengl::CRenderizable::m_pose
mrpt::poses::CPose3D m_pose
6D pose wrt the parent coordinate reference.
Definition: CRenderizable.h:57
mrpt::opengl::CRenderizable::m_color
mrpt::img::TColor m_color
Color components in the range [0,255].
Definition: CRenderizable.h:54
mrpt::opengl::CRenderizable::checkOpenGLError
static void checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
Definition: CRenderizable.cpp:301
mrpt::poses::CPoseOrPoint::y
double y() const
Definition: CPoseOrPoint.h:144
mrpt::opengl::CRenderizable::getPoseRollRad
double getPoseRollRad() const
Rotation relative to parent coordinate origin, in radians.
Definition: CRenderizable.h:149
mrpt::opengl::CRenderizable::getPoseRef
const mrpt::poses::CPose3D & getPoseRef() const
Returns a const ref to the 3D pose of the object as mrpt::poses::CPose3D (which explicitly contains t...
Definition: CRenderizable.h:111
opengl_fonts.h
mrpt::opengl::CRenderizable::getScaleY
float getScaleY() const
Get the current scaling factor in one axis.
Definition: CRenderizable.h:230
mrpt::poses::CPose2D
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
Definition: CPose2D.h:40
mrpt::poses::CPoseOrPoint::x
double x() const
Common members of all points & poses classes.
Definition: CPoseOrPoint.h:140
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
b
GLubyte GLubyte b
Definition: glext.h:6279
mrpt::img::TColorf
A RGB color - floats in the range [0,1].
Definition: TColor.h:79
mrpt::poses::CPose3D::roll
double roll() const
Get the ROLL angle (in radians)
Definition: CPose3D.h:540
mrpt::img::TColor
A RGB color - 8bit.
Definition: TColor.h:22
mrpt::opengl::CRenderizable::setColorR
CRenderizable & setColorR(const double r)
Color components in the range [0,1].
Definition: CRenderizable.h:167
mrpt::math::TPose2D
Lightweight 2D pose.
Definition: lightweight_geom_data.h:186
math_frwds.h
mrpt::serialization::CSerializable
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:32
mrpt::opengl::CRenderizable::getPoseX
double getPoseX() const
Translation relative to parent coordinate origin.
Definition: CRenderizable.h:133
mrpt::opengl::CRenderizable::m_scale_y
float m_scale_y
Definition: CRenderizable.h:59
mrpt::math::TPose3D
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Definition: lightweight_geom_data.h:603
mrpt::opengl::CRenderizable::setColor
CRenderizable & setColor(double R, double G, double B, double A=1)
Set the color components of this object (R,G,B,Alpha, in the range 0-1)
Definition: CRenderizable.h:248
mrpt::opengl::CRenderizable::setVisibility
void setVisibility(bool visible=true)
Set object visibility (default=true)
Definition: CRenderizable.h:76
mrpt::opengl::CRenderizable::setColorG
CRenderizable & setColorG(const double g)
Color components in the range [0,1].
Definition: CRenderizable.h:172
mrpt::opengl::CRenderizable::render
virtual void render() const =0
Implements the rendering of 3D objects in each class derived from CRenderizable.
mrpt::img::TColor::A
uint8_t A
Definition: TColor.h:48
mrpt::opengl::CRenderizable::getPoseRoll
double getPoseRoll() const
Rotation relative to parent coordinate origin, in DEGREES.
Definition: CRenderizable.h:143
mrpt::opengl::CRenderizable::m_show_name
bool m_show_name
Definition: CRenderizable.h:52
mrpt::opengl::CRenderizable::m_scale_x
float m_scale_x
Scale components to apply to the object (default=1)
Definition: CRenderizable.h:59
DEFINE_VIRTUAL_SERIALIZABLE
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
Definition: CSerializable.h:119
mrpt::opengl::CRenderizable::getName
const std::string & getName() const
Returns the name of the object.
Definition: CRenderizable.h:70
mrpt::opengl::operator<<
mrpt::serialization::CArchive & operator<<(mrpt::serialization::CArchive &out, const mrpt::opengl::CLight &o)
Definition: CLight.cpp:130
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
CPose3D.h
mrpt::opengl::CRenderizable::m_visible
bool m_visible
Is the object visible? (default=true)
Definition: CRenderizable.h:61
mrpt::opengl::CRenderizable::m_scale_z
float m_scale_z
Definition: CRenderizable.h:59
img
GLint GLvoid * img
Definition: glext.h:3763
mrpt::opengl::CRenderizable::getColorA_u8
uint8_t getColorA_u8() const
Color components in the range [0,255].
Definition: CRenderizable.h:165
mrpt::poses::CPose3D::yaw
double yaw() const
Get the YAW angle (in radians)
Definition: CPose3D.h:528
mrpt::opengl::CRenderizable::getPoseYaw
double getPoseYaw() const
Rotation relative to parent coordinate origin, in DEGREES.
Definition: CRenderizable.h:139
mrpt::opengl::CRenderizable::getColor
mrpt::img::TColorf getColor() const
Returns the object color property as a TColorf.
Definition: CRenderizable.h:234
mrpt::img::TColor::G
uint8_t G
Definition: TColor.h:48
mrpt::opengl::CListOpenGLObjects
std::deque< CRenderizable::Ptr > CListOpenGLObjects
A list of objects pointers, automatically managing memory free at destructor, and managing copies cor...
Definition: CRenderizable.h:332
mrpt::opengl::COpenGLViewport
A viewport within a COpenGLScene, containing a set of OpenGL objects to render.
Definition: COpenGLViewport.h:60
mrpt::opengl::CRenderizable::getColor_u8
const mrpt::img::TColor & getColor_u8() const
Returns the object color property as a TColor.
Definition: CRenderizable.h:254
z
GLdouble GLdouble z
Definition: glext.h:3872
mrpt::opengl::CRenderizable::setName
void setName(const std::string &n)
Changes the name of the object.
Definition: CRenderizable.h:68
in
GLuint in
Definition: glext.h:7274
mrpt::opengl::CRenderizable::getColorR
double getColorR() const
Color components in the range [0,1].
Definition: CRenderizable.h:151
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::opengl::CRenderizable::getColorR_u8
uint8_t getColorR_u8() const
Color components in the range [0,255].
Definition: CRenderizable.h:159
mrpt::poses::CPoint2D
A class used to store a 2D point.
Definition: CPoint2D.h:35
mrpt::poses::CPoint3D
A class used to store a 3D point.
Definition: CPoint3D.h:33
CSerializable.h
mrpt::opengl::CRenderizable::writeToStreamRender
void writeToStreamRender(mrpt::serialization::CArchive &out) const
Definition: CRenderizable.cpp:110
mrpt::opengl::CRenderizable::setColor_u8
virtual CRenderizable & setColor_u8(const mrpt::img::TColor &c)
Definition: CRenderizable.cpp:356
mrpt::opengl::CRenderizable::getColorG_u8
uint8_t getColorG_u8() const
Color components in the range [0,255].
Definition: CRenderizable.h:161
mrpt::opengl::CRenderizable::getPoseYawRad
double getPoseYawRad() const
Rotation relative to parent coordinate origin, in radians.
Definition: CRenderizable.h:145
y
GLenum GLint GLint y
Definition: glext.h:3538
mrpt::opengl::CRenderizable::isVisible
bool isVisible() const
Is the object visible?
Definition: CRenderizable.h:71
mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24
@ MRPT_GLUT_BITMAP_TIMES_ROMAN_24
Definition: opengl_fonts.h:29
TColor.h
x
GLenum GLint x
Definition: glext.h:3538
a
GLubyte GLubyte GLubyte a
Definition: glext.h:6279
mrpt::opengl::CRenderizable::setScale
CRenderizable & setScale(float sx, float sy, float sz)
Scale to apply to the object in each axis (default=1)
Definition: CRenderizable.h:220



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