OsgScreenSpacePass.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_OSGSCREENSPACEPASS_H
17 #define SURGSIM_GRAPHICS_OSGSCREENSPACEPASS_H
18 
19 #include <string>
20 
22 
23 #include <osg/ref_ptr>
24 
25 namespace osg
26 {
27 class Camera;
28 }
29 
30 namespace SurgSim
31 {
32 namespace Graphics
33 {
34 
38 {
39 public:
40 
43  explicit OsgScreenSpacePass(const std::string& name);
44 
46  virtual ~OsgScreenSpacePass();
47 
49  void setViewPort(int width, int height);
50 
52  bool doInitialize() override;
53 
54 
55 private:
56 
58  void updateViewport(int width, int height);
59 
61  osg::ref_ptr<osg::Camera> m_camera;
62 
64  int m_width;
65 
67  int m_height;
68 };
69 
70 }
71 }
72 
73 #endif // SURGSIM_GRAPHICS_OSGSCREENSPACEPASS_H
SurgSim::Graphics::OsgScreenSpacePass::m_width
int m_width
The width of the viewport.
Definition: OsgScreenSpacePass.h:64
osg
Definition: OculusView.h:25
SurgSim::Graphics::OsgScreenSpacePass::OsgScreenSpacePass
OsgScreenSpacePass(const std::string &name)
Constructor.
Definition: OsgScreenSpacePass.cpp:27
SurgSim::Graphics::OsgScreenSpacePass
Special RenderPass to draw items using a orthogonal projection, this is specific to the Osg implement...
Definition: OsgScreenSpacePass.h:37
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::OsgScreenSpacePass::doInitialize
bool doInitialize() override
Initialize this Component.
Definition: OsgScreenSpacePass.cpp:40
SurgSim::Graphics::OsgScreenSpacePass::~OsgScreenSpacePass
virtual ~OsgScreenSpacePass()
Destructor.
Definition: OsgScreenSpacePass.cpp:35
RenderPass.h
SurgSim::Graphics::OsgScreenSpacePass::updateViewport
void updateViewport(int width, int height)
Update the projection matrix.
Definition: OsgScreenSpacePass.cpp:61
SurgSim::Graphics::OsgScreenSpacePass::m_camera
osg::ref_ptr< osg::Camera > m_camera
The osg camera reference.
Definition: OsgScreenSpacePass.h:61
SurgSim::Graphics::RenderPass
Encapsulation of all the components necessary needed to implement a full renderpass,...
Definition: RenderPass.h:50
SurgSim::Graphics::OsgScreenSpacePass::setViewPort
void setViewPort(int width, int height)
Set viewport dimensions.
Definition: OsgScreenSpacePass.cpp:69
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
SurgSim::Graphics::OsgScreenSpacePass::m_height
int m_height
The height of the viewport.
Definition: OsgScreenSpacePass.h:67