opensurgsim
OculusView.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_DEVICES_OCULUS_OCULUSVIEW_H
17 #define SURGSIM_DEVICES_OCULUS_OCULUSVIEW_H
18 
19 #include <memory>
20 #include <osg/ref_ptr>
21 #include <string>
22 
23 #include "SurgSim/Graphics/OsgView.h"
24 
25 namespace osg
26 {
27 class DisplaySettings;
28 }
29 
30 namespace SurgSim
31 {
32 
33 namespace Framework
34 {
35 class Component;
36 }
37 
38 namespace Input
39 {
40 class InputComponent;
41 }
42 
43 namespace Devices
44 {
45 
46 SURGSIM_STATIC_REGISTRATION(OculusView);
47 
50 {
51 public:
54  explicit OculusView(const std::string& name);
55 
57  ~OculusView();
58 
59  SURGSIM_CLASSNAME(SurgSim::Devices::OculusView);
60 
64  void setInputComponent(std::shared_ptr<Framework::Component> input);
65 
67  std::shared_ptr<Input::InputComponent> getInputComponent() const;
68 
69 protected:
70  osg::ref_ptr<osg::DisplaySettings> createDisplaySettings() const override;
71 
72 private:
74  std::shared_ptr<Input::InputComponent> m_inputComponent;
75 };
76 
77 }; // namespace Graphics
78 }; // namespace SurgSim
79 
80 #endif // SURGSIM_DEVICES_OCULUS_OCULUSVIEW_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
OculusView is a customization of SurgSim::Graphics::OsgView with projection matrices pulled from the ...
Definition: OculusView.h:49
Definition: OsgImGuiHandler.h:8
OSG-based implementation of graphics view class.
Definition: OsgView.h:56