opensurgsim
OsgTexture3d.h
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_OSGTEXTURE3D_H
17 #define SURGSIM_GRAPHICS_OSGTEXTURE3D_H
18 
19 #include "SurgSim/Graphics/OsgTexture.h"
20 #include "SurgSim/Graphics/Texture3d.h"
21 
22 #include <osg/Texture3D>
23 
24 #if defined(_MSC_VER)
25 #pragma warning(push)
26 #pragma warning(disable:4250)
27 #endif
28 
29 namespace SurgSim
30 {
31 
32 namespace Graphics
33 {
34 
38 class OsgTexture3d : public OsgTexture, public Texture3d
39 {
40 public:
43  OsgTexture3d();
44 
50  virtual void setSize(int width, int height, int depth);
51 
56  virtual void getSize(int* width, int* height, int* depth) const;
57 
62  virtual bool loadImageSlices(const std::vector<std::string>& filePaths);
63 
65  osg::ref_ptr<osg::Texture3D> getOsgTexture3d() const
66  {
67  return static_cast<osg::Texture3D*>(getOsgTexture().get());
68  }
69 };
70 
71 }; // namespace Graphics
72 
73 }; // namespace SurgSim
74 
75 #if defined(_MSC_VER)
76 #pragma warning(pop)
77 #endif
78 
79 #endif // SURGSIM_GRAPHICS_OSGTEXTURE3D_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
virtual void setSize(int width, int height, int depth)
Sets the size of the texture.
Definition: OsgTexture3d.cpp:28
osg::ref_ptr< osg::Texture > getOsgTexture() const
Returns the osg::Texture1D.
Definition: OsgTexture.h:44
virtual void getSize(int *width, int *height, int *depth) const
Gets the size of the texture.
Definition: OsgTexture3d.cpp:33
OsgTexture3d()
Constructor.
Definition: OsgTexture3d.cpp:24
osg::ref_ptr< osg::Texture3D > getOsgTexture3d() const
Returns the osg::Texture3D.
Definition: OsgTexture3d.h:65
Base class for OSG implementations of Graphics Textures.
Definition: OsgTexture.h:32
OSG implementation of a 3D Texture.
Definition: OsgTexture3d.h:38
virtual bool loadImageSlices(const std::vector< std::string > &filePaths)
Loads images slices from files into the 3D texture.
Definition: OsgTexture3d.cpp:52
Base class defining the interface for a 3D Graphics Texture.
Definition: Texture3d.h:32