arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

TFItemSTD.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     6-20-03
00005 //                   ________    ____   ___ 
00006 //                  |        \  /    | /  /
00007 //                  +---+     \/     |/  /
00008 //                  +--+|  |\    /|     < 
00009 //                  |  ||  | \  / |  |\  \ 
00010 //                  |      |  \/  |  | \  \ 
00011 //                   \_____|      |__|  \__\
00012 //                       Copyright  2003 
00013 //                      Joe Michael Kniss
00014 //                   <<< jmk@cs.utah.edu >>>
00015 //               "All Your Base are Belong to Us"
00016 //-------------------------------------------------------------------------
00017 
00018 /// TFItemSTD.h
00019 ///  simianUI
00020 
00021 #ifndef __SIMIAN_UI_TF_ITEM_STD_DOT_H
00022 #define __SIMIAN_UI_TF_ITEM_STD_DOT_H
00023 
00024 #include "TFItem.h"
00025 #include <tf/TFElementSTD.h>
00026 
00027 class TFBoxItem : public TFItem {
00028 public:
00029    TFBoxItem(QCanvas *canvas, TFElementBox *belt);
00030    virtual ~TFBoxItem() {} 
00031 
00032    enum BOX_ITEM_VERT_IDS { LL, LR, TL, TR, VERT_LAST };
00033    enum BOX_ITEM_EDGE_IDS { L, R, T, B, EDGE_LAST };
00034 
00035    virtual void setBoxDims(gutz::vec2f ll, gutz::vec2f ur);
00036 
00037    virtual void childUpdate(CanvasItemBase *child);
00038    virtual void childMovedBy(CanvasItemBase *child, gutz::vec3d dv);
00039    virtual void childMoved(CanvasItemBase *child, gutz::vec3d last, gutz::vec3d point);
00040 
00041    /// elements in tf element based on current axies
00042    /// left
00043    STF::tfSType getTFLeft() const   { return xformX(_belt->getMin()[_axisX]); }
00044    void         setTFLeft(STF::tfSType left)
00045    {  _belt->getPos(TFElementBox::LL)[_axisX] = invXformX(left); }
00046    /// right
00047    STF::tfSType getTFRight() const  { return xformX(_belt->getMax()[_axisX]); }
00048    void         setTFRight(STF::tfSType right)
00049    {  _belt->getPos(TFElementBox::UR)[_axisX] = invXformX(right); }
00050    /// top
00051    STF::tfSType getTFTop() const    { return xformY(_belt->getMax()[_axisY]); }
00052    void         setTFTop(STF::tfSType top)
00053    {  _belt->getPos(TFElementBox::UR)[_axisY] = invXformY(top); }
00054    /// bottom
00055    STF::tfSType getTFBottom() const { return xformY(_belt->getMin()[_axisY]); }
00056    void         setTFBottom(STF::tfSType bottom)
00057    { _belt->getPos(TFElementBox::LL)[_axisY] = invXformY(bottom); }
00058 
00059 protected:
00060    virtual void updateDef();
00061    virtual void initBox();
00062    virtual void setDims();
00063 
00064    /// these take delta vectors, not absolute,
00065    /// the absolute position is contained in the object
00066    virtual void moveNode(int nodeIdx, gutz::vec3d dv);
00067    virtual void moveEdge(int edgeIdx, gutz::vec3d dv);
00068    
00069    TFElementBoxSP _belt;
00070 
00071    bool _moving;
00072 
00073 };
00074 
00075 
00076 #endif

Send questions, comments, and bug reports to:
jmk