33 #ifndef DART_GUI_OSG_WORLDNODE_HPP_ 34 #define DART_GUI_OSG_WORLDNODE_HPP_ 37 #include <unordered_map> 39 #include <osgShadow/ShadowTechnique> 41 #include "dart/gui/osg/Viewer.hpp" 72 std::shared_ptr<dart::simulation::World> world =
nullptr,
73 ::osg::ref_ptr<osgShadow::ShadowTechnique> shadowTechnique =
nullptr);
76 void setWorld(std::shared_ptr<dart::simulation::World> newWorld);
79 std::shared_ptr<dart::simulation::World> getWorld()
const;
90 virtual void refresh();
97 virtual void customPreRefresh();
104 virtual void customPostRefresh();
111 virtual void customPreStep();
118 virtual void customPostStep();
121 bool isSimulating()
const;
125 void simulate(
bool on);
129 void setNumStepsPerCycle(std::size_t steps);
133 std::size_t getNumStepsPerCycle()
const;
136 bool isShadowed()
const;
140 void setShadowTechnique(
141 ::osg::ref_ptr<osgShadow::ShadowTechnique> shadowTechnique =
nullptr);
145 ::osg::ref_ptr<osgShadow::ShadowTechnique> getShadowTechnique()
const;
149 static ::osg::ref_ptr<osgShadow::ShadowTechnique>
150 createDefaultShadowTechnique(
const Viewer* viewer);
159 virtual void setupViewer();
162 void clearChildUtilizationFlags();
166 void clearUnusedNodes();
169 void refreshSkeletons();
172 void refreshSimpleFrames();
178 using NodeMap = std::
179 unordered_map<dart::dynamics::Frame*, ::osg::ref_ptr<ShapeFrameNode>>;
185 std::shared_ptr<dart::simulation::World>
mWorld;
210 #endif // DART_GUI_OSG_WORLDNODE_HPP_ bool mShadowed
Whether the shadows are enabled.
Definition: WorldNode.hpp:203
Viewer * mViewer
Viewer that this WorldNode is inside of.
Definition: WorldNode.hpp:194
std::shared_ptr< dart::simulation::World > mWorld
The World that this WorldNode is associated with.
Definition: WorldNode.hpp:185
::osg::ref_ptr<::osgShadow::ShadowedScene > mShadowedGroup
OSG group for shadowed objects.
Definition: WorldNode.hpp:200
::osg::ref_ptr<::osg::Group > mNormalGroup
OSG group for non-shadowed objects.
Definition: WorldNode.hpp:197
The Frame class serves as the backbone of DART's kinematic tree structure.
Definition: Frame.hpp:57
Definition: test_Signal.cpp:68
WorldNode class encapsulates a World to be displayed in OpenSceneGraph.
Definition: WorldNode.hpp:64
Definition: Aspect.cpp:40
bool mSimulating
True iff simulation is active.
Definition: WorldNode.hpp:188
Definition: Viewer.hpp:111
NodeMap mFrameToNode
Map from Frame pointers to FrameNode pointers.
Definition: WorldNode.hpp:182
std::size_t mNumStepsPerCycle
Number of steps to take between rendering cycles.
Definition: WorldNode.hpp:191