16#ifndef OSGWIDGET_WINDOW_MANAGER
17#define OSGWIDGET_WINDOW_MANAGER
146 return _python.get();
150 return _python.get();
154 return _styleManager.get();
158 return _styleManager.get();
162 return _lastVertical;
166 return _lastHorizontal;
174 return _lastVertical | _lastHorizontal;
178 return _lastVertical ==
PD_UP;
182 return _lastVertical ==
PD_DOWN;
186 return _lastHorizontal ==
PD_LEFT;
194 return _lastVertical !=
PD_NONE;
198 return _lastHorizontal !=
PD_NONE;
255 return _handleMousePushed(x, y, _leftDown);
259 return _handleMousePushed(x, y, _middleDown);
263 return _handleMousePushed(x, y, _rightDown);
267 return _handleMouseReleased(x, y, _leftDown);
271 return _handleMouseReleased(x, y, _middleDown);
275 return _handleMouseReleased(x, y, _rightDown);
288 struct WindowZCompare
290 bool operator()(
const ptr_type& x,
const ptr_type& y) {
291 return x.get()->getZ() > y.get()->getZ();
296 struct WindowBinNumberCompare
298 bool operator()(
const ptr_type& x,
const ptr_type& y) {
300 x.get()->getOrCreateStateSet()->getBinNumber() >
301 y.get()->getOrCreateStateSet()->getBinNumber()
311 unsigned int _nodeMask;
312 osgViewer::View* _view;
315 EventInterface* _lastEvent;
316 EventInterface* _lastPush;
317 PointerDirection _lastVertical;
318 PointerDirection _lastHorizontal;
319 PointerFocusMode _focusMode;
326 osg::ref_ptr<ScriptEngine> _lua;
327 osg::ref_ptr<ScriptEngine> _python;
328 osg::ref_ptr<StyleManager> _styleManager;
330 osg::observer_ptr<Widget> _widget;
331 osg::observer_ptr<Window> _focused;
332 osg::observer_ptr<Window> _pickWindow;
334 void childInserted (
unsigned int);
335 void childRemoved (
unsigned int,
unsigned int);
337 bool _handleMousePushed (
float,
float,
bool&);
338 bool _handleMouseReleased (
float,
float,
bool&);
339 bool _handleMouseScrolled (
float,
float,
bool =
false);
340 void _getPointerXYDiff (
float&,
float&);
341 void _updatePickWindow (
const WidgetList*, point_type, point_type);
349 if(!container.size())
return 0;
352 for(
typename T::iterator i = container.begin(); i != container.end(); i++) {
353 Widget* widget = i->get();
368 Window* parent = container.back()->getParent();
375 for(WindowList::iterator i = windowList.begin(); i != windowList.end(); i++) {
376 Window* window = i->get();
The osgWidget library is a NodeKit that extends the core scene graph to support a 2D (and eventually ...
Definition Box:21
Window::WindowList WindowList
Definition Window:658
Point::value_type point_type
Definition Types:33
osg::Vec2 XYCoord
Definition Types:36
std::list< osg::observer_ptr< Widget > > WidgetList
Definition Widget:513
osgUtil::LineSegmentIntersector::Intersections Intersections
Definition WindowManager:35
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
Switch is a Group node that allows switching between children.
Definition Switch:27
@ RIGHT_MOUSE_BUTTON
Definition GUIEventAdapter:88
@ MIDDLE_MOUSE_BUTTON
Definition GUIEventAdapter:87
@ LEFT_MOUSE_BUTTON
Definition GUIEventAdapter:86
ScrollingMotion
Definition GUIEventAdapter:360
@ SCROLL_DOWN
Definition GUIEventAdapter:365
@ SCROLL_UP
Definition GUIEventAdapter:364
std::multiset< Intersection > Intersections
Definition LineSegmentIntersector:74
View holds a single view on a scene, this view may be composed of one or more slave cameras.
Definition View:76
Definition EventInterface:61
Window * _window
Definition EventInterface:145
EventType type
Definition EventInterface:63
Widget * _widget
Definition EventInterface:146
Definition EventInterface:268
unsigned int getEventMask() const
Definition EventInterface:313
Definition ScriptEngine:27
Definition StyleManager:85
Definition UIObjectParent:26
object_type * getByName(const std::string &name)
Definition UIObjectParent:55
Window * getParent()
Definition Widget:297
void getParentList(WindowList &) const
XYCoord windowXY(double, double) const
bool pickAtXY(float, float, WidgetList &)
bool mouseReleasedMiddle(float x, float y)
Definition WindowManager:270
void setWindowSize(point_type w, point_type h)
Definition WindowManager:246
PointerFocusMode getPointerFocusMode() const
Definition WindowManager:169
bool isPointerMovingVertically() const
Definition WindowManager:193
ScriptEngine * getPythonEngine()
Definition WindowManager:145
PointerDirection getPointerVerticalDirection() const
Definition WindowManager:161
bool setFocused(Window *)
bool isPointerMovingLeft() const
Definition WindowManager:185
void resizeAllWindows(bool=true)
bool mousePushedLeft(float x, float y)
Definition WindowManager:254
const ScriptEngine * getPythonEngine() const
Definition WindowManager:149
PointerDirection
Definition WindowManager:48
@ PD_LEFT
Definition WindowManager:50
@ PD_RIGHT
Definition WindowManager:51
@ PD_DOWN
Definition WindowManager:53
@ PD_UP
Definition WindowManager:52
@ PD_NONE
Definition WindowManager:49
ScriptEngine * getLuaEngine()
Definition WindowManager:137
bool isMouseScrollingUp() const
Definition WindowManager:213
bool mousePushedRight(float x, float y)
Definition WindowManager:262
bool isUsingRenderBins() const
Definition WindowManager:123
static EventInterface * getFirstEventInterface(T &, Event &)
Definition WindowManager:348
osg::Camera * createParentOrthoCamera()
bool isRightMouseButtonDown() const
Definition WindowManager:209
osgViewer::View * getView()
Definition WindowManager:283
bool isMiddleMouseButtonDown() const
Definition WindowManager:205
WindowManager(osgViewer::View *=0, point_type=0.0f, point_type=0.0f, unsigned int=0, unsigned int=0)
const osgViewer::View * getView() const
Definition WindowManager:284
void setPointerXY(float, float)
bool pointerMove(float, float)
void setStyleManager(StyleManager *)
bool isLeftMouseButtonDown() const
Definition WindowManager:201
static void setEventFromInterface(Event &, EventInterface *)
void setWidth(point_type w)
Definition WindowManager:233
bool setFocusedByName(const std::string &name)
Definition WindowManager:221
PointerFocusMode
Definition WindowManager:56
@ PFM_UNFOCUS
Definition WindowManager:58
@ PFM_FOCUS
Definition WindowManager:57
@ PFM_SLOPPY
Definition WindowManager:59
XYCoord localXY(double, double) const
int getMouseKeysDown() const
Definition WindowManager:127
bool isUsingLua() const
Definition WindowManager:115
bool isUsingPython() const
Definition WindowManager:119
void setScrollingMotion(osgGA::GUIEventAdapter::ScrollingMotion sm)
Definition WindowManager:225
META_Object(osgWidget, WindowManager)
void setSize(point_type w, point_type h)
Definition WindowManager:241
bool isPointerMovingRight() const
Definition WindowManager:189
const StyleManager * getStyleManager() const
Definition WindowManager:157
bool isMouseScrollingDown() const
Definition WindowManager:217
bool pointerDrag(float, float)
int getPointerDirectionVector() const
Definition WindowManager:173
bool mouseReleasedLeft(float x, float y)
Definition WindowManager:266
bool mousePushedMiddle(float x, float y)
Definition WindowManager:258
StyleManager * getStyleManager()
Definition WindowManager:153
bool isPointerMovingDown() const
Definition WindowManager:181
bool mouseReleasedRight(float x, float y)
Definition WindowManager:274
WmFlags
Definition WindowManager:41
@ WM_USE_RENDERBINS
Definition WindowManager:44
@ WM_USE_LUA
Definition WindowManager:42
@ WM_PICK_DEBUG
Definition WindowManager:45
@ WM_USE_PYTHON
Definition WindowManager:43
void setHeight(point_type h)
Definition WindowManager:237
bool isPointerMovingUp() const
Definition WindowManager:177
const ScriptEngine * getLuaEngine() const
Definition WindowManager:141
void setPointerFocusMode(PointerFocusMode pfm)
Definition WindowManager:229
WindowManager(const WindowManager &, const osg::CopyOp &)
point_type getHeight() const
Definition WindowManager:111
bool mouseScroll(float, float)
unsigned int getNodeMask() const
Definition WindowManager:103
PointerDirection getPointerHorizontalDirection() const
Definition WindowManager:165
bool isPointerMovingHorizontally() const
Definition WindowManager:197
point_type getWidth() const
Definition WindowManager:107
#define OSGWIDGET_EXPORT
Definition Export:42