16 #ifndef SURGSIM_FRAMEWORK_SCENEELEMENT_H 17 #define SURGSIM_FRAMEWORK_SCENEELEMENT_H 22 #include <unordered_map> 48 class SceneElement :
public std::enable_shared_from_this<SceneElement>
65 bool addComponent(std::shared_ptr<Component> component);
70 bool removeComponent(std::shared_ptr<Component> component);
80 std::shared_ptr<Component> getComponent(
const std::string& name)
const;
84 std::vector<std::shared_ptr<Component> > getComponents()
const;
89 std::vector<std::shared_ptr<T>> getComponents()
const;
110 std::shared_ptr<PoseComponent> getPoseComponent();
114 void setScene(std::weak_ptr<Scene> scene);
118 std::shared_ptr<Scene> getScene();
122 void setRuntime(std::weak_ptr<Runtime> runtime);
125 std::shared_ptr<Runtime> getRuntime();
129 bool isInitialized()
const;
137 void setActive(
bool val);
140 bool isActive()
const;
144 std::shared_ptr<SceneElement> getSharedPtr();
150 virtual YAML::Node encode(
bool standalone)
const;
156 virtual bool decode(
const YAML::Node& node);
162 bool initializeComponent(std::shared_ptr<SurgSim::Framework::Component> component);
167 std::shared_ptr<SurgSim::Framework::PoseComponent>
m_pose;
170 std::unordered_map<std::string, std::shared_ptr<Component>>
m_components;
180 virtual bool doInitialize() = 0;
198 #endif // SURGSIM_FRAMEWORK_SCENEELEMENT_H Definition: DriveElementFromInputBehavior.cpp:27
bool m_isInitialized
Indicates if this SceneElement has been initialized or not.
Definition: SceneElement.h:187
std::weak_ptr< Runtime > m_runtime
A (weak) back pointer to the Runtime containing this SceneElement.
Definition: SceneElement.h:176
std::string m_name
Name of this SceneElement.
Definition: SceneElement.h:165
std::shared_ptr< SurgSim::Framework::PoseComponent > m_pose
Definition: SceneElement.h:167
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
bool m_isActive
Indicates if this SceneElement is active or not.
Definition: SceneElement.h:190
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
Definition: DataStructuresConvert.h:28
std::weak_ptr< Scene > m_scene
A (weak) back pointer to the Scene containing this SceneElement.
Definition: SceneElement.h:173
SceneElement is the basic part of a scene, it is a container of components.
Definition: SceneElement.h:48
std::unordered_map< std::string, std::shared_ptr< Component > > m_components
A collection of Components.
Definition: SceneElement.h:170