Biomechanical Joint Model
 Author: Anderson Maciel

discretizer.cpp

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Form implementation generated from reading ui file 'discretizer.ui'
00003 **
00004 ** Created: Fri May 13 20:01:00 2005
00005 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.2.3   edited May 19 14:22 $)
00006 **
00007 ** WARNING! All changes made in this file will be lost!
00008 ****************************************************************************/
00009 
00010 #include "discretizer.h"
00011 
00012 #include <qvariant.h>
00013 #include <come_discretizerqglwidget.h>
00014 #include <qgroupbox.h>
00015 #include <qcheckbox.h>
00016 #include <qslider.h>
00017 #include <qlabel.h>
00018 #include <qspinbox.h>
00019 #include <qpushbutton.h>
00020 #include <qlineedit.h>
00021 #include <qtextedit.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025 #include <qaction.h>
00026 #include <qmenubar.h>
00027 #include <qpopupmenu.h>
00028 #include <qtoolbar.h>
00029 #include <qimage.h>
00030 #include <qpixmap.h>
00031 
00032 #include "discretizer.ui.h"
00033 static const char* const image1_data[] = { 
00034 "22 22 5 1",
00035 ". c None",
00036 "# c #000000",
00037 "c c #848200",
00038 "a c #ffff00",
00039 "b c #ffffff",
00040 "......................",
00041 "......................",
00042 "......................",
00043 "............####....#.",
00044 "...........#....##.##.",
00045 "..................###.",
00046 ".................####.",
00047 ".####...........#####.",
00048 "#abab##########.......",
00049 "#babababababab#.......",
00050 "#ababababababa#.......",
00051 "#babababababab#.......",
00052 "#ababab###############",
00053 "#babab##cccccccccccc##",
00054 "#abab##cccccccccccc##.",
00055 "#bab##cccccccccccc##..",
00056 "#ab##cccccccccccc##...",
00057 "#b##cccccccccccc##....",
00058 "###cccccccccccc##.....",
00059 "##cccccccccccc##......",
00060 "###############.......",
00061 "......................"};
00062 
00063 static const char* const image2_data[] = { 
00064 "22 22 5 1",
00065 ". c None",
00066 "# c #000000",
00067 "a c #848200",
00068 "b c #c1c1c1",
00069 "c c #cab5d1",
00070 "......................",
00071 ".####################.",
00072 ".#aa#bbbbbbbbbbbb#bb#.",
00073 ".#aa#bbbbbbbbbbbb#bb#.",
00074 ".#aa#bbbbbbbbbcbb####.",
00075 ".#aa#bbbccbbbbbbb#aa#.",
00076 ".#aa#bbbccbbbbbbb#aa#.",
00077 ".#aa#bbbbbbbbbbbb#aa#.",
00078 ".#aa#bbbbbbbbbbbb#aa#.",
00079 ".#aa#bbbbbbbbbbbb#aa#.",
00080 ".#aa#bbbbbbbbbbbb#aa#.",
00081 ".#aaa############aaa#.",
00082 ".#aaaaaaaaaaaaaaaaaa#.",
00083 ".#aaaaaaaaaaaaaaaaaa#.",
00084 ".#aaa#############aa#.",
00085 ".#aaa#########bbb#aa#.",
00086 ".#aaa#########bbb#aa#.",
00087 ".#aaa#########bbb#aa#.",
00088 ".#aaa#########bbb#aa#.",
00089 ".#aaa#########bbb#aa#.",
00090 "..##################..",
00091 "......................"};
00092 
00093 static const char* const image3_data[] = { 
00094 "22 22 88 2",
00095 "Qt c None",
00096 ".n c #403c3c",
00097 "#p c #a4989a",
00098 ".s c #a5989b",
00099 ".k c #d90026",
00100 ".S c #d90126",
00101 ".B c #d90127",
00102 ".y c #d90227",
00103 ".K c #d90228",
00104 ".H c #da0429",
00105 ".8 c #da042a",
00106 ".V c #da072c",
00107 ".j c #da082d",
00108 ".u c #da092e",
00109 ".R c #dc1135",
00110 ".p c #dc1336",
00111 "#a c #dd1c3e",
00112 "#e c #dd1d3f",
00113 ".5 c #de2243",
00114 ".z c #de2344",
00115 ".7 c #de2445",
00116 ".l c #de2747",
00117 ".L c #df2b4a",
00118 "#b c #df2d4d",
00119 ".d c #e02c4b",
00120 "## c #e02e4d",
00121 ".c c #e03352",
00122 ".e c #e03452",
00123 ".A c #e13755",
00124 ".X c #e13856",
00125 "#t c #e13a58",
00126 "#s c #e23f5c",
00127 ".T c #e2415e",
00128 ".b c #e24561",
00129 "#k c #e34662",
00130 ".6 c #e34b66",
00131 ".J c #e4506a",
00132 ".i c #e45a72",
00133 ".Q c #e54e68",
00134 ".P c #e5506a",
00135 "#j c #e5526b",
00136 ".M c #e5536d",
00137 ".9 c #e5546d",
00138 ".v c #e55c74",
00139 ".0 c #e6556e",
00140 ".G c #e65770",
00141 ".f c #e65d75",
00142 "#u c #e6657c",
00143 ".q c #e7687e",
00144 "#r c #e76d82",
00145 ".t c #ea798d",
00146 ".C c #ea7a8e",
00147 ".Z c #ea8093",
00148 "#h c #ec8194",
00149 ".a c #ec8497",
00150 "#. c #ed8597",
00151 ".O c #ee8a9c",
00152 ".W c #ee8c9d",
00153 "#g c #ee91a2",
00154 ".x c #ef93a3",
00155 ".o c #ef94a4",
00156 ".4 c #f09baa",
00157 ".3 c #f09dab",
00158 ".1 c #f19ead",
00159 ".E c #f1a1af",
00160 ".m c #f2a8b4",
00161 "#c c #f2aab6",
00162 "#v c #f2afba",
00163 ".I c #f3bbc4",
00164 ".g c #f4b6c0",
00165 "#q c #f4bbc4",
00166 ".N c #f5bdc7",
00167 ".D c #f6c4cd",
00168 ".h c #f6c8d0",
00169 ".Y c #f6ccd4",
00170 "#o c #f7ccd3",
00171 ".U c #f7cdd4",
00172 "#m c #f8cfd7",
00173 "#l c #f8d2d9",
00174 ".# c #f8d4da",
00175 "#n c #f8d4db",
00176 ".2 c #f9dae0",
00177 ".r c #f9dde2",
00178 ".w c #fae0e5",
00179 "#f c #fbe4e8",
00180 "#i c #fbe5e9",
00181 "#d c #fce8eb",
00182 ".F c #ffffff",
00183 "QtQtQtQtQtQtQt.#.a.b.c.d.e.f.gQtQtQtQtQtQtQt",
00184 "QtQtQtQtQt.h.i.j.k.k.k.k.k.k.k.l.mQtQtQtQtQt",
00185 "QtQtQt.n.o.p.k.k.k.k.k.k.k.k.k.k.k.q.rQtQtQt",
00186 "QtQt.s.t.u.k.k.k.k.k.k.k.k.k.k.k.k.k.v.wQtQt",
00187 "QtQt.x.k.k.k.k.k.k.k.k.k.y.z.A.p.B.k.k.CQtQt",
00188 "Qt.D.p.k.k.k.k.k.k.k.k.k.j.E.F.G.H.k.k.u.IQt",
00189 "Qt.J.k.k.k.k.k.k.k.k.K.L.M.N.F.O.P.Q.R.S.TQt",
00190 ".U.j.k.k.k.k.k.k.k.k.V.W.F.F.F.F.F.F.X.K.k.Y",
00191 ".Z.k.k.k.k.k.k.k.k.k.H.0.1.2.F.N.3.4.5.B.k.Z",
00192 ".6.k.k.k.k.k.k.k.k.k.k.k.j.E.F.G.H.k.k.k.k.6",
00193 ".7.k.k.k.k.k.k.k.k.k.k.k.8.9#.##.K.k.k.k.k.7",
00194 "#a.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k#a",
00195 "#b.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k#b",
00196 ".f.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.f",
00197 "#c.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.E",
00198 "#d.l.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k#e#f",
00199 "Qt#g.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k#hQt",
00200 "Qt#i#j.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k.k#k.wQt",
00201 "QtQt#l.A.k.k.k.k.k.k.k.k.k.k.k.k.k.k.A#mQtQt",
00202 "QtQtQt#n.v.k.k.k.k.k.k.k.k.k.k.k.k#j#oQtQtQt",
00203 "QtQtQtQt#p.E.c.k.k.k.k.k.k.k.k.l#g#iQtQtQtQt",
00204 "QtQtQtQtQtQtQt#q#r#s.d.c#t#u#v#dQtQtQtQtQtQt"};
00205 
00206 
00207 /*
00208  *  Constructs a discretizer as a child of 'parent', with the
00209  *  name 'name' and widget flags set to 'f'.
00210  *
00211  */
00212 discretizer::discretizer( QWidget* parent, const char* name, WFlags fl )
00213     : QMainWindow( parent, name, fl ),
00214       image1( (const char **) image1_data ),
00215       image2( (const char **) image2_data ),
00216       image3( (const char **) image3_data )
00217 {
00218     (void)statusBar();
00219     if ( !name )
00220         setName( "discretizer" );
00221     setCentralWidget( new QWidget( this, "qt_central_widget" ) );
00222 
00223     openglArea = new COME_DiscretizerQGLWidget( centralWidget(), "openglArea" );
00224     openglArea->setGeometry( QRect( 220, -2, 800, 711 ) );
00225 
00226     groupBox1 = new QGroupBox( centralWidget(), "groupBox1" );
00227     groupBox1->setGeometry( QRect( 10, 280, 200, 150 ) );
00228 
00229     cbNormals = new QCheckBox( groupBox1, "cbNormals" );
00230     cbNormals->setGeometry( QRect( 114, 28, 80, 22 ) );
00231 
00232     cbMesh = new QCheckBox( groupBox1, "cbMesh" );
00233     cbMesh->setGeometry( QRect( 20, 28, 94, 22 ) );
00234     cbMesh->setChecked( TRUE );
00235 
00236     cbGrid = new QCheckBox( groupBox1, "cbGrid" );
00237     cbGrid->setGeometry( QRect( 20, 58, 94, 22 ) );
00238 
00239     cbSpheres = new QCheckBox( groupBox1, "cbSpheres" );
00240     cbSpheres->setGeometry( QRect( 20, 90, 93, 22 ) );
00241 
00242     cbLinks = new QCheckBox( groupBox1, "cbLinks" );
00243     cbLinks->setGeometry( QRect( 20, 120, 94, 22 ) );
00244 
00245     groupBox5 = new QGroupBox( centralWidget(), "groupBox5" );
00246     groupBox5->setGeometry( QRect( 10, 438, 201, 70 ) );
00247 
00248     sliderScale = new QSlider( groupBox5, "sliderScale" );
00249     sliderScale->setGeometry( QRect( 20, 30, 160, 24 ) );
00250     sliderScale->setMinValue( 1 );
00251     sliderScale->setMaxValue( 100 );
00252     sliderScale->setValue( 10 );
00253     sliderScale->setOrientation( QSlider::Horizontal );
00254 
00255     checkBox1 = new QCheckBox( centralWidget(), "checkBox1" );
00256     checkBox1->setGeometry( QRect( 10, 208, 140, 22 ) );
00257 
00258     groupBox4 = new QGroupBox( centralWidget(), "groupBox4" );
00259     groupBox4->setGeometry( QRect( 10, 140, 180, 60 ) );
00260 
00261     textLabel1_2 = new QLabel( groupBox4, "textLabel1_2" );
00262     textLabel1_2->setGeometry( QRect( 110, 20, 42, 20 ) );
00263 
00264     sbRadius = new QSpinBox( groupBox4, "sbRadius" );
00265     sbRadius->setGeometry( QRect( 10, 20, 90, 24 ) );
00266     sbRadius->setMaxValue( 100000 );
00267     sbRadius->setValue( 1 );
00268 
00269     updateButton = new QPushButton( centralWidget(), "updateButton" );
00270     updateButton->setGeometry( QRect( 10, 230, 150, 40 ) );
00271 
00272     groupBox13 = new QGroupBox( centralWidget(), "groupBox13" );
00273     groupBox13->setGeometry( QRect( 10, 18, 181, 60 ) );
00274 
00275     leScale = new QLineEdit( groupBox13, "leScale" );
00276     leScale->setGeometry( QRect( 10, 20, 110, 24 ) );
00277     leScale->setAlignment( int( QLineEdit::AlignRight ) );
00278 
00279     groupBox3 = new QGroupBox( centralWidget(), "groupBox3" );
00280     groupBox3->setGeometry( QRect( 10, 80, 180, 60 ) );
00281 
00282     textLabel1 = new QLabel( groupBox3, "textLabel1" );
00283     textLabel1->setGeometry( QRect( 110, 20, 42, 20 ) );
00284 
00285     sbDistance = new QSpinBox( groupBox3, "sbDistance" );
00286     sbDistance->setGeometry( QRect( 10, 20, 90, 24 ) );
00287     sbDistance->setMaxValue( 100000 );
00288     sbDistance->setMinValue( 0 );
00289     sbDistance->setLineStep( 1 );
00290     sbDistance->setValue( 1 );
00291 
00292     groupBox2 = new QGroupBox( centralWidget(), "groupBox2" );
00293     groupBox2->setGeometry( QRect( 10, 520, 200, 120 ) );
00294 
00295     textEdit1 = new QTextEdit( groupBox2, "textEdit1" );
00296     textEdit1->setGeometry( QRect( 10, 20, 180, 90 ) );
00297 
00298     cbMakeMovie = new QCheckBox( centralWidget(), "cbMakeMovie" );
00299     cbMakeMovie->setGeometry( QRect( 10, 650, 110, 22 ) );
00300 
00301     // actions
00302     fileOpenAction = new QAction( this, "fileOpenAction" );
00303     fileOpenAction->setIconSet( QIconSet( image1 ) );
00304     fileExportAsAction = new QAction( this, "fileExportAsAction" );
00305     fileExportAsAction->setIconSet( QIconSet( image2 ) );
00306     fileExitAction = new QAction( this, "fileExitAction" );
00307     helpAboutAction = new QAction( this, "helpAboutAction" );
00308     helpAboutAction->setIconSet( QIconSet( image3 ) );
00309 
00310 
00311     // toolbars
00312     toolBar = new QToolBar( QString(""), this, DockTop ); 
00313 
00314     fileOpenAction->addTo( toolBar );
00315     fileExportAsAction->addTo( toolBar );
00316     fileExitAction->addTo( toolBar );
00317 
00318 
00319     // menubar
00320     MenuBar = new QMenuBar( this, "MenuBar" );
00321 
00322     MenuBar->setGeometry( QRect( 0, 0, 1023, 25 ) );
00323 
00324     fileMenu = new QPopupMenu( this );
00325     fileOpenAction->addTo( fileMenu );
00326     fileExportAsAction->addTo( fileMenu );
00327     fileMenu->insertSeparator();
00328     fileExitAction->addTo( fileMenu );
00329     MenuBar->insertItem( QString(""), fileMenu, 2 );
00330 
00331     helpMenu = new QPopupMenu( this );
00332     helpAboutAction->addTo( helpMenu );
00333     MenuBar->insertItem( QString(""), helpMenu, 3 );
00334 
00335     languageChange();
00336     resize( QSize(1023, 797).expandedTo(minimumSizeHint()) );
00337     clearWState( WState_Polished );
00338 
00339     // signals and slots connections
00340     connect( fileOpenAction, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
00341     connect( fileExitAction, SIGNAL( activated() ), this, SLOT( fileExit() ) );
00342     connect( helpAboutAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
00343     connect( fileExportAsAction, SIGNAL( activated() ), this, SLOT( fileExportAs() ) );
00344     connect( cbSpheres, SIGNAL( stateChanged(int) ), this, SLOT( viewOptions() ) );
00345     connect( updateButton, SIGNAL( clicked() ), this, SLOT( updateSampling() ) );
00346     init();
00347 }
00348 
00349 /*
00350  *  Destroys the object and frees any allocated resources
00351  */
00352 discretizer::~discretizer()
00353 {
00354     // no need to delete child widgets, Qt does it all for us
00355 }
00356 
00357 /*
00358  *  Sets the strings of the subwidgets using the current
00359  *  language.
00360  */
00361 void discretizer::languageChange()
00362 {
00363     setCaption( tr( "Discretizer v0.1" ) );
00364     groupBox1->setTitle( tr( "Display options" ) );
00365     cbNormals->setText( tr( "Normals" ) );
00366     cbMesh->setText( tr( "Mesh" ) );
00367     cbGrid->setText( tr( "Grid" ) );
00368     cbSpheres->setText( tr( "Spheres" ) );
00369     cbLinks->setText( tr( "Links" ) );
00370     groupBox5->setTitle( tr( "Spheres view scale" ) );
00371     checkBox1->setText( tr( "Interactive update" ) );
00372     groupBox4->setTitle( tr( "Molecules radius" ) );
00373     textLabel1_2->setText( tr( "mm/10" ) );
00374     QToolTip::add( sbRadius, tr( "Used for connectivity and volume issues." ) );
00375     updateButton->setText( tr( "Update sampling" ) );
00376     groupBox13->setTitle( tr( "Scale mesh on loading of" ) );
00377     leScale->setText( tr( "1.0" ) );
00378     groupBox3->setTitle( tr( "Preferred distance" ) );
00379     textLabel1->setText( tr( "mm/10" ) );
00380     QToolTip::add( sbDistance, tr( "Heuristical distance between mass points." ) );
00381     groupBox2->setTitle( tr( "Report" ) );
00382     cbMakeMovie->setText( tr( "Export video" ) );
00383     fileOpenAction->setText( tr( "Open" ) );
00384     fileOpenAction->setMenuText( tr( "&Open..." ) );
00385     fileOpenAction->setAccel( tr( "Ctrl+O" ) );
00386     fileExportAsAction->setText( tr( "Export As" ) );
00387     fileExportAsAction->setMenuText( tr( "Export &As..." ) );
00388     fileExportAsAction->setAccel( QString::null );
00389     fileExitAction->setText( tr( "E&xit" ) );
00390     fileExitAction->setMenuText( tr( "E&xit" ) );
00391     fileExitAction->setAccel( QString::null );
00392     helpAboutAction->setText( tr( "About" ) );
00393     toolBar->setLabel( tr( "Tools" ) );
00394     MenuBar->findItem( 2 )->setText( tr( "&File" ) );
00395     MenuBar->findItem( 3 )->setText( tr( "&Help" ) );
00396 }
00397 

Generated on Thu Dec 1 10:13:37 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5