Go to the documentation of this file.
16 #ifndef SURGSIM_GRAPHICS_OSGREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_OSGREPRESENTATION_H
21 #include <osg/ref_ptr>
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;
70 bool setMaterial(std::shared_ptr<SurgSim::Framework::Component> material)
override;
74 std::shared_ptr<Material>
getMaterial()
const override;
97 void update(
double dt)
override;
101 void addUniform(std::shared_ptr<SurgSim::Graphics::UniformBase> uniform);
145 #endif // SURGSIM_GRAPHICS_OSGREPRESENTATION_H
void setDrawAsWireFrame(bool val) override
Sets the representation to render as a wire frame.
Definition: OsgRepresentation.cpp:118
bool isGeneratingTangents() const override
Definition: OsgRepresentation.cpp:162
void addUniform(std::shared_ptr< SurgSim::Graphics::UniformBase > uniform)
Adds a uniform to this representation.
Definition: OsgRepresentation.cpp:175
Definition: OculusView.h:25
bool getDrawAsWireFrame() const override
Return if the representation is rendered as a wire frame.
Definition: OsgRepresentation.cpp:136
Definition: CompoundShapeToGraphics.cpp:29
virtual void doUpdate(double dt)
Definition: OsgRepresentation.cpp:113
void updateTangents()
Causes the tangents to be recalculated if tangent generation is enabled Subclasses should call this w...
Definition: OsgRepresentation.cpp:167
OsgRepresentation(const std::string &name)
Constructor.
Definition: OsgRepresentation.cpp:39
virtual ~OsgRepresentation()
Destructor.
Definition: OsgRepresentation.cpp:60
std::shared_ptr< OsgMaterial > m_material
Material defining the visual appearance of the representation.
Definition: OsgRepresentation.h:130
void update(double dt) override
Updates the representation.
Definition: OsgRepresentation.cpp:65
std::shared_ptr< Material > getMaterial() const override
Gets the material that defines the visual appearance of the representation.
Definition: OsgRepresentation.cpp:97
void clearMaterial() override
Removes the material from the representation.
Definition: OsgRepresentation.cpp:102
osg::ref_ptr< osg::PositionAttitudeTransform > m_transform
Transform used to pose the representation.
Definition: OsgRepresentation.h:124
bool m_drawAsWireFrame
Indicates if the representation is rendered as a wireframe.
Definition: OsgRepresentation.h:136
osg::ref_ptr< osg::Group > m_materialProxy
Holder for attributes coming from OsgMaterial.
Definition: OsgRepresentation.h:127
void setVisible(bool val)
Set the visibility of this representation.
Definition: OsgRepresentation.cpp:141
std::shared_ptr< OsgUniform< SurgSim::Math::Matrix44f > > m_modelMatrixUniform
Definition: OsgRepresentation.h:138
osg::ref_ptr< osg::Node > getOsgNode() const
Returns the root OSG Node for this representations portion of the scene graph.
Definition: OsgRepresentation.cpp:108
osg::ref_ptr< osg::Switch > m_switch
Switch used to toggle the visibility of the representation.
Definition: OsgRepresentation.h:121
osg::ref_ptr< TangentSpaceGenerator > m_tangentGenerator
Visitor to generate tangents.
Definition: OsgRepresentation.h:133
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:39
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
bool setMaterial(std::shared_ptr< SurgSim::Framework::Component > material) override
Sets the material that defines the visual appearance of the representation.
Definition: OsgRepresentation.cpp:83
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55
void setGenerateTangents(bool value) override
Enable the generation of tangents When enabled it is up to the subclasses responsibility to react to ...
Definition: OsgRepresentation.cpp:148