Go to the documentation of this file.
74 const T& objs,
const std::string& vpn = std::string(
"main"))
76 insert(objs.begin(), objs.end(), vpn);
87 const std::string& viewportName = std::string(
"main"));
97 const std::string& vpn = std::string(
"main"))
116 const std::string& viewportName = std::string(
"main"))
const;
127 void clear(
bool createMainViewport =
true);
143 const std::string& str,
144 const std::string& viewportName = std::string(
"main"));
154 template <
typename T>
160 typename T::Ptr o = m_viewport->getByClass<T>(ith);
163 return typename T::Ptr();
172 const std::string& viewportName = std::string(
"main"));
188 bool saveToFile(
const std::string& fil)
const;
205 const std::string& vpn = std::string(
"main"))
const;
212 template <
typename FUNCTOR>
217 for (
auto itO = m_viewport->begin(); itO != m_viewport->end();
235 template <
typename FUNCTOR>
243 std::dynamic_pointer_cast<CSetOfObjects>(o);
244 for (
auto it = obj->begin(); it != obj->end(); ++it)
264 s->insert(v.begin(), v.end());
bool followCamera() const
Return the value of "followCamera".
const_iterator end() const
std::shared_ptr< mrpt::opengl ::CSetOfObjects > Ptr
void insert(const CRenderizable::Ptr &newObject, const std::string &viewportName=std::string("main"))
Insert a new object into the scene, in the given viewport (by default, into the "main" viewport).
std::vector< COpenGLViewport::Ptr > TListViewports
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives.
void unloadShaders()
Ensure all shaders are unloaded in all viewports.
#define IS_CLASS(obj, class_name)
True if the given reference to object (derived from mrpt::rtti::CObject) is of the given class.
void initializeTextures()
Initializes all textures in the scene (See opengl::CTexturedPlane::initializeTextures)
const TListViewports & viewports() const
std::shared_ptr< CRenderizable > Ptr
void dumpListOfObjects(std::vector< std::string > &lst)
Retrieves a list of all objects in text form.
const_iterator begin() const
A set of object, which are referenced to the coordinates framework established in this object.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max, const std::string &vpn=std::string("main")) const
Evaluates the bounding box of the scene in the given viewport (default: "main").
TListViewports m_viewports
The list of viewports, indexed by name.
T::Ptr getByClass(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...
std::shared_ptr< mrpt::opengl ::COpenGLViewport > Ptr
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
bool loadFromFile(const std::string &fil)
Loads the scene from a 3Dscene file, the format used by the application SceneViewer3D.
COpenGLScene::Ptr & operator<<(COpenGLScene::Ptr &s, const CRenderizable::Ptr &r)
Inserts an openGL object into a scene.
void enableFollowCamera(bool enabled)
If disabled (default), the SceneViewer application will ignore the camera of the "main" viewport and ...
The virtual base class which provides a unified interface for all persistent objects in MRPT.
COpenGLViewport::Ptr createViewport(const std::string &viewportName)
Creates a new viewport, adding it to the scene and returning a pointer to the new object.
bool saveToFile(const std::string &fil) const
Saves the scene to a 3Dscene file, loadable by the application SceneViewer3D.
std::shared_ptr< mrpt::opengl ::COpenGLScene > Ptr
void clear(bool createMainViewport=true)
Clear the list of objects and viewports in the scene, deleting objects' memory, and leaving just the ...
static void internal_visitAllObjects(FUNCTOR functor, const CRenderizable::Ptr &o)
size_t viewportsCount() const
COpenGLScene & operator=(const COpenGLScene &obj)
void removeObject(const CRenderizable::Ptr &obj, const std::string &viewportName=std::string("main"))
Removes the given object from the scene (it also deletes the object to free its memory).
void freeOpenGLResources()
Ensure all OpenGL buffers are destroyed.
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).
COpenGLViewport::Ptr getViewport(const std::string &viewportName=std::string("main")) const
Returns the viewport with the given name, or nullptr if it does not exist; note that the default view...
CRenderizable::Ptr getByName(const std::string &str, const std::string &viewportName=std::string("main"))
Returns the first object with a given name, or nullptr (an empty smart pointer) if not found.
The namespace for 3D scene representation and rendering.
void render() const
Render this scene.
void visitAllObjects(FUNCTOR functor) const
Recursive depth-first visit all objects in all viewports of the scene, calling the user-supplied func...
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const
Traces a ray.
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).
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 15:49:54 UTC 2020 | |