namespace mrpt::opengl

The namespace for 3D scene representation and rendering.

See also the summary page of the mrpt-opengl library for more info and thumbnails of many of the render primitive.

namespace opengl {

// namespaces

namespace mrpt::opengl::graph_tools;
namespace mrpt::opengl::internal;
namespace mrpt::opengl::stock_objects;

// typedefs

typedef std::deque<CRenderizable::Ptr> CListOpenGLObjects;
typedef std::map<shader_id_t, std::multimap<float, RenderQueueElement>> RenderQueue;
typedef uint8_t shader_id_t;
typedef std::vector<shader_id_t> shader_list_t;

// enums

enum TCullFace;
enum TOpenGLFontStyle;
enum predefined_voxel_sets_t;

// structs

struct DefaultShaderID;
struct FrameBufferBinding;
struct RenderQueueElement;
struct T2DTextData;
struct TFontParams;
struct TLightParameters;
struct TRenderMatrices;
struct TTriangle;

// classes

class CAngularObservationMesh;
class CArrow;
class CAssimpModel;
class CAxis;
class CBox;
class CCamera;
class CColorBar;
class CCylinder;
class CDisk;
class CEllipsoid2D;
class CEllipsoid3D;
class CEllipsoidInverseDepth2D;
class CEllipsoidInverseDepth3D;
class CEllipsoidRangeBearing2D;
class CFBORender;
class CFrustum;

template <int DIM>
class CGeneralizedEllipsoidTemplate;

class CGridPlaneXY;
class CGridPlaneXZ;
class CMesh;
class CMesh3D;
class CMeshFast;
class COctoMapVoxels;

template <class Derived>
class COctreePointRenderer;

class COpenGLBuffer;
class COpenGLFramebuffer;
class COpenGLScene;
class COpenGLVertexArrayObject;
class COpenGLViewport;
class CPlanarLaserScan;
class CPointCloud;
class CPointCloudColoured;
class CPolyhedron;
class CRenderizable;
class CRenderizableShaderPoints;
class CRenderizableShaderText;
class CRenderizableShaderTexturedTriangles;
class CRenderizableShaderTriangles;
class CRenderizableShaderWireFrame;
class CSetOfLines;
class CSetOfObjects;
class CSetOfTexturedTriangles;
class CSetOfTriangles;
class CSimpleLine;
class CSphere;
class CText;
class CText3D;
class CTextMessageCapable;
class CTexturedPlane;
class CVectorField2D;
class CVectorField3D;
class PLY_Exporter;
class PLY_Importer;

template <>
class PointCloudAdapter<pcl::PointCloud<pcl::PointXYZRGBA>>;

template <>
class PointCloudAdapter<mrpt::obs::CObservation3DRangeScan>;

template <>
class PointCloudAdapter<mrpt::opengl::CPointCloud>;

template <>
class PointCloudAdapter<mrpt::opengl::CPointCloudColoured>;

template <>
class PointCloudAdapter<pcl::PointCloud<pcl::PointXYZ>>;

template <>
class PointCloudAdapter<mrpt::maps::CWeightedPointsMap>;

template <>
class PointCloudAdapter<mrpt::maps::CSimplePointsMap>;

template <>
class PointCloudAdapter<mrpt::maps::CPointsMapXYZI>;

template <>
class PointCloudAdapter<mrpt::maps::CPointsMap>;

template <>
class PointCloudAdapter<pcl::PointCloud<pcl::PointXYZRGB>>;

template <class POINTCLOUD>
class PointCloudAdapter;

template <>
class PointCloudAdapter<mrpt::maps::CColouredPointsMap>;

class Program;
class Shader;
class Visualizable;
class mrptEventGLPostRender;
class mrptEventGLPreRender;

// global functions

void enqueForRendering(const mrpt::opengl::CListOpenGLObjects& objs, const mrpt::opengl::TRenderMatrices& state, RenderQueue& rq);
void processRenderQueue(const RenderQueue& rq, std::map<shader_id_t, mrpt::opengl::Program::Ptr>& shaders, const mrpt::opengl::TLightParameters& lights);

template <class POSE_PDF>
CSetOfObjects::Ptr posePDF2opengl(const POSE_PDF& o);

COpenGLScene::Ptr& operator << (COpenGLScene::Ptr& s, const CRenderizable::Ptr& r);

template <class T>
COpenGLScene::Ptr& operator << (COpenGLScene::Ptr& s, const std::vector<T>& v);

COpenGLViewport::Ptr& operator << (COpenGLViewport::Ptr& s, const CRenderizable::Ptr& r);
COpenGLViewport::Ptr& operator << (COpenGLViewport::Ptr& s, const std::vector<CRenderizable::Ptr>& v);
mrpt::serialization::CArchive& operator >> (mrpt::serialization::CArchive& in, CPolyhedron::TPolyhedronEdge& o);
mrpt::serialization::CArchive& operator << (mrpt::serialization::CArchive& out, const CPolyhedron::TPolyhedronEdge& o);
mrpt::serialization::CArchive& operator >> (mrpt::serialization::CArchive& in, CPolyhedron::TPolyhedronFace& o);
mrpt::serialization::CArchive& operator << (mrpt::serialization::CArchive& out, const CPolyhedron::TPolyhedronFace& o);

template <class T>
CSetOfLines::Ptr& operator << (CSetOfLines::Ptr& l, const T& s);

CSetOfLines::Ptr& operator << (CSetOfLines::Ptr& l, const mrpt::math::TSegment3D& s);
CSetOfObjects::Ptr& operator << (CSetOfObjects::Ptr& s, const CRenderizable::Ptr& r);

template <class T>
CSetOfObjects::Ptr& operator << (CSetOfObjects::Ptr& o, const std::vector<T>& v);

template <class T>
CSetOfTriangles::Ptr& operator << (CSetOfTriangles::Ptr& s, const T& t);

CSetOfTriangles::Ptr& operator << (CSetOfTriangles::Ptr& s, const mrpt::opengl::TTriangle& t);
Program::Ptr LoadDefaultShader(const shader_id_t id);

mrpt::serialization::CArchive& operator >> (
    mrpt::serialization::CArchive& in,
    mrpt::opengl::TLightParameters& o
    );

mrpt::serialization::CArchive& operator << (
    mrpt::serialization::CArchive& out,
    const mrpt::opengl::TLightParameters& o
    );

CArchive& operator << (
    CArchive& out,
    const COctoMapVoxels::TInfoPerVoxelSet& a
    );

CArchive& operator >> (
    CArchive& in,
    COctoMapVoxels::TInfoPerVoxelSet& a
    );

CArchive& operator << (
    CArchive& out,
    const COctoMapVoxels::TGridCube& a
    );

CArchive& operator >> (
    CArchive& in,
    COctoMapVoxels::TGridCube& a
    );

CArchive& operator << (
    CArchive& out,
    const COctoMapVoxels::TVoxel& a
    );

CArchive& operator >> (
    CArchive& in,
    COctoMapVoxels::TVoxel& a
    );

} // namespace opengl

Typedefs

typedef std::deque<CRenderizable::Ptr> CListOpenGLObjects

A list of smart pointers to renderizable objects.

typedef std::vector<shader_id_t> shader_list_t

A list of shader IDs.

Global Functions

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 suitable to be used within processPendingRendering()

For each object in the list:

  • checks visibility of each object

  • update the MODELVIEW matrix according to its coordinates

  • call its ::render()

  • shows its name (if enabled).

Used by CSetOfObjects and COpenGLViewport

See also:

processPendingRendering

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.

Used by COpenGLViewport

template <class POSE_PDF>
CSetOfObjects::Ptr posePDF2opengl(const POSE_PDF& o)

Returns a representation of a the PDF - this is just an auxiliary function, it’s more natural to call mrpt::poses::CPosePDF::getAs3DObject.

COpenGLScene::Ptr& operator << (COpenGLScene::Ptr& s, const CRenderizable::Ptr& r)

Inserts an openGL object into a scene.

Allows call chaining.

See also:

mrpt::opengl::COpenGLScene::insert

template <class T>
COpenGLScene::Ptr& operator << (COpenGLScene::Ptr& s, const std::vector<T>& v)

Inserts any iterable collection of openGL objects into a scene, allowing call chaining.

See also:

mrpt::opengl::COpenGLScene::insert

COpenGLViewport::Ptr& operator << (COpenGLViewport::Ptr& s, const CRenderizable::Ptr& r)

Inserts an openGL object into a viewport.

Allows call chaining.

See also:

mrpt::opengl::COpenGLViewport::insert

COpenGLViewport::Ptr& operator << (COpenGLViewport::Ptr& s, const std::vector<CRenderizable::Ptr>& v)

Inserts any iterable set of openGL objects into a viewport.

Allows call chaining.

See also:

mrpt::opengl::COpenGLViewport::insert

mrpt::serialization::CArchive& operator >> (mrpt::serialization::CArchive& in, CPolyhedron::TPolyhedronEdge& o)

Reads a polyhedron edge from a binary stream.

mrpt::serialization::CArchive& operator << (mrpt::serialization::CArchive& out, const CPolyhedron::TPolyhedronEdge& o)

Writes a polyhedron edge to a binary stream.

mrpt::serialization::CArchive& operator >> (mrpt::serialization::CArchive& in, CPolyhedron::TPolyhedronFace& o)

Reads a polyhedron face from a binary stream.

mrpt::serialization::CArchive& operator << (mrpt::serialization::CArchive& out, const CPolyhedron::TPolyhedronFace& o)

Writes a polyhedron face to a binary stream.

template <class T>
CSetOfLines::Ptr& operator << (CSetOfLines::Ptr& l, const T& s)

Inserts a set of segments into the list.

Allows call chaining.

See also:

mrpt::opengl::CSetOfLines::appendLines

CSetOfLines::Ptr& operator << (CSetOfLines::Ptr& l, const mrpt::math::TSegment3D& s)

Inserts a segment into the list.

Allows call chaining.

See also:

mrpt::opengl::CSetOfLines::appendLine(const TSegment &)

CSetOfObjects::Ptr& operator << (CSetOfObjects::Ptr& s, const CRenderizable::Ptr& r)

Inserts an object into the list.

Allows call chaining.

See also:

mrpt::opengl::CSetOfObjects::insert

template <class T>
CSetOfObjects::Ptr& operator << (CSetOfObjects::Ptr& o, const std::vector<T>& v)

Inserts a set of objects into the list.

Allows call chaining.

See also:

mrpt::opengl::CSetOfObjects::insert

template <class T>
CSetOfTriangles::Ptr& operator << (CSetOfTriangles::Ptr& s, const T& t)

Inserts a set of triangles into the list; note that this method allows to pass another CSetOfTriangles as argument.

Allows call chaining.

See also:

mrpt::opengl::CSetOfTriangles::insertTriangle

CSetOfTriangles::Ptr& operator << (CSetOfTriangles::Ptr& s, const mrpt::opengl::TTriangle& t)

Inserts a triangle into the list.

Allows call chaining.

See also:

mrpt::opengl::CSetOfTriangles::insertTriangle