Go to the documentation of this file.
9 #ifndef opengl_CRenderizable_H
10 #define opengl_CRenderizable_H
24 class COpenGLViewport;
243 c.R * 255.f,
c.G * 255.f,
c.B * 255.f,
c.A * 255.f));
274 virtual void render()
const = 0;
306 int screen_x,
int screen_y,
const std::string& str,
float color_r = 1,
307 float color_g = 1,
float color_b = 1,
TOpenGLFont
Existing fonts for 2D texts in mrpt::opengl methods.
static unsigned int getNewTextureNumber()
Returns the lowest next free texture name (avoid using OpenGL's own function since we may call them f...
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)
virtual CRenderizable & setColorG_u8(const uint8_t g)
Color components in the range [0,255].
CRenderizable & setPose(const mrpt::poses::CPose3D &o)
Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)
CRenderizable & setColorA(const double a)
Color components in the range [0,1].
double getPosePitch() const
Rotation relative to parent coordinate origin, in DEGREES.
double pitch() const
Get the PITCH angle (in radians)
static void renderTextBitmap(const char *str, void *fontStyle)
This method is safe for calling from within ::render() methods.
double getColorG() const
Color components in the range [0,1].
void readFromStreamRender(mrpt::serialization::CArchive &in)
uint8_t getColorB_u8() const
Color components in the range [0,255].
CRenderizable()
Default constructor:
The base class of 3D objects that can be directly rendered through OpenGL.
CRenderizable & setScale(float s)
Scale to apply to the object, in all three axes (default=1)
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().
static void releaseTextureName(unsigned int i)
float getScaleX() const
Get the current scaling factor in one axis.
virtual bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const
Simulation of ray-trace, given a pose.
virtual CRenderizable & setColorA_u8(const uint8_t a)
Color components in the range [0,255].
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...
bool isShowNameEnabled() const
CRenderizable & setLocation(const mrpt::math::TPoint3D &p)
Changes the location of the object, keeping untouched the orientation.
virtual CRenderizable & setColorB_u8(const uint8_t b)
Color components in the range [0,255].
double getColorA() const
Color components in the range [0,1].
CRenderizable & setColor(const mrpt::img::TColorf &c)
Changes the default object color.
std::shared_ptr< CRenderizable > Ptr
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
virtual CRenderizable & setColorR_u8(const uint8_t r)
Color components in the range [0,255].
float getScaleZ() const
Get the current scaling factor in one axis.
double getPoseZ() const
Translation relative to parent coordinate origin.
double RAD2DEG(const double x)
Radians to degrees.
CRenderizable & setColorB(const double b)
Color components in the range [0,1].
double getPosePitchRad() const
Rotation relative to parent coordinate origin, in radians.
CRenderizable & setLocation(double x, double y, double z)
Changes the location of the object, keeping untouched the orientation.
double getColorB() const
Color components in the range [0,1].
Virtual base class for "archives": classes abstracting I/O streams.
void enableShowName(bool showName=true)
Enables or disables showing the name of the object as a label when rendering.
mrpt::math::TPose3D getPose() const
Returns the 3D pose of the object as TPose3D.
GLdouble GLdouble GLdouble r
A set of object, which are referenced to the coordinates framework established in this object.
double getPoseY() const
Translation relative to parent coordinate origin.
mrpt::poses::CPose3D m_pose
6D pose wrt the parent coordinate reference.
mrpt::img::TColor m_color
Color components in the range [0,255].
static void checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
double getPoseRollRad() const
Rotation relative to parent coordinate origin, in radians.
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...
float getScaleY() const
Get the current scaling factor in one axis.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
double x() const
Common members of all points & poses classes.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
A RGB color - floats in the range [0,1].
double roll() const
Get the ROLL angle (in radians)
CRenderizable & setColorR(const double r)
Color components in the range [0,1].
The virtual base class which provides a unified interface for all persistent objects in MRPT.
double getPoseX() const
Translation relative to parent coordinate origin.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
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)
void setVisibility(bool visible=true)
Set object visibility (default=true)
CRenderizable & setColorG(const double g)
Color components in the range [0,1].
virtual void render() const =0
Implements the rendering of 3D objects in each class derived from CRenderizable.
double getPoseRoll() const
Rotation relative to parent coordinate origin, in DEGREES.
float m_scale_x
Scale components to apply to the object (default=1)
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
const std::string & getName() const
Returns the name of the object.
mrpt::serialization::CArchive & operator<<(mrpt::serialization::CArchive &out, const mrpt::opengl::CLight &o)
bool m_visible
Is the object visible? (default=true)
uint8_t getColorA_u8() const
Color components in the range [0,255].
double yaw() const
Get the YAW angle (in radians)
double getPoseYaw() const
Rotation relative to parent coordinate origin, in DEGREES.
mrpt::img::TColorf getColor() const
Returns the object color property as a TColorf.
std::deque< CRenderizable::Ptr > CListOpenGLObjects
A list of objects pointers, automatically managing memory free at destructor, and managing copies cor...
A viewport within a COpenGLScene, containing a set of OpenGL objects to render.
const mrpt::img::TColor & getColor_u8() const
Returns the object color property as a TColor.
void setName(const std::string &n)
Changes the name of the object.
double getColorR() const
Color components in the range [0,1].
GLsizei const GLchar ** string
uint8_t getColorR_u8() const
Color components in the range [0,255].
A class used to store a 2D point.
A class used to store a 3D point.
void writeToStreamRender(mrpt::serialization::CArchive &out) const
virtual CRenderizable & setColor_u8(const mrpt::img::TColor &c)
uint8_t getColorG_u8() const
Color components in the range [0,255].
double getPoseYawRad() const
Rotation relative to parent coordinate origin, in radians.
bool isVisible() const
Is the object visible?
@ MRPT_GLUT_BITMAP_TIMES_ROMAN_24
GLubyte GLubyte GLubyte a
CRenderizable & setScale(float sx, float sy, float sz)
Scale to apply to the object in each axis (default=1)
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 | |