Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
SurgSim
Graphics
OsgUniformBase.h
Go to the documentation of this file.
1
// This file is a part of the OpenSurgSim project.
2
// Copyright 2013, SimQuest Solutions Inc.
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
16
#ifndef SURGSIM_GRAPHICS_OSGUNIFORMBASE_H
17
#define SURGSIM_GRAPHICS_OSGUNIFORMBASE_H
18
19
#include "
SurgSim/Graphics/Uniform.h
"
20
21
#include <osg/StateSet>
22
#include <osg/Uniform>
23
24
namespace
SurgSim
25
{
26
27
namespace
Graphics
28
{
29
36
class
OsgUniformBase
:
public
virtual
UniformBase
37
{
38
public
:
40
const
std::string&
getName
()
const
41
{
42
return
m_uniform
->getName();
43
}
44
47
virtual
void
addToStateSet
(osg::StateSet* stateSet);
48
51
virtual
void
removeFromStateSet
(osg::StateSet* stateSet);
52
54
osg::ref_ptr<osg::Uniform>
getOsgUniform
()
const
55
{
56
return
m_uniform
;
57
}
58
59
protected
:
62
explicit
OsgUniformBase
(
const
std::string& name);
63
65
osg::ref_ptr<osg::Uniform>
m_uniform
;
66
};
67
68
};
// namespace Graphics
69
70
};
// namespace SurgSim
71
72
#endif // SURGSIM_GRAPHICS_OSGUNIFORMBASE_H
SurgSim
Definition:
DriveElementFromInputBehavior.cpp:27
SurgSim::Graphics::OsgUniformBase::getName
const std::string & getName() const
Returns the name used in shader code to access this uniform.
Definition:
OsgUniformBase.h:40
SurgSim::Graphics::OsgUniformBase::addToStateSet
virtual void addToStateSet(osg::StateSet *stateSet)
Adds this uniform to the OSG state set.
Definition:
OsgUniformBase.cpp:27
SurgSim::Graphics::OsgUniformBase::m_uniform
osg::ref_ptr< osg::Uniform > m_uniform
OSG uniform node.
Definition:
OsgUniformBase.h:65
SurgSim::Graphics::OsgUniformBase::removeFromStateSet
virtual void removeFromStateSet(osg::StateSet *stateSet)
Removes this uniform from the OSG state set.
Definition:
OsgUniformBase.cpp:33
Uniform.h
SurgSim::Graphics::OsgUniformBase
Base OSG implementation of graphics uniforms.
Definition:
OsgUniformBase.h:36
SurgSim::Graphics::OsgUniformBase::getOsgUniform
osg::ref_ptr< osg::Uniform > getOsgUniform() const
Returns the OSG uniform node.
Definition:
OsgUniformBase.h:54
SurgSim::Graphics::OsgUniformBase::OsgUniformBase
OsgUniformBase(const std::string &name)
Constructor.
Definition:
OsgUniformBase.cpp:21
SurgSim::Graphics::UniformBase
Common base class for all graphics uniforms.
Definition:
UniformBase.h:33
Generated on Sun Sep 20 2015 17:33:34 for OpenSurgSim by
1.8.9.1