9 #ifndef opengl_CSetOfObjects_H
10 #define opengl_CSetOfObjects_H
55 insert(objs.begin(),objs.end());
59 void insert(
const CRenderizablePtr &newObject );
64 for (T_it it=
begin;it!=
end;it++) insert(*it);
76 size_t size() {
return m_objects.size(); }
79 inline bool empty()
const {
return m_objects.empty(); }
83 void initializeAllTextures();
87 CRenderizablePtr getByName(
const std::string &str );
97 typename T::Ptr getByClass(
const size_t &ith = 0 )
const;
101 void removeObject(
const CRenderizablePtr &
obj );
113 bool contains(
const CRenderizablePtr &
obj)
const;
153 inline CSetOfObjectsPtr &operator<<(CSetOfObjectsPtr &
s,const CRenderizablePtr &
r) {
160 template<
class T>
inline CSetOfObjectsPtr &
operator<<(CSetOfObjectsPtr &o,
const std::vector<T> &
v) {
161 o->insertCollection(
v);
166 template <
typename T>
170 size_t foundCount = 0;
173 if ( (*it).present() && (*it)->GetRuntimeClass()->derivedFrom( class_ID ) )
174 if (foundCount++ == ith)
175 return typename T::Ptr(*it);
182 typename T::Ptr o = CSetOfObjectsPtr(*it)->getByClass<T>(ith);
187 return typename T::Ptr();
#define CLASS_ID_NAMESPACE(class_name, namespaceName)
Access to runtime class ID for a defined class name.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#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...
The base class of 3D objects that can be directly rendered through OpenGL.
A set of object, which are referenced to the coordinates framework established in this object.
bool empty() const
Returns true if there are no objects.
CListOpenGLObjects::iterator iterator
void insert(const T_it &begin, const T_it &end)
Inserts a set of objects, bounded by iterators, into the list.
const_iterator begin() const
T::Ptr getByClass(const size_t &ith=0) const
Returns the i'th object of a given class (or of a descendant class), or NULL (an empty smart pointer)...
void insertCollection(const T &objs)
Inserts a set of objects into the list.
CListOpenGLObjects m_objects
The list of child objects.
CListOpenGLObjects::const_iterator const_iterator
const_iterator end() const
Declares a class that represents a Probability Distribution function (PDF) of a 3D point (x,...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually).
Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually),...
Declares a class that represents a probability density function (pdf) of a 2D pose (x,...
A class for storing a list of text lines.
const Scalar * const_iterator
EIGEN_STRONG_INLINE iterator begin()
GLsizei GLsizei GLuint * obj
GLdouble GLdouble GLdouble r
GLubyte GLubyte GLubyte a
GLsizei const GLchar ** string
bool BASE_IMPEXP traceRay(const std::vector< TPolygonWithPlane > &vec, const mrpt::poses::CPose3D &pose, double &dist)
Fast ray tracing method using polygons' properties.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
The namespace for 3D scene representation and rendering.
OPENGL_IMPEXP mrpt::utils::CStream & operator<<(mrpt::utils::CStream &out, const mrpt::opengl::CLight &o)
std::deque< CRenderizablePtr > CListOpenGLObjects
A list of objects pointers, automatically managing memory free at destructor, and managing copies cor...
CSetOfObjectsPtr posePDF2opengl(const POSE_PDF &o)
Returns a representation of a the PDF - this is just an auxiliary function, it's more natural to call...
void clear()
Clear the contents of this container.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A structure that holds runtime class type information.