50 insert(objs.begin(), objs.end());
66 void render()
const override;
95 typename T::Ptr
getByClass(
const size_t& ith = 0)
const;
174 o->insertCollection(
v);
180 template <
typename T>
184 size_t foundCount = 0;
185 const auto class_ID = &T::GetRuntimeClassIdStatic();
187 if (o && o->GetRuntimeClass()->derivedFrom(class_ID))
188 if (foundCount++ == ith)
return std::dynamic_pointer_cast<T>(o);
193 if (o && o->GetRuntimeClass() ==
197 ->
template getByClass<T>(ith);
202 return typename T::Ptr();
void clear()
Clear the list of objects in the scene, deleting objects' memory.
A set of object, which are referenced to the coordinates framework established in this object...
CSetOfObjects()
Default constructor.
mrpt::serialization::CArchive & operator<<(mrpt::serialization::CArchive &out, const mrpt::opengl::CLight &o)
void insertCollection(const T &objs)
Inserts a set of objects into the list.
CListOpenGLObjects::const_iterator const_iterator
std::deque< CRenderizable::Ptr > CListOpenGLObjects
A list of objects pointers, automatically managing memory free at destructor, and managing copies cor...
bool contains(const CRenderizable::Ptr &obj) const
void render() const override
Render child objects.
CListOpenGLObjects m_objects
The list of child objects.
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Simulation of ray-trace, given a pose.
The base class of 3D objects that can be directly rendered through OpenGL.
bool empty() const
Returns true if there are no objects.
CRenderizable & setColorR_u8(const uint8_t r) override
Color components in the range [0,255].
GLsizei GLsizei GLuint * obj
CRenderizable & setColorG_u8(const uint8_t g) override
Color components in the range [0,255].
void insert(const T_it &begin, const T_it &end)
Inserts a set of objects, bounded by iterators, into the list.
const_iterator end() const
size_t size()
Returns number of objects.
CRenderizable & setColorA_u8(const uint8_t a) override
Color components in the range [0,255].
~CSetOfObjects() override
Private, virtual destructor: only can be deleted from smart pointers.
GLsizei const GLchar ** string
Declares a class that represents a probability density function (pdf) of a 2D pose (x...
const_iterator begin() const
CListOpenGLObjects::iterator iterator
void removeObject(const CRenderizable::Ptr &obj)
Removes the given object from the scene (it also deletes the object to free its memory).
#define CLASS_ID_NAMESPACE(class_name, namespaceName)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
static CSetOfObjects::Ptr posePDF2opengl(const mrpt::poses::CPosePDF &o)
Returns a representation of a the PDF - this is just an auxiliary function, it's more natural to call...
GLdouble GLdouble GLdouble r
void dumpListOfObjects(std::vector< std::string > &lst)
Retrieves a list of all objects in text form.
Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually)...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
The namespace for 3D scene representation and rendering.
void initializeAllTextures()
Initializes all textures in the scene (See opengl::CTexturedPlane::loadTextureInOpenGL) ...
CRenderizable & setColor_u8(const mrpt::img::TColor &c) override
Declares a class that represents a Probability Distribution function (PDF) of a 3D point (x...
CRenderizable::Ptr getByName(const std::string &str)
Returns the first object with a given name, or a nullptr pointer if not found.
void insert(const CRenderizable::Ptr &newObject)
Insert a new object to the list.
GLubyte GLubyte GLubyte a
CRenderizable & setColorB_u8(const uint8_t b) override
Color components in the range [0,255].
Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually)...
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
T::Ptr getByClass(const size_t &ith=0) const
Returns the i'th object of a given class (or of a descendant class), or nullptr (an empty smart point...