Window
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
// Code by: Jeremy Moles (cubicool) 2007-2008
#ifndef OSGWIDGET_WINDOW
#define OSGWIDGET_WINDOW
#include <osg/Scissor>
#include <osg/MatrixTransform>
#include <osg/Geode>
#include <osg/ClipNode>
#include <osgWidget/Types>
#include <osgWidget/Util>
#include <osgWidget/Widget>
namespace osgWidget {
// These are helper callbacks you can attach to Windows that will make them moveable,
// rotatable, and scalable respectively.
bool OSGWIDGET_EXPORT callbackWindowMove (Event&);
bool OSGWIDGET_EXPORT callbackWindowRotate (Event&);
bool OSGWIDGET_EXPORT callbackWindowScale (Event&);
// These are helper callbacks you can attach to Windows to that will make various
// keyboard events behave as you might imagine.
bool OSGWIDGET_EXPORT callbackWindowTabFocus(Event&);
class OSGWIDGET_EXPORT Window:
public osg::MatrixTransform,
public UIObjectParent<Widget>,
public EventInterface,
public StyleInterface
{
public:
typedef std::list<osg::observer_ptr<Window> > WindowList;
struct Sizes
{
point_type current;
point_type minimum;
Sizes(point_type c = -1.0f, point_type m = -1.0f):
current(c),
minimum(m) {}
};
// TODO: This is a class that puts (embeds) the Window inside of a Widget
// interface, to help assemble Windows with Windows, and what have you.
class OSGWIDGET_EXPORT EmbeddedWindow: public Widget {
osg::ref_ptr<Window> _window;
public:
META_Object (osgWidget::Window, EmbeddedWindow);
EmbeddedWindow (const std::string& = "", point_type = 0.0f, point_type = 0.0f);
EmbeddedWindow (const EmbeddedWindow&, const osg::CopyOp&);
virtual void parented (Window*);
virtual void unparented (Window*);
virtual void managed (WindowManager*);
virtual void unmanaged (WindowManager*);
virtual void positioned ();
bool setWindow (Window*);
void updateSizeFromWindow ();
Window* getWindow() {
return _window.get();
}
const Window* getWindow() const {
return _window.get();
}
};
// These correspond to special regions honored by the WindowManager. Most Windows
// will want to be NONE, unless they need to exist in the foreground or background
// for some reason.
enum Strata {
STRATA_NONE,
STRATA_BACKGROUND,
STRATA_FOREGROUND
};
// If you only want to display a portion of a Window (such as when it is embedded),
// you will need to set the VisibilityMode to WM_PARTIAL. Otherwise, the entire
// Window is visible by default. The final enum, VM_ENTIRE, says that no Scissoring
// should take place at all, and is useful in cases where you want to properly
// scale or rotate Windows.
enum VisibilityMode {
VM_FULL,
VM_PARTIAL,
VM_ENTIRE
};
// Anchors are very similar in that they allow us to pre-apply transformations in the
// call to Window::update() that allow us to position a Window somewhere relative
// to the WindowManger's viewable area. However, unlike the ALIGNMENT enums, these
// are totally optional (whereas a Widget must always have some ALIGNMENT value set.
enum VerticalAnchor {
VA_NONE,
VA_CENTER,
VA_TOP,
VA_BOTTOM
};
enum HorizontalAnchor {
HA_NONE,
HA_CENTER,
HA_LEFT,
HA_RIGHT
};
Window (const std::string& = "");
Window (const Window&, const osg::CopyOp&);
bool resize (point_type = 0.0f, point_type = 0.0f);
bool resizeAdd (point_type = 0.0f, point_type = 0.0f);
bool resizePercent (point_type = 0.0f, point_type = 0.0f);
virtual void update ();
virtual void managed (WindowManager*);
virtual void unmanaged (WindowManager*);
virtual bool addWidget (Widget*);
virtual bool insertWidget (Widget*, unsigned int);
virtual bool removeWidget (Widget*);
virtual bool replaceWidget (Widget*, Widget*);
// This method wraps our Geode's addDrawable() method and returns the index of
// the newly-added Drawable.
unsigned int addDrawableAndGetIndex (osg::Drawable*);
unsigned int addChildAndGetIndex (osg::Node*);
bool isVisible () const;
bool isXYWithinVisible (float, float) const;
void setVisibleArea (int = 0, int = 0, int = 0, int = 0);
void addVisibleArea (int = 0, int = 0, int = 0, int = 0);
bool setFocused (const Widget*);
bool setFocused (const std::string&);
bool grabFocus ();
bool setFirstFocusable ();
bool setNextFocusable ();
bool getFocusList (WidgetList&) const;
bool getEmbeddedList (WindowList&) const;
void getParentList (WindowList&) const;
XYCoord localXY (double, double) const;
XYCoord getAbsoluteOrigin () const;
// This method wraps the current Window in a EmbeddedWindow object and returns it.
EmbeddedWindow* embed(
const std::string& = "",
Widget::Layer = Widget::LAYER_MIDDLE,
unsigned int = 0
);
Widget* getFocused() {
return _focused.get();
}
const Widget* getFocused() const {
return _focused.get();
}
bool show() {
return _setVisible(true);
}
bool hide() {
return _setVisible(false);
}
bool isPointerXYWithinVisible(float x, float y) const {
XYCoord xy = localXY(x, y);
return isXYWithinVisible(xy.x(), xy.y());
}
osg::Geode* getGeode() {
return _geode();
}
const osg::Geode* getGeode() const {
return _geode();
}
Widget* getBackground() {
return _bg();
}
const Widget* getBackground() const {
return _bg();
}
WindowManager* getWindowManager() {
return _wm;
}
const WindowManager* getWindowManager() const {
return _wm;
}
Window* getParent() {
return _parent;
}
const Window* getParent() const {
return _parent;
}
Window* getTopmostParent() {
return _getTopmostParent();
}
const Window* getTopmostParent() const {
return _getTopmostParent();
}
unsigned int getIndex() const {
return _index;
}
matrix_type getX() const {
return _x;
}
matrix_type getY() const {
return _y;
}
matrix_type getZ() const {
return _z;
}
point_type getWidth() const {
return _width.current;
}
point_type getHeight() const {
return _height.current;
}
point_type getMinWidth() const {
return _width.minimum;
}
point_type getMinHeight() const {
return _height.minimum;
}
VerticalAnchor getAnchorVertical() const {
return _vAnchor;
}
HorizontalAnchor getAnchorHorizontal() const {
return _hAnchor;
}
XYCoord getOrigin() const {
return XYCoord(_x, _y);
}
XYCoord getSize() const {
return XYCoord(_width.current, _height.current);
}
XYCoord getMinSize() const {
return XYCoord(_width.minimum, _height.minimum);
}
matrix_type getZRange() const {
return _zRange;
}
Strata getStrata() const {
return _strata;
}
const Quad& getVisibleArea() const {
return _visibleArea;
}
VisibilityMode getVisibilityMode() const {
return _vis;
}
Point getPosition() const {
return Point(_x, _y, _z);
}
matrix_type getRotate() const {
return _r;
}
matrix_type getScale() const {
return _s;
}
matrix_type getScaleDenominator() const {
return _scaleDenom;
}
void setX(matrix_type x) {
_x = x;
}
void setY(matrix_type y) {
_y = y;
}
void setZ(matrix_type z) {
_z = z;
}
void setZRange(matrix_type zRange) {
_zRange = zRange;
}
void setPosition(matrix_type x, matrix_type y, matrix_type z) {
_x = x;
_y = y;
_z = z;
}
void setPosition(const Point& p) {
setPosition(p.x(), p.y(), p.z());
}
void setOrigin(matrix_type x, matrix_type y) {
_x = x;
_y = y;
}
void setOrigin(const XYCoord& xy) {
setOrigin(xy.x(), xy.y());
}
void setRotate(matrix_type r) {
_r = r;
}
void setScale(matrix_type s) {
_s = s;
}
void setScaleDenominator(matrix_type sd) {
_scaleDenom = sd;
}
void setAnchorVertical(VerticalAnchor va) {
_vAnchor = va;
}
void setAnchorHorizontal(HorizontalAnchor ha) {
_hAnchor = ha;
}
void setStrata(Strata s) {
_strata = s;
}
void setVisibilityMode(VisibilityMode v) {
_vis = v;
}
void addX(matrix_type x) {
_x += x;
}
void addY(matrix_type y) {
_y += y;
}
void addZ(matrix_type z) {
_z += z;
}
void addRotate(matrix_type r) {
_r += r;
}
void addScale(matrix_type s) {
_s += s / (_scaleDenom != 0.0f ? _scaleDenom : 1.0f);
}
void addOrigin(matrix_type x, matrix_type y) {
_x += x;
_y += y;
}
void attachMoveCallback() {
addCallback(new Callback(&callbackWindowMove, EVENT_MOUSE_DRAG));
}
void attachRotateCallback() {
addCallback(new Callback(&callbackWindowRotate, EVENT_MOUSE_DRAG));
}
void attachScaleCallback() {
addCallback(new Callback(&callbackWindowScale, EVENT_MOUSE_DRAG));
}
void attachTabFocusCallback() {
addCallback(new Callback(&callbackWindowTabFocus, EVENT_KEY_DOWN));
}
typedef point_type (Widget::*Getter)() const;
protected:
typedef std::less<point_type> Less;
typedef std::greater<point_type> Greater;
typedef std::plus<point_type> Plus;
friend class WindowManager;
// The (optional) Window that this Window is parented inside.
Window* _parent;
// The WindowManger to which this window is attached.
WindowManager* _wm;
// The positional index this Node holds within it's parent WindowManager.
unsigned int _index;
// The X and Y values of the Window (origin).
matrix_type _x;
matrix_type _y;
// A pair of values representing the currently calculated Z value and the
// depth range for all children to be used during the call to update().
matrix_type _z;
matrix_type _zRange;
// This is a special value that can be used to "force" a Window not to be
// focusable and instead always exist in the foreground or background.
Strata _strata;
// A flag determining whether our visible area is the full Window or rather
// a portion of the Window.
VisibilityMode _vis;
// A rotation value in degrees.
matrix_type _r;
// This will also need to adjust geom internally so that picking is correct.
matrix_type _s;
matrix_type _scaleDenom;
Sizes _width;
Sizes _height;
VerticalAnchor _vAnchor;
HorizontalAnchor _hAnchor;
// Not all windows have widgets that can focus, but if they do this should
// be a pointer to it.
osg::observer_ptr<Widget> _focused;
// The "visible" area that will define both the glScissor bounds AND will
// be used to make sure our pick is valid. The values herein correspond to
// X, Y, W, and H--in that order.
Quad _visibleArea;
// This helper method is used by _compare<>() and _accumulate<>(), so ignore this
// function and go see the docs for those instead. This thing is huge and unwieldy
// and not to be triffled with! :)
template<typename T>
point_type _forEachAssignOrApply(
Getter get,
int begin,
int end,
int add,
bool assign
) const {
point_type val = 0.0f;
unsigned int c = begin;
ConstIterator e = end > 0 ? _objects.begin() + end : _objects.end() + end;
// I WARNED YOU! If you try and understand what this does your head will
// explode! But let me say a few things: in MSVC you can't add to an iterator
// such that the add will cause it to increment past the end of the container.
// This appears to be safe in GCC, where it will just return the last
// item therein, but causes an assertion error in other compilers. I'm not
// sure if there is a cleaner remedy for this, so what we do for now is keep a
// count variable called "c" that makes sure our iterator's opterator+()
// method is safe to call.
for(
ConstIterator i = _objects.begin() + begin;
i < e;
c += add
) {
point_type v = 0.0f;
if(i->valid()) v = (i->get()->*get)();
// If you want to assign to val, and NOT add a sequence of them...
if(assign) {
if(T()(v, val)) val = v;
}
// If you want to accumulate a value INTO val...
else val = T()(v, val);
// Make sure our iterator is safe to increment. Otherwise, set it to
// whatever end is.
// TODO: This isn't 100% accurate, as it does not YET take into account
// our requested end in any way other than implicitly. It should, however,
// work okay for now.
if((c + add) < _objects.size()) i += add;
else i = e;
}
return val;
}
void _setWidthAndHeightUnknownSizeError (const std::string&, point_type);
void _setWidthAndHeightNotPAError (const std::string&, point_type);
void _setWidthAndHeight ();
void _removeFromGeode (Widget*);
Widget* _getBackground() const;
Window* _getTopmostParent() const;
// This method will return the T'th value returned by applying the Getter member function
// pointer to each iterator in the range of iterators defined by offset and add. In
// plain language, this helper method will apply some standard Widget::get* function
// to a range of objects in the _objects Vector, and will return the T'th of that.
// The template T can be any functor accepting two point_type values that return
// a bool. For example, this is commonly used with std::less to find the smallest
// width in a range of Widgets.
template<typename T>
point_type _compare(
Getter get,
int begin = 0,
int end = 0,
int add = 1
) const {
return _forEachAssignOrApply<T>(get, begin, end, add, true);
}
// This method will return the T'th value accumulated by applying the Getter member
// function to each iterator in the range of iterators defined by offset and add (similar
// to above). For example, this method can be used to apply std::plus to every
// width in a range of Widgets, and return the total.
template<typename T>
point_type _accumulate(
Getter get,
int begin = 0,
int end = 0,
int add = 1
) const {
return _forEachAssignOrApply<T>(get, begin, end, add, false);
}
osg::Geode* _geode() {
return dynamic_cast<osg::Geode*>(getChild(0));
}
const osg::Geode* _geode() const {
return dynamic_cast<const osg::Geode*>(getChild(0));
}
Widget* _bg() {
return _getBackground();
}
const Widget* _bg() const {
return _getBackground();
}
osg::Scissor* _scissor() {
return dynamic_cast<osg::Scissor*>(
getStateSet()->getAttribute(osg::StateAttribute::SCISSOR)
);
}
bool _setWidget (Widget*, int = -1);
bool _setVisible (bool);
void _setFocused (Widget*);
void _setStyled (Widget*);
void _setParented (Widget*, bool=false);
void _setManaged (Widget*, bool=false);
void _positionWidget(Widget*, point_type, point_type);
// These return the smallest and largest width and height values for the given
// range of Widgets.
point_type _getMinWidgetWidth (int = 0, int = 0, int = 1) const;
point_type _getMinWidgetHeight (int = 0, int = 0, int = 1) const;
point_type _getMaxWidgetWidth (int = 0, int = 0, int = 1) const;
point_type _getMaxWidgetHeight (int = 0, int = 0, int = 1) const;
// These return the smallest and largest minWidth and minHeight values for
// the given range of Widgets.
point_type _getMinWidgetMinWidth (int = 0, int = 0, int = 1) const;
point_type _getMinWidgetMinHeight (int = 0, int = 0, int = 1) const;
point_type _getMaxWidgetMinWidth (int = 0, int = 0, int = 1) const;
point_type _getMaxWidgetMinHeight (int = 0, int = 0, int = 1) const;
// These return the smallest and largest width and height total (width + pad)
// values for the given range of Widgets.
point_type _getMinWidgetWidthTotal (int = 0, int = 0, int = 1) const;
point_type _getMinWidgetHeightTotal (int = 0, int = 0, int = 1) const;
point_type _getMaxWidgetWidthTotal (int = 0, int = 0, int = 1) const;
point_type _getMaxWidgetHeightTotal (int = 0, int = 0, int = 1) const;
// These return the smallest and largest minWidth and minHeight total
// (width + pad) values for the given range of Widgets.
point_type _getMinWidgetMinWidthTotal (int = 0, int = 0, int = 1) const;
point_type _getMinWidgetMinHeightTotal (int = 0, int = 0, int = 1) const;
point_type _getMaxWidgetMinWidthTotal (int = 0, int = 0, int = 1) const;
point_type _getMaxWidgetMinHeightTotal (int = 0, int = 0, int = 1) const;
// These return the smallest and largest horizontal and vertical padding
// values for the given range of Widgets.
point_type _getMinWidgetPadHorizontal (int = 0, int = 0, int = 1) const;
point_type _getMinWidgetPadVertical (int = 0, int = 0, int = 1) const;
point_type _getMaxWidgetPadHorizontal (int = 0, int = 0, int = 1) const;
point_type _getMaxWidgetPadVertical (int = 0, int = 0, int = 1) const;
point_type _getNumFill(int = 0, int = 0, int = 1) const;
// This method is passed the additional values by which width and height should be
// modified as calculed by the parent method, Window::resize. Keep in mind that these
// values can be negative (indicating a potential "shrink" request) or positive (which
// would indicate a "grow" request).
virtual void _resizeImplementation(point_type, point_type) = 0;
// These are made into implementation functions since getting the width or height
// of a window can potentially be an expensive operation, and we'll want to cache
// results if possible (which is handled transparently by the actual Window::resize
// method). They return a Sizes struct which contains two members: cur (for current)
// and min (minimum). It's important that the Window know it's minimum possible
// size so that it can ignore invalid requests to resize.
//
// Default versions using BoundingBox calculations are provided, but some Windows
// override this (Table, Box).
virtual Sizes _getWidthImplementation () const;
virtual Sizes _getHeightImplementation () const;
};
typedef Window::WindowList WindowList;
}
#endif
ClipNode
Geode
MatrixTransform
Scissor
Util
osgWidget::Callback
Definition EventInterface:207
osgWidget::EventInterface::addCallback
void addCallback(Callback *cb)
Definition EventInterface:322
osgWidget::EventInterface::EventInterface
EventInterface()
Definition EventInterface:270
osgWidget::Event
Definition EventInterface:61
osgWidget::StyleInterface::StyleInterface
StyleInterface()
Definition StyleInterface:26
osgWidget::UIObjectParent
Definition UIObjectParent:26
osgWidget::UIObjectParent< Widget >::end
Iterator end()
Definition UIObjectParent:43
osgWidget::UIObjectParent< Widget >::_objects
Vector _objects
Definition UIObjectParent:105
osgWidget::UIObjectParent< Widget >::ConstIterator
Vector::const_iterator ConstIterator
Definition UIObjectParent:33
osgWidget::UIObjectParent< Widget >::begin
Iterator begin()
Definition UIObjectParent:35
osgWidget::Widget
Definition osgWidget/Widget:35
osgWidget::Widget::Window
friend class Window
Definition osgWidget/Widget:459
osgWidget::Widget::Widget
Widget(const std::string &="", point_type=0.0f, point_type=0.0f)
osgWidget::Widget::Layer
Layer
Definition osgWidget/Widget:49
osgWidget::Widget::LAYER_MIDDLE
@ LAYER_MIDDLE
Definition osgWidget/Widget:52
osgWidget::Window::EmbeddedWindow
Definition Window:60
osgWidget::Window::EmbeddedWindow::setWindow
bool setWindow(Window *)
osgWidget::Window::EmbeddedWindow::getWindow
Window * getWindow()
Definition Window:78
osgWidget::Window::EmbeddedWindow::parented
virtual void parented(Window *)
osgWidget::Window::EmbeddedWindow::updateSizeFromWindow
void updateSizeFromWindow()
osgWidget::Window::EmbeddedWindow::unparented
virtual void unparented(Window *)
osgWidget::Window::EmbeddedWindow::EmbeddedWindow
EmbeddedWindow(const EmbeddedWindow &, const osg::CopyOp &)
osgWidget::Window::EmbeddedWindow::EmbeddedWindow
EmbeddedWindow(const std::string &="", point_type=0.0f, point_type=0.0f)
osgWidget::Window::EmbeddedWindow::unmanaged
virtual void unmanaged(WindowManager *)
osgWidget::Window::EmbeddedWindow::managed
virtual void managed(WindowManager *)
osgWidget::Window::EmbeddedWindow::getWindow
const Window * getWindow() const
Definition Window:82
osgWidget::Window::EmbeddedWindow::META_Object
META_Object(osgWidget::Window, EmbeddedWindow)
osgWidget::Window::EmbeddedWindow::positioned
virtual void positioned()
osgWidget::Window
Definition Window:44
osgWidget::Window::embed
EmbeddedWindow * embed(const std::string &="", Widget::Layer=Widget::LAYER_MIDDLE, unsigned int=0)
osgWidget::Window::_getHeightImplementation
virtual Sizes _getHeightImplementation() const
osgWidget::Window::setScale
void setScale(matrix_type s)
Definition Window:353
osgWidget::Window::_getMinWidgetWidthTotal
point_type _getMinWidgetWidthTotal(int=0, int=0, int=1) const
osgWidget::Window::getMinHeight
point_type getMinHeight() const
Definition Window:258
osgWidget::Window::addRotate
void addRotate(matrix_type r)
Definition Window:389
osgWidget::Window::_getTopmostParent
Window * _getTopmostParent() const
osgWidget::Window::_hAnchor
HorizontalAnchor _hAnchor
Definition Window:466
osgWidget::Window::_getMinWidgetHeight
point_type _getMinWidgetHeight(int=0, int=0, int=1) const
osgWidget::Window::_x
matrix_type _x
Definition Window:438
osgWidget::Window::isVisible
bool isVisible() const
osgWidget::Window::_y
matrix_type _y
Definition Window:439
osgWidget::Window::update
virtual void update()
osgWidget::Window::_getMinWidgetWidth
point_type _getMinWidgetWidth(int=0, int=0, int=1) const
osgWidget::Window::_getMinWidgetMinWidth
point_type _getMinWidgetMinWidth(int=0, int=0, int=1) const
osgWidget::Window::addX
void addX(matrix_type x)
Definition Window:377
osgWidget::Window::_getMaxWidgetPadHorizontal
point_type _getMaxWidgetPadHorizontal(int=0, int=0, int=1) const
osgWidget::Window::setFirstFocusable
bool setFirstFocusable()
osgWidget::Window::show
bool show()
Definition Window:176
osgWidget::Window::_forEachAssignOrApply
point_type _forEachAssignOrApply(Getter get, int begin, int end, int add, bool assign) const
Definition Window:481
osgWidget::Window::_z
matrix_type _z
Definition Window:443
osgWidget::Window::insertWidget
virtual bool insertWidget(Widget *, unsigned int)
osgWidget::Window::getAnchorVertical
VerticalAnchor getAnchorVertical() const
Definition Window:262
osgWidget::Window::attachMoveCallback
void attachMoveCallback()
Definition Window:402
osgWidget::Window::_width
Sizes _width
Definition Window:462
osgWidget::Window::getParent
const Window * getParent() const
Definition Window:218
osgWidget::Window::getTopmostParent
const Window * getTopmostParent() const
Definition Window:226
osgWidget::Window::isPointerXYWithinVisible
bool isPointerXYWithinVisible(float x, float y) const
Definition Window:184
osgWidget::Window::getBackground
const Widget * getBackground() const
Definition Window:202
osgWidget::Window::_getMaxWidgetWidth
point_type _getMaxWidgetWidth(int=0, int=0, int=1) const
osgWidget::Window::_getMaxWidgetPadVertical
point_type _getMaxWidgetPadVertical(int=0, int=0, int=1) const
osgWidget::Window::resizeAdd
bool resizeAdd(point_type=0.0f, point_type=0.0f)
osgWidget::Window::_setWidthAndHeightUnknownSizeError
void _setWidthAndHeightUnknownSizeError(const std::string &, point_type)
osgWidget::Window::_focused
osg::observer_ptr< Widget > _focused
Definition Window:470
osgWidget::Window::getEmbeddedList
bool getEmbeddedList(WindowList &) const
osgWidget::Window::_getMaxWidgetHeight
point_type _getMaxWidgetHeight(int=0, int=0, int=1) const
osgWidget::Window::WindowList
std::list< osg::observer_ptr< Window > > WindowList
Definition Window:46
osgWidget::Window::setOrigin
void setOrigin(const XYCoord &xy)
Definition Window:345
osgWidget::Window::resizePercent
bool resizePercent(point_type=0.0f, point_type=0.0f)
osgWidget::Window::setPosition
void setPosition(const Point &p)
Definition Window:336
osgWidget::Window::getFocusList
bool getFocusList(WidgetList &) const
osgWidget::Window::addOrigin
void addOrigin(matrix_type x, matrix_type y)
Definition Window:397
osgWidget::Window::_getMaxWidgetMinHeight
point_type _getMaxWidgetMinHeight(int=0, int=0, int=1) const
osgWidget::Window::_strata
Strata _strata
Definition Window:448
osgWidget::Window::addVisibleArea
void addVisibleArea(int=0, int=0, int=0, int=0)
osgWidget::Window::HorizontalAnchor
HorizontalAnchor
Definition Window:118
osgWidget::Window::HA_LEFT
@ HA_LEFT
Definition Window:121
osgWidget::Window::HA_CENTER
@ HA_CENTER
Definition Window:120
osgWidget::Window::HA_NONE
@ HA_NONE
Definition Window:119
osgWidget::Window::HA_RIGHT
@ HA_RIGHT
Definition Window:122
osgWidget::Window::setZRange
void setZRange(matrix_type zRange)
Definition Window:326
osgWidget::Window::_bg
const Widget * _bg() const
Definition Window:582
osgWidget::Window::removeWidget
virtual bool removeWidget(Widget *)
osgWidget::Window::getGeode
const osg::Geode * getGeode() const
Definition Window:194
osgWidget::Window::_positionWidget
void _positionWidget(Widget *, point_type, point_type)
osgWidget::Window::Greater
std::greater< point_type > Greater
Definition Window:423
osgWidget::Window::attachTabFocusCallback
void attachTabFocusCallback()
Definition Window:414
osgWidget::Window::replaceWidget
virtual bool replaceWidget(Widget *, Widget *)
osgWidget::Window::_parent
Window * _parent
Definition Window:429
osgWidget::Window::_getMinWidgetPadVertical
point_type _getMinWidgetPadVertical(int=0, int=0, int=1) const
osgWidget::Window::_getMinWidgetMinHeightTotal
point_type _getMinWidgetMinHeightTotal(int=0, int=0, int=1) const
osgWidget::Window::_setWidget
bool _setWidget(Widget *, int=-1)
osgWidget::Window::hide
bool hide()
Definition Window:180
osgWidget::Window::addWidget
virtual bool addWidget(Widget *)
osgWidget::Window::_bg
Widget * _bg()
Definition Window:578
osgWidget::Window::_zRange
matrix_type _zRange
Definition Window:444
osgWidget::Window::getParent
Window * getParent()
Definition Window:214
osgWidget::Window::setScaleDenominator
void setScaleDenominator(matrix_type sd)
Definition Window:357
osgWidget::Window::getWindowManager
WindowManager * getWindowManager()
Definition Window:206
osgWidget::Window::getPosition
Point getPosition() const
Definition Window:298
osgWidget::Window::_index
unsigned int _index
Definition Window:435
osgWidget::Window::_getWidthImplementation
virtual Sizes _getWidthImplementation() const
osgWidget::Window::setFocused
bool setFocused(const std::string &)
osgWidget::Window::_getBackground
Widget * _getBackground() const
osgWidget::Window::_vis
VisibilityMode _vis
Definition Window:452
osgWidget::Window::getVisibilityMode
VisibilityMode getVisibilityMode() const
Definition Window:294
osgWidget::Window::getFocused
Widget * getFocused()
Definition Window:168
osgWidget::Window::_getMinWidgetMinHeight
point_type _getMinWidgetMinHeight(int=0, int=0, int=1) const
osgWidget::Window::_setFocused
void _setFocused(Widget *)
osgWidget::Window::_getNumFill
point_type _getNumFill(int=0, int=0, int=1) const
osgWidget::Window::addScale
void addScale(matrix_type s)
Definition Window:393
osgWidget::Window::getIndex
unsigned int getIndex() const
Definition Window:230
osgWidget::Window::addZ
void addZ(matrix_type z)
Definition Window:385
osgWidget::Window::_setParented
void _setParented(Widget *, bool=false)
osgWidget::Window::getMinWidth
point_type getMinWidth() const
Definition Window:254
osgWidget::Window::Window
Window(const Window &, const osg::CopyOp &)
osgWidget::Window::_scissor
osg::Scissor * _scissor()
Definition Window:586
osgWidget::Window::WindowManager
friend class WindowManager
Definition Window:426
osgWidget::Window::getTopmostParent
Window * getTopmostParent()
Definition Window:222
osgWidget::Window::getScaleDenominator
matrix_type getScaleDenominator() const
Definition Window:310
osgWidget::Window::_setVisible
bool _setVisible(bool)
osgWidget::Window::setAnchorVertical
void setAnchorVertical(VerticalAnchor va)
Definition Window:361
osgWidget::Window::setY
void setY(matrix_type y)
Definition Window:318
osgWidget::Window::isXYWithinVisible
bool isXYWithinVisible(float, float) const
osgWidget::Window::getOrigin
XYCoord getOrigin() const
Definition Window:270
osgWidget::Window::_compare
point_type _compare(Getter get, int begin=0, int end=0, int add=1) const
Definition Window:547
osgWidget::Window::_geode
const osg::Geode * _geode() const
Definition Window:574
osgWidget::Window::getY
matrix_type getY() const
Definition Window:238
osgWidget::Window::setX
void setX(matrix_type x)
Definition Window:314
osgWidget::Window::getAbsoluteOrigin
XYCoord getAbsoluteOrigin() const
osgWidget::Window::getSize
XYCoord getSize() const
Definition Window:274
osgWidget::Window::_wm
WindowManager * _wm
Definition Window:432
osgWidget::Window::getAnchorHorizontal
HorizontalAnchor getAnchorHorizontal() const
Definition Window:266
osgWidget::Window::setAnchorHorizontal
void setAnchorHorizontal(HorizontalAnchor ha)
Definition Window:365
osgWidget::Window::addChildAndGetIndex
unsigned int addChildAndGetIndex(osg::Node *)
osgWidget::Window::getZRange
matrix_type getZRange() const
Definition Window:282
osgWidget::Window::_getMaxWidgetMinHeightTotal
point_type _getMaxWidgetMinHeightTotal(int=0, int=0, int=1) const
osgWidget::Window::Getter
point_type(Widget::* Getter)() const
Definition Window:418
osgWidget::Window::attachRotateCallback
void attachRotateCallback()
Definition Window:406
osgWidget::Window::getHeight
point_type getHeight() const
Definition Window:250
osgWidget::Window::localXY
XYCoord localXY(double, double) const
osgWidget::Window::_getMinWidgetPadHorizontal
point_type _getMinWidgetPadHorizontal(int=0, int=0, int=1) const
osgWidget::Window::resize
bool resize(point_type=0.0f, point_type=0.0f)
osgWidget::Window::_geode
osg::Geode * _geode()
Definition Window:570
osgWidget::Window::VerticalAnchor
VerticalAnchor
Definition Window:111
osgWidget::Window::VA_NONE
@ VA_NONE
Definition Window:112
osgWidget::Window::VA_CENTER
@ VA_CENTER
Definition Window:113
osgWidget::Window::VA_BOTTOM
@ VA_BOTTOM
Definition Window:115
osgWidget::Window::VA_TOP
@ VA_TOP
Definition Window:114
osgWidget::Window::setOrigin
void setOrigin(matrix_type x, matrix_type y)
Definition Window:340
osgWidget::Window::Window
Window(const std::string &="")
osgWidget::Window::_vAnchor
VerticalAnchor _vAnchor
Definition Window:465
osgWidget::Window::attachScaleCallback
void attachScaleCallback()
Definition Window:410
osgWidget::Window::_setWidthAndHeightNotPAError
void _setWidthAndHeightNotPAError(const std::string &, point_type)
osgWidget::Window::getVisibleArea
const Quad & getVisibleArea() const
Definition Window:290
osgWidget::Window::getRotate
matrix_type getRotate() const
Definition Window:302
osgWidget::Window::_setWidthAndHeight
void _setWidthAndHeight()
osgWidget::Window::managed
virtual void managed(WindowManager *)
osgWidget::Window::_getMaxWidgetHeightTotal
point_type _getMaxWidgetHeightTotal(int=0, int=0, int=1) const
osgWidget::Window::_s
matrix_type _s
Definition Window:458
osgWidget::Window::_setManaged
void _setManaged(Widget *, bool=false)
osgWidget::Window::addDrawableAndGetIndex
unsigned int addDrawableAndGetIndex(osg::Drawable *)
osgWidget::Window::_getMaxWidgetMinWidthTotal
point_type _getMaxWidgetMinWidthTotal(int=0, int=0, int=1) const
osgWidget::Window::_getMaxWidgetWidthTotal
point_type _getMaxWidgetWidthTotal(int=0, int=0, int=1) const
osgWidget::Window::getWindowManager
const WindowManager * getWindowManager() const
Definition Window:210
osgWidget::Window::Less
std::less< point_type > Less
Definition Window:422
osgWidget::Window::_setStyled
void _setStyled(Widget *)
osgWidget::Window::_getMaxWidgetMinWidth
point_type _getMaxWidgetMinWidth(int=0, int=0, int=1) const
osgWidget::Window::setRotate
void setRotate(matrix_type r)
Definition Window:349
osgWidget::Window::getZ
matrix_type getZ() const
Definition Window:242
osgWidget::Window::addY
void addY(matrix_type y)
Definition Window:381
osgWidget::Window::_getMinWidgetHeightTotal
point_type _getMinWidgetHeightTotal(int=0, int=0, int=1) const
osgWidget::Window::getStrata
Strata getStrata() const
Definition Window:286
osgWidget::Window::_visibleArea
Quad _visibleArea
Definition Window:475
osgWidget::Window::setStrata
void setStrata(Strata s)
Definition Window:369
osgWidget::Window::setNextFocusable
bool setNextFocusable()
osgWidget::Window::_scaleDenom
matrix_type _scaleDenom
Definition Window:460
osgWidget::Window::getScale
matrix_type getScale() const
Definition Window:306
osgWidget::Window::getFocused
const Widget * getFocused() const
Definition Window:172
osgWidget::Window::getBackground
Widget * getBackground()
Definition Window:198
osgWidget::Window::setVisibleArea
void setVisibleArea(int=0, int=0, int=0, int=0)
osgWidget::Window::setZ
void setZ(matrix_type z)
Definition Window:322
osgWidget::Window::_height
Sizes _height
Definition Window:463
osgWidget::Window::getMinSize
XYCoord getMinSize() const
Definition Window:278
osgWidget::Window::_resizeImplementation
virtual void _resizeImplementation(point_type, point_type)=0
osgWidget::Window::getParentList
void getParentList(WindowList &) const
osgWidget::Window::grabFocus
bool grabFocus()
osgWidget::Window::setFocused
bool setFocused(const Widget *)
osgWidget::Window::Plus
std::plus< point_type > Plus
Definition Window:424
osgWidget::Window::setPosition
void setPosition(matrix_type x, matrix_type y, matrix_type z)
Definition Window:330
osgWidget::Window::Strata
Strata
Definition Window:90
osgWidget::Window::STRATA_NONE
@ STRATA_NONE
Definition Window:91
osgWidget::Window::STRATA_BACKGROUND
@ STRATA_BACKGROUND
Definition Window:92
osgWidget::Window::STRATA_FOREGROUND
@ STRATA_FOREGROUND
Definition Window:93
osgWidget::Window::unmanaged
virtual void unmanaged(WindowManager *)
osgWidget::Window::_getMinWidgetMinWidthTotal
point_type _getMinWidgetMinWidthTotal(int=0, int=0, int=1) const
osgWidget::Window::setVisibilityMode
void setVisibilityMode(VisibilityMode v)
Definition Window:373
osgWidget::Window::_accumulate
point_type _accumulate(Getter get, int begin=0, int end=0, int add=1) const
Definition Window:561
osgWidget::Window::getX
matrix_type getX() const
Definition Window:234
osgWidget::Window::getGeode
osg::Geode * getGeode()
Definition Window:190
osgWidget::Window::_removeFromGeode
void _removeFromGeode(Widget *)
osgWidget::Window::_r
matrix_type _r
Definition Window:455
osgWidget::Window::getWidth
point_type getWidth() const
Definition Window:246
osgWidget::Window::VisibilityMode
VisibilityMode
Definition Window:101
osgWidget::Window::VM_ENTIRE
@ VM_ENTIRE
Definition Window:104
osgWidget::Window::VM_PARTIAL
@ VM_PARTIAL
Definition Window:103
osgWidget::Window::VM_FULL
@ VM_FULL
Definition Window:102
osg::CopyOp
Definition CopyOp:41
osg::Drawable
Definition Drawable:89
osg::Geode
Definition Geode:29
osg::Group::getChild
Node * getChild(unsigned int i)
Definition Group:117
osg::MatrixTransform
Definition MatrixTransform:26
osg::Node
Definition Node:72
osg::Node::getStateSet
osg::StateSet * getStateSet()
Definition Node:382
osg::Scissor
Definition Scissor:23
osg::StateAttribute::SCISSOR
@ SCISSOR
Definition StateAttribute:156
osg::Vec2f::x
value_type & x()
Definition Vec2f:67
osg::Vec2f::y
value_type & y()
Definition Vec2f:68
osg::observer_ptr
Definition observer_ptr:39
osg::ref_ptr
Definition ref_ptr:32
osgWidget
Definition Box:21
osgWidget::callbackWindowTabFocus
bool OSGWIDGET_EXPORT callbackWindowTabFocus(Event &)
osgWidget::Quad
osg::Vec4 Quad
Definition osgWidget/Types:37
osgWidget::WindowList
Window::WindowList WindowList
Definition Window:658
osgWidget::point_type
Point::value_type point_type
Definition osgWidget/Types:33
osgWidget::XYCoord
osg::Vec2 XYCoord
Definition osgWidget/Types:36
osgWidget::callbackWindowRotate
bool OSGWIDGET_EXPORT callbackWindowRotate(Event &)
osgWidget::Point
PointArray::value_type Point
Definition osgWidget/Types:29
osgWidget::callbackWindowScale
bool OSGWIDGET_EXPORT callbackWindowScale(Event &)
osgWidget::EVENT_MOUSE_DRAG
@ EVENT_MOUSE_DRAG
Definition EventInterface:40
osgWidget::EVENT_KEY_DOWN
@ EVENT_KEY_DOWN
Definition EventInterface:44
osgWidget::WidgetList
std::list< osg::observer_ptr< Widget > > WidgetList
Definition osgWidget/Widget:513
osgWidget::matrix_type
osg::Matrix::value_type matrix_type
Definition osgWidget/Types:39
osgWidget::callbackWindowMove
bool OSGWIDGET_EXPORT callbackWindowMove(Event &)
OSGWIDGET_EXPORT
#define OSGWIDGET_EXPORT
Definition osgWidget/Export:42
Types
Widget
osgWidget::Window::Sizes
Definition Window:49
osgWidget::Window::Sizes::minimum
point_type minimum
Definition Window:51
osgWidget::Window::Sizes::current
point_type current
Definition Window:50
osgWidget::Window::Sizes::Sizes
Sizes(point_type c=-1.0f, point_type m=-1.0f)
Definition Window:53