OpenSceneGraph 3.6.5
ViewerEventHandlers
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2*
3* This library is open source and may be redistributed and/or modified under
4* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5* (at your option) any later version. The full license is in LICENSE file
6* included with this distribution, and on the openscenegraph.org website.
7*
8* This library is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGVIEWER_VIEWEREVENTHANDLERS
15#define OSGVIEWER_VIEWEREVENTHANDLERS 1
16
17#include <osg/AnimationPath>
18#include <osgText/Text>
19#include <osgGA/GUIEventHandler>
21
23#include <osgViewer/Viewer>
24
25#include <osgDB/fstream>
26
27namespace osgViewer {
28
70
75{
76 public:
77
79
89
92
95
96 double getBlockMultiplier() const { return _blockMultiplier; }
97
98 void reset();
99
100 osg::Camera* getCamera() { return _camera.get(); }
101 const osg::Camera* getCamera() const { return _camera.get(); }
102
104
106
108 virtual void getUsage(osg::ApplicationUsage& usage) const;
109
142 void addUserStatsLine(const std::string& label, const osg::Vec4& textColor, const osg::Vec4& barColor,
143 const std::string& timeTakenName, float multiplier, bool average, bool averageInInverseSpace,
144 const std::string& beginTimeName, const std::string& endTimeName, float maxValue);
145
146 void removeUserStatsLine(const std::string& label);
147
148protected:
149
151 void setWindowSize(int width, int height);
152
153 osg::Geometry* createBackgroundRectangle(const osg::Vec3& pos, const float width, const float height, osg::Vec4& color);
154
155 osg::Geometry* createGeometry(const osg::Vec3& pos, float height, const osg::Vec4& colour, unsigned int numBlocks);
156
157 osg::Geometry* createFrameMarkers(const osg::Vec3& pos, float height, const osg::Vec4& colour, unsigned int numBlocks);
158
159 osg::Geometry* createTick(const osg::Vec3& pos, float height, const osg::Vec4& colour, unsigned int numTicks);
160
161 void createTimeStatsLine(const std::string& lineLabel, osg::Vec3 pos,
162 const osg::Vec4& textColor, const osg::Vec4& barColor, osg::Stats* viewerStats, osg::Stats* stats,
163 const std::string& timeTakenName, float multiplier, bool average, bool averageInInverseSpace,
164 const std::string& beginTimeName, const std::string& endTimeName);
165
166 void createCameraTimeStats(osg::Vec3& pos, bool acquireGPUStats, osg::Stats* viewerStats, osg::Camera* camera);
167
169
171
174
176
179
181
183
186
187 unsigned int _frameRateChildNum;
188 unsigned int _viewerChildNum;
191 unsigned int _numBlocks;
193
196
197 std::string _font;
199 float _leftPos;
202
204 {
205 std::string label;
208 std::string timeTakenName;
212 std::string beginTimeName;
213 std::string endTimeName;
214 float maxValue;
215
216 UserStatsLine(const std::string& label_, const osg::Vec4& textColor_, const osg::Vec4& barColor_,
217 const std::string& timeTakenName_, float multiplier_, bool average_, bool averageInInverseSpace_,
218 const std::string& beginTimeName_, const std::string& endTimeName_, float maxValue_)
219 : label(label_), textColor(textColor_), barColor(barColor_),
220 timeTakenName(timeTakenName_), multiplier(multiplier_), average(average_), averageInInverseSpace(averageInInverseSpace_),
221 beginTimeName(beginTimeName_), endTimeName(endTimeName_), maxValue(maxValue_)
222 {
223 }
224 };
225
226 typedef std::vector<UserStatsLine> UserStatsLines;
228
229};
230
233{
234public:
235
237
239 virtual void getUsage(osg::ApplicationUsage &usage) const;
240
243
244 void setToggleFullscreen(bool flag) { _toggleFullscreen = flag; }
245 bool getToggleFullscreen() const { return _toggleFullscreen; }
246
251
254
256
257protected:
258
261
262 unsigned int getNearestResolution(int screenWidth, int screenHeight, int width, int height) const;
263
266
270 std::vector<osg::Vec2> _resolutionList;
272};
273
308
354
381
404
405
408{
409 public:
410
413 {
414 public:
415 virtual void operator()(const osg::Image& image, const unsigned int context_id) = 0;
416 };
417
420 {
421 public:
423 {
426 // ... any others?
427 };
428
429 WriteToFile(const std::string& filename, const std::string& extension, SavePolicy savePolicy = SEQUENTIAL_NUMBER);
430
431 virtual void operator()(const osg::Image& image, const unsigned int context_id);
432
433 void setSavePolicy(SavePolicy savePolicy) { _savePolicy = savePolicy; }
435
436 protected:
437
438 WriteToFile& operator = (const WriteToFile&) { return *this; }
439
440 const std::string _filename;
441 const std::string _extension;
442
444
445 std::vector<unsigned int> _contextSaveCounter;
446 };
447
450 ScreenCaptureHandler(CaptureOperation* defaultOperation = 0, int numFrames = 1);
451
454
457
460
461 // aa will point to an osgViewer::View, so we will take a screenshot
462 // of that view's graphics contexts.
464
467
470 void setFramesToCapture(int numFrames);
471
474
478
481
483 virtual void getUsage(osg::ApplicationUsage& usage) const;
484
485 protected:
488
491 // there could be a key to start taking screenshots every new frame
492
495
499};
500
505{
506public:
507
512
514
517
520
523
526
527 // use the osgGA::GUIEventHandler implementation of run.
528 virtual bool run(osg::Object* object, osg::Object* data) { return osgGA::GUIEventHandler::run(object, data); }
529
531
532 virtual bool cull(osg::NodeVisitor* nv, osg::Drawable* drawable, osg::RenderInfo* renderInfo) const;
533
534protected:
535
537
540
543
544 bool mousePosition(osgViewer::View* view, osg::NodeVisitor* nv, const osgGA::GUIEventAdapter& ea, int& x, int &y) const;
545
546 void resize(int width, int height);
547
550
553
554};
555
556}
557
558#endif
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec3f Vec3
Definition Vec3:21
Vec4f Vec4
Definition Vec4:21
unsigned long long Timer_t
Definition Timer:24
The 'GA' in osgGA stands for 'GUI Abstraction'; the osgGA namespace provides facilities to help devel...
Definition Callback:21
The osgViewer library provides high level viewer functionality designed to make it easier to write a ...
Definition ApplicationUsage:26
Callback()
Definition Callback:38
virtual bool run(osg::Object *object, osg::Object *data)
Invoke the callback, first parameter is the Object that the callback is attached to,...
Definition Callback:80
NodeCallback()
Definition Callback:219
virtual NodeCallback * asNodeCallback()
Definition Callback:227
virtual DrawableEventCallback * asDrawableEventCallback()
Definition Callback:330
DrawableEventCallback()
Definition Callback:322
Definition Callback:341
virtual DrawableCullCallback * asDrawableCullCallback()
Definition Callback:351
DrawableCullCallback()
Definition Callback:343
Camera - is a subclass of Transform which represents encapsulates the settings of a Camera.
Definition Camera:45
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Pure virtual base class for drawable geometry.
Definition Drawable:89
Definition Geometry:31
Image class for encapsulating the storage texture image data.
Definition Image:179
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Object()
Construct an object.
Definition Object:69
Smart pointer for observed objects, that automatically set pointers to them to null when they are del...
Definition observer_ptr:39
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for providing reference counted objects.
Definition Referenced:44
Definition RenderInfo:28
Definition Stats:29
Encapsulates OpenGL 2D texture functionality.
Definition Texture2D:25
Definition fstream:47
EventHandler is base class for adding handling of events, either as node event callback,...
Definition EventHandler:34
virtual EventHandler * asEventHandler()
Definition EventHandler:52
Definition GUIActionAdapter:62
Event class for storing Keyboard, mouse and window events.
Definition GUIEventAdapter:82
GUIEventHandler provides a basic interface for any class which wants to handle a GUI Events.
Definition GUIEventHandler:50
GUIEventHandler()
Definition GUIEventHandler:53
Base class for providing Windowing API agnostic access to creating and managing graphics window and e...
Definition GraphicsWindow:43
View holds a single view on a scene, this view may be composed of one or more slave cameras.
Definition View:76
ViewerBase is the view base class that is inherited by both Viewer and CompositeViewer.
Definition ViewerBase:36
ThreadingModel
Definition ViewerBase:78
std::vector< osg::Camera * > Cameras
Definition ViewerBase:263
const osg::Camera * getCamera() const
Definition ViewerEventHandlers:46
void setUpHUDCamera(osgViewer::ViewerBase *viewer)
void setUpScene(osgViewer::ViewerBase *viewer)
const osg::ApplicationUsage * getApplicationUsage() const
Definition ViewerEventHandlers:38
bool _helpEnabled
Definition ViewerEventHandlers:63
osg::ref_ptr< osg::ApplicationUsage > _applicationUsage
Definition ViewerEventHandlers:59
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the keyboard and mouse usage of this manipulator.
void setApplicationUsage(osg::ApplicationUsage *au)
Definition ViewerEventHandlers:36
void setKeyEventTogglesOnScreenHelp(int key)
Definition ViewerEventHandlers:40
osg::ref_ptr< osg::Camera > _camera
Definition ViewerEventHandlers:66
HelpHandler(osg::ApplicationUsage *au=0)
osg::ApplicationUsage * getApplicationUsage()
Definition ViewerEventHandlers:37
bool _initialized
Definition ViewerEventHandlers:65
osg::ref_ptr< osg::Switch > _switch
Definition ViewerEventHandlers:67
osg::Camera * getCamera()
Definition ViewerEventHandlers:45
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Deprecated, Handle events, return true if handled, false otherwise.
int getKeyEventTogglesOnScreenHelp() const
Definition ViewerEventHandlers:41
int _keyEventTogglesOnScreenHelp
Definition ViewerEventHandlers:61
void addUserStatsLine(const std::string &label, const osg::Vec4 &textColor, const osg::Vec4 &barColor, const std::string &timeTakenName, float multiplier, bool average, bool averageInInverseSpace, const std::string &beginTimeName, const std::string &endTimeName, float maxValue)
This allows the user to register additional stats lines that will be added to the graph.
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the keyboard and mouse usage of this manipulator.
void createTimeStatsLine(const std::string &lineLabel, osg::Vec3 pos, const osg::Vec4 &textColor, const osg::Vec4 &barColor, osg::Stats *viewerStats, osg::Stats *stats, const std::string &timeTakenName, float multiplier, bool average, bool averageInInverseSpace, const std::string &beginTimeName, const std::string &endTimeName)
ViewerBase::ThreadingModel _threadingModel
Definition ViewerEventHandlers:184
void setUpScene(osgViewer::ViewerBase *viewer)
osg::Geometry * createGeometry(const osg::Vec3 &pos, float height, const osg::Vec4 &colour, unsigned int numBlocks)
std::vector< UserStatsLine > UserStatsLines
Definition ViewerEventHandlers:226
UserStatsLines _userStatsLines
Definition ViewerEventHandlers:227
void setWindowSize(int width, int height)
osg::ref_ptr< osgText::Text > _threadingModelText
Definition ViewerEventHandlers:185
int getKeyEventTogglesOnScreenStats() const
Definition ViewerEventHandlers:91
osg::Geometry * createFrameMarkers(const osg::Vec3 &pos, float height, const osg::Vec4 &colour, unsigned int numBlocks)
unsigned int _frameRateChildNum
Definition ViewerEventHandlers:187
osg::ref_ptr< osg::Switch > _switch
Definition ViewerEventHandlers:180
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Deprecated, Handle events, return true if handled, false otherwise.
osg::Geometry * createTick(const osg::Vec3 &pos, float height, const osg::Vec4 &colour, unsigned int numTicks)
void setKeyEventTogglesOnScreenStats(int key)
Definition ViewerEventHandlers:90
osg::Camera * getCamera()
Definition ViewerEventHandlers:100
void setUpHUDCamera(osgViewer::ViewerBase *viewer)
const osg::Camera * getCamera() const
Definition ViewerEventHandlers:101
osg::ref_ptr< osg::Geode > _statsGeode
Definition ViewerEventHandlers:182
int _keyEventPrintsOutStats
Definition ViewerEventHandlers:173
int _statsType
Definition ViewerEventHandlers:175
float _statsWidth
Definition ViewerEventHandlers:194
double _blockMultiplier
Definition ViewerEventHandlers:192
double getBlockMultiplier() const
Definition ViewerEventHandlers:96
float _leftPos
Definition ViewerEventHandlers:199
float _characterSize
Definition ViewerEventHandlers:200
unsigned int _viewerSceneChildNum
Definition ViewerEventHandlers:190
std::string _font
Definition ViewerEventHandlers:197
StatsType
Definition ViewerEventHandlers:81
@ LAST
Definition ViewerEventHandlers:87
@ VIEWER_STATS
Definition ViewerEventHandlers:84
@ CAMERA_SCENE_STATS
Definition ViewerEventHandlers:85
@ NO_STATS
Definition ViewerEventHandlers:82
@ FRAME_RATE
Definition ViewerEventHandlers:83
@ VIEWER_SCENE_STATS
Definition ViewerEventHandlers:86
osg::Geometry * createBackgroundRectangle(const osg::Vec3 &pos, const float width, const float height, osg::Vec4 &color)
void createCameraTimeStats(osg::Vec3 &pos, bool acquireGPUStats, osg::Stats *viewerStats, osg::Camera *camera)
float _statsHeight
Definition ViewerEventHandlers:195
void removeUserStatsLine(const std::string &label)
void setKeyEventPrintsOutStats(int key)
Definition ViewerEventHandlers:93
unsigned int _numBlocks
Definition ViewerEventHandlers:191
bool _initialized
Definition ViewerEventHandlers:177
float _startBlocks
Definition ViewerEventHandlers:198
virtual void collectWhichCamerasToRenderStatsFor(osgViewer::ViewerBase *viewer, osgViewer::ViewerBase::Cameras &cameras)
int _keyEventTogglesOnScreenStats
Definition ViewerEventHandlers:172
unsigned int _cameraSceneChildNum
Definition ViewerEventHandlers:189
unsigned int _viewerChildNum
Definition ViewerEventHandlers:188
int getKeyEventPrintsOutStats() const
Definition ViewerEventHandlers:94
osg::ref_ptr< osg::Camera > _camera
Definition ViewerEventHandlers:178
float _lineHeight
Definition ViewerEventHandlers:201
osg::Vec4 barColor
Definition ViewerEventHandlers:207
std::string timeTakenName
Definition ViewerEventHandlers:208
osg::Vec4 textColor
Definition ViewerEventHandlers:206
bool averageInInverseSpace
Definition ViewerEventHandlers:211
bool average
Definition ViewerEventHandlers:210
std::string endTimeName
Definition ViewerEventHandlers:213
std::string beginTimeName
Definition ViewerEventHandlers:212
UserStatsLine(const std::string &label_, const osg::Vec4 &textColor_, const osg::Vec4 &barColor_, const std::string &timeTakenName_, float multiplier_, bool average_, bool averageInInverseSpace_, const std::string &beginTimeName_, const std::string &endTimeName_, float maxValue_)
Definition ViewerEventHandlers:216
float maxValue
Definition ViewerEventHandlers:214
std::string label
Definition ViewerEventHandlers:205
float multiplier
Definition ViewerEventHandlers:209
void setKeyEventWindowedResolutionUp(int key)
Definition ViewerEventHandlers:247
int getKeyEventToggleFullscreen() const
Definition ViewerEventHandlers:242
int _keyEventWindowedResolutionDown
Definition ViewerEventHandlers:268
void setToggleFullscreen(bool flag)
Definition ViewerEventHandlers:244
unsigned int getNearestResolution(int screenWidth, int screenHeight, int width, int height) const
int _keyEventWindowedResolutionUp
Definition ViewerEventHandlers:267
void setKeyEventToggleFullscreen(int key)
Definition ViewerEventHandlers:241
int _keyEventToggleFullscreen
Definition ViewerEventHandlers:264
void toggleFullscreen(osgViewer::GraphicsWindow *window)
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Deprecated, Handle events, return true if handled, false otherwise.
int getKeyEventWindowedResolutionDown() const
Definition ViewerEventHandlers:250
bool _toggleFullscreen
Definition ViewerEventHandlers:265
bool getChangeWindowedResolution() const
Definition ViewerEventHandlers:253
bool _changeWindowedResolution
Definition ViewerEventHandlers:269
std::vector< osg::Vec2 > _resolutionList
Definition ViewerEventHandlers:270
void setKeyEventWindowedResolutionDown(int key)
Definition ViewerEventHandlers:249
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the keyboard and mouse usage of this manipulator.
int getKeyEventWindowedResolutionUp() const
Definition ViewerEventHandlers:248
void setChangeWindowedResolution(bool flag)
Definition ViewerEventHandlers:252
void changeWindowedResolution(osgViewer::GraphicsWindow *window, bool increase)
int _currentResolutionIndex
Definition ViewerEventHandlers:271
bool getToggleFullscreen() const
Definition ViewerEventHandlers:245
void setChangeEndBarrierPosition(bool flag)
Definition ViewerEventHandlers:293
bool _changeEndBarrierPosition
Definition ViewerEventHandlers:304
int getKeyEventChangeThreadingModel() const
Definition ViewerEventHandlers:285
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the keyboard and mouse usage of this manipulator.
void setChangeThreadingModel(bool flag)
Definition ViewerEventHandlers:287
bool _changeThreadingModel
Definition ViewerEventHandlers:301
bool getChangeThreadingModel() const
Definition ViewerEventHandlers:288
bool getChangeEndBarrierPosition() const
Definition ViewerEventHandlers:294
osg::Timer_t _tickOrLastKeyPress
Definition ViewerEventHandlers:306
int _keyEventChangeThreadingModel
Definition ViewerEventHandlers:300
int _keyEventChangeEndBarrierPosition
Definition ViewerEventHandlers:303
void setKeyEventChangeThreadingModel(int key)
Definition ViewerEventHandlers:284
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Deprecated, Handle events, return true if handled, false otherwise.
int getKeyEventChangeEndBarrierPosition() const
Definition ViewerEventHandlers:291
void setKeyEventChangeEndBarrierPosition(int key)
Definition ViewerEventHandlers:290
double _interval
Definition ViewerEventHandlers:346
bool _currentlyPlaying
Definition ViewerEventHandlers:345
int _keyEventToggleRecord
Definition ViewerEventHandlers:340
int _autoinc
Definition ViewerEventHandlers:337
int getKeyEventToggleRecord() const
Definition ViewerEventHandlers:323
osgDB::ofstream _fout
Definition ViewerEventHandlers:338
void setKeyEventToggleRecord(int key)
Definition ViewerEventHandlers:322
bool _currentlyRecording
Definition ViewerEventHandlers:344
osg::Timer_t _lastFrameTime
Definition ViewerEventHandlers:349
osg::ref_ptr< osgGA::AnimationPathManipulator > _animPathManipulator
Definition ViewerEventHandlers:351
void setKeyEventTogglePlayback(int key)
Definition ViewerEventHandlers:325
std::string _filename
Definition ViewerEventHandlers:336
int _keyEventTogglePlayback
Definition ViewerEventHandlers:341
double _delta
Definition ViewerEventHandlers:347
osg::ref_ptr< osgGA::CameraManipulator > _oldManipulator
Definition ViewerEventHandlers:352
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Deprecated, Handle events, return true if handled, false otherwise.
RecordCameraPathHandler(const std::string &filename="saved_animation.path", float fps=25.0f)
osg::ref_ptr< osg::AnimationPath > _animPath
Definition ViewerEventHandlers:350
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the user interface usage of this event handler, i.e.
void setAutoIncrementFilename(bool autoinc=true)
Definition ViewerEventHandlers:328
int getKeyEventTogglePlayback() const
Definition ViewerEventHandlers:326
osg::Timer_t _animStartTime
Definition ViewerEventHandlers:348
int _keyEventIncreaseLODScale
Definition ViewerEventHandlers:376
void setKeyEventDecreaseLODScale(int key)
Definition ViewerEventHandlers:365
int _keyEventDecreaseLODScale
Definition ViewerEventHandlers:377
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the keyboard and mouse usage of this manipulator.
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Deprecated, Handle events, return true if handled, false otherwise.
int getKeyEventDecreaseLODScale() const
Definition ViewerEventHandlers:366
int getKeyEventIncreaseLODScale() const
Definition ViewerEventHandlers:363
void setKeyEventIncreaseLODScale(int key)
Definition ViewerEventHandlers:362
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the keyboard and mouse usage of this manipulator.
void setKeyEventToggleSyncToVBlankHandler(int key)
Definition ViewerEventHandlers:389
int _keyEventToggleSyncToVBlank
Definition ViewerEventHandlers:400
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Deprecated, Handle events, return true if handled, false otherwise.
int getKeyEventToggleSyncToVBlankHandler() const
Definition ViewerEventHandlers:390
bool _startCapture
Definition ViewerEventHandlers:486
int getKeyEventToggleContinuousCapture() const
Definition ViewerEventHandlers:456
void stopCapture()
Stop capturing.
osg::ref_ptr< CaptureOperation > _operation
Definition ViewerEventHandlers:493
void setKeyEventToggleContinuousCapture(int key)
Definition ViewerEventHandlers:455
virtual void captureNextFrame(osgViewer::ViewerBase &viewer)
Capture the given viewer's views on the next frame.
int getFramesToCapture() const
Get the number of frames to capture.
osg::Camera * findAppropriateCameraForCallback(osgViewer::ViewerBase &viewer)
ScreenCaptureHandler(CaptureOperation *defaultOperation=0, int numFrames=1)
void setFramesToCapture(int numFrames)
Set the number of frames to capture.
void setCaptureOperation(CaptureOperation *operation)
void setKeyEventTakeScreenShot(int key)
Definition ViewerEventHandlers:452
bool _stopCapture
Definition ViewerEventHandlers:487
void startCapture()
Start capturing any viewer(s) the handler is attached to at the end of the next frame.
void removeCallbackFromViewer(osgViewer::ViewerBase &viewer)
int _keyEventTakeScreenShot
Definition ViewerEventHandlers:489
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Deprecated, Handle events, return true if handled, false otherwise.
int getKeyEventTakeScreenShot() const
Definition ViewerEventHandlers:453
void addCallbackToViewer(osgViewer::ViewerBase &viewer)
int _keyEventToggleContinuousCapture
Definition ViewerEventHandlers:490
osg::ref_ptr< osg::Camera::DrawCallback > _callback
Definition ViewerEventHandlers:494
CaptureOperation * getCaptureOperation() const
virtual void getUsage(osg::ApplicationUsage &usage) const
Get the keyboard and mouse usage of this manipulator.
Abstract base class for what to do when a screen capture happens.
Definition ViewerEventHandlers:413
virtual void operator()(const osg::Image &image, const unsigned int context_id)=0
SavePolicy
Definition ViewerEventHandlers:423
@ SEQUENTIAL_NUMBER
Definition ViewerEventHandlers:425
@ OVERWRITE
Definition ViewerEventHandlers:424
SavePolicy getSavePolicy() const
Definition ViewerEventHandlers:434
const std::string _extension
Definition ViewerEventHandlers:441
SavePolicy _savePolicy
Definition ViewerEventHandlers:443
std::vector< unsigned int > _contextSaveCounter
Definition ViewerEventHandlers:445
virtual void operator()(const osg::Image &image, const unsigned int context_id)
const std::string _filename
Definition ViewerEventHandlers:440
WriteToFile(const std::string &filename, const std::string &extension, SavePolicy savePolicy=SEQUENTIAL_NUMBER)
void setSavePolicy(SavePolicy savePolicy)
Definition ViewerEventHandlers:433
virtual const NodeCallback * asNodeCallback() const
Definition ViewerEventHandlers:516
InteractiveImageHandler(osg::Image *image)
Constructor to use when the InteractiveImage is in the 3D scene (i.e. not in a fullscreen HUD overlay...
bool mousePosition(osgViewer::View *view, osg::NodeVisitor *nv, const osgGA::GUIEventAdapter &ea, int &x, int &y) const
virtual const osgGA::EventHandler * asEventHandler() const
Definition ViewerEventHandlers:525
virtual bool cull(osg::NodeVisitor *nv, osg::Drawable *drawable, osg::RenderInfo *renderInfo) const
do customized cull code, return true if drawable should be culled.
virtual const DrawableCullCallback * asDrawableCullCallback() const
Definition ViewerEventHandlers:522
osg::observer_ptr< osg::Camera > _camera
Definition ViewerEventHandlers:552
InteractiveImageHandler()
Definition ViewerEventHandlers:538
InteractiveImageHandler(osg::Image *image, osg::Texture2D *texture, osg::Camera *camera)
Constructor to use when the InteractiveImage is in a fullscreen HUD overlay.
virtual DrawableEventCallback * asDrawableEventCallback()
Definition ViewerEventHandlers:518
virtual bool run(osg::Object *object, osg::Object *data)
NodeCallback overrides the Callback::run() method to adapt it the old style NodeCallback::operator()(...
Definition ViewerEventHandlers:528
virtual const DrawableEventCallback * asDrawableEventCallback() const
Definition ViewerEventHandlers:519
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *nv)
Handle events, return true if handled, false otherwise.
osg::observer_ptr< osg::Texture2D > _texture
Definition ViewerEventHandlers:549
META_Object(osgViewer, InteractiveImageHandler)
virtual DrawableCullCallback * asDrawableCullCallback()
Definition ViewerEventHandlers:521
virtual ~InteractiveImageHandler()
Definition ViewerEventHandlers:536
InteractiveImageHandler(const InteractiveImageHandler &, const osg::CopyOp &=osg::CopyOp::SHALLOW_COPY)
Definition ViewerEventHandlers:541
void resize(int width, int height)
virtual osgGA::EventHandler * asEventHandler()
Definition ViewerEventHandlers:524
osg::observer_ptr< osg::Image > _image
Definition ViewerEventHandlers:548
bool _fullscreen
Definition ViewerEventHandlers:551
virtual NodeCallback * asNodeCallback()
Definition ViewerEventHandlers:515
#define OSGVIEWER_EXPORT
Definition Export:40

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.