Go to the documentation of this file.
16 #ifndef SURGSIM_BLOCKS_COMPOUNDSHAPETOGRAPHICS_H
17 #define SURGSIM_BLOCKS_COMPOUNDSHAPETOGRAPHICS_H
47 SURGSIM_STATIC_REGISTRATION(CompoundShapeToGraphics);
63 void update(
double dt)
override;
73 void setShape(
const std::shared_ptr<Math::Shape>& shape);
78 void setSource(
const std::shared_ptr<Framework::Component>& component);
84 void setTargets(
const std::vector<std::shared_ptr<Framework::Component>> components);
89 void addTarget(
const std::shared_ptr<Framework::Component>& component);
92 std::vector<std::shared_ptr<Framework::Component>>
getTargets()
const;
95 std::shared_ptr<Math::CompoundShape>
getShape()
const;
98 std::shared_ptr<Framework::Component>
getSource()
const;
Component is the main interface class to pass information to the system managers each will decide whe...
Definition: Component.h:42
void setSource(const std::shared_ptr< Framework::Component > &component)
Sets the source component, the components needs to provide a shape and that shape needs to be a compo...
Definition: CompoundShapeToGraphics.cpp:106
CompoundShapeToGraphics(const std::string &name)
Constructor.
Definition: CompoundShapeToGraphics.cpp:37
std::shared_ptr< Math::CompoundShape > getShape() const
Definition: CompoundShapeToGraphics.cpp:140
std::vector< std::shared_ptr< Framework::Component > > getTargets() const
Definition: CompoundShapeToGraphics.cpp:133
void setTargets(const std::vector< std::shared_ptr< Framework::Component >> components)
Sets the graphics targets to be used, each target will be update with the pose of the corresponding s...
Definition: CompoundShapeToGraphics.cpp:115
Behaviors perform actions.
Definition: Behavior.h:40
Definition: CompoundShapeToGraphics.cpp:29
std::vector< std::shared_ptr< Graphics::Representation > > m_representations
List of graphics targets for updating.
Definition: CompoundShapeToGraphics.h:109
void setShape(const std::shared_ptr< Math::Shape > &shape)
Sets the shape to be used for synchronization.
Definition: CompoundShapeToGraphics.cpp:95
void addTarget(const std::shared_ptr< Framework::Component > &component)
Adds a single target to the list of targets, the target needs to be a graphics representation.
Definition: CompoundShapeToGraphics.cpp:124
void update(double dt) override
Update the behavior.
Definition: CompoundShapeToGraphics.cpp:54
Representations are manifestations of a SceneElement.
Definition: Representation.h:33
Definition: CompoundShape.h:36
~CompoundShapeToGraphics()
Destructor.
Definition: CompoundShapeToGraphics.cpp:49
Generic rigid shape class defining a shape.
Definition: Shape.h:65
SURGSIM_CLASSNAME(SurgSim::Blocks::CompoundShapeToGraphics)
int getTargetManagerType() const override
Specifies which manger will handle this behavior.
Definition: CompoundShapeToGraphics.cpp:67
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:39
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: CompoundShapeToGraphics.cpp:77
Keep a set of Graphics representations in sync with a CompoundShape, the shape can either be set dire...
Definition: CompoundShapeToGraphics.h:52
std::shared_ptr< Framework::Component > m_source
Source representation if known.
Definition: CompoundShapeToGraphics.h:106
std::shared_ptr< Framework::Component > getSource() const
Definition: CompoundShapeToGraphics.cpp:145
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: CompoundShapeToGraphics.cpp:72
std::shared_ptr< Math::CompoundShape > m_shape
Source shape used for updating.
Definition: CompoundShapeToGraphics.h:103