2 #ifndef _VHDYNSCENEADAPTER_H_
4 #include <scene/dynamic/DynScene.h>
5 #include <visualhelios/adapters/VHStaticObjectAdapter.h>
6 #include <visualhelios/adapters/VHDynObjectAdapter.h>
11 namespace visualhelios{
14 using std::shared_ptr;
15 using std::static_pointer_cast;
29 template <
typename ST,
typename DT>
103 return static_pointer_cast<VHStaticObjectAdapter>(
staticObjs[index])\
112 return static_pointer_cast<VHStaticObjectAdapter>(
staticObjs[index])\
113 ->isRenderingNormals();
122 bool const renderingNormals
124 static_pointer_cast<VHStaticObjectAdapter>(
staticObjs[index])\
125 ->setRenderingNormals(renderingNormals);
149 return static_pointer_cast<VHDynObjectAdapter>(
dynObjs[index])\
173 return static_pointer_cast<VHDynObjectAdapter>(
dynObjs[index])\
174 ->isRenderingNormals();
183 bool const renderingNormals
185 static_pointer_cast<VHDynObjectAdapter>(
dynObjs[index])\
186 ->setRenderingNormals(renderingNormals);
188 inline vector<pcl::Vertices>
const & getVertices(
size_t const index)
const{
189 return static_pointer_cast<VHDynObjectAdapter>(
dynObjs[index])\
196 inline string const &
getId(
size_t const index)
const{
197 return static_pointer_cast<VHDynObjectAdapter>(
dynObjs[index])\
203 #include <visualhelios/adapters/VHDynSceneAdapter.tpp>
205 #define _VHDYNSCENEADAPTER_H_
Dynamic object base implementation.
Definition: DynObject.h:23
Dynamic scene base implementation.
Definition: DynScene.h:29
bool isDynObjectUpdated(size_t const index) const
Check whether the dynamic object at given index has been updated on last step (true) or not (false)
Definition: DynScene.h:221
Class representing a scene part.
Definition: ScenePart.h:20
Class defining core mechanisms to adapt dynamic scenes to the visual Helios context based on PCL and ...
Definition: VHDynSceneAdapter.h:30
bool isDynObjectUpdated(size_t const index) const
Check if the dynamic object at given index has been updated on last step (true) or not (false)
Definition: VHDynSceneAdapter.h:160
bool isStaticObjectRenderingNormals(size_t const index) const
Check whether the normals of static object at given index must be rendered or not.
Definition: VHDynSceneAdapter.h:111
shared_ptr< ST > getAdaptedStaticObj(size_t const index)
Obtain the adapted static object at given index.
Definition: VHDynSceneAdapter.h:93
bool isDynObjectRenderingNormals(size_t const index) const
Obtain the ordered vertices indices representing the dynamic object at given index.
Definition: VHDynSceneAdapter.h:172
vector< shared_ptr< DT > > dynObjs
Vector of adapted dynamic objects from the adapted dynamic scene.
Definition: VHDynSceneAdapter.h:43
vector< shared_ptr< ST > > staticObjs
Vector of adapted static objects from the adapted dynamic scene.
Definition: VHDynSceneAdapter.h:49
ScenePart & getStaticObj(size_t const index)
Obtain the static object at given index.
Definition: VHDynSceneAdapter.h:102
DynObject & getDynObj(size_t const index)
Obtain the dynamic object at given index.
Definition: VHDynSceneAdapter.h:148
size_t numDynObjects() const
Obtain the number of dynamic objects composing the dynamic scene.
Definition: VHDynSceneAdapter.h:131
string const & getId(size_t const index) const
Obtain the ID of the dynamic object at given index.
Definition: VHDynSceneAdapter.h:196
shared_ptr< DT > getAdaptedDynObj(size_t const index)
Obtain the adapted dynamic object at given index.
Definition: VHDynSceneAdapter.h:138
bool doStep()
Method to adapt dynamic scene computations over time to visual Helios.
DynScene & getDynScene()
Obtain the adapted dynamic scene.
Definition: VHDynSceneAdapter.h:81
DynScene & dynScene
The adapted dynamic scene.
Definition: VHDynSceneAdapter.h:38
size_t numStaticObjects() const
Obtain the number of static objects composing the dynamic scene.
Definition: VHDynSceneAdapter.h:86
void setStaticObjectRenderingNormals(size_t const index, bool const renderingNormals)
Enable or disable normals rendering for the static object at given index.
Definition: VHDynSceneAdapter.h:120
void setDynObjectRenderingNormals(size_t const index, bool const renderingNormals)
Enable or disable normals rendering for the dynamic object at given index.
Definition: VHDynSceneAdapter.h:181
VHDynSceneAdapter(DynScene &dynScene)
Constructor for the visual Helios dynamic scene adapter.