16 #ifndef SURGSIM_GRAPHICS_OSGREPRESENTATION_H 17 #define SURGSIM_GRAPHICS_OSGREPRESENTATION_H 21 #include <osg/ref_ptr> 23 #include "SurgSim/Graphics/Representation.h" 24 #include "SurgSim/Graphics/OsgUniform.h" 30 class PositionAttitudeTransform;
40 class TangentSpaceGenerator;
45 static const int TANGENT_VERTEX_ATTRIBUTE_ID = 6;
46 static const int BITANGENT_VERTEX_ATTRIBUTE_ID = 7;
47 static const int DIFFUSE_TEXTURE_UNIT = 0;
48 static const int NORMAL_TEXTURE_UNIT = 1;
49 static const int SHADOW_TEXTURE_UNIT = 8;
64 osg::ref_ptr<osg::Node> getOsgNode()
const;
70 bool setMaterial(std::shared_ptr<SurgSim::Framework::Component> material)
override;
74 std::shared_ptr<Material> getMaterial()
const override;
77 void clearMaterial()
override;
79 void setDrawAsWireFrame(
bool val)
override;
81 bool getDrawAsWireFrame()
const override;
91 void setGenerateTangents(
bool value)
override;
93 bool isGeneratingTangents()
const override;
97 void update(
double dt)
override;
99 void addUniform(std::shared_ptr<UniformBase> uniform)
override;
101 void addUniform(
const std::string& type,
const std::string& name,
const boost::any& value)
override;
103 void setUniforms(
const std::vector<std::shared_ptr<UniformBase>>& uniforms)
override;
105 std::vector<std::shared_ptr<UniformBase>> getUniforms()
const override;
108 void doRetire()
override;
110 virtual void doUpdate(
double dt);
114 void setVisible(
bool val);
118 void updateTangents();
122 void setOsgUniforms(
const std::vector<std::shared_ptr<Graphics::OsgUniformBase>>& uniforms);
125 std::vector<std::shared_ptr<Graphics::OsgUniformBase>> getOsgUniforms()
const;
145 std::shared_ptr<OsgUniform<SurgSim::Math::Matrix44f>> m_modelMatrixUniform;
147 std::vector<std::shared_ptr<OsgUniformBase>> m_uniforms;
153 #endif // SURGSIM_GRAPHICS_OSGREPRESENTATION_H bool m_drawAsWireFrame
Indicates if the representation is rendered as a wireframe.
Definition: OsgRepresentation.h:143
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
osg::ref_ptr< osg::Group > m_materialProxy
Holder for attributes coming from OsgMaterial.
Definition: OsgRepresentation.h:134
osg::ref_ptr< osg::Switch > m_switch
Switch used to toggle the visibility of the representation.
Definition: OsgRepresentation.h:128
osg::ref_ptr< osg::PositionAttitudeTransform > m_transform
Transform used to pose the representation.
Definition: OsgRepresentation.h:131
osg::ref_ptr< TangentSpaceGenerator > m_tangentGenerator
Visitor to generate tangents.
Definition: OsgRepresentation.h:140
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:40
Definition: OsgImGuiHandler.h:8
std::shared_ptr< OsgMaterial > m_material
Material defining the visual appearance of the representation.
Definition: OsgRepresentation.h:137
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55