9 #ifndef opengl_COpenGLScene_H
10 #define opengl_COpenGLScene_H
74 insert(objs.begin(),objs.end(),vpn);
88 for (T_it it=
begin;it!=
end;it++) insert(*it,vpn);
95 COpenGLViewportPtr createViewport(
const std::string &viewportName );
108 void clear(
bool createMainViewport =
true );
131 template <
typename T>
137 typename T::Ptr o = (*it)->getByClass<T>(ith);
138 if (o.present())
return o;
140 return typename T::Ptr();
151 void initializeAllTextures();
179 template <
typename FUNCTOR>
185 internal_visitAllObjects(functor, *itO);
193 template <
typename FUNCTOR,
typename EXTRA_PARAM>
195 visitAllObjects( std::bind2nd(functor,userParam) );
206 template <
typename FUNCTOR>
212 CSetOfObjectsPtr
obj = CSetOfObjectsPtr(o);
214 internal_visitAllObjects(functor,*it);
222 inline COpenGLScenePtr &operator<<(COpenGLScenePtr &
s,const CRenderizablePtr &
r) {
227 template <
class T>
inline COpenGLScenePtr &
operator<<(COpenGLScenePtr &
s,
const std::vector<T> &
v) {
228 s->insert(
v.begin(),
v.end());
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is of t...
#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...
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives.
bool followCamera() const
Return the value of "followCamera".
std::vector< COpenGLViewportPtr > TListViewports
static void internal_visitAllObjects(FUNCTOR functor, const CRenderizablePtr &o)
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 visitAllObjects(FUNCTOR functor, const EXTRA_PARAM &userParam) const
Recursive depth-first visit all objects in all viewports of the scene, calling the user-supplied func...
void insert(const T_it &begin, const T_it &end, const std::string &vpn=std::string("main"))
Inserts a set of objects into the scene, in the given viewport ("main" by default).
void insertCollection(const T &objs, const std::string &vpn=std::string("main"))
Inserts a set of objects into the scene, in the given viewport ("main" by default).
void visitAllObjects(FUNCTOR functor) const
Recursive depth-first visit all objects in all viewports of the scene, calling the user-supplied func...
size_t viewportsCount() const
void enableFollowCamera(bool enabled)
If disabled (default), the SceneViewer application will ignore the camera of the "main" viewport and ...
TListViewports m_viewports
The list of viewports, indexed by name.
CListOpenGLObjects::const_iterator const_iterator
A set of object, which are referenced to the coordinates framework established in this object.
CListOpenGLObjects::const_iterator const_iterator
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
The virtual base class which provides a unified interface for all persistent objects in MRPT.
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
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.
OPENGL_IMPEXP mrpt::utils::CStream & operator<<(mrpt::utils::CStream &out, const mrpt::opengl::CLight &o)
void clear()
Clear the contents of this container.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.