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

SlicerMulti.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 
00019 ///SlicerMulti.cpp
00020 ///  simianUI
00021 
00022 #include "SlicerMulti.h"
00023 #include "SlicerWidget.h"
00024 #include <qlayout.h>
00025 
00026 #include <fields/FieldProperties.h>
00027 
00028 #include <iostream>
00029 
00030 using namespace std;
00031 
00032 ////////////////////////////////////////////////////////////////////////////
00033 /// construct
00034 ////////////////////////////////////////////////////////////////////////////
00035 SlicerMulti::SlicerMulti(QWidget *parent, const char *name, WFlags wf)
00036 : SlicerBase(3,parent,name,wf)
00037 {
00038    confMenu();
00039    setCentralWidget(_qcentral);
00040    confSliceView();
00041 }
00042 
00043 ////////////////////////////////////////////////////////////////////////////
00044 ////////////////////////////////////////////////////////////////////////////
00045 /// public slots
00046 ////////////////////////////////////////////////////////////////////////////
00047 ////////////////////////////////////////////////////////////////////////////
00048 
00049 ////////////////////////////////////////////////////////////////////////////
00050 /// setVolume
00051 ////////////////////////////////////////////////////////////////////////////
00052 void SlicerMulti::setVolume(VolumeSP vol)
00053 {
00054    if(vol.isNull())
00055    {
00056       cerr << typeid(*this).name() 
00057          << "::setVolume(), attempting to set a null volume" << endl;
00058       return;
00059    }
00060    _vol = vol;
00061    
00062    volumeChanged(_vol);
00063 }
00064 
00065 
00066 ////////////////////////////////////////////////////////////////////////////
00067 /// configure slice view
00068 ////////////////////////////////////////////////////////////////////////////
00069 void SlicerMulti::confSliceView()
00070 {
00071    QHBoxLayout *topLayout = new QHBoxLayout( _qcentral, 1 );
00072    // Create a grid layout the slice widgets
00073    // 2 rows, 2 columns
00074    // slicer slicer
00075    // slicer info
00076    QGridLayout *_mainGrid = new QGridLayout(topLayout, 2,2);
00077 
00078    /// X axis view
00079    SlicerWidget *slicer1 = new SlicerWidget(_qcentral, "slicer 1");
00080    slicer1->setAxis(SlicerWidget::X_AXIS);
00081    slicer1->connect(this, SIGNAL(volumeChanged(VolumeSP)), SLOT(setVolume(VolumeSP)));
00082    slicer1->connect(this,SIGNAL(filterChanged(int)), SLOT(setFilter(int)));
00083    _mainGrid->addWidget(slicer1,0,0);
00084 
00085    /// Z axis view
00086    SlicerWidget *slicer2 = new SlicerWidget(_qcentral, "slicer 2");
00087    slicer2->setAxis(SlicerWidget::Z_AXIS);
00088    slicer2->connect(this, SIGNAL(volumeChanged(VolumeSP)), SLOT(setVolume(VolumeSP)));
00089    slicer2->connect(this,SIGNAL(filterChanged(int)), SLOT(setFilter(int)));
00090    _mainGrid->addWidget(slicer2, 1,0);
00091 
00092    /// Y axis view
00093    SlicerWidget *slicer3 = new SlicerWidget(_qcentral, "slicer 3");
00094    slicer3->setAxis(SlicerWidget::Y_AXIS);
00095    slicer3->connect(this, SIGNAL(volumeChanged(VolumeSP)), SLOT(setVolume(VolumeSP)));
00096    slicer3->connect(this,SIGNAL(filterChanged(int)), SLOT(setFilter(int)));
00097    _mainGrid->addWidget(slicer3, 0,1);
00098 
00099    /// now for spagettii
00100    /// connect them all together!
00101    slicer1->connect(slicer2, SIGNAL(volPickPosChanged(int,int,int)), SLOT(setVolPos(int,int,int)));
00102    slicer1->connect(slicer3, SIGNAL(volPickPosChanged(int,int,int)), SLOT(setVolPos(int,int,int)));
00103    connect(slicer1,SIGNAL(volPickPosChanged(int,int,int)), SLOT(setProbePos(int,int,int)));
00104 
00105    slicer2->connect(slicer1, SIGNAL(volPickPosChanged(int,int,int)), SLOT(setVolPos(int,int,int)));
00106    slicer2->connect(slicer3, SIGNAL(volPickPosChanged(int,int,int)), SLOT(setVolPos(int,int,int)));
00107    connect(slicer2,SIGNAL(volPickPosChanged(int,int,int)), SLOT(setProbePos(int,int,int)));
00108 
00109    slicer3->connect(slicer1, SIGNAL(volPickPosChanged(int,int,int)), SLOT(setVolPos(int,int,int)));
00110    slicer3->connect(slicer2, SIGNAL(volPickPosChanged(int,int,int)), SLOT(setVolPos(int,int,int)));
00111    connect(slicer3,SIGNAL(volPickPosChanged(int,int,int)), SLOT(setProbePos(int,int,int)));
00112 
00113    /// create the info widget
00114    _sliceInfo = new SlicerInfo(_qcentral, "info tabs");
00115    _mainGrid->addWidget(_sliceInfo,1,1);
00116    _sliceInfo->connect(this, SIGNAL(volumeChanged(VolumeSP)), SLOT(setVolume(VolumeSP)));
00117    _sliceInfo->connect(this, SIGNAL(probePosChanged(int,int,int)), SLOT(setProbePos(int,int,int)));
00118 }
00119 
00120 

Send questions, comments, and bug reports to:
jmk