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();
A set of object, which are referenced to the coordinates framework established in this object...
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
void insertCollection(const T &objs)
Inserts a set of objects into the list.
bool BASE_IMPEXP traceRay(const std::vector< TPolygonWithPlane > &vec, const mrpt::poses::CPose3D &pose, double &dist)
Fast ray tracing method using polygons' properties.
CListOpenGLObjects m_objects
The list of child objects.
The base class of 3D objects that can be directly rendered through OpenGL.
EIGEN_STRONG_INLINE iterator begin()
bool empty() const
Returns true if there are no objects.
std::deque< CRenderizablePtr > CListOpenGLObjects
A list of objects pointers, automatically managing memory free at destructor, and managing copies cor...
const Scalar * const_iterator
GLsizei GLsizei GLuint * obj
void clear()
Clear the contents of this container.
void insert(const T_it &begin, const T_it &end)
Inserts a set of objects, bounded by iterators, into the list.
A class for storing a list of text lines.
const_iterator end() const
#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...
GLsizei const GLchar ** string
Declares a class that represents a probability density function (pdf) of a 2D pose (x...
const_iterator begin() const
#define CLASS_ID_NAMESPACE(class_name, namespaceName)
Access to runtime class ID for a defined class name.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
GLdouble GLdouble GLdouble r
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).
CListOpenGLObjects::const_iterator const_iterator
The namespace for 3D scene representation and rendering.
CListOpenGLObjects::iterator iterator
A structure that holds runtime class type information.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
Declares a class that represents a Probability Distribution function (PDF) of a 3D point (x...
GLubyte GLubyte GLubyte a
Declares a class that represents a Probability Density Function (PDF) of a 3D pose (6D actually)...
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...
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)...