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

TFWidget.cpp

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 /// TFWidget.cpp
00019 ///  simianUI
00020 
00021 #include "TFWidget.h"
00022 #include <qlayout.h>
00023 #include <iostream>
00024 
00025 using namespace std;
00026 
00027 //////////////////////////////////////////////////////////////////////////
00028 /// construct
00029 //////////////////////////////////////////////////////////////////////////
00030 TFWidget::TFWidget(QWidget *parent, char *name, WFlags f)
00031 :QWidget(parent,name,f)
00032 {
00033 #if 0
00034    /// canvas
00035    _tfCanvas = new QCanvas(512,512);
00036    _tfCanvas->setDoubleBuffering(true);
00037    _tfCanvas->setBackgroundColor(QColor(0,0,0));
00038    
00039    /// view
00040    _tfView = new TFView(_tfCanvas,this,"slice canvas");
00041    _tfView->setVScrollBarMode(QScrollView::AlwaysOff);
00042    _tfView->setHScrollBarMode(QScrollView::AlwaysOff);
00043 #endif
00044 
00045    _tfRender = new TFGL(this, "TF GL Render Widget");
00046 
00047    conf();
00048 }
00049 
00050 //////////////////////////////////////////////////////////////////////////
00051 /// destruct
00052 //////////////////////////////////////////////////////////////////////////
00053 TFWidget::~TFWidget()
00054 {
00055 
00056 }
00057 
00058 //////////////////////////////////////////////////////////////////////////
00059 //////////////////////////////////////////////////////////////////////////
00060 /// public slots
00061 //////////////////////////////////////////////////////////////////////////
00062 //////////////////////////////////////////////////////////////////////////
00063 
00064 void TFWidget::setVolume(VolumeSP vol)
00065 {
00066    iVolumeChanged(vol);
00067 }
00068 
00069 void TFWidget::setTF()
00070 {
00071 
00072 }
00073 
00074 
00075 //////////////////////////////////////////////////////////////////////////
00076 //////////////////////////////////////////////////////////////////////////
00077 /// protected members
00078 //////////////////////////////////////////////////////////////////////////
00079 //////////////////////////////////////////////////////////////////////////
00080 
00081 //////////////////////////////////////////////////////////////////////////
00082 /// resize
00083 //////////////////////////////////////////////////////////////////////////
00084 void TFWidget::resizeEvent(QResizeEvent *re)
00085 {
00086    cerr << "widget resize" << endl;
00087   /// _tfCanvas->resize(re->size().width(), re->size().height());
00088    update();
00089 }
00090 
00091 
00092 //////////////////////////////////////////////////////////////////////////
00093 /// conf view
00094 //////////////////////////////////////////////////////////////////////////
00095 void TFWidget::conf()
00096 {
00097    // Create a layout to position the widgets
00098    QHBoxLayout *topLayout = new QHBoxLayout( this, 1 );
00099 
00100    /// 1 row, 1 column
00101    QGridLayout *grid = new QGridLayout(topLayout, 1,1);
00102 
00103    grid->addWidget(_tfRender,0,0);
00104 
00105 #if 0
00106    /// top widget
00107    grid->addWidget(_tfView, 0,0);
00108    /// connect the tf view to us
00109    connect(_tfView,SIGNAL(tfChanged()), SLOT(setTF()));
00110    /// connect us to the tf view
00111    _tfView->connect(this,SIGNAL(iVolumeChanged(VolumeSP)), SLOT(setVolume(VolumeSP)));
00112 #endif
00113 }

Send questions, comments, and bug reports to:
jmk