OsgUniform.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_GRAPHICS_OSGUNIFORM_H
#define SURGSIM_GRAPHICS_OSGUNIFORM_H
#include "SurgSim/Graphics/OsgUniformBase.h"
#include "SurgSim/Graphics/Uniform.h"
namespace YAML
{
class Node;
}
namespace SurgSim
{
namespace Graphics
{
template <class T>
class OsgUniform : public Uniform<T>, public OsgUniformBase
{
public:
explicit OsgUniform(const std::string& name);
virtual void set(const T& value);
virtual void set(const YAML::Node& node);
virtual const T& get() const;
private:
T m_value;
};
template <class T>
class OsgUniform<std::vector<T>> : public Uniform<std::vector<T>>, public OsgUniformBase
{
public:
OsgUniform(const std::string& name, size_t numElements);
virtual size_t getNumElements() const;
virtual void setElement(size_t index, const T& value);
virtual void set(const std::vector<T>& value);
virtual void set(const YAML::Node& node);
virtual typename std::vector<T>::const_reference getElement(size_t index) const;
virtual const std::vector<T>& get() const;
private:
std::vector<T> m_value;
};
}; // namespace Graphics
}; // namespace SurgSim
#include "SurgSim/Graphics/OsgUniform-inl.h"
#include "SurgSim/Graphics/OsgTextureUniform.h"
#include "SurgSim/Graphics/OsgTextureUniform-inl.h"
#endif // SURGSIM_GRAPHICS_OSGUNIFORM_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::OsgUniform::m_value
T m_value
Value of the uniform.
Definition: OsgUniform.h:56
OsgTextureUniform.h
std
STL namespace.
SurgSim::Graphics::OsgUniform
OSG implementation of graphics uniform with a value of type T.
Definition: OsgCamera.h:46
OsgUniform-inl.h
OsgTextureUniform-inl.h
Uniform.h
SurgSim::Graphics::OsgUniformBase
Base OSG implementation of graphics uniforms.
Definition: OsgUniformBase.h:41
SurgSim::Graphics::Uniform
Base class for a graphics uniform with a value of type T.
Definition: Uniform.h:32
SurgSim::Graphics::OsgUniform< std::vector< T > >::m_value
std::vector< T > m_value
Vector containing the values of the uniform&#39;s elements.
Definition: OsgUniform.h:98
OsgUniformBase.h
YAML
Definition: DataStructuresConvert.h:28