OsgTexture.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_OSGTEXTURE_H
#define SURGSIM_GRAPHICS_OSGTEXTURE_H
#include "SurgSim/Graphics/Texture.h"
#include <osg/Texture>
namespace SurgSim
{
namespace Graphics
{
class OsgTexture : public virtual Texture
{
public:
virtual bool loadImage(const std::string& filePath);
virtual void clearImage();
osg::ref_ptr<osg::Texture> getOsgTexture() const
{
return m_texture;
}
protected:
explicit OsgTexture(osg::Texture* texture);
private:
osg::ref_ptr<osg::Texture> m_texture;
};
}; // namespace Graphics
}; // namespace SurgSim
#endif // SURGSIM_GRAPHICS_OSGTEXTURE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::OsgTexture::getOsgTexture
osg::ref_ptr< osg::Texture > getOsgTexture() const
Returns the osg::Texture1D.
Definition: OsgTexture.h:44
Texture.h
SurgSim::Graphics::OsgTexture::clearImage
virtual void clearImage()
Removes the image from the texture.
Definition: OsgTexture.cpp:42
SurgSim::Graphics::OsgTexture
Base class for OSG implementations of Graphics Textures.
Definition: OsgTexture.h:32
SurgSim::Graphics::OsgTexture::m_texture
osg::ref_ptr< osg::Texture > m_texture
OSG texture.
Definition: OsgTexture.h:56
SurgSim::Graphics::OsgTexture::loadImage
virtual bool loadImage(const std::string &filePath)
Loads an image into the texture from a file.
Definition: OsgTexture.cpp:27
SurgSim::Graphics::Texture
Base class defining the interface for a Graphics Texture.
Definition: Texture.h:28
SurgSim::Graphics::OsgTexture::OsgTexture
OsgTexture(osg::Texture *texture)
Constructor.
Definition: OsgTexture.cpp:22