#include <GLSurfaceWidget.h>
Inheritance diagram for GLSurfaceWidget:
Event & constraint mapper. | |
All widgets have the default event of: gutz::GUTZ_LEFT_MOUSE -> MOVE you may want to nuke this event if it isn't applicable: delEvent(gutz::GUTZ_LEFT_MOUSE); event keys are defined in: gutzKeyMouse.h | |
enum | WIGET_BEHAVIORS { NO_EVENT = 0, MOVE, ROTATE, WB_LAST } |
void | addEvent (const unsigned int key, const unsigned int event, const ConstraintSP cnst=new Constraint()) |
addEvent. constraint defaults to "Free Move" constraint | |
unsigned int | getEvent (const gutz::MouseEvent &me) const |
getEvent, returns the event if one is defined, returns NO_EVENT if the mouse is up works for both: gutz::MouseEvent and gutz::MouseMoveEvent This function is usefull in implementation, externally use getEvent(unsigned int). | |
unsigned int | getEvent (unsigned int key) const |
what is the event assigned to a key | |
void | delEvent (const unsigned int key) |
delete an event from the event map | |
void | nukeEvents () |
delete all events from the event map | |
gutz::EventKeyMap | getEvents () const |
void | setEvents (const gutz::EventKeyMap &eventMap) |
ConstraintMap | getConstraints () const |
void | setConstraints (const ConstraintMap &cnstMap) |
set/get Visible | |
bool | isVisible () const |
virtual void | setVisible (bool yes=true) |
Clones | |
WidgetItem * | clone () const |
WidgetItem::clone definition. | |
set/get Points | |
gutz::vec3f | getPoint (int ptIdx) const |
void | setPoint (int ptIdx, const gutz::vec3f &pt) |
gutz::planef | getPlane () const |
get the plane that defines the surface, see gutz::plane | |
set specific points (slots): | |
void | setLL (const gutz::vec3f &ll) |
void | setLR (const gutz::vec3f &lr) |
void | setUL (const gutz::vec3f &ul) |
void | setUR (const gutz::vec3f &ur) |
Transform Widget | |
virtual void | applyXform (gutz::mat4f xf) |
apply a 4x4 transformation matrix, must be defined by a sub-class. | |
Behaviors from WidgetItem | |
virtual bool | mouseDef (const gutz::MouseEvent &me) |
override this one to implement mouse behavior | |
virtual bool | moveDef (const gutz::MouseMoveEvent &mme) |
override this one to implement move behavior | |
Events duplicated from <Renderable>. | |
These are duplicated to insure/ease framework issues, notice that mouse and move handle the "check with parent" and mouseDef(), moveDef() are what actually implement the behavior. | |
void | draw (const gutz::RenderEvent &r) |
main draw event... | |
bool | mouse (const gutz::MouseEvent &me) |
a mouse event... | |
virtual bool | mouseChild (WidgetItem *child, const gutz::MouseEvent &me) |
a child was moused, called before their mouseDef. | |
bool | move (const gutz::MouseMoveEvent &mme) |
a move event, checks with parent, then calls moveDef(). | |
virtual bool | moveChild (WidgetItem *child, const gutz::MouseMoveEvent &mme) |
a child wants to be moved. | |
Parent/Child management | |
virtual void | addChild (WidgetItem *child) |
a child was added | |
virtual void | delChild (WidgetItem *child) |
a child was deleted/ changed parent | |
virtual void | setParent (WidgetItem *parent) |
a (new?) parent now owns you :) | |
Some appearance management | |
ColorWStateSP | getColor () const |
void | setColor (ColorWState *const color) |
Draw on/off. | |
bool | isOn () const |
void | setOn (bool yes) |
Delete. | |
Does this object need to be removed from a render list? This means that the object is finished and anyone with a smart pointer to it needs to delete the smart pointer and stop using the renderable. | |
bool | needsDelete () const |
void | setDelete (bool yes) |
Interaction Functions | |
Return true if the event was for you.
By default interaction is forwarded to your protected manipulator (_manip). To use it just apply it in your draw function. However, if you don't add any events or call setManipEventsDefault(), you won't have any interaction. Override these functions in your base class to implement custom behaviors. | |
virtual bool | key (unsigned char k, int x, int y) |
Selected | |
Is this object currently selected? | |
virtual void | setSelected (bool yes) |
bool | isSelected () const |
Manipulator Interface | |
gutz::Manip * | getManip () const |
void | setManip (gutz::Manip *const m) |
void | setManipEventsDefault () |
you have to call this to enable default interaction, OR customize the manipulators events yourself. | |
Signals | |
gutz::Signal< int, const gutz::vec3f & > | pointChanged |
pointChanged(int,vec3f), point index & the point itself | |
gutz::Signal< const gutz::vec3f & > | surfacePicked |
signal: surfacePicked(const vec3f &pt); | |
gutz::Signal< const gutz::vec3f & > | surfacePickMoved |
signal: surfacePickMoved(const vec3f &) | |
Public Types | |
enum | SURFACE_W_BEHAVIORS { PICK = WB_LAST + 1, SW_LAST } |
enum | SURFACE_POINTS { LL, LR, UL, UR, NODE_LAST } |
points corresponding to a frame (4point) surface More... | |
typedef gutz::SmartPtr< WidgetItem > | WidgetItemSP |
typedef gutz::vec2f | Point2 |
2D point | |
typedef gutz::arrayOwn1< Point2 > | Point2Array |
2D point array | |
typedef gutz::vec3f | Point3 |
3D point | |
typedef gutz::arrayOwn1< Point3 > | Point3Array |
3D point array | |
Public Member Functions | |
GLSurfaceWidget (WidgetItem *parent, float border=0, bool drawBorder=false, bool visible=true) | |
GLSurfaceWidget (const GLSurfaceWidget &gsw) | |
GLSurfaceWidget & | operator= (const GLSurfaceWidget &gsw) |
virtual | ~GLSurfaceWidget () |
virtual SurfaceWidget * | cloneSurface () const |
override from SurfaceWidget | |
virtual void | drawDef (const gutz::RenderEvent &r) |
override from WidgetItem | |
virtual void | drawQuad () |
override this to customize | |
virtual void | setChanged () |
object changed | |
virtual Point2Array | getValidArea () const |
get the "tightest 2D bounding polygon" in screen space | |
Public Attributes | |
HAS_SLOTS | |
Protected Member Functions | |
gutz::vec3f | intersectPlane (const gutz::MouseEvent &me) const |
virtual void | _invalidate () |
called before widget changes, see also _update() some window systems need these calls before and after something changes, respectively, you'll have to specify them in your concrete class, if you need them. | |
virtual void | _update () |
called after widget is changed | |
virtual void | appearanceChanged () |
called if something about how it looks changes, does not include changes to the transform, just things like radius and color. | |
virtual void | _incCount () |
gutz::Counted interface, increment reference count by one. | |
virtual void | _decCount () |
gutz::Counted interface, decrement reference count by one. | |
virtual int | _getCount () const |
gutz::Counted interface, get the current reference count. | |
Protected Attributes | |
GLUItem | _gluitem |
bool | _visible |
gutz::vec3f | _corners [NODE_LAST] |
These points are in LOCAL space. | |
gutz::vec3f | _lastPick |
This point is in WORLD space!! | |
bool | _on |
is this renderable currently "render-able"? | |
bool | _selected |
is this renderable selected? | |
bool | _deleteMe |
does this object need to be deleted? | |
gutz::ManipSP | _manip |
You get a manipulator free, no charge. | |
Friends | |
class | SmartPtr |
class | SmartPtrRef |
|
2D point
Definition at line 124 of file WidgetBase.h. Referenced by WidgetItem::getValidArea(), NodeWidget::getValidArea(), and EdgeWidget::getValidArea(). |
|
2D point array
Definition at line 125 of file WidgetBase.h. Referenced by WidgetItem::getValidArea(), NodeWidget::getValidArea(), and EdgeWidget::getValidArea(). |
|
3D point
Definition at line 127 of file WidgetBase.h. Referenced by FrameWidget::setDims(), FrameWidget::setHeight(), and FrameWidget::setWidth(). |
|
3D point array
Definition at line 128 of file WidgetBase.h. |
|
Definition at line 122 of file WidgetBase.h. |
|
points corresponding to a frame (4point) surface
Definition at line 86 of file SurfaceWidget.h. |
|
Definition at line 48 of file SurfaceWidget.h. |
|
Definition at line 313 of file WidgetBase.h. |
|
Definition at line 28 of file GLSurfaceWidget.h. References _visible, and border. Referenced by cloneSurface(). |
|
Definition at line 32 of file GLSurfaceWidget.h. References _visible. |
|
Definition at line 42 of file GLSurfaceWidget.h. |
|
gutz::Counted interface, decrement reference count by one. Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr Definition at line 54 of file smartptr.h. Referenced by TFImage::clear(), NrroImage::fBlendOverRGBA(), and Nrro::updateMinMax(). |
|
gutz::Counted interface, get the current reference count. Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Definition at line 58 of file smartptr.h. |
|
gutz::Counted interface, increment reference count by one. Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr Definition at line 48 of file smartptr.h. Referenced by TFImage::clear(), NrroImage::fBlendOverRGBA(), and Nrro::updateMinMax(). |
|
called before widget changes, see also _update() some window systems need these calls before and after something changes, respectively, you'll have to specify them in your concrete class, if you need them. They are quite usefull, if you need to update when a widget changes, but you don't (nescessarily) care what changed Definition at line 380 of file WidgetBase.h. Referenced by FrameWidget::setCenter(), FrameWidget::setDims(), EdgeWidget::setEndPoint(), FrameWidget::setHeight(), SurfaceWidget::setPoint(), NodeWidget::setPointLocal(), EdgeWidget::setStartPoint(), and FrameWidget::setWidth(). |
|
called after widget is changed
Definition at line 383 of file WidgetBase.h. Referenced by FrameWidget::setCenter(), FrameWidget::setDims(), EdgeWidget::setEndPoint(), FrameWidget::setHeight(), SurfaceWidget::setPoint(), NodeWidget::setPointLocal(), EdgeWidget::setStartPoint(), and FrameWidget::setWidth(). |
|
a child was added
Definition at line 278 of file WidgetBase.h. |
|
addEvent. constraint defaults to "Free Move" constraint
Definition at line 321 of file WidgetBase.h. References _constraintMap, and _eventMap. Referenced by SurfaceWidget::SurfaceWidget(), and WidgetItem::WidgetItem(). |
|
called if something about how it looks changes, does not include changes to the transform, just things like radius and color.
Reimplemented in GLUNodeWidget, and GLUEdgeWidget. Definition at line 387 of file WidgetBase.h. Referenced by EdgeWidget::setEndPoint(), NodeWidget::setRad(), EdgeWidget::setRad(), and EdgeWidget::setStartPoint(). |
|
apply a 4x4 transformation matrix, must be defined by a sub-class.
Implements WidgetItem. Definition at line 148 of file SurfaceWidget.h. References SurfaceWidget::_corners, and SurfaceWidget::NODE_LAST. |
|
WidgetItem::clone definition.
Implements WidgetItem. Definition at line 61 of file SurfaceWidget.h. References SurfaceWidget::cloneSurface(). |
|
override from SurfaceWidget
Implements SurfaceWidget. Definition at line 45 of file GLSurfaceWidget.h. References GLSurfaceWidget(). |
|
a child was deleted/ changed parent
Reimplemented in FrameWidget. Definition at line 280 of file WidgetBase.h. |
|
delete an event from the event map
Definition at line 344 of file WidgetBase.h. References _constraintMap, and _eventMap. |
|
main draw event...
Framework only, do not override, Might need to add functionality here later. Implements Renderable. Definition at line 209 of file WidgetBase.h. References WidgetItem::drawDef(), and r. |
|
override from WidgetItem
Implements WidgetItem. Definition at line 51 of file GLSurfaceWidget.h. References _visible, drawQuad(), and r. |
|
override this to customize
Definition at line 25 of file GLSurfaceWidget.cpp. References SurfaceWidget::_corners, _gluitem, SurfaceWidget::_lastPick, Renderable::_manip, GLUItem::drawSphere(), SurfaceWidget::getPlane(), GL_QUADS, glBegin(), glColor3f(), glColor3ub(), glEnd(), glMultMatrixf(), glNormal3f(), glPopMatrix(), glPopName(), glPushMatrix(), glPushName(), glVertex3f(), SurfaceWidget::LL, SurfaceWidget::LR, n, RENDERABLE_NAME, SurfaceWidget::UL, SurfaceWidget::UR, gutz::vec3f, x, y, and z. Referenced by drawDef(). |
|
Definition at line 366 of file WidgetBase.h. References _color. |
|
Definition at line 357 of file WidgetBase.h. References _constraintMap, and ConstraintMap. |
|
what is the event assigned to a key
Definition at line 338 of file WidgetBase.h. References _eventMap. |
|
getEvent, returns the event if one is defined, returns NO_EVENT if the mouse is up works for both: gutz::MouseEvent and gutz::MouseMoveEvent This function is usefull in implementation, externally use getEvent(unsigned int).
Definition at line 331 of file WidgetBase.h. References _eventMap, gutz::MouseEvent::getButton(), gutz::MouseEvent::isButtonDown(), and WidgetItem::NO_EVENT. Referenced by WidgetItem::mouseDef(), SurfaceWidget::mouseDef(), and SurfaceWidget::moveDef(). |
|
Definition at line 353 of file WidgetBase.h. References _eventMap. |
|
Definition at line 184 of file Renderable.h. References Renderable::_manip. |
|
get the plane that defines the surface, see gutz::plane
Definition at line 111 of file SurfaceWidget.h. References SurfaceWidget::getPoint(), SurfaceWidget::LL, SurfaceWidget::LR, gutz::planef, and SurfaceWidget::UL. Referenced by GLTFSurfaceWidget::drawDef(), drawQuad(), and SurfaceWidget::intersectPlane(). |
|
Definition at line 99 of file SurfaceWidget.h. References SurfaceWidget::_corners, and Renderable::_manip. Referenced by SurfaceWidget::getPlane(), SurfaceWidget::operator=(), and SurfaceWidget::setPoint(). |
|
get the "tightest 2D bounding polygon" in screen space
Reimplemented in EdgeWidget, and NodeWidget. Definition at line 302 of file WidgetBase.h. References WidgetItem::Point2, and WidgetItem::Point2Array. |
|
Definition at line 39 of file SurfaceWidget.cpp. References Renderable::_manip, SurfaceWidget::getPlane(), gutz::MouseEvent::getWorldPos(), gutz::planef, t, and gutz::vec3f. Referenced by SurfaceWidget::mouseDef(), and SurfaceWidget::moveDef(). |
|
Definition at line 141 of file Renderable.h. References Renderable::_on. |
|
Definition at line 177 of file Renderable.h. References Renderable::_selected. |
|
Definition at line 62 of file GLSurfaceWidget.h. References _visible. |
|
Definition at line 166 of file Renderable.h. |
|
a mouse event...
checks with parent, then calls mouseDef() Reimplemented from Renderable. Definition at line 220 of file WidgetBase.h. References WidgetItem::mouseDef(). |
|
a child was moused, called before their mouseDef.
return true if & only if parent will be handling the mouse event Reimplemented in TFViewWidget, FrameWidget, and SurfaceContentWidget. Definition at line 238 of file WidgetBase.h. |
|
override this one to implement mouse behavior
Reimplemented from WidgetItem. Definition at line 53 of file SurfaceWidget.cpp. References SurfaceWidget::_lastPick, WidgetItem::getEvent(), SurfaceWidget::intersectPlane(), WidgetItem::NO_EVENT, and SurfaceWidget::surfacePicked. |
|
a move event, checks with parent, then calls moveDef(). Framework only, do not override. Reimplemented from Renderable. Definition at line 245 of file WidgetBase.h. References WidgetItem::moveDef(). |
|
a child wants to be moved. if true, child does nothing (parent moves them) if false, child moves self Reimplemented in TFViewWidget, FrameWidget, and SurfaceContentWidget. Definition at line 267 of file WidgetBase.h. |
|
override this one to implement move behavior
Reimplemented from WidgetItem. Definition at line 71 of file SurfaceWidget.cpp. References SurfaceWidget::_lastPick, WidgetItem::getEvent(), SurfaceWidget::intersectPlane(), WidgetItem::NO_EVENT, and SurfaceWidget::surfacePickMoved. |
|
Definition at line 152 of file Renderable.h. References Renderable::_deleteMe. |
|
delete all events from the event map
Definition at line 347 of file WidgetBase.h. References _constraintMap, _eventMap, and ConstraintMap. |
|
Definition at line 35 of file GLSurfaceWidget.h. References _visible, and SurfaceWidget::operator=(). |
|
object changed
Implements WidgetItem. Reimplemented in SurfaceContentWidget. Definition at line 72 of file SurfaceWidget.h. References SurfaceWidget::_corners, SurfaceWidget::NODE_LAST, and SurfaceWidget::pointChanged. Referenced by SurfaceContentWidget::setChanged(). |
|
Definition at line 367 of file WidgetBase.h. References _color. Referenced by GLUEdgeWidget::GLUEdgeWidget(), and GLUNodeWidget::GLUNodeWidget(). |
|
Definition at line 358 of file WidgetBase.h. References _constraintMap. |
|
Definition at line 153 of file Renderable.h. References Renderable::_deleteMe, and Renderable::setOn(). |
|
Definition at line 354 of file WidgetBase.h. References _eventMap. |
|
Definition at line 122 of file SurfaceWidget.h. References SurfaceWidget::LL, and SurfaceWidget::setPoint(). Referenced by FrameWidget::delSurface(), and FrameWidget::setSurface(). |
|
Definition at line 123 of file SurfaceWidget.h. References SurfaceWidget::LR, and SurfaceWidget::setPoint(). Referenced by FrameWidget::delSurface(), and FrameWidget::setSurface(). |
|
Definition at line 185 of file Renderable.h. References Renderable::_manip. |
|
you have to call this to enable default interaction, OR customize the manipulators events yourself.
Definition at line 188 of file Renderable.h. References Renderable::_manip. |
|
Definition at line 142 of file Renderable.h. References Renderable::_on. Referenced by Renderable::setDelete(). |
|
a (new?) parent now owns you :)
Definition at line 283 of file WidgetBase.h. References Renderable::_manip. Referenced by SurfaceContentWidget::addContent(), SurfaceContentWidget::delContent(), and PolygonWidget::setPoints(). |
|
Definition at line 101 of file SurfaceWidget.h. References SurfaceWidget::_corners, WidgetItem::_invalidate(), Renderable::_manip, WidgetItem::_update(), SurfaceWidget::getPoint(), and SurfaceWidget::pointChanged. Referenced by SurfaceWidget::operator=(), SurfaceWidget::setLL(), SurfaceWidget::setLR(), SurfaceWidget::setUL(), and SurfaceWidget::setUR(). |
|
Definition at line 176 of file Renderable.h. References Renderable::_selected. |
|
Definition at line 124 of file SurfaceWidget.h. References SurfaceWidget::setPoint(), and SurfaceWidget::UL. Referenced by FrameWidget::delSurface(), and FrameWidget::setSurface(). |
|
Definition at line 125 of file SurfaceWidget.h. References SurfaceWidget::setPoint(), and SurfaceWidget::UR. Referenced by FrameWidget::delSurface(), and FrameWidget::setSurface(). |
|
Definition at line 63 of file GLSurfaceWidget.h. References _visible. |
|
Definition at line 40 of file smartptr.h. Referenced by Nrro::NrroIter< T >::NrroIter(). |
|
Definition at line 41 of file smartptr.h. |
|
These points are in LOCAL space.
Definition at line 175 of file SurfaceWidget.h. Referenced by SurfaceWidget::applyXform(), GLTFSurfaceWidget::drawDef(), drawQuad(), SurfaceWidget::getPoint(), SurfaceWidget::setChanged(), SurfaceWidget::setPoint(), and SurfaceWidget::SurfaceWidget(). |
|
does this object need to be deleted?
Definition at line 237 of file Renderable.h. Referenced by Renderable::needsDelete(), Renderable::Renderable(), and Renderable::setDelete(). |
|
Definition at line 67 of file GLSurfaceWidget.h. Referenced by drawQuad(). |
|
This point is in WORLD space!!
Definition at line 178 of file SurfaceWidget.h. Referenced by drawQuad(), SurfaceWidget::mouseDef(), and SurfaceWidget::moveDef(). |
|
|
is this renderable currently "render-able"?
Definition at line 235 of file Renderable.h. Referenced by Renderable::isOn(), Renderable::operator=(), Renderable::Renderable(), and Renderable::setOn(). |
|
is this renderable selected?
Definition at line 236 of file Renderable.h. Referenced by Renderable::isSelected(), Renderable::Renderable(), and Renderable::setSelected(). |
|
Definition at line 68 of file GLSurfaceWidget.h. Referenced by drawDef(), GLSurfaceWidget(), isVisible(), operator=(), and setVisible(). |
|
Definition at line 94 of file SurfaceWidget.h. |
|
pointChanged(int,vec3f), point index & the point itself
Definition at line 134 of file SurfaceWidget.h. Referenced by SurfaceWidget::setChanged(), and SurfaceWidget::setPoint(). |
|
signal: surfacePicked(const vec3f &pt);
Definition at line 137 of file SurfaceWidget.h. Referenced by SurfaceWidget::mouseDef(). |
|
signal: surfacePickMoved(const vec3f &)
Definition at line 140 of file SurfaceWidget.h. Referenced by SurfaceWidget::moveDef(). |