opensurgsim
OsgViewElement.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_OSGVIEWELEMENT_H
17 #define SURGSIM_GRAPHICS_OSGVIEWELEMENT_H
18 
19 #include <osg/ref_ptr>
20 
21 #include "SurgSim/Graphics/ViewElement.h"
22 #include "SurgSim/Math/Vector.h"
23 
24 namespace SurgSim
25 {
26 
27 namespace Input
28 {
29 class CommonDevice;
30 }
31 
32 namespace Graphics
33 {
34 
42 {
43 public:
46  explicit OsgViewElement(const std::string& name);
47 
49  virtual ~OsgViewElement();
50 
55  bool setView(std::shared_ptr<View> view) override;
56 
60  void enableManipulator(bool val);
61 
66  void setManipulatorParameters(const SurgSim::Math::Vector3d& position, const SurgSim::Math::Vector3d& lookat);
67 
70  std::shared_ptr<SurgSim::Input::CommonDevice> getKeyboardDevice() override;
73  void enableKeyboardDevice(bool val) override;
74 
77  std::shared_ptr<SurgSim::Input::CommonDevice> getMouseDevice() override;
80  void enableMouseDevice(bool val) override;
81 
82 private:
84  bool m_keyboardEnabled;
86  bool m_mouseEnabled;
87 };
88 
89 }; // namespace Graphics
90 
91 }; // namespace SurgSim
92 
93 #endif // SURGSIM_GRAPHICS_OSGVIEWELEMENT_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
OSG-based implementation of graphics view element.
Definition: OsgViewElement.h:41
Basic SceneElement that wraps a View so that it can be added to the Scene.
Definition: ViewElement.h:39
Definitions of small fixed-size vector types.