00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
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
00046
00047
00048
00049
00050
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
00068
00069 void SlicerMulti::confSliceView()
00070 {
00071 QHBoxLayout *topLayout = new QHBoxLayout( _qcentral, 1 );
00072
00073
00074
00075
00076 QGridLayout *_mainGrid = new QGridLayout(topLayout, 2,2);
00077
00078
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
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
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
00100
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
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