Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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/utils/TColor.h>
14 #include <mrpt/math/math_frwds.h>
15 #include <mrpt/poses/CPose3D.h>
19 #include <deque>
20 
21 namespace mrpt
22 {
23  namespace opengl
24  {
25  class COpenGLViewport;
26  class CSetOfObjects;
27 
28 
29  // This must be added to any CSerializable derived class:
31 
32  /** A list of objects pointers, automatically managing memory free at destructor, and managing copies correctly. */
33  typedef std::deque<CRenderizablePtr> CListOpenGLObjects;
34 
35  /** The base class of 3D objects that can be directly rendered through OpenGL.
36  * In this class there are a set of common properties to all 3D objects, mainly:
37  * - A name (m_name): A name that can be optionally asigned to objects for easing its reference.
38  * - 6D coordinates (x,y,z,yaw,pitch,roll), relative to the "current" reference framework. By default, any object is referenced to global scene coordinates.
39  * - A RGB color: This field will be used in simple elements (points, lines, text,...) but is ignored in more complex objects that carry their own color information (triangle sets,...)
40  * See the main class opengl::COpenGLScene
41  * \sa opengl::COpenGLScene, mrpt::opengl
42  * \ingroup mrpt_opengl_grp
43  */
44  class OPENGL_IMPEXP CRenderizable : public mrpt::utils::CSerializable
45  {
47 
48  friend class mrpt::opengl::COpenGLViewport;
49  friend class mrpt::opengl::CSetOfObjects;
50 
51  protected:
52  std::string m_name;
53  bool m_show_name;
54  mrpt::utils::TColor m_color; //!< Color components in the range [0,255]
55  mrpt::poses::CPose3D m_pose; //!< 6D pose wrt the parent coordinate reference. This class automatically holds the cached 3x3 rotation matrix for quick load into opengl stack.
56  float m_scale_x, m_scale_y, m_scale_z; //!< Scale components to apply to the object (default=1)
57  bool m_visible; //!< Is the object visible? (default=true)
58 
59  public:
60  /** @name Changes the appearance of the object to render
61  @{ */
62 
63  void setName(const std::string &n) { m_name=n; } //!< Changes the name of the object
64  const std::string &getName() const { return m_name; } //!< Returns the name of the object
65 
66  inline bool isVisible() const /** Is the object visible? \sa setVisibility */ { return m_visible; }
67  inline void setVisibility(bool visible=true) /** Set object visibility (default=true) \sa isVisible */ { m_visible=visible; }
68 
69  inline void enableShowName(bool showName=true) { m_show_name=showName; } //!< Enables or disables showing the name of the object as a label when rendering
70  inline bool isShowNameEnabled() const { return m_show_name; } //!< \sa enableShowName
71 
72  CRenderizable& setPose( const mrpt::poses::CPose3D &o ); //!< Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)
73  CRenderizable& setPose( const mrpt::math::TPose3D &o ); //!< Set the 3D pose from a mrpt::math::TPose3D object (return a ref to this)
74  CRenderizable& setPose( const mrpt::poses::CPoint3D &o ); //!< Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)
75  CRenderizable& setPose( const mrpt::poses::CPoint2D &o ); //!< Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)
76 
77  mrpt::math::TPose3D getPose() const; //!< Returns the 3D pose of the object as TPose3D
78  /** Returns a const ref to the 3D pose of the object as mrpt::poses::CPose3D (which explicitly contains the 3x3 rotation matrix) */
79  inline const mrpt::poses::CPose3D & getPoseRef() const { return m_pose; }
80 
81  /** Changes the location of the object, keeping untouched the orientation \return a ref to this */
82  inline CRenderizable& setLocation(double x,double y,double z) { m_pose.x(x); m_pose.y(y); m_pose.z(z); return *this; }
83 
84  /** Changes the location of the object, keeping untouched the orientation \return a ref to this */
85  inline CRenderizable& setLocation(const mrpt::math::TPoint3D &p ) { m_pose.x(p.x); m_pose.y(p.y); m_pose.z(p.z); return *this; }
86 
87  inline double getPoseX() const { return m_pose.x(); } //!< Translation relative to parent coordinate origin.
88  inline double getPoseY() const { return m_pose.y(); } //!< Translation relative to parent coordinate origin.
89  inline double getPoseZ() const { return m_pose.z(); } //!< Translation relative to parent coordinate origin.
90  inline double getPoseYaw() const { return mrpt::utils::RAD2DEG(m_pose.yaw()); } //!< Rotation relative to parent coordinate origin, in **DEGREES**.
91  inline double getPosePitch() const { return mrpt::utils::RAD2DEG(m_pose.pitch()); } //!< Rotation relative to parent coordinate origin, in **DEGREES**.
92  inline double getPoseRoll() const { return mrpt::utils::RAD2DEG(m_pose.roll()); } //!< Rotation relative to parent coordinate origin, in **DEGREES**.
93  inline double getPoseYawRad() const { return m_pose.yaw(); } //!< Rotation relative to parent coordinate origin, in radians.
94  inline double getPosePitchRad() const { return m_pose.pitch(); } //!< Rotation relative to parent coordinate origin, in radians.
95  inline double getPoseRollRad() const { return m_pose.roll(); } //!< Rotation relative to parent coordinate origin, in radians.
96 
97  inline double getColorR() const { return m_color.R/255.; } //!< Color components in the range [0,1]
98  inline double getColorG() const { return m_color.G/255.; } //!< Color components in the range [0,1]
99  inline double getColorB() const { return m_color.B/255.; } //!< Color components in the range [0,1]
100  inline double getColorA() const { return m_color.A/255.; } //!< Color components in the range [0,1]
101 
102  inline uint8_t getColorR_u8() const { return m_color.R; } //!< Color components in the range [0,255]
103  inline uint8_t getColorG_u8() const { return m_color.G; } //!< Color components in the range [0,255]
104  inline uint8_t getColorB_u8() const { return m_color.B; } //!< Color components in the range [0,255]
105  inline uint8_t getColorA_u8() const { return m_color.A; } //!< Color components in the range [0,255]
106 
107  CRenderizable& setColorR(const double r) {return setColorR_u8(static_cast<uint8_t>(255*r));} //!<Color components in the range [0,1] \return a ref to this
108  CRenderizable& setColorG(const double g) {return setColorG_u8(static_cast<uint8_t>(255*g));} //!<Color components in the range [0,1] \return a ref to this
109  CRenderizable& setColorB(const double b) {return setColorB_u8(static_cast<uint8_t>(255*b));} //!<Color components in the range [0,1] \return a ref to this
110  CRenderizable& setColorA(const double a) {return setColorA_u8(static_cast<uint8_t>(255*a));} //!<Color components in the range [0,1] \return a ref to this
111 
112  virtual CRenderizable& setColorR_u8(const uint8_t r) {m_color.R=r; return *this;} //!<Color components in the range [0,255] \return a ref to this
113  virtual CRenderizable& setColorG_u8(const uint8_t g) {m_color.G=g; return *this;} //!<Color components in the range [0,255] \return a ref to this
114  virtual CRenderizable& setColorB_u8(const uint8_t b) {m_color.B=b; return *this;} //!<Color components in the range [0,255] \return a ref to this
115  virtual CRenderizable& setColorA_u8(const uint8_t a) {m_color.A=a; return *this;} //!<Color components in the range [0,255] \return a ref to this
116 
117  inline CRenderizable& setScale(float s) { m_scale_x=m_scale_y=m_scale_z = s; return *this; } //!< Scale to apply to the object, in all three axes (default=1) \return a ref to this
118  inline CRenderizable& setScale(float sx,float sy,float sz) { m_scale_x=sx; m_scale_y=sy; m_scale_z = sz; return *this; } //!< Scale to apply to the object in each axis (default=1) \return a ref to this
119  inline float getScaleX() const { return m_scale_x; } //!< Get the current scaling factor in one axis
120  inline float getScaleY() const { return m_scale_y; } //!< Get the current scaling factor in one axis
121  inline float getScaleZ() const { return m_scale_z; } //!< Get the current scaling factor in one axis
122 
123 
124  inline mrpt::utils::TColorf getColor() const { return mrpt::utils::TColorf(m_color); } //!< Returns the object color property as a TColorf
125  CRenderizable& setColor( const mrpt::utils::TColorf &c) //!< Changes the default object color \return a ref to this
126  {
127  return setColor_u8(mrpt::utils::TColor(c.R*255.f,c.G*255.f,c.B*255.f,c.A*255.f));
128  }
129 
130  /** Set the color components of this object (R,G,B,Alpha, in the range 0-1) \return a ref to this */
131  inline CRenderizable& setColor( double R, double G, double B, double A=1) { return setColor_u8(R*255,G*255,B*255,A*255); }
132 
133  inline const mrpt::utils::TColor &getColor_u8() const { return m_color; } //!< Returns the object color property as a TColor
134  /*** Changes the default object color \return a ref to this */
136 
137  /** Set the color components of this object (R,G,B,Alpha, in the range 0-1) \return a ref to this */
138  inline CRenderizable& setColor_u8( uint8_t R, uint8_t G, uint8_t B, uint8_t A=255) { return setColor_u8(mrpt::utils::TColor(R,G,B,A)); }
139 
140  /** @} */
141 
142 
143  /** Default constructor: */
145  virtual ~CRenderizable();
146 
147  /** Interface for the stlplus smart pointer class. */
148  inline CRenderizable * clone() const
149  {
150  return static_cast<CRenderizable*>( this->duplicate() );
151  }
152 
153  /** Implements the rendering of 3D objects in each class derived from CRenderizable.
154  */
155  virtual void render() const = 0;
156 
157  /** Simulation of ray-trace, given a pose. Returns true if the ray effectively collisions with the object (returning the distance to the origin of the ray in "dist"), or false in other case. "dist" variable yields undefined behaviour when false is returned
158  */
159  virtual bool traceRay(const mrpt::poses::CPose3D &o,double &dist) const;
160 
161 
162  /** This method is safe for calling from within ::render() methods \sa renderTextBitmap, mrpt::opengl::gl_utils */
163  static void renderTextBitmap( const char *str, void *fontStyle );
164 
165  /** Return the exact width in pixels for a given string, as will be rendered by renderTextBitmap().
166  * \sa renderTextBitmap, mrpt::opengl::gl_utils
167  */
168  static int textBitmapWidth(
169  const std::string &str,
171 
172  /** Render a text message in the current rendering context, creating a glViewport in the way (do not call within ::render() methods)
173  * - Coordinates (x,y) are 2D pixels, starting at bottom-left of the viewport. Negative numbers will wrap to the opposite side of the viewport (e.g. x=-10 means 10px fromt the right).
174  * - The text color is defined by (color_r,color_g,color_b), each float numbers in the range [0,1].
175  * \sa renderTextBitmap, textBitmapWidth, mrpt::opengl::gl_utils
176  */
177  static void renderTextBitmap(
178  int screen_x,
179  int screen_y,
180  const std::string &str,
181  float color_r=1,
182  float color_g=1,
183  float color_b=1,
185  );
186 
187  /** Evaluates the bounding box of this object (including possible children) in the coordinate frame of the object parent. */
188  virtual void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const = 0;
189 
190  protected:
191  /** Checks glGetError and throws an exception if an error situation is found */
192  static void checkOpenGLError();
193 
196 
197  /** Returns the lowest next free texture name (avoid using OpenGL's own function since we may call them from different threads and seem it's not cool). */
198  static unsigned int getNewTextureNumber();
199  static void releaseTextureName(unsigned int i);
200 
201  };
203 
204  /** Applies a mrpt::poses::CPose3D transformation to the object. Note that this method doesn't <i>set</i> the pose to the given value, but <i>combines</i> it with the existing one.
205  * \sa setPose */
206  OPENGL_IMPEXP CRenderizablePtr & operator<<(CRenderizablePtr &r,const mrpt::poses::CPose3D &p);
207 
208  } // end namespace
209 
210 } // End of namespace
211 
212 // This header goes here so there we can use "CRenderizablePtr"
213 //#include <mrpt/opengl/gl_utils.h>
214 
215 
216 #endif
mrpt::opengl::TOpenGLFont
TOpenGLFont
Existing fonts for 2D texts in mrpt::opengl methods.
Definition: opengl_fonts.h:27
mrpt::opengl::CRenderizable::renderTextBitmap
static void renderTextBitmap(const char *str, void *fontStyle)
This method is safe for calling from within ::render() methods.
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-1)
Definition: CRenderizable.h:138
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().
mrpt::opengl::CRenderizable::setColorG_u8
virtual CRenderizable & setColorG_u8(const uint8_t g)
Color components in the range [0,255].
Definition: CRenderizable.h:113
mrpt::opengl::CRenderizable::setColorA
CRenderizable & setColorA(const double a)
Color components in the range [0,1].
Definition: CRenderizable.h:110
mrpt::opengl::CRenderizable::getPosePitch
double getPosePitch() const
Rotation relative to parent coordinate origin, in DEGREES.
Definition: CRenderizable.h:91
mrpt::opengl::CRenderizable::getColorG
double getColorG() const
Color components in the range [0,1].
Definition: CRenderizable.h:98
mrpt::utils::TColorf::A
float A
Definition: TColor.h:56
mrpt::opengl::CRenderizable::getColorB_u8
uint8_t getColorB_u8() const
Color components in the range [0,255].
Definition: CRenderizable.h:104
mrpt::opengl::CRenderizable
The base class of 3D objects that can be directly rendered through OpenGL.
Definition: CRenderizable.h:45
mrpt::opengl::CRenderizable::setScale
CRenderizable & setScale(float s)
Scale to apply to the object, in all three axes (default=1)
Definition: CRenderizable.h:117
mrpt::opengl::CRenderizable::renderTextBitmap
static void renderTextBitmap(int screen_x, int screen_y, const std::string &str, float color_r=1, float color_g=1, float color_b=1, mrpt::opengl::TOpenGLFont font=mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24)
Render a text message in the current rendering context, creating a glViewport in the way (do not call...
mrpt::opengl::CRenderizable::getScaleX
float getScaleX() const
Get the current scaling factor in one axis.
Definition: CRenderizable.h:119
mrpt::math::TPoint3D::z
double z
X,Y,Z coordinates.
Definition: lightweight_geom_data.h:231
mrpt::opengl::CRenderizable::readFromStreamRender
void readFromStreamRender(utils::CStream &in)
mrpt::opengl::CRenderizable::clone
CRenderizable * clone() const
Interface for the stlplus smart pointer class.
Definition: CRenderizable.h:148
mrpt::opengl::CRenderizable::getColor_u8
const mrpt::utils::TColor & getColor_u8() const
Returns the object color property as a TColor.
Definition: CRenderizable.h:133
mrpt::opengl::CRenderizable::setColorA_u8
virtual CRenderizable & setColorA_u8(const uint8_t a)
Color components in the range [0,255].
Definition: CRenderizable.h:115
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::utils::TColorf::G
float G
Definition: TColor.h:56
mrpt::opengl::CRenderizable::isShowNameEnabled
bool isShowNameEnabled() const
Definition: CRenderizable.h:70
mrpt::opengl::CRenderizable::setLocation
CRenderizable & setLocation(const mrpt::math::TPoint3D &p)
Changes the location of the object, keeping untouched the orientation.
Definition: CRenderizable.h:85
mrpt::opengl::CRenderizable::setColorB_u8
virtual CRenderizable & setColorB_u8(const uint8_t b)
Color components in the range [0,255].
Definition: CRenderizable.h:114
mrpt::opengl::CRenderizable::getColorA
double getColorA() const
Color components in the range [0,1].
Definition: CRenderizable.h:100
mrpt::opengl::CRenderizable::writeToStreamRender
void writeToStreamRender(utils::CStream &out) const
mrpt::opengl::CListOpenGLObjects
std::deque< CRenderizablePtr > CListOpenGLObjects
A list of objects pointers, automatically managing memory free at destructor, and managing copies cor...
Definition: CRenderizable.h:33
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CParticleFilter.h:17
mrpt::opengl::CRenderizable::setColorR_u8
virtual CRenderizable & setColorR_u8(const uint8_t r)
Color components in the range [0,255].
Definition: CRenderizable.h:112
mrpt::opengl::CRenderizable::setPose
CRenderizable & setPose(const mrpt::poses::CPoint3D &o)
Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)
mrpt::opengl::CRenderizable::getScaleZ
float getScaleZ() const
Get the current scaling factor in one axis.
Definition: CRenderizable.h:121
mrpt::opengl::CRenderizable::traceRay
virtual bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const
Simulation of ray-trace, given a pose.
mrpt::opengl::CRenderizable::getPoseZ
double getPoseZ() const
Translation relative to parent coordinate origin.
Definition: CRenderizable.h:89
mrpt::opengl::CRenderizable::setColor
CRenderizable & setColor(const mrpt::utils::TColorf &c)
Definition: CRenderizable.h:125
mrpt::opengl::CRenderizable::setColorB
CRenderizable & setColorB(const double b)
Color components in the range [0,1].
Definition: CRenderizable.h:109
mrpt::opengl::CRenderizable::getPosePitchRad
double getPosePitchRad() const
Rotation relative to parent coordinate origin, in radians.
Definition: CRenderizable.h:94
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:82
mrpt::opengl::CRenderizable::getColorB
double getColorB() const
Color components in the range [0,1].
Definition: CRenderizable.h:99
mrpt::opengl::CRenderizable::setPose
CRenderizable & setPose(const mrpt::math::TPose3D &o)
Set the 3D pose from a mrpt::math::TPose3D object (return a ref to this)
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:69
mrpt::opengl::CRenderizable::CRenderizable
CRenderizable()
Default constructor:
mrpt::opengl::CSetOfObjects
A set of object, which are referenced to the coordinates framework established in this object.
Definition: CSetOfObjects.h:33
mrpt::opengl::CRenderizable::getPoseY
double getPoseY() const
Translation relative to parent coordinate origin.
Definition: CRenderizable.h:88
mrpt::opengl::CRenderizable::setPose
CRenderizable & setPose(const mrpt::poses::CPoint2D &o)
Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)
mrpt::opengl::CRenderizable::getPoseRollRad
double getPoseRollRad() const
Rotation relative to parent coordinate origin, in radians.
Definition: CRenderizable.h:95
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:79
opengl_fonts.h
mrpt::opengl::CRenderizable::getScaleY
float getScaleY() const
Get the current scaling factor in one axis.
Definition: CRenderizable.h:120
mrpt::utils::CStream
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:39
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:73
mrpt::math::TPoint3D::x
double x
Definition: lightweight_geom_data.h:231
mrpt::opengl::CRenderizable::getPose
mrpt::math::TPose3D getPose() const
Returns the 3D pose of the object as TPose3D.
DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
Definition: CSerializable.h:174
mrpt::opengl::CRenderizable::setColorR
CRenderizable & setColorR(const double r)
Color components in the range [0,1].
Definition: CRenderizable.h:107
math_frwds.h
mrpt::opengl::CRenderizable::getPoseX
double getPoseX() const
Translation relative to parent coordinate origin.
Definition: CRenderizable.h:87
mrpt::math::TPose3D
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Definition: lightweight_geom_data.h:389
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:131
mrpt::opengl::CRenderizable::setVisibility
void setVisibility(bool visible=true)
Set object visibility (default=true)
Definition: CRenderizable.h:67
mrpt::opengl::CRenderizable::setColorG
CRenderizable & setColorG(const double g)
Color components in the range [0,1].
Definition: CRenderizable.h:108
mrpt::opengl::CRenderizable::render
virtual void render() const =0
Implements the rendering of 3D objects in each class derived from CRenderizable.
mrpt::opengl::CRenderizable::getPoseRoll
double getPoseRoll() const
Rotation relative to parent coordinate origin, in DEGREES.
Definition: CRenderizable.h:92
DEFINE_VIRTUAL_SERIALIZABLE
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
Definition: CSerializable.h:192
mrpt::opengl::CRenderizable::getName
const std::string & getName() const
Returns the name of the object.
Definition: CRenderizable.h:64
mrpt::opengl::CRenderizable::getColor
mrpt::utils::TColorf getColor() const
Returns the object color property as a TColorf.
Definition: CRenderizable.h:124
mrpt::utils::CSerializable
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:40
mrpt::utils::TColorf::R
float R
Definition: TColor.h:56
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:229
CPose3D.h
mrpt::utils::TColorf
A RGB color - floats in the range [0,1].
Definition: TColor.h:53
DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE
#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...
Definition: CSerializable.h:170
mrpt::math::TPoint3D::y
double y
Definition: lightweight_geom_data.h:231
mrpt::utils::TColor
A RGB color - 8bit.
Definition: TColor.h:26
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...
mrpt::opengl::CRenderizable::getColorA_u8
uint8_t getColorA_u8() const
Color components in the range [0,255].
Definition: CRenderizable.h:105
mrpt::opengl::CRenderizable::releaseTextureName
static void releaseTextureName(unsigned int i)
mrpt::opengl::CRenderizable::getPoseYaw
double getPoseYaw() const
Rotation relative to parent coordinate origin, in DEGREES.
Definition: CRenderizable.h:90
mrpt::opengl::CRenderizable::checkOpenGLError
static void checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
mrpt::opengl::COpenGLViewport
A viewport within a COpenGLScene, containing a set of OpenGL objects to render.
Definition: COpenGLViewport.h:59
mrpt::opengl::CRenderizable::getColorR
double getColorR() const
Color components in the range [0,1].
Definition: CRenderizable.h:97
mrpt::utils::RAD2DEG
double RAD2DEG(const double x)
Radians to degrees.
Definition: bits.h:75
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)
mrpt::opengl::CRenderizable::getColorR_u8
uint8_t getColorR_u8() const
Color components in the range [0,255].
Definition: CRenderizable.h:102
mrpt::poses::CPoint2D
A class used to store a 2D point.
Definition: CPoint2D.h:37
mrpt::poses::CPoint3D
A class used to store a 3D point.
Definition: CPoint3D.h:33
CSerializable.h
mrpt::opengl::CRenderizable::getColorG_u8
uint8_t getColorG_u8() const
Color components in the range [0,255].
Definition: CRenderizable.h:103
mrpt::opengl::CRenderizable::getPoseYawRad
double getPoseYawRad() const
Rotation relative to parent coordinate origin, in radians.
Definition: CRenderizable.h:93
mrpt::opengl::CRenderizable::setColor_u8
virtual CRenderizable & setColor_u8(const mrpt::utils::TColor &c)
mrpt::opengl::CRenderizable::isVisible
bool isVisible() const
Is the object visible?
Definition: CRenderizable.h:66
mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24
@ MRPT_GLUT_BITMAP_TIMES_ROMAN_24
Definition: opengl_fonts.h:30
TColor.h
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:118
mrpt::utils::TColorf::B
float B
Definition: TColor.h:56
mrpt::opengl::CRenderizable::~CRenderizable
virtual ~CRenderizable()



Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020