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

TFViewWidget.cpp

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     9-01-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 // TFViewWidget.cpp
00019 
00020 #include "TFViewWidget.h"
00021 #include <iostream>
00022 
00023 using namespace gutz;
00024 using namespace std;
00025 
00026 ///////////////////////////////////////////////////////////////////////////
00027 // Construct
00028 ///////////////////////////////////////////////////////////////////////////
00029 TFViewWidget::TFViewWidget(TFSurfaceWidget *const surfProto, 
00030                            const WidgetFactory &wf, 
00031                            WidgetItem *parent, 
00032                            const gutz::vec3f &ll,
00033                            const gutz::vec3f &lr,
00034                            const gutz::vec3f &ul,
00035                            const gutz::vec3f &ur)
00036 : FrameWidget(wf,parent,ll,lr,ul,ur), _tfsurf(0), _axes(0,1)
00037 {
00038    if(surfProto)
00039       setTFSurface(surfProto->cloneTFSurface());
00040 }
00041 
00042 ///////////////////////////////////////////////////////////////////////////
00043 // set TF Surface
00044 ///////////////////////////////////////////////////////////////////////////
00045 void TFViewWidget::setTFSurface(TFSurfaceWidget *sw)
00046 {
00047    _tfsurf = sw;
00048    /// we let the FrameWidget connect the surface to the nodes
00049    setSurface(_tfsurf);
00050 }
00051 
00052 ///////////////////////////////////////////////////////////////////////////
00053 // del TF Surface
00054 ///////////////////////////////////////////////////////////////////////////
00055 void TFViewWidget::delTFSurface()
00056 {
00057    _tfsurf = 0;
00058    /// we let the FrameWidget disconnect the surface
00059    delSurface();
00060 }
00061 
00062 ///////////////////////////////////////////////////////////////////////////
00063 // mouseChild
00064 ///////////////////////////////////////////////////////////////////////////
00065 bool TFViewWidget::mouseChild(WidgetItem *child, const gutz::MouseEvent &me)
00066 {
00067    if( FrameWidget::mouseChild(child, me) )
00068    {
00069       cerr << " frame handled child " << endl;
00070       return true;
00071    }
00072 
00073    if( child == _tfsurf.getPtr() )
00074    {
00075       cerr << " -- tf surface widget moused -- " << endl;
00076    }
00077 
00078    return false;
00079 }
00080 
00081 ///////////////////////////////////////////////////////////////////////////
00082 // moveChild
00083 ///////////////////////////////////////////////////////////////////////////
00084 bool TFViewWidget::moveChild(WidgetItem *child, const gutz::MouseMoveEvent &mme)
00085 {
00086    if( FrameWidget::moveChild(child, mme) )
00087       return true;
00088 
00089    return false;
00090 }
00091 

Send questions, comments, and bug reports to:
jmk