OsgTexture.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_OSGTEXTURE_H
17 #define SURGSIM_GRAPHICS_OSGTEXTURE_H
18 
20 
21 #include <osg/Texture>
22 
23 namespace SurgSim
24 {
25 
26 namespace Graphics
27 {
28 
32 class OsgTexture : public virtual Texture
33 {
34 public:
38  virtual bool loadImage(const std::string& filePath);
39 
41  virtual void clearImage();
42 
44  osg::ref_ptr<osg::Texture> getOsgTexture() const
45  {
46  return m_texture;
47  }
48 
49 protected:
52  explicit OsgTexture(osg::Texture* texture);
53 
54 private:
56  osg::ref_ptr<osg::Texture> m_texture;
57 };
58 
59 }; // namespace Graphics
60 
61 }; // namespace SurgSim
62 
63 #endif // SURGSIM_GRAPHICS_OSGTEXTURE_H
Texture.h
SurgSim::Graphics::OsgTexture::clearImage
virtual void clearImage()
Removes the image from the texture.
Definition: OsgTexture.cpp:42
SurgSim::Graphics::OsgTexture::m_texture
osg::ref_ptr< osg::Texture > m_texture
OSG texture.
Definition: OsgTexture.h:56
SurgSim::Graphics::OsgTexture
Base class for OSG implementations of Graphics Textures.
Definition: OsgTexture.h:33
SurgSim
Definition: CompoundShapeToGraphics.cpp:30
SurgSim::Graphics::Texture
Base class defining the interface for a Graphics Texture.
Definition: Texture.h:29
SurgSim::Graphics::OsgTexture::OsgTexture
OsgTexture(osg::Texture *texture)
Constructor.
Definition: OsgTexture.cpp:22
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
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::OsgTexture::getOsgTexture
osg::ref_ptr< osg::Texture > getOsgTexture() const
Returns the osg::Texture1D.
Definition: OsgTexture.h:44