16 #ifndef SURGSIM_GRAPHICS_REPRESENTATION_H 17 #define SURGSIM_GRAPHICS_REPRESENTATION_H 19 #include "SurgSim/Framework/Representation.h" 23 #include <unordered_set> 44 static const std::string DefaultGroupName;
45 static const std::string DefaultHudGroupName;
57 virtual bool setMaterial(std::shared_ptr<SurgSim::Framework::Component> material) = 0;
61 virtual std::shared_ptr<Material>
getMaterial()
const = 0;
63 void setMaterialReference(
const std::string& materialName);
65 std::string getMaterialReference()
const;
87 virtual void update(
double dt) = 0;
123 virtual void addUniform(std::shared_ptr<UniformBase> uniform) = 0;
129 virtual void addUniform(
const std::string& type,
const std::string& name,
const boost::any& value) = 0;
133 virtual void setUniforms(
const std::vector<std::shared_ptr<UniformBase>>& uniforms) = 0;
136 virtual std::vector<std::shared_ptr<UniformBase>>
getUniforms()
const = 0;
142 std::unordered_set<std::string> m_groups;
147 bool checkAwake(
const std::string& functionName);
150 std::string m_materialReference;
156 #endif // SURGSIM_GRAPHICS_REPRESENTATION_H virtual ~Representation()
Destructor.
Definition: Representation.cpp:152
virtual void addUniform(std::shared_ptr< UniformBase > uniform)=0
Adds a uniform to this representation.
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Representation(const std::string &name)
Constructor.
Definition: Representation.cpp:34
void setGroupReference(const std::string &group)
Helper functions, this clears all the references and sets, only the reference given in the parameter...
Definition: Representation.cpp:132
void clearGroupReferences()
Clear all the Group references.
Definition: Representation.cpp:88
virtual std::shared_ptr< Material > getMaterial() const =0
Gets the material that defines the visual appearance of the representation.
virtual std::vector< std::shared_ptr< UniformBase > > getUniforms() const =0
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: Representation.cpp:96
virtual void setDrawAsWireFrame(bool val)=0
Sets the representation to render as a wire frame.
virtual void setUniforms(const std::vector< std::shared_ptr< UniformBase >> &uniforms)=0
Sets a set of uniforms for this representation.
virtual bool getDrawAsWireFrame() const =0
Return if the representation is rendered as a wire frame.
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:40
std::vector< std::string > getGroupReferences() const
Gets group references.
Definition: Representation.cpp:83
virtual void setGenerateTangents(bool value)=0
Enable or disable the generation of tangents.
void addGroupReferences(const std::vector< std::string > &groups)
Adds a list of group references.
Definition: Representation.cpp:60
virtual bool setMaterial(std::shared_ptr< SurgSim::Framework::Component > material)=0
Sets the material that defines the visual appearance of the representation.
virtual void update(double dt)=0
Updates the representation.
virtual bool addGroupReference(const std::string &name)
Add a reference to a group, this will eventual add this representation to the group with the the same...
Definition: Representation.cpp:49
Representations are manifestations of a SceneElement.
Definition: Representation.h:33
virtual void clearMaterial()=0
Removes the material from the representation.
virtual bool isGeneratingTangents() const =0
void setGroupReferences(const std::vector< std::string > &groups)
Sets the list of group references.
Definition: Representation.cpp:71
bool removeGroupReference(const std::string &group)
Function to remove an unwanted reference.
Definition: Representation.cpp:122