OpenSceneGraph 3.6.5
Callbacks
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 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 OSGUI_CALLBACKS
15#define OSGUI_CALLBACKS
16
17#include <osg/Callback>
18#include <osgGA/EventVisitor>
19
20#include <osgUI/Export>
21#include <osgUI/Widget>
22
23namespace osgUI
24{
25
26
28{
29public:
30 CloseCallback(const std::string& callbackName=std::string("close"), osgUI::Widget* closeWidget=0);
33
34 void setCloseWidget(osgUI::Widget* widget) { _closeWidget = widget; }
36 const osgUI::Widget* getCloseWidget() const { return _closeWidget.get(); }
37
38 virtual bool run(osg::Object* object, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const;
39
40protected:
41 virtual ~CloseCallback() {}
43};
44
46{
47public:
51
52 virtual bool run(osg::Object* object, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const;
53 virtual bool handle(osgGA::EventVisitor* ev, osgGA::Event* event) const;
54
55protected:
56 virtual ~HandleCallback() {}
57};
58
60{
61public:
65
66 void setDragging(bool v) { _dragging = v; }
67 bool getDragging() const { return _dragging; }
68
69 void setPreviousPosition(const osg::Vec3d& position) { _previousPosition = position; }
71
72 virtual bool handle(osgGA::EventVisitor* ev, osgGA::Event* event) const;
73
74protected:
75 virtual ~DragCallback() {}
76
79
80};
81
82}
83
84#endif
std::vector< osg::ref_ptr< osg::Object > > Parameters
Definition Callback:130
Definition AlignmentSettings:23
Callback for attaching a script to a Node's via there UserDataContainer for the purpose of overriding...
Definition Callback:134
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
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for observed objects, that automatically set pointers to them to null when they are del...
Definition observer_ptr:39
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
Base Event class.
Definition Event:27
Basic EventVisitor implementation for animating a scene.
Definition EventVisitor:42
const osgUI::Widget * getCloseWidget() const
Definition Callbacks:36
virtual bool run(osg::Object *object, osg::Parameters &inputParameters, osg::Parameters &outputParameters) const
osg::observer_ptr< osgUI::Widget > _closeWidget
Definition Callbacks:42
CloseCallback(const std::string &callbackName=std::string("close"), osgUI::Widget *closeWidget=0)
virtual ~CloseCallback()
Definition Callbacks:41
CloseCallback(const CloseCallback &hc, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgUI::Widget * getCloseWidget()
Definition Callbacks:35
META_Object(osgUI, CloseCallback)
void setCloseWidget(osgUI::Widget *widget)
Definition Callbacks:34
virtual bool run(osg::Object *object, osg::Parameters &inputParameters, osg::Parameters &outputParameters) const
virtual ~HandleCallback()
Definition Callbacks:56
HandleCallback(const HandleCallback &hc, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual bool handle(osgGA::EventVisitor *ev, osgGA::Event *event) const
META_Object(osgUI, HandleCallback)
osg::Vec3d _previousPosition
Definition Callbacks:78
bool getDragging() const
Definition Callbacks:67
void setDragging(bool v)
Definition Callbacks:66
virtual ~DragCallback()
Definition Callbacks:75
DragCallback(const DragCallback &dc, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
void setPreviousPosition(const osg::Vec3d &position)
Definition Callbacks:69
META_Object(osgUI, DragCallback)
virtual bool handle(osgGA::EventVisitor *ev, osgGA::Event *event) const
const osg::Vec3d & getPreviousPosition() const
Definition Callbacks:70
bool _dragging
Definition Callbacks:77
Definition Widget:29
#define OSGUI_EXPORT
Definition Export:40

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.