Go to the documentation of this file.
26 class COpenGLViewport;
29 struct TLightParameters;
405 std::map<shader_id_t, mrpt::opengl::Program::Ptr>& shaders,
A resource handling helper for OpenGL Shader "programs".
CRenderizable & setColor(float R, float G, float B, float A=1)
Set the color components of this object (R,G,B,Alpha, in the range 0-1)
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)
uint8_t shader_id_t
Type for IDs of shaders.
virtual void enqueForRenderRecursive([[maybe_unused]] const mrpt::opengl::TRenderMatrices &state, [[maybe_unused]] RenderQueue &rq) const
Process all children objects recursively, if the object is a container.
~CRenderizable() override
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
const mrpt::opengl::Program * shader
std::map< shader_id_t, std::multimap< float, RenderQueueElement > > RenderQueue
A queue for rendering, sorted by shader program to minimize changes of OpenGL shader programs while r...
double getPosePitch() const
Rotation relative to parent coordinate origin, in DEGREES.
double pitch() const
Get the PITCH angle (in radians)
void readFromStreamRender(mrpt::serialization::CArchive &in)
uint8_t getColorB_u8() const
Color components in the range [0,255].
double x() const
Common members of all points & poses classes.
CRenderizable()
Default constructor:
The base class of 3D objects that can be directly rendered through OpenGL.
virtual void renderUpdateBuffers() const =0
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers,...
mrpt::opengl::CText & labelObject() const
Returns or constructs (in its first invokation) the associated mrpt::opengl::CText object representin...
CRenderizable & setScale(float s)
Scale to apply to the object, in all three axes (default=1)
void processRenderQueue(const RenderQueue &rq, std::map< shader_id_t, mrpt::opengl::Program::Ptr > &shaders, const mrpt::opengl::TLightParameters &lights)
After enqueForRendering(), actually executes the rendering tasks, grouped shader by shader.
float getScaleX() const
Get the current scaling factor in one axis.
CRenderizable & setColorB(const float b)
Color components in the range [0,1].
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].
uint8_t f2u8(const float f)
converts a float [0,1] into an uint8_t [0,255] (without checking for out of bounds)
void setLocalRepresentativePoint(const mrpt::math::TPoint3Df &p)
See getLocalRepresentativePoint()
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].
mrpt::vision::TStereoCalibResults out
CRenderizable & setColor(const mrpt::img::TColorf &c)
Changes the default object color.
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.
float getColorR() const
Color components in the range [0,1].
#define THROW_EXCEPTION(msg)
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.
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.
mrpt::math::TPoint3Df m_representativePoint
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].
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.
constexpr double RAD2DEG(const double x)
Radians to degrees.
float u8tof(const uint8_t v)
converts a uint8_t [0,255] into a float [0,1]
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
float getColorA() const
Color components in the range [0,1].
CRenderizable & setColorA(const float a)
Color components in the range [0,1].
An RGBA color - floats in the range [0,1].
double roll() const
Get the ROLL angle (in radians)
CRenderizable & setColorG(const float g)
Color components in the range [0,1].
std::shared_ptr< mrpt::opengl::CText > m_label_obj
Optional pointer to a mrpt::opengl::CText.
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).
void setVisibility(bool visible=true)
Set object visibility (default=true)
double getPoseRoll() const
Rotation relative to parent coordinate origin, in DEGREES.
bool hasToUpdateBuffers() const
Returns whether notifyChange() has been invoked since the last call to renderUpdateBuffers(),...
float m_scale_x
Scale components to apply to the object (default=1)
Context for calls to render()
#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::opengl::shader_id_t shader_id
void enqueForRendering(const mrpt::opengl::CListOpenGLObjects &objs, const mrpt::opengl::TRenderMatrices &state, RenderQueue &rq)
Processes, recursively, all objects in the list, classifying them by shader programs into a list suit...
virtual void freeOpenGLResources()=0
Free opengl buffers.
float getColorB() const
Color components in the range [0,1].
Rendering state related to the projection and model-view matrices.
bool m_visible
Is the object visible? (default=true)
void updateBuffers() const
Calls renderUpdateBuffers() and clear the flag that is set with notifyChange()
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.
const mrpt::opengl::TLightParameters * lights
mrpt::img::TColorf getColor() const
Returns the object color property as a TColorf.
std::deque< CRenderizable::Ptr > CListOpenGLObjects
A list of smart pointers to renderizable objects.
float getColorG() const
Color components in the range [0,1].
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.
std::vector< shader_id_t > shader_list_t
A list of shader IDs.
void setName(const std::string &n)
Changes the name of the object.
Lighting parameters, mostly for triangle shaders.
CRenderizable & setColorR(const float r)
Color components in the range [0,1].
virtual mrpt::math::TPoint3Df getLocalRepresentativePoint() const
Provide a representative point (in object local coordinates), used to sort objects by eye-distance wh...
virtual shader_list_t requiredShaders() const
Returns the ID of the OpenGL shader program required to render this class.
const mrpt::opengl::TRenderMatrices * state
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].
The namespace for 3D scene representation and rendering.
double getPoseYawRad() const
Rotation relative to parent coordinate origin, in radians.
A 2D text (bitmap rendering): it always "faces the observer" despite it's at some 3D location.
bool isVisible() const
Is the object visible?
virtual void initializeTextures() const
Initializes all textures (loads them into opengl memory).
CRenderizable & setScale(float sx, float sy, float sz)
Scale to apply to the object in each axis (default=1)
virtual void render(const RenderContext &rc) const =0
Implements the rendering of 3D objects in each class derived from CRenderizable.
Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020 | |