osgWidget/Widget
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_WIDGET
#define OSGWIDGET_WIDGET
#include <osg/Texture2D>
#include <osgWidget/EventInterface>
#include <osgWidget/StyleInterface>
#include <osgWidget/UIObjectParent>
#include <osgWidget/Types>
namespace osgWidget {
class Window;
class WindowManager;
// A Widget is a rectangular region that receives events about the state of various input
// devices such as the pointer and keyboard. It is aware of it's width, height, and origin but
// nothing else. It is the job of higher-level container objects to organize layouts and
// the like, and to contextualize the meaning of the widgets "origin" (whether it is absolute
// or relative).
class OSGWIDGET_EXPORT Widget: public osg::Geometry, public EventInterface, public StyleInterface {
public:
enum Corner {
LOWER_LEFT = 0,
LOWER_RIGHT = 1,
UPPER_RIGHT = 2,
UPPER_LEFT = 3,
LL = LOWER_LEFT,
LR = LOWER_RIGHT,
UR = UPPER_RIGHT,
UL = UPPER_LEFT,
ALL_CORNERS = 4
};
enum Layer {
LAYER_TOP = 100,
LAYER_HIGH = 75,
LAYER_MIDDLE = 50,
LAYER_LOW = 25,
LAYER_BG = 0
};
enum VerticalAlignment {
VA_CENTER,
VA_TOP,
VA_BOTTOM
};
enum HorizontalAlignment {
HA_CENTER,
HA_LEFT,
HA_RIGHT
};
enum CoordinateMode {
CM_ABSOLUTE,
CM_RELATIVE
};
Widget (const std::string& = "", point_type = 0.0f, point_type = 0.0f);
Widget (const Widget&, const osg::CopyOp&);
META_Object (osgWidget, Widget);
virtual ~Widget() {
}
// This method is called when the widget is added to a Window; this is useful
// when the widget needs to do something advanced (like a Label). The parent
// is passed as the first argument, although _parent should already be set.
virtual void parented(Window*) {
}
virtual void unparented(Window*) {
}
// This method is called when the widget's parent Window is added to a
// WindowManager object. The base managed method (WHICH YOU MUST REMEMBER
// TO CALL IN YOUR DERIVED METHODS!) sets the TexMat properly depending
// on what coordinate system you're using.
virtual void managed(WindowManager*) {
}
virtual void unmanaged(WindowManager*) {
}
// This method is called when the widget is resized or reallocated in any
// way. This is useful when the widget manages some internal Drawables that need
// to be modified in some way.
virtual void positioned() {
}
void setDimensions(
point_type = -1.0f,
point_type = -1.0f,
point_type = -1.0f,
point_type = -1.0f,
point_type = -1.0f
);
void setPadding (point_type);
void setColor (color_type, color_type, color_type, color_type, Corner = ALL_CORNERS);
void addColor (color_type, color_type, color_type, color_type, Corner = ALL_CORNERS);
void setTexCoord (texcoord_type, texcoord_type, Corner = ALL_CORNERS);
void setLayer (Layer l, unsigned int offset = 0);
// These are additional texture coordinate setting methods.
// This method will use a given origin as the LOWER_LEFT point and texture the
// remaining area based on some width and height values.
void setTexCoordRegion(point_type, point_type, point_type, point_type);
// These are convenience methods for setting up wrapping modes.
void setTexCoordWrapHorizontal ();
void setTexCoordWrapVertical ();
bool setImage (osg::Image*, bool = false, bool = false);
template<class T> bool setImage(const osg::ref_ptr<T>& image, bool f1 = false, bool f2 = false) { return setImage(image.get(), f1, f2); }
bool setImage (const std::string&, bool = false, bool = false);
bool setTexture (osg::Texture*, bool = false, bool = false);
void addX (point_type);
void addY (point_type);
void addWidth (point_type);
void addHeight (point_type);
void addOrigin (point_type, point_type);
void addSize (point_type, point_type);
point_type getWidth () const;
point_type getHeight () const;
point_type getX () const;
point_type getY () const;
point_type getZ () const;
point_type getPadHorizontal () const;
point_type getPadVertical () const;
const Point& getPoint (Corner = ALL_CORNERS) const;
const Color& getColor (Corner = ALL_CORNERS) const;
const TexCoord& getTexCoord (Corner = ALL_CORNERS) const;
Color getImageColorAtXY (point_type x, point_type y) const;
XYCoord localXY (double, double) const;
bool isPaddingUniform() const;
bool isManaged() const {
return _isManaged;
}
bool isStyled() const {
return _isStyled;
}
void setDimensions(const Quad& q, point_type z = -1.0f) {
setDimensions(q[0], q[1], q[2], q[3], z);
}
void setX(point_type x) {
setDimensions(x);
}
void setY(point_type y) {
setDimensions(-1.0f, y);
}
// This method should be use with extreme caution.
void setZ(point_type z) {
setDimensions(-1.0f, -1.0f, -1.0f, -1.0f, z);
}
void setWidth(point_type w) {
setDimensions(-1.0f, -1.0f, w);
}
void setHeight(point_type h) {
setDimensions(-1.0f, -1.0f, -1.0f, h);
}
void setOrigin(point_type x, point_type y) {
setDimensions(x, y);
}
void setOrigin(const XYCoord& xy) {
setOrigin(xy.x(), xy.y());
}
void setSize(point_type w, point_type h) {
setDimensions(-1.0f, -1.0f, w, h);
}
void setSize(const XYCoord& xy) {
setSize(xy.x(), xy.y());
}
void setColor(const Color& col, Corner p = ALL_CORNERS) {
setColor(col.r(), col.g(), col.b(), col.a(), p);
}
void setTexCoord(const XYCoord& xy, Corner p = ALL_CORNERS) {
setTexCoord(xy.x(), xy.y(), p);
}
void setTexCoordRegion(const XYCoord& xy, point_type w, point_type h) {
setTexCoordRegion(xy.x(), xy.y(), w, h);
}
void setTexCoordRegion(point_type x, point_type y, const XYCoord& wh) {
setTexCoordRegion(x, y, wh.x(), wh.y());
}
void setTexCoordRegion(const XYCoord& xy, const XYCoord& wh) {
setTexCoordRegion(xy.x(), xy.y(), wh.x(), wh.y());
}
void addColor(const Color& col, Corner p = ALL_CORNERS) {
addColor(col.r(), col.g(), col.b(), col.a(), p);
}
void addOrigin(const XYCoord& xy) {
addOrigin(xy.x(), xy.y());
}
void addSize(const XYCoord& xy) {
addSize(xy.x(), xy.y());
}
void setMinimumSize(point_type width, point_type height) {
_minWidth = width;
_minHeight = height;
}
void setMinimumSize(const XYCoord& xy) {
setMinimumSize(xy.x(), xy.y());
}
void setPadLeft(point_type p) {
_padLeft = p;
}
void setPadRight(point_type p) {
_padRight = p;
}
void setPadTop(point_type p) {
_padTop = p;
}
void setPadBottom(point_type p) {
_padBottom = p;
}
void setAlignHorizontal(HorizontalAlignment h) {
_halign = h;
}
void setAlignVertical(VerticalAlignment v) {
_valign = v;
}
void setCoordinateMode(CoordinateMode cm) {
_coordMode = cm;
}
void setCanFill(bool f) {
_canFill = f;
}
void setCanClone(bool c) {
_canClone = c;
}
WindowManager* getWindowManager() {
return _getWindowManager();
}
const WindowManager* getWindowManager() const {
return _getWindowManager();
}
Window* getParent() {
return _parent;
}
const Window* getParent() const {
return _parent;
}
unsigned int getIndex() const {
return _index;
}
XYCoord getOrigin() const {
return XYCoord(getX(), getY());
}
Color getImageColorAtXY(const XYCoord& xy) const {
return getImageColorAtXY(xy.x(), xy.y());
}
Color getImageColorAtPointerXY(double x, double y) const {
return getImageColorAtXY(localXY(x, y));
}
Point getPosition() const {
return Point(getX(), getY(), getZ());
}
XYCoord getSize() const {
return XYCoord(getWidth(), getHeight());
}
Quad getDimensions() const {
return Quad(getX(), getY(), getWidth(), getHeight());
}
point_type getPadLeft() const {
return _padLeft;
}
point_type getPadRight() const {
return _padRight;
}
point_type getPadTop() const {
return _padTop;
}
point_type getPadBottom() const {
return _padBottom;
}
HorizontalAlignment getAlignHorizontal() const {
return _halign;
}
VerticalAlignment getAlignVertical() const {
return _valign;
}
CoordinateMode getCoordinateMode() const {
return _coordMode;
}
bool canFill() const {
return _canFill;
}
bool canClone() const {
return _canClone;
}
// This casts the bool _fill variable to be used in iteratively in functions such
// as Window::_accumulate and whatnot.
point_type getFillAsNumeric() const {
return static_cast<point_type>(_canFill);
}
point_type getWidthTotal() const {
return getWidth() + getPadHorizontal();
}
point_type getHeightTotal() const {
return getHeight() + getPadVertical();
}
point_type getMinWidth() const {
return _minWidth;
}
point_type getMinHeight() const {
return _minHeight;
}
point_type getMinWidthTotal() const {
return _minWidth + getPadHorizontal();
}
point_type getMinHeightTotal() const {
return _minHeight + getPadVertical();
}
unsigned int getLayer() const {
return _layer;
}
protected:
point_type _calculateZ(unsigned int) const;
PointArray* _verts() {
return dynamic_cast<PointArray*>(getVertexArray());
}
const PointArray* _verts() const {
return dynamic_cast<const PointArray*>(getVertexArray());
}
ColorArray* _cols() {
return dynamic_cast<ColorArray*>(getColorArray());
}
const ColorArray* _cols() const {
return dynamic_cast<const ColorArray*>(getColorArray());
}
TexCoordArray* _texs() {
return dynamic_cast<TexCoordArray*>(getTexCoordArray(0));
}
const TexCoordArray* _texs() const {
return dynamic_cast<const TexCoordArray*>(getTexCoordArray(0));
}
osg::Texture* _texture() {
osg::StateSet* ss = getStateSet();
if(!ss) return 0;
return dynamic_cast<osg::Texture2D*>(
ss->getTextureAttribute(0, osg::StateAttribute::TEXTURE)
);
}
const osg::Texture* _texture() const {
const osg::StateSet* ss = getStateSet();
if(!ss) return 0;
return dynamic_cast<const osg::Texture2D*>(
ss->getTextureAttribute(0, osg::StateAttribute::TEXTURE)
);
}
osg::Image* _image() {
return _getImage();
}
const osg::Image* _image() const {
return _getImage();
}
friend class Window;
// TODO: Because of the current class design, I don't think it's possible to
// have a ref_ptr here. :(
Window* _parent;
unsigned int _index;
unsigned int _layer;
// Padding is the value of pixels of space between whatever the widget is "contianed"
// in and the point at which it starts getting placed.
point_type _padLeft;
point_type _padRight;
point_type _padTop;
point_type _padBottom;
// The alignments are used in conjunction when the widget is NOT set to fill.
VerticalAlignment _valign;
HorizontalAlignment _halign;
// This flag determines how sizing values are interpretted by setDimensions().
CoordinateMode _coordMode;
// These are the relative values, which are not stored directly in our verts
// array but kept around for calculation later.
Quad _relCoords;
// This fill flag determines whether or not the widget will resize itself to fill
// all available space.
bool _canFill;
// Set this to false in an implementation to prevent copying.
bool _canClone;
// This variable is only used by the Window object to determine if it's necessary
// to call managed().
bool _isManaged;
// This variable is like _isManaged; it is used to store whether the Widget has
// been styled yet.
bool _isStyled;
// Set these variables to be the minimum size of a Widget so that it cannot be
// resized any smaller than this.
point_type _minWidth;
point_type _minHeight;
static osg::ref_ptr<PointArray> _norms;
WindowManager* _getWindowManager () const;
osg::Image* _getImage () const;
};
typedef std::list<osg::observer_ptr<Widget> > WidgetList;
// A Widget subclass that prints stuff using osg::notify(). :)
struct NotifyWidget: public Widget {
META_Object(osgWidget, NotifyWidget);
NotifyWidget(const std::string& n = "", point_type w = 0.0f, point_type h = 0.0f):
Widget(n, w, h) {
setEventMask(EVENT_ALL);
}
NotifyWidget(const NotifyWidget& widget, const osg::CopyOp& co):
Widget(widget, co) {
}
bool focus(const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > focus called" << std::endl;
return false;
}
bool unfocus(const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > unfocus called" << std::endl;
return false;
}
bool mouseEnter(double, double, const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > mouseEnter called" << std::endl;
return false;
}
bool mouseOver(double, double, const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > mouseOver called" << std::endl;
return false;
}
bool mouseLeave(double, double, const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > mouseLeave called" << std::endl;
return false;
}
bool mouseDrag(double, double, const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > mouseDrag called" << std::endl;
return false;
}
bool mousePush(double, double, const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > mousePush called" << std::endl;
return false;
}
bool mouseRelease(double, double, const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > mouseRelease called" << std::endl;
return false;
}
bool mouseScroll(double, double, const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > mouseScroll called" << std::endl;
return false;
}
bool keyPress(int, int, const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > keyPress called" << std::endl;
return false;
}
bool keyRelease(int, int, const WindowManager*) {
osg::notify(osg::NOTICE) << _name << " > keyRelease called" << std::endl;
return false;
}
};
// A Widget that eats all events and returns true.
struct NullWidget: public Widget {
META_Object(osgWidget, NullWidget);
NullWidget(const std::string& n = "", point_type w = 0.0f, point_type h = 0.0f):
Widget(n, w, h) {
setEventMask(EVENT_ALL);
}
NullWidget(const NullWidget& widget, const osg::CopyOp& co):
Widget(widget, co) {
}
bool focus(const WindowManager*) {
return true;
}
bool unfocus(const WindowManager*) {
return true;
}
bool mouseEnter(double, double, const WindowManager*) {
return true;
}
bool mouseOver(double, double, const WindowManager*) {
return true;
}
bool mouseLeave(double, double, const WindowManager*) {
return true;
}
bool mouseDrag(double, double, const WindowManager*) {
return true;
}
bool mousePush(double, double, const WindowManager*) {
return true;
}
bool mouseRelease(double, double, const WindowManager*) {
return true;
}
bool mouseScroll(double, double, const WindowManager*) {
return true;
}
bool keyPress(int, int, const WindowManager*) {
return true;
}
bool keyRelease(int, int, const WindowManager*) {
return true;
}
};
}
#endif
EventInterface
StyleInterface
Texture2D
UIObjectParent
osgWidget::EventInterface::EventInterface
EventInterface()
Definition EventInterface:270
osgWidget::EventInterface::setEventMask
void setEventMask(unsigned int mask)
Definition EventInterface:301
osgWidget::StyleInterface::StyleInterface
StyleInterface()
Definition StyleInterface:26
osgWidget::Widget::getMinHeight
point_type getMinHeight() const
Definition osgWidget/Widget:387
osgWidget::Widget::getFillAsNumeric
point_type getFillAsNumeric() const
Definition osgWidget/Widget:371
osgWidget::Widget::getPadRight
point_type getPadRight() const
Definition osgWidget/Widget:337
osgWidget::Widget::getPoint
const Point & getPoint(Corner=ALL_CORNERS) const
osgWidget::Widget::setTexCoordRegion
void setTexCoordRegion(const XYCoord &xy, const XYCoord &wh)
Definition osgWidget/Widget:228
osgWidget::Widget::META_Object
META_Object(osgWidget, Widget)
osgWidget::Widget::unparented
virtual void unparented(Window *)
Definition osgWidget/Widget:89
osgWidget::Widget::_padRight
point_type _padRight
Definition osgWidget/Widget:471
osgWidget::Widget::_verts
PointArray * _verts()
Definition osgWidget/Widget:407
osgWidget::Widget::_parent
Window * _parent
Definition osgWidget/Widget:463
osgWidget::Widget::setOrigin
void setOrigin(const XYCoord &xy)
Definition osgWidget/Widget:200
osgWidget::Widget::setHeight
void setHeight(point_type h)
Definition osgWidget/Widget:192
osgWidget::Widget::_layer
unsigned int _layer
Definition osgWidget/Widget:466
osgWidget::Widget::setTexture
bool setTexture(osg::Texture *, bool=false, bool=false)
osgWidget::Widget::_calculateZ
point_type _calculateZ(unsigned int) const
osgWidget::Widget::getPadBottom
point_type getPadBottom() const
Definition osgWidget/Widget:345
osgWidget::Widget::_minHeight
point_type _minHeight
Definition osgWidget/Widget:504
osgWidget::Widget::setSize
void setSize(const XYCoord &xy)
Definition osgWidget/Widget:208
osgWidget::Widget::_isStyled
bool _isStyled
Definition osgWidget/Widget:499
osgWidget::Widget::addSize
void addSize(point_type, point_type)
osgWidget::Widget::setTexCoord
void setTexCoord(const XYCoord &xy, Corner p=ALL_CORNERS)
Definition osgWidget/Widget:216
osgWidget::Widget::localXY
XYCoord localXY(double, double) const
osgWidget::Widget::getHeightTotal
point_type getHeightTotal() const
Definition osgWidget/Widget:379
osgWidget::Widget::getAlignHorizontal
HorizontalAlignment getAlignHorizontal() const
Definition osgWidget/Widget:349
osgWidget::Widget::HorizontalAlignment
HorizontalAlignment
Definition osgWidget/Widget:63
osgWidget::Widget::HA_LEFT
@ HA_LEFT
Definition osgWidget/Widget:65
osgWidget::Widget::HA_CENTER
@ HA_CENTER
Definition osgWidget/Widget:64
osgWidget::Widget::HA_RIGHT
@ HA_RIGHT
Definition osgWidget/Widget:66
osgWidget::Widget::addX
void addX(point_type)
osgWidget::Widget::_image
const osg::Image * _image() const
Definition osgWidget/Widget:455
osgWidget::Widget::getWidthTotal
point_type getWidthTotal() const
Definition osgWidget/Widget:375
osgWidget::Widget::unmanaged
virtual void unmanaged(WindowManager *)
Definition osgWidget/Widget:99
osgWidget::Widget::addHeight
void addHeight(point_type)
osgWidget::Widget::setOrigin
void setOrigin(point_type x, point_type y)
Definition osgWidget/Widget:196
osgWidget::Widget::getPadLeft
point_type getPadLeft() const
Definition osgWidget/Widget:333
osgWidget::Widget::getLayer
unsigned int getLayer() const
Definition osgWidget/Widget:399
osgWidget::Widget::setTexCoordWrapVertical
void setTexCoordWrapVertical()
osgWidget::Widget::setCoordinateMode
void setCoordinateMode(CoordinateMode cm)
Definition osgWidget/Widget:277
osgWidget::Widget::~Widget
virtual ~Widget()
Definition osgWidget/Widget:80
osgWidget::Widget::getImageColorAtXY
Color getImageColorAtXY(const XYCoord &xy) const
Definition osgWidget/Widget:313
osgWidget::Widget::getDimensions
Quad getDimensions() const
Definition osgWidget/Widget:329
osgWidget::Widget::Window
friend class Window
Definition osgWidget/Widget:459
osgWidget::Widget::_isManaged
bool _isManaged
Definition osgWidget/Widget:495
osgWidget::Widget::setTexCoordRegion
void setTexCoordRegion(point_type, point_type, point_type, point_type)
osgWidget::Widget::_padTop
point_type _padTop
Definition osgWidget/Widget:472
osgWidget::Widget::setY
void setY(point_type y)
Definition osgWidget/Widget:179
osgWidget::Widget::setPadRight
void setPadRight(point_type p)
Definition osgWidget/Widget:257
osgWidget::Widget::getParent
const Window * getParent() const
Definition osgWidget/Widget:301
osgWidget::Widget::getOrigin
XYCoord getOrigin() const
Definition osgWidget/Widget:309
osgWidget::Widget::setZ
void setZ(point_type z)
Definition osgWidget/Widget:184
osgWidget::Widget::Widget
Widget(const std::string &="", point_type=0.0f, point_type=0.0f)
osgWidget::Widget::setColor
void setColor(const Color &col, Corner p=ALL_CORNERS)
Definition osgWidget/Widget:212
osgWidget::Widget::getIndex
unsigned int getIndex() const
Definition osgWidget/Widget:305
osgWidget::Widget::_halign
HorizontalAlignment _halign
Definition osgWidget/Widget:477
osgWidget::Widget::setMinimumSize
void setMinimumSize(point_type width, point_type height)
Definition osgWidget/Widget:244
osgWidget::Widget::addWidth
void addWidth(point_type)
osgWidget::Widget::setTexCoordWrapHorizontal
void setTexCoordWrapHorizontal()
osgWidget::Widget::getWindowManager
const WindowManager * getWindowManager() const
Definition osgWidget/Widget:293
osgWidget::Widget::getAlignVertical
VerticalAlignment getAlignVertical() const
Definition osgWidget/Widget:353
osgWidget::Widget::setAlignVertical
void setAlignVertical(VerticalAlignment v)
Definition osgWidget/Widget:273
osgWidget::Widget::Layer
Layer
Definition osgWidget/Widget:49
osgWidget::Widget::LAYER_HIGH
@ LAYER_HIGH
Definition osgWidget/Widget:51
osgWidget::Widget::LAYER_LOW
@ LAYER_LOW
Definition osgWidget/Widget:53
osgWidget::Widget::LAYER_BG
@ LAYER_BG
Definition osgWidget/Widget:54
osgWidget::Widget::LAYER_TOP
@ LAYER_TOP
Definition osgWidget/Widget:50
osgWidget::Widget::LAYER_MIDDLE
@ LAYER_MIDDLE
Definition osgWidget/Widget:52
osgWidget::Widget::_cols
ColorArray * _cols()
Definition osgWidget/Widget:415
osgWidget::Widget::_getImage
osg::Image * _getImage() const
osgWidget::Widget::addOrigin
void addOrigin(const XYCoord &xy)
Definition osgWidget/Widget:236
osgWidget::Widget::_index
unsigned int _index
Definition osgWidget/Widget:465
osgWidget::Widget::setImage
bool setImage(const osg::ref_ptr< T > &image, bool f1=false, bool f2=false)
Definition osgWidget/Widget:133
osgWidget::Widget::_cols
const ColorArray * _cols() const
Definition osgWidget/Widget:419
osgWidget::Widget::_norms
static osg::ref_ptr< PointArray > _norms
Definition osgWidget/Widget:506
osgWidget::Widget::isStyled
bool isStyled() const
Definition osgWidget/Widget:167
osgWidget::Widget::setSize
void setSize(point_type w, point_type h)
Definition osgWidget/Widget:204
osgWidget::Widget::setImage
bool setImage(osg::Image *, bool=false, bool=false)
osgWidget::Widget::setCanClone
void setCanClone(bool c)
Definition osgWidget/Widget:285
osgWidget::Widget::_canClone
bool _canClone
Definition osgWidget/Widget:491
osgWidget::Widget::getPadVertical
point_type getPadVertical() const
osgWidget::Widget::setTexCoordRegion
void setTexCoordRegion(point_type x, point_type y, const XYCoord &wh)
Definition osgWidget/Widget:224
osgWidget::Widget::addColor
void addColor(color_type, color_type, color_type, color_type, Corner=ALL_CORNERS)
osgWidget::Widget::isPaddingUniform
bool isPaddingUniform() const
osgWidget::Widget::CoordinateMode
CoordinateMode
Definition osgWidget/Widget:69
osgWidget::Widget::CM_ABSOLUTE
@ CM_ABSOLUTE
Definition osgWidget/Widget:70
osgWidget::Widget::CM_RELATIVE
@ CM_RELATIVE
Definition osgWidget/Widget:71
osgWidget::Widget::VerticalAlignment
VerticalAlignment
Definition osgWidget/Widget:57
osgWidget::Widget::VA_CENTER
@ VA_CENTER
Definition osgWidget/Widget:58
osgWidget::Widget::VA_BOTTOM
@ VA_BOTTOM
Definition osgWidget/Widget:60
osgWidget::Widget::VA_TOP
@ VA_TOP
Definition osgWidget/Widget:59
osgWidget::Widget::setTexCoordRegion
void setTexCoordRegion(const XYCoord &xy, point_type w, point_type h)
Definition osgWidget/Widget:220
osgWidget::Widget::getY
point_type getY() const
osgWidget::Widget::_relCoords
Quad _relCoords
Definition osgWidget/Widget:484
osgWidget::Widget::setX
void setX(point_type x)
Definition osgWidget/Widget:175
osgWidget::Widget::managed
virtual void managed(WindowManager *)
Definition osgWidget/Widget:96
osgWidget::Widget::setPadLeft
void setPadLeft(point_type p)
Definition osgWidget/Widget:253
osgWidget::Widget::_texture
const osg::Texture * _texture() const
Definition osgWidget/Widget:441
osgWidget::Widget::_coordMode
CoordinateMode _coordMode
Definition osgWidget/Widget:480
osgWidget::Widget::_canFill
bool _canFill
Definition osgWidget/Widget:488
osgWidget::Widget::setPadTop
void setPadTop(point_type p)
Definition osgWidget/Widget:261
osgWidget::Widget::Corner
Corner
Definition osgWidget/Widget:37
osgWidget::Widget::LL
@ LL
Definition osgWidget/Widget:42
osgWidget::Widget::LOWER_RIGHT
@ LOWER_RIGHT
Definition osgWidget/Widget:39
osgWidget::Widget::UR
@ UR
Definition osgWidget/Widget:44
osgWidget::Widget::LOWER_LEFT
@ LOWER_LEFT
Definition osgWidget/Widget:38
osgWidget::Widget::LR
@ LR
Definition osgWidget/Widget:43
osgWidget::Widget::ALL_CORNERS
@ ALL_CORNERS
Definition osgWidget/Widget:46
osgWidget::Widget::UPPER_LEFT
@ UPPER_LEFT
Definition osgWidget/Widget:41
osgWidget::Widget::UL
@ UL
Definition osgWidget/Widget:45
osgWidget::Widget::UPPER_RIGHT
@ UPPER_RIGHT
Definition osgWidget/Widget:40
osgWidget::Widget::getWidth
point_type getWidth() const
osgWidget::Widget::_minWidth
point_type _minWidth
Definition osgWidget/Widget:503
osgWidget::Widget::setDimensions
void setDimensions(point_type=-1.0f, point_type=-1.0f, point_type=-1.0f, point_type=-1.0f, point_type=-1.0f)
osgWidget::Widget::addOrigin
void addOrigin(point_type, point_type)
osgWidget::Widget::setAlignHorizontal
void setAlignHorizontal(HorizontalAlignment h)
Definition osgWidget/Widget:269
osgWidget::Widget::getMinWidth
point_type getMinWidth() const
Definition osgWidget/Widget:383
osgWidget::Widget::_image
osg::Image * _image()
Definition osgWidget/Widget:451
osgWidget::Widget::getPadTop
point_type getPadTop() const
Definition osgWidget/Widget:341
osgWidget::Widget::getX
point_type getX() const
osgWidget::Widget::_valign
VerticalAlignment _valign
Definition osgWidget/Widget:476
osgWidget::Widget::setDimensions
void setDimensions(const Quad &q, point_type z=-1.0f)
Definition osgWidget/Widget:171
osgWidget::Widget::_verts
const PointArray * _verts() const
Definition osgWidget/Widget:411
osgWidget::Widget::setPadding
void setPadding(point_type)
osgWidget::Widget::getColor
const Color & getColor(Corner=ALL_CORNERS) const
osgWidget::Widget::getHeight
point_type getHeight() const
osgWidget::Widget::addY
void addY(point_type)
osgWidget::Widget::_padBottom
point_type _padBottom
Definition osgWidget/Widget:473
osgWidget::Widget::getZ
point_type getZ() const
osgWidget::Widget::_getWindowManager
WindowManager * _getWindowManager() const
osgWidget::Widget::getPadHorizontal
point_type getPadHorizontal() const
osgWidget::Widget::setTexCoord
void setTexCoord(texcoord_type, texcoord_type, Corner=ALL_CORNERS)
osgWidget::Widget::getImageColorAtPointerXY
Color getImageColorAtPointerXY(double x, double y) const
Definition osgWidget/Widget:317
osgWidget::Widget::canClone
bool canClone() const
Definition osgWidget/Widget:365
osgWidget::Widget::_texs
const TexCoordArray * _texs() const
Definition osgWidget/Widget:427
osgWidget::Widget::getMinHeightTotal
point_type getMinHeightTotal() const
Definition osgWidget/Widget:395
osgWidget::Widget::addSize
void addSize(const XYCoord &xy)
Definition osgWidget/Widget:240
osgWidget::Widget::_texture
osg::Texture * _texture()
Definition osgWidget/Widget:431
osgWidget::Widget::getParent
Window * getParent()
Definition osgWidget/Widget:297
osgWidget::Widget::getSize
XYCoord getSize() const
Definition osgWidget/Widget:325
osgWidget::Widget::getPosition
Point getPosition() const
Definition osgWidget/Widget:321
osgWidget::Widget::setCanFill
void setCanFill(bool f)
Definition osgWidget/Widget:281
osgWidget::Widget::getCoordinateMode
CoordinateMode getCoordinateMode() const
Definition osgWidget/Widget:357
osgWidget::Widget::getWindowManager
WindowManager * getWindowManager()
Definition osgWidget/Widget:289
osgWidget::Widget::setLayer
void setLayer(Layer l, unsigned int offset=0)
osgWidget::Widget::setPadBottom
void setPadBottom(point_type p)
Definition osgWidget/Widget:265
osgWidget::Widget::canFill
bool canFill() const
Definition osgWidget/Widget:361
osgWidget::Widget::getMinWidthTotal
point_type getMinWidthTotal() const
Definition osgWidget/Widget:391
osgWidget::Widget::setMinimumSize
void setMinimumSize(const XYCoord &xy)
Definition osgWidget/Widget:249
osgWidget::Widget::_texs
TexCoordArray * _texs()
Definition osgWidget/Widget:423
osgWidget::Widget::parented
virtual void parented(Window *)
Definition osgWidget/Widget:86
osgWidget::Widget::positioned
virtual void positioned()
Definition osgWidget/Widget:105
osgWidget::Widget::setImage
bool setImage(const std::string &, bool=false, bool=false)
osgWidget::Widget::getImageColorAtXY
Color getImageColorAtXY(point_type x, point_type y) const
osgWidget::Widget::Widget
Widget(const Widget &, const osg::CopyOp &)
osgWidget::Widget::setWidth
void setWidth(point_type w)
Definition osgWidget/Widget:188
osgWidget::Widget::addColor
void addColor(const Color &col, Corner p=ALL_CORNERS)
Definition osgWidget/Widget:232
osgWidget::Widget::isManaged
bool isManaged() const
Definition osgWidget/Widget:163
osgWidget::Widget::setColor
void setColor(color_type, color_type, color_type, color_type, Corner=ALL_CORNERS)
osgWidget::Widget::_padLeft
point_type _padLeft
Definition osgWidget/Widget:470
osgWidget::Widget::getTexCoord
const TexCoord & getTexCoord(Corner=ALL_CORNERS) const
osgWidget::WindowManager
Definition WindowManager:39
osg::CopyOp
Definition CopyOp:41
osg::Geometry
Definition Geometry:31
osg::Geometry::getVertexArray
Array * getVertexArray()
Definition Geometry:49
osg::Geometry::getTexCoordArray
Array * getTexCoordArray(unsigned int unit)
osg::Geometry::getColorArray
Array * getColorArray()
Definition Geometry:62
osg::Image
Definition Image:179
osg::Node::getStateSet
osg::StateSet * getStateSet()
Definition Node:382
osg::Object::_name
std::string _name
Definition Object:303
osg::StateAttribute::TEXTURE
@ TEXTURE
Definition StateAttribute:125
osg::StateSet
Definition StateSet:46
osg::StateSet::getTextureAttribute
StateAttribute * getTextureAttribute(unsigned int unit, StateAttribute::Type type)
osg::Texture2D
Definition Texture2D:25
osg::Texture
Definition Texture:422
osg::Vec2f::x
value_type & x()
Definition Vec2f:67
osg::Vec2f::y
value_type & y()
Definition Vec2f:68
osg::ref_ptr
Definition ref_ptr:32
osg::ref_ptr::get
T * get() const
Definition ref_ptr:117
osgWidget
Definition Box:21
osgWidget::ColorArray
osg::Vec4Array ColorArray
Definition osgWidget/Types:26
osgWidget::Quad
osg::Vec4 Quad
Definition osgWidget/Types:37
osgWidget::color_type
Color::value_type color_type
Definition osgWidget/Types:34
osgWidget::point_type
Point::value_type point_type
Definition osgWidget/Types:33
osgWidget::XYCoord
osg::Vec2 XYCoord
Definition osgWidget/Types:36
osgWidget::Point
PointArray::value_type Point
Definition osgWidget/Types:29
osgWidget::EVENT_ALL
@ EVENT_ALL
Definition EventInterface:46
osgWidget::texcoord_type
TexCoord::value_type texcoord_type
Definition osgWidget/Types:32
osgWidget::TexCoord
TexCoordArray::value_type TexCoord
Definition osgWidget/Types:28
osgWidget::TexCoordArray
osg::Vec2Array TexCoordArray
Definition osgWidget/Types:24
osgWidget::WidgetList
std::list< osg::observer_ptr< Widget > > WidgetList
Definition osgWidget/Widget:513
osgWidget::Color
ColorArray::value_type Color
Definition osgWidget/Types:30
osgWidget::PointArray
osg::Vec3Array PointArray
Definition osgWidget/Types:25
osg::NOTICE
@ NOTICE
Definition Notify:34
osg::notify
std::ostream & notify(void)
Definition Notify:80
OSGWIDGET_EXPORT
#define OSGWIDGET_EXPORT
Definition osgWidget/Export:42
Types
osgWidget::NotifyWidget::mouseEnter
bool mouseEnter(double, double, const WindowManager *)
Definition osgWidget/Widget:540
osgWidget::NotifyWidget::mouseLeave
bool mouseLeave(double, double, const WindowManager *)
Definition osgWidget/Widget:552
osgWidget::NotifyWidget::mouseDrag
bool mouseDrag(double, double, const WindowManager *)
Definition osgWidget/Widget:558
osgWidget::NotifyWidget::keyPress
bool keyPress(int, int, const WindowManager *)
Definition osgWidget/Widget:582
osgWidget::NotifyWidget::focus
bool focus(const WindowManager *)
Definition osgWidget/Widget:528
osgWidget::NotifyWidget::keyRelease
bool keyRelease(int, int, const WindowManager *)
Definition osgWidget/Widget:588
osgWidget::NotifyWidget::mousePush
bool mousePush(double, double, const WindowManager *)
Definition osgWidget/Widget:564
osgWidget::NotifyWidget::NotifyWidget
NotifyWidget(const std::string &n="", point_type w=0.0f, point_type h=0.0f)
Definition osgWidget/Widget:519
osgWidget::NotifyWidget::NotifyWidget
NotifyWidget(const NotifyWidget &widget, const osg::CopyOp &co)
Definition osgWidget/Widget:524
osgWidget::NotifyWidget::mouseOver
bool mouseOver(double, double, const WindowManager *)
Definition osgWidget/Widget:546
osgWidget::NotifyWidget::mouseScroll
bool mouseScroll(double, double, const WindowManager *)
Definition osgWidget/Widget:576
osgWidget::NotifyWidget::META_Object
META_Object(osgWidget, NotifyWidget)
osgWidget::NotifyWidget::unfocus
bool unfocus(const WindowManager *)
Definition osgWidget/Widget:534
osgWidget::NotifyWidget::mouseRelease
bool mouseRelease(double, double, const WindowManager *)
Definition osgWidget/Widget:570
osgWidget::NullWidget::mouseEnter
bool mouseEnter(double, double, const WindowManager *)
Definition osgWidget/Widget:616
osgWidget::NullWidget::mouseLeave
bool mouseLeave(double, double, const WindowManager *)
Definition osgWidget/Widget:624
osgWidget::NullWidget::keyRelease
bool keyRelease(int, int, const WindowManager *)
Definition osgWidget/Widget:648
osgWidget::NullWidget::mouseRelease
bool mouseRelease(double, double, const WindowManager *)
Definition osgWidget/Widget:636
osgWidget::NullWidget::keyPress
bool keyPress(int, int, const WindowManager *)
Definition osgWidget/Widget:644
osgWidget::NullWidget::mouseOver
bool mouseOver(double, double, const WindowManager *)
Definition osgWidget/Widget:620
osgWidget::NullWidget::unfocus
bool unfocus(const WindowManager *)
Definition osgWidget/Widget:612
osgWidget::NullWidget::NullWidget
NullWidget(const std::string &n="", point_type w=0.0f, point_type h=0.0f)
Definition osgWidget/Widget:599
osgWidget::NullWidget::focus
bool focus(const WindowManager *)
Definition osgWidget/Widget:608
osgWidget::NullWidget::mousePush
bool mousePush(double, double, const WindowManager *)
Definition osgWidget/Widget:632
osgWidget::NullWidget::NullWidget
NullWidget(const NullWidget &widget, const osg::CopyOp &co)
Definition osgWidget/Widget:604
osgWidget::NullWidget::mouseDrag
bool mouseDrag(double, double, const WindowManager *)
Definition osgWidget/Widget:628
osgWidget::NullWidget::META_Object
META_Object(osgWidget, NullWidget)
osgWidget::NullWidget::mouseScroll
bool mouseScroll(double, double, const WindowManager *)
Definition osgWidget/Widget:640