Go to the documentation of this file.
16 #ifndef SURGSIM_FRAMEWORK_SCENE_H
17 #define SURGSIM_FRAMEWORK_SCENE_H
19 #include <boost/thread/mutex.hpp>
42 class Scene :
public std::enable_shared_from_this<Scene>
48 explicit Scene(std::weak_ptr<Runtime> runtime);
71 const std::shared_ptr<SceneElement>
getSceneElement(
const std::string& name)
const;
77 std::shared_ptr<Component>
getComponent(
const std::string& elementName,
const std::string& componentName)
const;
90 bool decode(
const YAML::Node& node);
115 #endif // SURGSIM_FRAMEWORK_SCENE_H
Class to wrap grouping operations, gives access to the members of a group and the groups of members.
Definition: Groups.h:37
void removeSceneElement(std::shared_ptr< SceneElement > element)
Removes a scene element from the Scene.
Definition: Scene.cpp:68
const std::shared_ptr< SceneElement > getSceneElement(const std::string &name) const
Retrieve a SceneElement for this scene with the given name.
Definition: Scene.cpp:104
std::vector< std::shared_ptr< SceneElement > > m_elements
Definition: Scene.h:102
std::weak_ptr< Runtime > m_runtime
Definition: Scene.h:100
~Scene()
Destructor.
Definition: Scene.cpp:43
void addSceneElement(std::shared_ptr< SceneElement > element)
Adds a scene element to the Scene, the SceneElement will have its initialize() function called.
Definition: Scene.cpp:48
Scene(std::weak_ptr< Runtime > runtime)
Constructor.
Definition: Scene.cpp:36
void addSceneElements(std::vector< std::shared_ptr< SceneElement >> elements)
Invokes addSceneElement() for each element in the list.
Definition: Scene.cpp:86
boost::mutex m_sceneElementsMutex
Definition: Scene.h:105
Definition: DataStructuresConvert.h:28
Definition: CompoundShapeToGraphics.cpp:29
YAML::Node encode() const
Convert to a YAML::Node.
Definition: Scene.cpp:133
std::shared_ptr< Scene > getSharedPtr()
Get a shared pointer to Scene.
Definition: Scene.cpp:119
bool decode(const YAML::Node &node)
Pull data from a YAML::Node.
Definition: Scene.cpp:147
const std::vector< std::shared_ptr< SceneElement > > & getSceneElements() const
Gets all the scene elements in the scene.
Definition: Scene.cpp:99
std::shared_ptr< Component > getComponent(const std::string &elementName, const std::string &componentName) const
Look through the scene to find a component of a named element.
Definition: Scene.cpp:174
SurgSim::DataStructures::Groups< std::string, std::shared_ptr< SceneElement > > m_groups
Definition: Scene.h:107
std::shared_ptr< Runtime > getRuntime()
Gets the runtime.
Definition: Scene.cpp:94
std::shared_ptr< Framework::Logger > m_logger
Definition: Scene.h:109
Scene. Basic Container for SceneElements.
Definition: Scene.h:42
SurgSim::DataStructures::Groups< std::string, std::shared_ptr< SceneElement > > & getGroups()
Definition: Scene.cpp:169