#include <TFItem.h>
Inheritance diagram for TFItem:
This is the generic tf item that the TFView will see, for the most part all external interactions are through the TFItemVec. TFItems are the bridge between simianlib TFElements and the QT interface. An items behavior should be defined by the Element they represent, the Item's role is to comunicate changes to element and display them from the element. You should endevor to make sure "behavior" resides in the simianlib Element and only "interaction" and "display" stuff live in the Item.
Definition at line 54 of file TFItem.h.
Public Member Functions | |
TFItem (QCanvas *canvas, TFEltSP elt) | |
construct | |
virtual | ~TFItem () |
TFEltSP | getElt () const |
transfer function element that we own | |
void | setElt (TFEltSP elt) |
void | setAxisX (int elm) |
which TF axies are we visualizing??? could be exteded to 3D... | |
int | getAxisX () const |
void | setAxisY (int elm) |
int | getAxisY () const |
tfVec2 | getTFPosCA (int i) |
get/set Pos in TF element for the Current Axies | |
void | setTFPosCA (int i, tfVec2 pos) |
setTFPosCA | |
void | update () |
checks if anything in the TFElement changed if it has, calls updateDef() | |
bool | deleteMe () const |
indicate to parents or pointers that we need to be removed | |
virtual tfMat3 | getXform () const |
get the transformation | |
virtual tfMat3 | getInvXform () const |
virtual tfVec2 | xform (tfVec2 pt) const |
transform a point (tf -> canvas) | |
virtual STF::tfSType | xformX (STF::tfSType x) const |
virtual STF::tfSType | xformY (STF::tfSType y) const |
virtual tfVec2 | invXform (tfVec2 pt) const |
inverse transform (canvas -> tf) | |
virtual STF::tfSType | invXformX (STF::tfSType x) const |
virtual STF::tfSType | invXformY (STF::tfSType y) const |
tfVec2 | getBorder () const |
set the border space around tf, in pixels (canvas space) | |
void | setBorder (tfVec2 b) |
tfVec2 | getScale () const |
set the scale factor to go from [0-1] tf space to "canvas space" and the inverse of that, ie. | |
tfVec2 | getInvScale () const |
void | setScale (tfVec2 scales) |
setScale | |
virtual void | setPoints (QPointArray p) |
Set Points. | |
QPointArray | areaPoints () const |
Area points. | |
virtual void | childUpdate (CanvasItemBase *child) |
TODO: as far as I can tell child update is unused!! | |
virtual void | childMovedBy (CanvasItemBase *child, gutz::vec3d dv) |
child Moveby (relative motion) | |
virtual void | childMoved (CanvasItemBase *child, gutz::vec3d last, gutz::vec3d point) |
child moved (absolute modtion) | |
virtual void | moveBy (double dx, double dy) |
virtual void | moveBy (gutz::vec3d dv) |
this (incrmentaly) translates each node by differential vec "dv" | |
virtual void | setSelected (bool yes) |
is it selected? (currently being modified) bool isSelected() declared in QCanvasItem | |
virtual void | setActive (bool yes) |
has it been selected and modifiable as a group? bool isActive() declared in QCanvasItem | |
bool | getUpdateLinks () const |
do you want this object to update other objects that are linked to it? | |
void | setUpdateLinks (bool yes) |
Protected Member Functions | |
virtual void | updateDef () |
called by update, for subclasses | |
void | setTransform () |
set Transform | |
virtual void | drawShape (QPainter &p) |
Draw Shape. | |
void | nukePoints () |
Nuke Points. | |
void | nukeEdges () |
Nuke Edges. | |
int | getEdgeIndex (CanvasItemBase *ptr) |
returns -1 if not an edge/node respectively | |
int | getNodeIndex (CanvasItemBase *ptr) |
node index | |
void | updatePen () |
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 | |
TFEltSP | _elt |
tfVec2 | _scale |
tfVec2 | _invScale |
tfVec2 | _border |
tfMat3 | _xform |
tfMat3 | _invXform |
int | _axisX |
int | _axisY |
int | _lastEltMod |
int | _lastElmMod |
id for last elt mod | |
bool | _done |
id for last element mod | |
NodeItemVec | _points |
EdgeItemVec | _edges |
CompositeItem * | _comp |
bool | _updateLinks |
Friends | |
class | SmartPtr |
class | SmartPtrRef |
|
construct elt Definition at line 36 of file TFItem.cpp. References _elt, _lastElmMod, _lastEltMod, TFEltSP::getChangeID(), height, gutz::SmartPtrRef< TFElement >::isNull(), setTransform(), STF::tfSType, and width. |
|
Definition at line 58 of file TFItem.h. References _elt. |
|
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(). |
|
Area points.
Implements CanvasItemIF. Definition at line 360 of file CanvasItems.cpp. References PolygonEdit::_points, x, and y. |
|
child moved (absolute modtion)
Implements CompositeItem. Reimplemented in TFBoxItem. Definition at line 260 of file commonQt/canvas/CanvasItems.h. |
|
child Moveby (relative motion)
Implements CompositeItem. Reimplemented in TFBoxItem. Definition at line 258 of file commonQt/canvas/CanvasItems.h. |
|
TODO: as far as I can tell child update is unused!!
Implements CompositeItem. Reimplemented in TFBoxItem. Definition at line 256 of file commonQt/canvas/CanvasItems.h. |
|
indicate to parents or pointers that we need to be removed
Definition at line 81 of file TFItem.h. References _done. |
|
Draw Shape.
Implements CanvasItemIF. Definition at line 417 of file CanvasItems.cpp. |
|
Definition at line 67 of file TFItem.h. References _axisX. |
|
Definition at line 69 of file TFItem.h. References _axisY. |
|
set the border space around tf, in pixels (canvas space)
|
|
returns -1 if not an edge/node respectively
Definition at line 424 of file CanvasItems.cpp. References PolygonEdit::_edges. Referenced by TFBoxItem::childMoved(), and TFBoxItem::childMovedBy(). |
|
transfer function element that we own
Definition at line 61 of file TFItem.h. References _elt. |
|
|
|
|
|
node index
Definition at line 435 of file CanvasItems.cpp. References PolygonEdit::_points. Referenced by TFBoxItem::childMoved(), and TFBoxItem::childMovedBy(). |
|
set the scale factor to go from [0-1] tf space to "canvas space" and the inverse of that, ie. scale should probably just be the canvas width and height. |
|
get/set Pos in TF element for the Current Axies get tf element make sure we are good get position get elements that correspond to current axes Definition at line 70 of file TFItem.cpp. References _axisX, _axisY, _elt, TFElement::getPos(), TFElement::getPosVec(), gutz::SmartPtrRef< TFElement >::getPtr(), tfVec2, and tfVec2_bad. |
|
do you want this object to update other objects that are linked to it?
Definition at line 117 of file commonQt/canvas/CanvasItems.h. References CanvasItemIF::_updateLinks. |
|
get the transformation
|
|
inverse transform (canvas -> tf)
Definition at line 93 of file TFItem.h. References _invXform, tfVec2, and gutz::mat3< STF::tfSType >::tpoint(). |
|
Definition at line 94 of file TFItem.h. Referenced by TFBoxItem::setTFLeft(), and TFBoxItem::setTFRight(). |
|
Definition at line 95 of file TFItem.h. Referenced by TFBoxItem::setTFBottom(), and TFBoxItem::setTFTop(). |
|
this (incrmentaly) translates each node by differential vec "dv"
Definition at line 446 of file CanvasItems.cpp. References PolygonEdit::_points. |
|
Definition at line 262 of file commonQt/canvas/CanvasItems.h. |
|
Nuke Edges.
Definition at line 406 of file CanvasItems.cpp. References PolygonEdit::_edges, and EdgeItemVec. Referenced by PolygonEdit::setPoints(), and PolygonEdit::~PolygonEdit(). |
|
Nuke Points.
Definition at line 395 of file CanvasItems.cpp. References PolygonEdit::_points, and NodeItemVec. Referenced by PolygonEdit::setPoints(), and PolygonEdit::~PolygonEdit(). |
|
has it been selected and modifiable as a group? bool isActive() declared in QCanvasItem
Definition at line 68 of file CanvasItems.cpp. |
|
which TF axies are we visualizing??? could be exteded to 3D... later Definition at line 66 of file TFItem.h. References _axisX. |
|
Definition at line 68 of file TFItem.h. References _axisY. |
|
Definition at line 99 of file TFItem.h. References _border, and setTransform(). |
|
Definition at line 62 of file TFItem.h. References _elt. |
|
Set Points. create nodes create points Definition at line 374 of file CanvasItems.cpp. References PolygonEdit::_edges, PolygonEdit::_points, EdgeItemSP, NodeItemSP, PolygonEdit::nukeEdges(), and PolygonEdit::nukePoints(). Referenced by TFView::TFView(). |
|
setScale
Definition at line 102 of file TFItem.cpp. References _invScale, _scale, setTransform(), gutz::vec2< tfSType >::x, and gutz::vec2< tfSType >::y. |
|
is it selected? (currently being modified) bool isSelected() declared in QCanvasItem
Definition at line 61 of file CanvasItems.cpp. |
|
setTFPosCA get tf element make sure we are good Definition at line 86 of file TFItem.cpp. References _axisX, _axisY, _elt, TFElement::getPos(), TFElement::getPosVec(), gutz::SmartPtrRef< TFElement >::getPtr(), TFElement::setPos(), gutz::vec2< tfSType >::x, and gutz::vec2< tfSType >::y. |
|
set Transform set to identity TODO: looks like the mat3 inverse is fucked up, shouldn't need a transpose, need to fix this! Definition at line 112 of file TFItem.cpp. References _border, _invXform, _scale, _xform, gutz::mat3< STF::tfSType >::eye(), gutz::mat3< STF::tfSType >::inv(), scale, gutz::vec2< tfSType >::x, and gutz::vec2< tfSType >::y. Referenced by setBorder(), setScale(), TFItem(), and update(). |
|
Definition at line 118 of file commonQt/canvas/CanvasItems.h. References CanvasItemIF::_updateLinks. |
|
checks if anything in the TFElement changed if it has, calls updateDef()
Definition at line 56 of file TFItem.cpp. References _elt, _lastElmMod, _lastEltMod, TFEltSP::getChangeID(), gutz::SmartPtrRef< TFElement >::isNull(), setTransform(), and updateDef(). |
|
called by update, for subclasses
Reimplemented in TFBoxItem. Definition at line 110 of file TFItem.h. Referenced by update(). |
|
|
|
transform a point (tf -> canvas)
Definition at line 88 of file TFItem.h. References _xform, tfVec2, and gutz::mat3< STF::tfSType >::tpoint(). |
|
Definition at line 89 of file TFItem.h. Referenced by TFBoxItem::getTFLeft(), and TFBoxItem::getTFRight(). |
|
Definition at line 90 of file TFItem.h. Referenced by TFBoxItem::getTFBottom(), and TFBoxItem::getTFTop(). |
|
Definition at line 40 of file smartptr.h. Referenced by Nrro::NrroIter< T >::NrroIter(). |
|
Definition at line 41 of file smartptr.h. |
|
Definition at line 123 of file TFItem.h. Referenced by getAxisX(), TFBoxItem::getTFLeft(), getTFPosCA(), TFBoxItem::getTFRight(), setAxisX(), TFBoxItem::setTFLeft(), setTFPosCA(), and TFBoxItem::setTFRight(). |
|
Definition at line 124 of file TFItem.h. Referenced by getAxisY(), TFBoxItem::getTFBottom(), getTFPosCA(), TFBoxItem::getTFTop(), setAxisY(), TFBoxItem::setTFBottom(), setTFPosCA(), and TFBoxItem::setTFTop(). |
|
Definition at line 118 of file TFItem.h. Referenced by getBorder(), setBorder(), and setTransform(). |
|
Definition at line 129 of file commonQt/canvas/CanvasItems.h. Referenced by CanvasItemIF::CanvasItemIF(), NodeItem::moveBy(), and EdgeItem::moveBy(). |
|
id for last element mod
Definition at line 129 of file TFItem.h. Referenced by deleteMe(). |
|
Definition at line 276 of file commonQt/canvas/CanvasItems.h. Referenced by PolygonEdit::getEdgeIndex(), TFBoxItem::initBox(), PolygonEdit::nukeEdges(), and PolygonEdit::setPoints(). |
|
Definition at line 112 of file TFItem.h. Referenced by getElt(), getTFPosCA(), setElt(), setTFPosCA(), TFItem(), update(), and ~TFItem(). |
|
Definition at line 117 of file TFItem.h. Referenced by getInvScale(), and setScale(). |
|
Definition at line 121 of file TFItem.h. Referenced by getInvXform(), invXform(), invXformX(), invXformY(), and setTransform(). |
|
id for last elt mod
|
|
|
|
Definition at line 275 of file commonQt/canvas/CanvasItems.h. Referenced by PolygonEdit::areaPoints(), PolygonEdit::getNodeIndex(), TFBoxItem::initBox(), PolygonEdit::moveBy(), PolygonEdit::nukePoints(), TFBoxItem::setBoxDims(), and PolygonEdit::setPoints(). |
|
Definition at line 116 of file TFItem.h. Referenced by getScale(), setScale(), and setTransform(). |
|
Definition at line 131 of file commonQt/canvas/CanvasItems.h. Referenced by CanvasItemIF::CanvasItemIF(), CanvasItemIF::getUpdateLinks(), NodeItem::moveBy(), EdgeItem::moveBy(), NodeItem::setPoint(), and CanvasItemIF::setUpdateLinks(). |
|
Definition at line 120 of file TFItem.h. Referenced by getXform(), setTransform(), xform(), xformX(), and xformY(). |