16 #ifndef SURGSIM_GRAPHICS_OSGVIEW_H 17 #define SURGSIM_GRAPHICS_OSGVIEW_H 19 #include <osgViewer/Viewer> 26 class DisplaySettings;
47 class OsgTrackballZoomManipulator;
49 SURGSIM_STATIC_REGISTRATION(OsgView);
65 explicit OsgView(
const std::string& name);
72 void setPosition(
const std::array<int, 2>& position)
override;
74 std::array<int, 2> getPosition()
const override;
76 void setDimensions(
const std::array<int, 2>& dimensions)
override;
78 std::array<int, 2> getDimensions()
const override;
80 void setDimensionsDouble(
const std::array<double, 2>& dimensions)
override;
82 std::array<double, 2> getDimensionsDouble()
const override;
84 void setWindowBorderEnabled(
bool enabled)
override;
86 bool isWindowBorderEnabled()
const override;
92 void setCamera(std::shared_ptr<SurgSim::Framework::Component> camera)
override;
97 void enableManipulator(
bool val);
100 bool isManipulatorEnabled();
125 void setOsgMapsUniforms(
bool val);
128 bool getOsgMapsUniforms();
132 std::shared_ptr<SurgSim::Input::CommonDevice> getKeyboardDevice();
136 void enableKeyboardDevice(
bool val);
139 bool isKeyboardDeviceEnabled();
143 std::shared_ptr<SurgSim::Input::CommonDevice> getMouseDevice();
147 void enableMouseDevice(
bool val);
150 bool isMouseDeviceEnabled();
152 void update(
double dt)
override;
155 osg::ref_ptr<osgViewer::View> getOsgView()
const;
160 bool doInitialize()
override;
163 bool doWakeUp()
override;
166 int doSetTargetScreen(
int val)
override;
170 virtual osg::ref_ptr<osg::DisplaySettings> createDisplaySettings()
const;
175 void fixupStatsHandler(osgViewer::StatsHandler* statsHandler);
214 #endif // SURGSIM_GRAPHICS_OSGVIEW_H Base graphics view class, which defines the basic interface for all graphics views.
Definition: View.h:39
osg::ref_ptr< OsgTrackballZoomManipulator > m_manipulator
Definition: OsgView.h:197
Definition: CompoundShapeToGraphics.cpp:29
bool m_osgMapUniforms
Wether to enable osg uniform mapping.
Definition: OsgView.h:195
osg::ref_ptr< osgViewer::View > m_view
OSG view which performs the actual work involved in setting up and rendering to a window...
Definition: OsgView.h:192
SurgSim::Math::Vector3d m_manipulatorPosition
Definition: OsgView.h:198
bool m_mouseEnabled
Indicate if a mouse device is enabled.
Definition: OsgView.h:206
bool m_isWindowBorderEnabled
Whether the view window has a border.
Definition: OsgView.h:183
std::shared_ptr< SurgSim::Devices::MouseDevice > m_mouseDevice
Definition: OsgView.h:207
std::array< int, 2 > m_position
Position of the view on the screen (in pixels)
Definition: OsgView.h:178
std::array< int, 2 > m_screenDimensions
Definition: OsgView.h:181
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
std::array< int, 2 > m_dimensions
Dimensions of the view on the screen (in pixels)
Definition: OsgView.h:180
std::shared_ptr< SurgSim::Devices::KeyboardDevice > m_keyboardDevice
Definition: OsgView.h:203
SurgSim::Math::Vector3d m_manipulatorLookat
Definition: OsgView.h:199
bool m_isFirstUpdate
Whether the next update will be the first time the view has been updated On the first update...
Definition: OsgView.h:187
bool m_areWindowSettingsDirty
Whether the settings have been changed and the window needs to be updated.
Definition: OsgView.h:189
bool m_keyboardEnabled
Indicate if a keyboard device is enabled.
Definition: OsgView.h:202
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
OSG-based implementation of graphics view class.
Definition: OsgView.h:56