Go to the documentation of this file.
16 #ifndef SURGSIM_GRAPHICS_OSGMATERIAL_H
17 #define SURGSIM_GRAPHICS_OSGMATERIAL_H
19 #include <boost/any.hpp>
20 #include <osg/Material>
21 #include <osg/StateSet>
57 void addUniform(std::shared_ptr<UniformBase> uniform)
override;
71 bool removeUniform(std::shared_ptr<UniformBase> uniform)
override;
77 std::shared_ptr<UniformBase>
getUniform(
size_t index)
const override;
87 bool setProgram(std::shared_ptr<Program> program)
override;
89 std::shared_ptr<Program>
getProgram()
const override;
123 #endif // SURGSIM_GRAPHICS_OSGMATERIAL_H
std::shared_ptr< UniformBase > getUniform(size_t index) const override
Gets a uniform in this material.
Definition: OsgMaterial.cpp:116
std::vector< std::shared_ptr< OsgUniformBase > > m_uniforms
Uniforms used by this material.
Definition: OsgMaterial.h:105
osg::ref_ptr< osg::StateSet > m_stateSet
OSG state set which provides material properties in the scenegraph.
Definition: OsgMaterial.h:102
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: OsgMaterial.cpp:205
void addUniform(std::shared_ptr< UniformBase > uniform) override
Adds a uniform to this material.
Definition: OsgMaterial.cpp:46
Base class that defines the interface for graphics materials.
Definition: Material.h:40
Definition: CompoundShapeToGraphics.cpp:30
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: OsgMaterial.cpp:196
OSG-based implementation of a graphics material.
Definition: OsgMaterial.h:46
bool removeUniform(std::shared_ptr< UniformBase > uniform) override
Removes a uniform from this material.
Definition: OsgMaterial.cpp:84
void clearProgram() override
Removes the shader from the material, falling back to fixed-function pipeline.
Definition: OsgMaterial.cpp:187
bool hasUniform(const std::string &name) const override
Checks if this material has a uniform with the given name.
Definition: OsgMaterial.cpp:158
std::shared_ptr< OsgMaterial > buildMaterial(const std::string &vertexShaderName, const std::string &fragmentShaderName)
Utility function to build the material.
Definition: OsgMaterial.cpp:215
size_t getNumUniforms() const override
Returns the number of uniforms in this material.
Definition: OsgMaterial.cpp:111
std::shared_ptr< Program > getProgram() const override
Gets the program used by this material.
Definition: OsgMaterial.cpp:182
OsgMaterial(const std::string &name)
Constructor.
Definition: OsgMaterial.cpp:39
std::shared_ptr< OsgProgram > m_program
Shader used by this material.
Definition: OsgMaterial.h:108
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgMaterial)
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
bool setProgram(std::shared_ptr< Program > program) override
Sets the shader used by this material.
Definition: OsgMaterial.cpp:163
osg::ref_ptr< osg::StateSet > getOsgStateSet() const
Definition: OsgMaterial.cpp:210