00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "window.qt.hh"
00025 #include "HtmlEntities.hh"
00026
00027 #include "gl-multi-window.qt.hh"
00028
00029 #include <stdlib.h>
00030 #include <stdio.h>
00031 #include <string>
00032
00033 #include <QtGui/QPixmap>
00034 #include <QtGui/QToolButton>
00035 #include <QtGui/QMessageBox>
00036 #include <QtGui/QStatusBar>
00037 #include <QtGui/QFileDialog>
00038 #include <Qt3Support/Q3Accel>
00039
00040
00041
00042
00043
00044 Window :: Window() :
00045 QMainWindow(),
00046 LINK_COLOR(QColor(53, 200, 255)),
00047 FControler(new CControlerGMap),
00048 FCreationActive(NULL),
00049 #ifdef MODULE_ARCHITECTURE
00050 FMeshActive(NULL) ,
00051 #endif
00052 FOperationActive(NULL) ,
00053 FOptionsFrame(NULL),
00054 FOperationChanfreinage(NULL) ,
00055 FOptionsCarac(NULL) ,
00056 FDialogDo(NULL) ,
00057 FDoubleCliquee(NULL),
00058 FCouleurs(NULL),
00059 color_active(false),
00060 current_dir("."),
00061 FileDialog(NULL)
00062 {
00063 setWindowTitle("MOKA");
00064 resize(800 , 600) ;
00065
00066 setWindowIcon(QIcon(":/moka-logo.png")) ;
00067
00068
00069 creationBoitesOutils() ;
00070
00071
00072 main_menu = new MenuBar(this) ;
00073 setMenuBar(main_menu);
00074
00075
00076 FWorkspace = new QWorkspace(this) ;
00077 setCentralWidget(FWorkspace) ;
00078 connect(FWorkspace, SIGNAL(windowActivated(QWidget *)),
00079 this, SLOT(windowActivated(QWidget *)));
00080
00081
00082 FControler -> setMode(MODE_SELECTION) ;
00083 FControler -> setUndoOnFile(true) ;
00084
00085
00086
00087 #ifdef MODULE_ARCHITECTURE
00088 FVueMere = new GLWindow(VIEW_XY , FWorkspace , this , FSelection) ;
00089 initialisationModeArchi();
00090 #else
00091 FVueMere = new GLWindow(VIEW_XYZ , FWorkspace , this , FSelection) ;
00092 #endif
00093
00094 string str = "Mère : " + FVueMere->getViewTypeString();
00095 FVueMere -> setWindowTitle(*HTML::decode(&str));
00096 FVueMere -> setMinimumSize(200 , 200) ;
00097 FVueMere -> showMaximized() ;
00098
00099
00100 Q3Accel* Raccourci = new Q3Accel(this) ;
00101
00102 Raccourci -> insertItem(QKeySequence("Alt+F9") , 8) ;
00103 Raccourci -> connectItem(8 , this ,
00104 SLOT(callbackToggleNormal())) ;
00105
00106 Raccourci -> insertItem(QKeySequence(Qt::Key_F9) , 9) ;
00107 Raccourci -> connectItem(9 , this ,
00108 SLOT(callbackToggleSews())) ;
00109
00110 Raccourci -> insertItem(QKeySequence(Qt::Key_F10) , 10) ;
00111 Raccourci -> connectItem(10 , this ,
00112 SLOT(callbackToggleVertices())) ;
00113
00114 Raccourci -> insertItem(QKeySequence(Qt::Key_F11) , 11) ;
00115 Raccourci -> connectItem(11 , this ,
00116 SLOT(callbackToggleFaces())) ;
00117
00118 Raccourci -> insertItem(QKeySequence(Qt::Key_F12) , 12) ;
00119 Raccourci -> connectItem(12 , this ,
00120 SLOT(callbackToggleGrille())) ;
00121
00122 Raccourci -> insertItem(QKeySequence("Alt+F11") , 14) ;
00123 Raccourci -> connectItem(14 , this ,
00124 SLOT(callbackTournerButton())) ;
00125
00126 Raccourci -> insertItem(QKeySequence(Qt::Key_Space) , 1) ;
00127 Raccourci -> connectItem(1 , this ,
00128 SLOT(callbackHideAllWindow())) ;
00129
00130 Raccourci -> insertItem(QKeySequence(Qt::Key_Up) , 15) ;
00131 Raccourci -> connectItem(15, this, SLOT(callbackKeyUp()));
00132
00133 Raccourci -> insertItem(QKeySequence(Qt::Key_Down) , 16) ;
00134 Raccourci -> connectItem(16, this, SLOT(callbackKeyDown()));
00135
00136 Raccourci -> insertItem(QKeySequence(Qt::Key_Left) , 17) ;
00137 Raccourci -> connectItem(17, this, SLOT(callbackKeyLeft()));
00138
00139 Raccourci -> insertItem(QKeySequence(Qt::Key_Right) , 18) ;
00140 Raccourci -> connectItem(18, this, SLOT(callbackKeyRight()));
00141
00142 Raccourci -> insertItem(QKeySequence(Qt::CTRL + Qt::Key_Up) , 19) ;
00143 Raccourci -> connectItem(19, this, SLOT(callbackKeyCtrlUp()));
00144
00145 Raccourci -> insertItem(QKeySequence(Qt::CTRL + Qt::Key_Down) , 20) ;
00146 Raccourci -> connectItem(20, this, SLOT(callbackKeyCtrlDown()));
00147
00148 Raccourci -> insertItem(QKeySequence(Qt::CTRL + Qt::Key_Left) , 21) ;
00149 Raccourci -> connectItem(21, this, SLOT(callbackKeyCtrlLeft()));
00150
00151 Raccourci -> insertItem(QKeySequence(Qt::CTRL + Qt::Key_Right) , 22) ;
00152 Raccourci -> connectItem(22, this, SLOT(callbackKeyCtrlRight()));
00153
00154 Raccourci -> insertItem(QKeySequence(Qt::SHIFT + Qt::Key_Up) , 23) ;
00155 Raccourci -> connectItem(23, this, SLOT(callbackKeyShiftUp()));
00156
00157 Raccourci -> insertItem(QKeySequence(Qt::SHIFT + Qt::Key_Down) , 24) ;
00158 Raccourci -> connectItem(24, this, SLOT(callbackKeyShiftDown()));
00159
00160 Raccourci -> insertItem(QKeySequence(Qt::SHIFT + Qt::Key_Left) , 25) ;
00161 Raccourci -> connectItem(25, this, SLOT(callbackKeyShiftLeft()));
00162
00163 Raccourci -> insertItem(QKeySequence(Qt::SHIFT + Qt::Key_Right) , 26);
00164 Raccourci -> connectItem(26, this, SLOT(callbackKeyShiftRight()));
00165
00166 Raccourci -> insertItem(QKeySequence(Qt::SHIFT + Qt::Key_F8) , 27) ;
00167 Raccourci -> connectItem(27 , this , SLOT(callbackVueCompacte())) ;
00168
00169 Raccourci -> insertItem(QKeySequence(Qt::SHIFT + Qt::Key_F9) , 28) ;
00170 Raccourci -> connectItem(28 , this , SLOT(callbackVueSemiEclatee()));
00171
00172 Raccourci -> insertItem(QKeySequence(Qt::SHIFT + Qt::Key_F10) , 29) ;
00173 Raccourci -> connectItem(29 , this , SLOT(callbackVueMoka())) ;
00174
00175 Raccourci -> insertItem(QKeySequence(Qt::SHIFT + Qt::Key_F11) , 30) ;
00176 Raccourci -> connectItem(30 , this , SLOT(callbackVueTopoFil())) ;
00177
00178
00179 FCreationBrin = new CreationBrin(this , FControler);
00180 FCreationCylindre = new CreationCylindre(this , FControler);
00181 FCreationMaillage = new CreationMaillage(this , FControler);
00182 FCreationPolygone = new CreationPolygone(this , FControler);
00183 FCreationPyramide = new CreationPyramide(this , FControler);
00184 FCreationSphere = new CreationSphere(this , FControler);
00185 FCreationTore = new CreationTore(this , FControler);
00186 FDialogRotation = new dialogRotation(this , FControler);
00187 FDialogHomothetie = new dialogHomothetie(this , FControler);
00188 FDialogTranslation = new dialogTranslation(this , FControler);
00189 FCouleurs = new OptionCouleurs(this) ;
00190
00191 updateStatusBar() ;
00192 }
00193
00194
00195
00196
00197 Window :: ~Window()
00198 { }
00199
00200
00201
00202
00203 GMap3d :: CControlerGMap * Window :: getControler() const
00204 {
00205 return FControler ;
00206 }
00207
00208 void Window :: setDoubleCliquee(GLWindow * vue)
00209 {
00210 string str;
00211
00212 if (FDoubleCliquee != NULL)
00213 {
00214 if (FDoubleCliquee == FVueMere)
00215 {
00216 str = "Mère : " + FVueMere->getViewTypeString();
00217 FVueMere->setWindowTitle(*HTML::decode(&str));
00218 }
00219
00220 else
00221 {
00222 str = FDoubleCliquee -> getViewTypeString();
00223 FDoubleCliquee->setWindowTitle(*HTML::decode(&str));
00224 }
00225 }
00226
00227 FDoubleCliquee = vue ;
00228
00229 if (FDoubleCliquee == FVueMere)
00230 {
00231 str = "Mère : " + FVueMere->getViewTypeString()
00232 + " : Double-Click";
00233 FVueMere->setWindowTitle(*HTML::decode(&str));
00234 }
00235 else
00236 {
00237 str = FDoubleCliquee->getViewTypeString() + " : Double-Click";
00238 FDoubleCliquee->setWindowTitle(*HTML::decode(&str));
00239 }
00240 }
00241
00242
00243
00244 void Window::repaint()
00245 {
00246 static bool is_repainting = false;
00247
00248 if (!is_repainting)
00249 {
00250 is_repainting = true;
00251 QMainWindow::repaint() ;
00252
00253 #ifdef MODULE_ARCHITECTURE
00254 toolbar_archi -> updateToolbar();
00255 #endif
00256
00257
00258 QWidgetList vues = FWorkspace -> windowList() ;
00259 for (int i = 0 ; i < int (vues . count()) ; i++)
00260 ((GLWindow *) vues.at(i))->update();
00261
00262 updateStatusBar();
00263 is_repainting = false;
00264 }
00265 }
00266
00267 void Window::closeEvent(QCloseEvent *)
00268 {
00269 #ifdef MODULE_ARCHITECTURE
00270 FDialogAmeublement -> close();
00271 win_ray_tracing -> close();
00272 #endif
00273
00274 FControler -> saveAllParameters(getCurrentViewId());
00275 }
00276
00277 void Window::windowActivated(QWidget * w)
00278 {
00279 if (w == NULL) return;
00280
00281 CreationObjet * boite = getCreationActive() ;
00282 if (boite != NULL)
00283 boite -> update() ;
00284
00285 dialogOperations * op = getOperationActive() ;
00286 if (op != NULL)
00287 op -> update() ;
00288
00289 OptionCouleurs * col = getCouleurActive();
00290 if (col != NULL)
00291 col->changeColor();
00292
00293 if (FOptionsFrame != NULL && FOptionsFrame -> isVisible())
00294 FOptionsFrame -> update() ;
00295
00296 OptionsCarac * carac = getOptionsCaracActive() ;
00297 if (carac != NULL) carac -> update() ;
00298 }
00299
00300
00301
00302
00303 void Window::updateStatusBar()
00304 {
00305 int darts = getControler()->getNbDarts();
00306 int selected = getControler()->getNbSelectedDarts();
00307 int vertices = getControler()->getNbVertices();
00308
00309 QString texte = "Brins : " ;
00310 texte += QString :: number(darts) ;
00311 texte += "; Sélectionnés : " ;
00312 texte += QString :: number(selected) ;
00313 texte += "; Sommets : " ;
00314 texte += QString :: number(vertices) ;
00315 texte += "; " ;
00316 texte += QString::fromUtf8(getControler()->getMessage().c_str()) ;
00317 statusBar() -> showMessage(*HTML::decode(texte)) ;
00318 }
00319
00320
00321
00322
00323 CreationObjet * Window :: getCreationActive() const
00324 {
00325 return FCreationActive ;
00326 }
00327
00328 dialogOperations * Window :: getOperationActive() const
00329 {
00330 return FOperationActive ;
00331 }
00332
00333 OptionCouleurs * Window :: getCouleurActive() const
00334 {
00335 return FCouleurs ;
00336 }
00337
00338 OptionsCarac * Window :: getOptionsCaracActive() const
00339 {
00340 return FOptionsCarac ;
00341 }
00342
00343
00344
00345
00346 void Window :: bascule(TView type)
00347 {
00348 assert(FWorkspace->activeWindow() != NULL);
00349
00350 bool find = false;
00351 int actu = 0;
00352 int first;
00353
00354
00355 QWidgetList vues = FWorkspace -> windowList() ;
00356
00357 while (!find && actu < int(vues.count()))
00358 {
00359 if ((GLWindow*)FWorkspace->activeWindow() == (GLWindow*)vues.at(actu))
00360 find = true;
00361 else
00362 ++actu;
00363 }
00364
00365 assert(find);
00366
00367
00368 find = false;
00369 first = actu;
00370 actu = (actu + 1) % vues.count();
00371
00372 while (!find && actu != first)
00373 {
00374 if (((GLWindow*)vues.at(actu))->getViewType() == type)
00375 find = true;
00376 else
00377 actu = (actu + 1) % vues.count();
00378 }
00379
00380 if (find)
00381 {
00382
00383 ((GLWindow*)vues.at(actu))->setFocus();
00384 }
00385 else
00386 {
00387 if (((GLWindow*)FWorkspace->activeWindow())->getViewType() != type)
00388 {
00389
00390 switch (type)
00391 {
00392 case VIEW_XYZ :
00393 addView3D() ;
00394 break ;
00395 case VIEW_XY :
00396 addViewXY() ;
00397 break ;
00398 case VIEW_YZ :
00399 addViewYZ() ;
00400 break ;
00401 case VIEW_XZ :
00402 addViewZX() ;
00403 break ;
00404 case VIEW_ISO :
00405 addViewMulti() ;
00406 break ;
00407 }
00408 }
00409 }
00410 }
00411
00412
00413
00414
00415 void Window :: creationBoitesOutils()
00416 {
00417 QIcon pf0(":/nouveau.png") ;
00418 QIcon pf1(":/charger.png") ;
00419 QIcon pf2(":/sauver.png") ;
00420 QIcon pf5(":/file-import-48x48.png") ;
00421 QIcon pf3(":/file-export-48x48.png") ;
00422 QIcon pf4(":/ajouter.png") ;
00423
00424 QIcon pe1(":/undo.png") ;
00425 QIcon pe2(":/redo.png") ;
00426 QIcon pe3(":/vider.png") ;
00427
00428 QIcon pc1(":/polyligne.png") ;
00429 QIcon pc2(":/polygone.png") ;
00430 QIcon pc3(":/maillage.png") ;
00431 QIcon pc4(":/sphere.png") ;
00432 QIcon pc5(":/cylindre.png") ;
00433 QIcon pc6(":/cone.png") ;
00434 QIcon pc7(":/tore.png") ;
00435
00436 QIcon pv1(":/addvue.png") ;
00437 QIcon pv2(":/deletevue.png") ;
00438 QIcon pv3(":/groupervues.png") ;
00439 QIcon pv4(":/degroupervues.png") ;
00440
00441 QIcon pop1(":/homothetie.png") ;
00442 QIcon pop2(":/translation.png") ;
00443 QIcon pop3(":/rotation.png") ;
00444
00445 QIcon psel1(":/sel_prev.png");
00446 QIcon psel2(":/sel_next.png");
00447 QIcon psel3(":/suppression.png");
00448 QIcon psel4(":/suppression_forcee.png");
00449
00450
00451 fichier = new QToolBar("Fichier" , this) ;
00452 fichier -> addAction(pf0, "Nouveau", this, SLOT(callbackNettoyage()));
00453 charger_act = fichier -> addAction(pf1, "Charger", this,
00454 SLOT(callbackLoad()));
00455 fichier -> addAction(pf4, "Ajouter", this, SLOT(callbackAdd()));
00456 sauver_act = fichier -> addAction(pf2, "Sauver", this,
00457 SLOT(callbackSave()));
00458 exporter_act = fichier -> addAction(pf3, "Exporter", this,
00459 SLOT(callbackExport()));
00460 importer_act = fichier -> addAction(pf5, "Importer", this,
00461 SLOT(callbackImport()));
00462 addToolBar(fichier);
00463
00464
00465 edition = new QToolBar("Edition", this) ;
00466 edition -> addAction(pe1, "Annuler", this, SLOT(callbackUndo()));
00467 edition -> addAction(pe2, "Refaire", this, SLOT(callbackRedo()));
00468 edition -> addSeparator() ;
00469 edition -> addAction(pe3, "Vider la pile", this,
00470 SLOT(callbackEmptyUndoRedo()));
00471 addToolBar(edition);
00472
00473
00474 creation = new QToolBar(*HTML::decode("Création"), this) ;
00475 creation -> addAction(pc1,
00476 *HTML::decode("Créer polyligne/brin/face"),
00477 this, SLOT(callbackPolyline()));
00478 creation -> addAction(pc2, *HTML::decode("Créer polygone"), this,
00479 SLOT(callbackPolygon()));
00480 creation -> addAction(pc3, *HTML::decode("Créer maillage"), this,
00481 SLOT(callbackMeshCreation()));
00482 creation -> addAction(pc4, *HTML::decode("Créer sphère"),
00483 this, SLOT(callbackSphere()));
00484 creation -> addAction(pc5, *HTML::decode("Créer cylindre"), this,
00485 SLOT(callbackCylinder()));
00486 creation -> addAction(pc6,
00487 *HTML::decode("Créer cône/pyramide"),
00488 this, SLOT(callbackPyramide()));
00489 creation -> addAction(pc7, *HTML::decode("Créer tore"), this,
00490 SLOT(callbackTorus()));
00491 addToolBar(creation);
00492
00493
00494 operations = new QToolBar(*HTML::decode("Opérations"), this) ;
00495 operations -> addAction(pop2, "Translation", this,
00496 SLOT(callbackTranslateWindow()));
00497 operations -> addAction(pop3, "Rotation", this,
00498 SLOT(callbackRotateWindow()));
00499 operations -> addAction(pop1, *HTML::decode("Homothétie"), this,
00500 SLOT(callbackScaleWindow()));
00501 addToolBar(operations);
00502
00503
00504
00505 vues = new QToolBar("Vue", this) ;
00506 vues -> addAction(pv1, "Ajouter une vue 3D", this, SLOT(addView3D()));
00507 vues -> addAction(pv2, "Supprimer la vue", this, SLOT(deleteView()));
00508 vues -> addSeparator() ;
00509 vues -> addAction(pv3, "Grouper vues", this,
00510 SLOT(OperationGroupAllGeneral()));
00511 vues -> addAction(pv4, *HTML::decode("Dégrouper vue"), this,
00512 SLOT(OperationUngroupAllGeneral()));
00513 addToolBar(vues);
00514
00515
00516 #ifdef MODULE_ARCHITECTURE
00517 selection = new QToolBar(*HTML::decode("Sélection"), this) ;
00518 selection -> addAction(psel1, *HTML::decode("Passer au brin "
00519 "precédent"), this,
00520 SLOT(callbackFocusPreviousSelection()));
00521 selection -> addAction(psel2, "Passer au brin suivant", this,
00522 SLOT(callbackFocusNextSelection()));
00523 suppression_act =
00524 selection-> addAction(psel3,
00525 *HTML::decode("Supprimer la sélection"),
00526 this,
00527 SLOT(callbackOperationSuppressionArchiIHM()));
00528 selection -> addAction(psel4, *HTML::decode("Suppression "
00529 "forcée de la sélection"),
00530 this,
00531 SLOT(callbackOperationSuppressionArchiForcee()));
00532
00533 selection -> setVisible(false);
00534 addToolBar(selection);
00535 #endif
00536
00537
00538 FSelection = new SelectBar(this) ;
00539 addToolBar(Qt::LeftToolBarArea, FSelection);
00540 }
00541
00542
00543
00544
00545
00546 std::string Window::getOpenFileName(const QString & caption,
00547 const QStringList & filters,
00548 int * ind_filter)
00549 {
00550 QString filename;
00551 QFileDialog open_dialog(0, caption, current_dir.path());
00552
00553 if (ind_filter != NULL) *ind_filter = -1;
00554 open_dialog.setFilters(filters);
00555 open_dialog.setAcceptMode(QFileDialog::AcceptOpen);
00556 open_dialog.setFileMode(QFileDialog::ExistingFile);
00557
00558 if (open_dialog.exec())
00559 {
00560 filename = open_dialog.selectedFiles().at(0);
00561 current_dir = open_dialog.directory();
00562
00563 if (ind_filter != NULL)
00564 {
00565 for ((*ind_filter) = 0;
00566 filters.at(*ind_filter) != open_dialog.selectedFilter();
00567 (*ind_filter)++);
00568 }
00569 return filename.toStdString();
00570 }
00571 return std::string("");
00572 }
00573
00574 void Window::filterSelected(const QString & selected)
00575 {
00576 QRegExp rxfilter(".*\\(.*\\.(.*)\\).*");
00577 int pos = rxfilter.indexIn(selected);
00578 if (pos > -1)
00579 {
00580 FileDialog->setDefaultSuffix(rxfilter.cap(1));
00581 }
00582 }
00583
00584
00585
00586
00587
00588 std::string Window::getSaveFileName(const QString & caption,
00589 const QStringList & filters,
00590 int * ind_filter)
00591 {
00592 assert(FileDialog == NULL);
00593
00594 QString filename;
00595 FileDialog = new QFileDialog(0, caption, current_dir.path());
00596
00597 connect(FileDialog, SIGNAL(filterSelected(const QString &)),
00598 this, SLOT(filterSelected(const QString &)));
00599
00600 if (ind_filter != NULL) *ind_filter = -1;
00601 FileDialog->setFilters(filters);
00602 FileDialog->setAcceptMode(QFileDialog::AcceptSave);
00603 FileDialog->setFileMode(QFileDialog::AnyFile);
00604 filterSelected(filters.at(0));
00605
00606 if (FileDialog->exec())
00607 {
00608 filename = FileDialog->selectedFiles().at(0);
00609 current_dir = FileDialog->directory();
00610
00611 if (ind_filter != NULL)
00612 {
00613 for ((*ind_filter) = 0;
00614 filters.at(*ind_filter) != FileDialog->selectedFilter();
00615 (*ind_filter)++);
00616 }
00617
00618 delete FileDialog; FileDialog = NULL;
00619 return filename.toStdString();
00620 }
00621 delete FileDialog; FileDialog = NULL;
00622 return std::string("");
00623 }
00624
00625
00626 bool Window :: getVerticesDisplay() const
00627 {
00628 return getControler()->viewIsEnabledPrecompile(getCurrentViewId(),
00629 PRECOMPILE_VERTEX);
00630 }
00631 void Window :: setVerticesDisplay(bool b)
00632 {
00633 if (getVerticesDisplay() != b)
00634 {
00635 getControler()->viewTogglePrecompile(getCurrentViewId(),
00636 PRECOMPILE_VERTEX);
00637 }
00638 }
00639
00640 bool Window :: getNormalDisplay() const
00641 {
00642 return getControler()->viewIsEnabledPrecompile(getCurrentViewId(),
00643 PRECOMPILE_NORMAL_VECTOR);
00644 }
00645 void Window :: setNormalDisplay(bool b)
00646 {
00647 if (getNormalDisplay() != b)
00648 {
00649 getControler()->viewTogglePrecompile(getCurrentViewId(),
00650 PRECOMPILE_NORMAL_VECTOR);
00651 }
00652 }
00653
00654 bool Window :: getFacesDisplay() const
00655 {
00656 return getControler()->viewIsEnabledPrecompile(getCurrentViewId(),
00657 PRECOMPILE_FACE);
00658 }
00659 void Window :: setFacesDisplay(bool b)
00660 {
00661 if (getFacesDisplay() != b)
00662 {
00663 getControler()->viewTogglePrecompile(getCurrentViewId(), PRECOMPILE_FACE);
00664
00665 toggleDarts(b);
00666 }
00667 }
00668
00669 bool Window::getFacesCoulAlea() const
00670 {
00671 return getControler()->getParameterFace(getCurrentViewId())
00672 ->getRandomCLFace();
00673 }
00674
00675 void Window::setFacesCoulAlea()
00676 {
00677 if (!getFacesCoulAlea())
00678 {
00679 getControler()->getParameterFace(getCurrentViewId())
00680 ->setRandomCLFace(true);
00681 getControler()->getParameterFace(getCurrentViewId())
00682 ->setRandomCLVolume(false);
00683
00684 toggleDarts(true);
00685 }
00686 }
00687
00688 bool Window::getVolumesCoulAlea() const
00689 {
00690 return getControler()->getParameterFace(getCurrentViewId())
00691 ->getRandomCLVolume();
00692 }
00693
00694 void Window::setVolumesCoulAlea()
00695 {
00696 if (!getVolumesCoulAlea())
00697 {
00698 getControler()->getParameterFace(getCurrentViewId())
00699 ->setRandomCLVolume(true);
00700 getControler()->getParameterFace(getCurrentViewId())
00701 ->setRandomCLFace(false);
00702
00703 toggleDarts(true);
00704 }
00705 }
00706
00707 bool Window::getCoulFacesGlobale() const
00708 {
00709 return
00710 !getControler()->getParameterFace(getCurrentViewId())
00711 ->getRandomCLFace() &&
00712 !getControler()->getParameterFace(getCurrentViewId())
00713 ->getRandomCLVolume();
00714 }
00715
00716 void Window::setCoulFacesGlobale()
00717 {
00718 if (!getCoulFacesGlobale())
00719 {
00720 getControler()->getParameterFace(getCurrentViewId())
00721 ->setRandomCLFace(false);
00722 getControler()->getParameterFace(getCurrentViewId())
00723 ->setRandomCLVolume(false);
00724
00725 toggleDarts(true);
00726 }
00727 }
00728
00729 bool Window::getCoulGeometry() const
00730 {
00731 #ifdef MODULE_ARCHITECTURE
00732 return (!(getControler()->getParameterFace(getCurrentViewId())
00733 ->getSemantiqueColorGeometry()) &&
00734 (getControler()->getParameterFace(getCurrentViewId())
00735 ->getRandomColorGeometry()));
00736 #else
00737 return getControler()->getParameterFace(getCurrentViewId())
00738 ->getRandomColorGeometry();
00739 #endif // MODULE_ARCHITECTURE
00740 }
00741
00742 void Window::setCoulGeometry()
00743 {
00744 if (!getCoulGeometry())
00745 {
00746 getControler()->getParameterFace(getCurrentViewId())
00747 ->setRandomColorGeometry(true);
00748
00749 toggleDarts(true);
00750 }
00751 }
00752
00753 #ifdef MODULE_ARCHITECTURE
00754 bool Window::getCoulSemantique() const
00755 {
00756 return getControler()->getParameterFace(getCurrentViewId())
00757 ->getSemantiqueColorGeometry();
00758 }
00759
00760 void Window::setCoulSemantique()
00761 {
00762 if (!getCoulSemantique())
00763 {
00764 getControler()->getParameterFace(getCurrentViewId())
00765 ->setSemantiqueColorGeometry(true);
00766 toggleDarts(true);
00767 }
00768 }
00769 #endif // MODULE_ARCHITECTURE
00770
00771 bool Window::getCoulTopologie() const
00772 {
00773 #ifdef MODULE_ARCHITECTURE
00774 return (!(getControler()->getParameterFace(getCurrentViewId())
00775 ->getSemantiqueColorGeometry()) &&
00776 (!getControler()->getParameterFace(getCurrentViewId())
00777 ->getRandomColorGeometry()));
00778 #else
00779 return (!getControler()->getParameterFace(getCurrentViewId())
00780 ->getRandomColorGeometry());
00781 #endif // MODULE_ARCHITECTURE
00782 }
00783
00784 void Window::setCoulTopologie()
00785 {
00786 if (!getCoulTopologie())
00787 {
00788 getControler()->getParameterFace(getCurrentViewId())
00789 ->setRandomColorGeometry(false);
00790 toggleDarts(true);
00791 }
00792 }
00793
00794 bool Window :: getSewsDisplay() const
00795 {
00796 return getControler()->viewIsEnabledPrecompile(getCurrentViewId(),
00797 PRECOMPILE_SEW);
00798 }
00799 void Window :: setSewsDisplay(bool b)
00800 {
00801 if (getSewsDisplay() != b)
00802 {
00803 getControler()->viewTogglePrecompile(getCurrentViewId(), PRECOMPILE_SEW);
00804
00805 toggleDarts(b);
00806 }
00807 }
00808
00809 bool Window :: getGridDisplay() const
00810 {
00811 return getControler()->viewIsEnabledPrecompile(getCurrentViewId(),
00812 PRECOMPILE_GRID);
00813 }
00814 void Window :: setGridDisplay(bool b)
00815 {
00816 if (getGridDisplay() != b)
00817 {
00818 getControler()->viewTogglePrecompile(getCurrentViewId(), PRECOMPILE_GRID);
00819 }
00820 }
00821
00822 bool Window :: getAxisDisplay() const
00823 {
00824 return getControler()->viewIsEnabledPrecompile(getCurrentViewId(),
00825 PRECOMPILE_AXIS);
00826 }
00827 void Window :: setAxisDisplay(bool b)
00828 {
00829 if (getAxisDisplay() != b)
00830 {
00831 getControler()->viewTogglePrecompile(getCurrentViewId(), PRECOMPILE_AXIS);
00832 }
00833 }
00834
00835 TViewId Window :: getCurrentViewId() const
00836 {
00837 assert(FWorkspace->activeWindow() != NULL);
00838
00839 return ((GLWindow *) FWorkspace -> activeWindow())
00840 -> getCliquedViewId() ;
00841 }
00842
00843 void Window :: toggleDarts(bool b)
00844 {
00845 #ifdef MODULE_SPAMOD
00846
00847
00848
00849 if (getParameterSpamod()->getViewMode() != SPAMOD_NONE &&
00850 getControler()->viewIsEnabledPrecompile(getCurrentViewId(),
00851 PRECOMPILE_SPAMOD))
00852 {
00853 if (b)
00854 getControler()->
00855 viewEnablePrecompile(getCurrentViewId(), PRECOMPILE_DART);
00856 else if (!getFacesDisplay() && !getSewsDisplay())
00857 getControler()->
00858 viewDisablePrecompile(getCurrentViewId(), PRECOMPILE_DART);
00859 }
00860 #endif // MODULE_SPAMOD
00861 }
00862
00863
00864
00865
00866
00867 void Window :: callbackKeyUp()
00868 {
00869 int view = getCurrentViewId();
00870
00871 switch (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType())
00872 {
00873 case VIEW_XYZ :
00874 {
00875 FControler -> moveEye(view, true);
00876 repaint();
00877 #ifdef MODULE_ARCHITECTURE
00878 if (win_ray_tracing -> isVisible())
00879 win_ray_tracing -> updateRayTracing(true);
00880 #endif
00881 break;
00882 }
00883 case VIEW_XY : FControler -> moveEyeY(view, true); repaint(); break;
00884 case VIEW_XZ :
00885 case VIEW_YZ : FControler -> moveEyeZ(view, true); repaint(); break;
00886 }
00887 }
00888
00889 void Window :: callbackKeyDown()
00890 {
00891 int view = getCurrentViewId();
00892
00893 switch (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType())
00894 {
00895 case VIEW_XYZ :
00896 {
00897 FControler -> moveEye(view, false);
00898 repaint();
00899 #ifdef MODULE_ARCHITECTURE
00900 if (win_ray_tracing -> isVisible())
00901 win_ray_tracing -> updateRayTracing(true);
00902 #endif
00903 break;
00904 }
00905 case VIEW_XY : FControler -> moveEyeY(view, false); repaint(); break;
00906 case VIEW_XZ :
00907 case VIEW_YZ : FControler -> moveEyeZ(view, false); repaint(); break;
00908 }
00909 }
00910
00911 void Window :: callbackKeyLeft()
00912 {
00913 int view = getCurrentViewId();
00914
00915 switch (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType())
00916 {
00917 case VIEW_XYZ :
00918 {
00919 FControler -> horizontalRotationEye(view, true);
00920 repaint();
00921 #ifdef MODULE_ARCHITECTURE
00922 if (win_ray_tracing -> isVisible())
00923 win_ray_tracing -> updateRayTracing(true);
00924 #endif
00925 break;
00926 }
00927 case VIEW_XY :
00928 case VIEW_XZ : FControler -> moveEyeX(view, false); repaint(); break;
00929 case VIEW_YZ : FControler -> moveEyeY(view, false); repaint(); break;
00930 }
00931 }
00932
00933 void Window :: callbackKeyRight()
00934 {
00935 int view = getCurrentViewId();
00936
00937 switch (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType())
00938 {
00939 case VIEW_XYZ :
00940 {
00941 FControler -> horizontalRotationEye(view, false);
00942 repaint();
00943 #ifdef MODULE_ARCHITECTURE
00944 if (win_ray_tracing -> isVisible())
00945 win_ray_tracing -> updateRayTracing(true);
00946 #endif
00947 break;
00948 }
00949 case VIEW_XY :
00950 case VIEW_XZ : FControler -> moveEyeX(view, true); repaint(); break;
00951 case VIEW_YZ : FControler -> moveEyeY(view, true); repaint(); break;
00952 }
00953 }
00954
00955 void Window :: callbackKeyCtrlUp()
00956 {
00957 if (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType() == VIEW_XYZ)
00958 {
00959 FControler -> verticalRotationEye(getCurrentViewId(), true);
00960 repaint();
00961 #ifdef MODULE_ARCHITECTURE
00962 if (win_ray_tracing -> isVisible())
00963 win_ray_tracing -> updateRayTracing(true);
00964 #endif
00965 }
00966 }
00967
00968 void Window :: callbackKeyCtrlDown()
00969 {
00970 if (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType() == VIEW_XYZ)
00971 {
00972 FControler -> verticalRotationEye(getCurrentViewId(), false);
00973 repaint();
00974 #ifdef MODULE_ARCHITECTURE
00975 if (win_ray_tracing -> isVisible())
00976 win_ray_tracing -> updateRayTracing(true);
00977 #endif
00978 }
00979 }
00980
00981 void Window :: callbackKeyCtrlLeft()
00982 {
00983 if (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType() == VIEW_XYZ)
00984 {
00985 FControler -> moveEyeLateral(getCurrentViewId(), false);
00986 repaint();
00987 #ifdef MODULE_ARCHITECTURE
00988 if (win_ray_tracing -> isVisible())
00989 win_ray_tracing -> updateRayTracing(true);
00990 #endif
00991 }
00992 }
00993
00994 void Window :: callbackKeyCtrlRight()
00995 {
00996 if (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType() == VIEW_XYZ)
00997 {
00998 FControler -> moveEyeLateral(getCurrentViewId(), true);
00999 repaint();
01000 #ifdef MODULE_ARCHITECTURE
01001 if (win_ray_tracing -> isVisible())
01002 win_ray_tracing -> updateRayTracing(true);
01003 #endif
01004 }
01005 }
01006
01007 void Window :: callbackKeyShiftUp()
01008 {
01009 if (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType() == VIEW_XYZ)
01010 {
01011 TViewId AView = getCurrentViewId();
01012 float coeff =
01013 FControler -> getParameterEyePosition(AView) -> getPasAvancement();
01014 FControler -> moveEye(AView, true, coeff * 5);
01015 repaint();
01016 #ifdef MODULE_ARCHITECTURE
01017 if (win_ray_tracing -> isVisible())
01018 win_ray_tracing -> updateRayTracing(true);
01019 #endif
01020 }
01021 }
01022
01023 void Window :: callbackKeyShiftDown()
01024 {
01025 if (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType() == VIEW_XYZ)
01026 {
01027 TViewId AView = getCurrentViewId();
01028 float coeff =
01029 FControler -> getParameterEyePosition(AView) -> getPasAvancement();
01030 FControler -> moveEye(AView, false, coeff * 5);
01031 repaint();
01032 #ifdef MODULE_ARCHITECTURE
01033 if (win_ray_tracing -> isVisible())
01034 win_ray_tracing -> updateRayTracing(true);
01035 #endif
01036 }
01037 }
01038
01039 void Window :: callbackKeyShiftLeft()
01040 {
01041 if (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType() == VIEW_XYZ)
01042 {
01043 FControler -> horizontalRotationEye(getCurrentViewId(), true, 90);
01044 repaint();
01045 #ifdef MODULE_ARCHITECTURE
01046 if (win_ray_tracing -> isVisible())
01047 win_ray_tracing -> updateRayTracing(true);
01048 #endif
01049 }
01050 }
01051
01052 void Window :: callbackKeyShiftRight()
01053 {
01054 if (((GLWindow *) FWorkspace -> activeWindow()) -> getViewType() == VIEW_XYZ)
01055 {
01056 FControler -> horizontalRotationEye(getCurrentViewId(), false, 90);
01057 repaint();
01058 #ifdef MODULE_ARCHITECTURE
01059 if (win_ray_tracing -> isVisible())
01060 win_ray_tracing -> updateRayTracing(true);
01061 #endif
01062 }
01063 }
01064
01065 void Window :: callbackVueCompacte()
01066 {
01067 if (FOptionsFrame == NULL)
01068 FOptionsFrame = new OptionsFrame(this) ;
01069
01070 FOptionsFrame -> getOptionsVue() -> callbackPresetting0();
01071 }
01072
01073 void Window :: callbackVueSemiEclatee()
01074 {
01075 if (FOptionsFrame == NULL)
01076 FOptionsFrame = new OptionsFrame(this) ;
01077
01078 FOptionsFrame -> getOptionsVue() -> callbackPresetting1();
01079 }
01080
01081 void Window :: callbackVueMoka()
01082 {
01083 if (FOptionsFrame == NULL)
01084 FOptionsFrame = new OptionsFrame(this) ;
01085
01086 FOptionsFrame -> getOptionsVue() -> callbackPresetting2();
01087 }
01088
01089 void Window :: callbackVueTopoFil()
01090 {
01091 if (FOptionsFrame == NULL)
01092 FOptionsFrame = new OptionsFrame(this) ;
01093
01094 FOptionsFrame -> getOptionsVue() -> callbackPresetting3();
01095 }
01096
01097
01098
01099
01100
01101 void Window::callbackNettoyage()
01102 {
01103 if (getControler()->empty()) repaint();
01104 else updateStatusBar();
01105 }
01106
01107 void Window :: callbackLoad()
01108 {
01109
01110 QStringList type_load;
01111 type_load << "Moka file (*.moka)";
01112
01113 std::string filename = getOpenFileName("Chargement", type_load) ;
01114
01115
01116 if (filename != "")
01117 {
01118 if (getControler() -> loadMap(filename.c_str())) repaint() ;
01119 else updateStatusBar() ;
01120 }
01121 }
01122
01123 void Window::callbackAdd()
01124 {
01125 int type;
01126 QStringList type_load;
01127
01128 type_load << "Moka file (*.moka)"
01129 #ifdef MODULE_ARCHITECTURE
01130 << "Plan NFF (*.nff)"
01131 #endif
01132 ;
01133
01134 std::string filename = getOpenFileName("Ajout d'un fichier",
01135 type_load, &type) ;
01136
01137 if (filename != "")
01138 {
01139 int res = 0;
01140
01141 switch (type)
01142 {
01143 case 0 :
01144 case 1 : res = getControler()->addMap(filename.c_str()); break;
01145 #ifdef MODULE_ARCHITECTURE
01146 case 2 : res = getControler()->addMapNff(filename.c_str()); break;
01147 #endif
01148 default : break;
01149 }
01150
01151 if (res) repaint() ;
01152 else updateStatusBar() ;
01153 }
01154 }
01155
01156 void Window::callbackSave()
01157 {
01158 int type;
01159 QStringList type_save;
01160
01161 type_save << "Fichier ASCII (*.moka)" << "Fichier Binaire (*.moka)";
01162 std::string filename = getSaveFileName("Sauvegarde", type_save, &type);
01163
01164 if (filename != "")
01165 {
01166 int res = 0;
01167
01168 switch (type)
01169 {
01170 case 0: res = getControler()->saveMapBinary(filename.c_str()); break;
01171 case 1: res = getControler()->saveMapAscii(filename.c_str()); break;
01172 default : break;
01173 }
01174
01175 if (res) repaint() ;
01176 else updateStatusBar() ;
01177 }
01178 }
01179
01180 void Window::callbackImport()
01181 {
01182 int type;
01183 QStringList type_load;
01184
01185 type_load << "Off (*.off)";
01186
01187 std::string filename = getOpenFileName("Import d'un fichier",
01188 type_load, &type) ;
01189
01190 if (filename != "")
01191 {
01192 int res = 0;
01193
01194 switch (type)
01195 {
01196 case 0 :
01197 case 1 : res = getControler()->importOff(filename.c_str()); break;
01198 default : break;
01199 }
01200
01201 if (res) repaint() ;
01202 else updateStatusBar() ;
01203 }
01204 }
01205
01206 void Window :: callbackExport()
01207 {
01208 int type;
01209 QStringList type_save;
01210
01211 type_save << "XFig G-carte (*.fig)"
01212 << "XFig Carte (*.fig)"
01213 << "XFig Intervoxel (*.fig)"
01214 << "Pov (*.pov)"
01215 << "Off (*.off)"
01216 << "Off3D (*.off)";
01217 std::string filename = getSaveFileName("Exporter", type_save, &type);
01218
01219
01220 if (filename != "")
01221 {
01222 switch (type)
01223 {
01224 case 0 :
01225 FControler -> exportXfig(filename.c_str() , getCurrentViewId() ,
01226 false, getFacesDisplay() ,
01227 getSewsDisplay() , false ,
01228 getVerticesDisplay()) ;
01229 break ;
01230
01231 case 1 :
01232 FControler -> exportXfig(filename.c_str() , getCurrentViewId() ,
01233 true, getFacesDisplay() ,
01234 getSewsDisplay() , false ,
01235 getVerticesDisplay()) ;
01236 break ;
01237
01238 case 2 :
01239 FControler -> exportXfigAsIntervoxel(filename.c_str(),
01240 getCurrentViewId());
01241 break ;
01242
01243 case 3 :
01244 FControler -> exportPov(filename.c_str()) ;
01245 break ;
01246 case 4 :
01247 FControler -> exportOff(filename.c_str()) ;
01248 break ;
01249 case 5 :
01250 FControler -> exportOff3D(filename.c_str()) ;
01251 break ;
01252 }
01253 updateStatusBar() ;
01254 }
01255 }
01256
01257 void Window::callbackFindMotif()
01258 {
01259 int type;
01260 QStringList type_load;
01261
01262 type_load << "Moka file (*.moka)" << "Off (*.off)";
01263
01264 std::string filename = getOpenFileName("Recherche d'un motif",
01265 type_load, &type) ;
01266
01267 if (filename != "")
01268 {
01269 int res = 0;
01270
01271 switch (type)
01272 {
01273 case 0 : res = getControler()->findMotifMoka(filename.c_str()); break;
01274 case 1 : res = getControler()->findMotifOff(filename.c_str()); break;
01275 default : break;
01276 }
01277
01278 if (res) repaint() ;
01279 else updateStatusBar() ;
01280 }
01281 }
01282
01283 void Window::callbackCountMotifs()
01284 {
01285 int type;
01286 QStringList type_load;
01287
01288 type_load << "Moka file (*.moka)" << "Off (*.off)";
01289
01290 std::string filename = getOpenFileName("Compter les occurences d'un motif",
01291 type_load, &type) ;
01292
01293 if (filename != "")
01294 {
01295 int res = 0;
01296
01297 switch (type)
01298 {
01299 case 0 :
01300 res = getControler()->countNumberOfMotifsMoka(filename.c_str());
01301 break;
01302 case 1 :
01303 res = getControler()->countNumberOfMotifsOff(filename.c_str());
01304 break;
01305 default : break;
01306 }
01307
01308 if (res) repaint() ;
01309 else updateStatusBar() ;
01310 }
01311 }
01312
01313
01314 void Window::callbackQuit()
01315 {
01316 this -> close() ;
01317 }
01318
01319
01320
01321
01322
01323
01324 void Window :: callbackUndo()
01325 {
01326 if (getControler() -> undo()) repaint() ;
01327 else updateStatusBar() ;
01328 }
01329
01330 void Window :: callbackRedo()
01331 {
01332 if (getControler() -> redo()) repaint() ;
01333 else updateStatusBar() ;
01334 }
01335
01336 void Window :: callbackEmptyUndoRedo()
01337 {
01338 getControler() -> emptyUndoRedo() ;
01339 updateStatusBar() ;
01340 }
01341
01342 void Window :: callbackConfigUndoRedo()
01343 {
01344 FDialogDo = new DialogDo(this) ;
01345 FDialogDo -> show() ;
01346 }
01347
01348
01349
01350 void Window :: help()
01351 {
01352 }
01353 void Window :: view()
01354 {
01355 if (FOptionsFrame == NULL)
01356 FOptionsFrame = new OptionsFrame(this) ;
01357
01358 FOptionsFrame -> setOption(3) ;
01359 FOptionsFrame -> show() ;
01360 }
01361
01362 void Window :: plating()
01363 {
01364 if (FOptionsFrame == NULL)
01365 FOptionsFrame = new OptionsFrame(this) ;
01366
01367 FOptionsFrame -> setOption(4) ;
01368 FOptionsFrame -> show() ;
01369 }
01370
01371 void Window :: pondDef()
01372 {
01373 if (FOptionsFrame == NULL)
01374 FOptionsFrame = new OptionsFrame(this) ;
01375
01376 FOptionsFrame -> setOption(5) ;
01377 FOptionsFrame -> show() ;
01378 }
01379
01380 void Window :: extrusion()
01381 {
01382 if (FOptionsFrame == NULL)
01383 FOptionsFrame = new OptionsFrame(this) ;
01384
01385 FOptionsFrame -> setOption(6) ;
01386 FOptionsFrame -> show() ;
01387 }
01388
01389 void Window :: interpol()
01390 {
01391 if (FOptionsFrame == NULL)
01392 FOptionsFrame = new OptionsFrame(this) ;
01393
01394 FOptionsFrame -> setOption(7) ;
01395 FOptionsFrame -> show() ;
01396 }
01397
01398 void Window :: affich()
01399 {
01400 if (FOptionsFrame == NULL)
01401 FOptionsFrame = new OptionsFrame(this) ;
01402
01403 FOptionsFrame -> setOption(2) ;
01404 FOptionsFrame -> show() ;
01405 }
01406
01407 void Window :: affichDivers()
01408 {
01409 if (FOptionsFrame == NULL)
01410 FOptionsFrame = new OptionsFrame(this) ;
01411
01412 FOptionsFrame -> setOption(8) ;
01413 FOptionsFrame -> show() ;
01414 }
01415
01416 void Window :: caracTopo()
01417 {
01418 if (FOptionsCarac == NULL)
01419 FOptionsCarac = new OptionsCarac(this) ;
01420
01421 FOptionsCarac -> show_impl() ;
01422 }
01423
01424 void Window :: couleurs()
01425 {
01426 resetActiveOperations();
01427 color_active = true;
01428 FCouleurs -> show();
01429 repaint();
01430 }
01431
01432
01433 void Window :: callbackToggleSews()
01434 {
01435 if (FOptionsFrame == NULL)
01436 FOptionsFrame = new OptionsFrame(this) ;
01437 FOptionsFrame -> callbackToggleSews() ;
01438 }
01439
01440
01441 void Window :: callbackToggleNormal()
01442 {
01443 if (FOptionsFrame == NULL)
01444 FOptionsFrame = new OptionsFrame(this) ;
01445 FOptionsFrame -> callbackToggleNormal() ;
01446 }
01447
01448
01449 void Window :: callbackToggleVertices()
01450 {
01451 if (FOptionsFrame == NULL)
01452 FOptionsFrame = new OptionsFrame(this) ;
01453 FOptionsFrame -> callbackToggleVertices() ;
01454 }
01455
01456
01457 void Window :: callbackToggleFaces()
01458 {
01459 if (FOptionsFrame == NULL)
01460 FOptionsFrame = new OptionsFrame(this);
01461 FOptionsFrame -> callbackToggleFaces() ;
01462 }
01463
01464 void Window :: callbackTournerButton()
01465 {
01466 if (FOptionsFrame == NULL)
01467 FOptionsFrame = new OptionsFrame(this);
01468 FOptionsFrame ->callbackTournerButton();
01469 }
01470
01471 void Window :: callbackToggleGrille()
01472 {
01473 if (FOptionsFrame == NULL)
01474 FOptionsFrame = new OptionsFrame(this) ;
01475 FOptionsFrame -> callbackToggleGrille() ;
01476 }
01477
01478 void Window :: chanf()
01479 {
01480 if (FOperationChanfreinage == NULL)
01481 FOperationChanfreinage = new OperationChanfreinage(this) ;
01482 FOperationChanfreinage -> show() ;
01483 }
01484
01485 void Window :: resetActiveOperations()
01486 {
01487
01488
01489 if (FCreationActive != NULL)
01490 {
01491 FCreationActive -> cancel() ;
01492 FCreationActive = NULL ;
01493 }
01494 else if (FOperationActive != NULL)
01495 {
01496 FOperationActive -> close() ;
01497 FOperationActive = NULL ;
01498 }
01499 #ifdef MODULE_ARCHITECTURE
01500 else if (FMeshActive != NULL)
01501 {
01502 FMeshActive -> reject() ;
01503 FMeshActive = NULL ;
01504 }
01505 #endif // MODULE_ARCHITECTURE
01506 else if (color_active)
01507 {
01508 FCouleurs -> close();
01509 color_active = false;
01510 }
01511 }
01512
01513
01514
01515 void Window :: callbackPolyline()
01516 {
01517 resetActiveOperations();
01518 getControler() -> setMode(MODE_CREATION_POLYLINE) ;
01519 FCreationActive = FCreationBrin ;
01520 FCreationActive -> setVisible(true);
01521 updateStatusBar();
01522 repaint();
01523 }
01524
01525 void Window :: callbackPolygon()
01526 {
01527 resetActiveOperations();
01528 getControler() -> setMode(MODE_CREATION_POLYGON) ;
01529 FCreationActive = FCreationPolygone ;
01530 FCreationActive -> setVisible(true);
01531 updateStatusBar();
01532 repaint();
01533 }
01534
01535 void Window :: callbackMeshCreation()
01536 {
01537 resetActiveOperations();
01538 getControler() -> setMode(MODE_CREATION_MESH) ;
01539 FCreationActive = FCreationMaillage ;
01540 FCreationActive -> setVisible(true);
01541 updateStatusBar();
01542 repaint();
01543 }
01544
01545 void Window :: callbackSphere()
01546 {
01547 resetActiveOperations();
01548 getControler() -> setMode(MODE_CREATION_SPHERE) ;
01549 FCreationActive = FCreationSphere ;
01550 FCreationActive -> setVisible(true);
01551 updateStatusBar();
01552 repaint();
01553 }
01554
01555 void Window :: callbackCylinder()
01556 {
01557 resetActiveOperations();
01558 getControler() -> setMode(MODE_CREATION_CYLINDER) ;
01559 FCreationActive = FCreationCylindre ;
01560 FCreationActive -> setVisible(true);
01561 updateStatusBar();
01562 repaint();
01563 }
01564
01565 void Window :: callbackPyramide()
01566 {
01567 resetActiveOperations();
01568 getControler() -> setMode(MODE_CREATION_PYRAMID) ;
01569 FCreationActive = FCreationPyramide ;
01570 FCreationActive -> setVisible(true);
01571 updateStatusBar();
01572 repaint();
01573 }
01574
01575 void Window :: callbackTorus()
01576 {
01577 resetActiveOperations();
01578 getControler() -> setMode(MODE_CREATION_TORUS) ;
01579 FCreationActive = FCreationTore ;
01580 FCreationActive -> setVisible(true);
01581 updateStatusBar();
01582 repaint();
01583 }
01584
01585 void Window :: callbackRandomizeDarts()
01586 {
01587 getControler()->randomizeDarts();
01588 updateStatusBar();
01589 }
01590
01591
01592
01593
01594
01595 void Window :: callbackTranslateWindow()
01596 {
01597 resetActiveOperations();
01598 getControler() -> setMode(MODE_TRANSLATION);
01599 FOperationActive = FDialogTranslation ;
01600 FOperationActive -> update();
01601 FOperationActive -> setVisible(true);
01602 updateStatusBar() ;
01603 repaint();
01604 }
01605
01606 void Window :: callbackRotateWindow()
01607 {
01608 resetActiveOperations();
01609 getControler() -> setMode(MODE_ROTATION);
01610 FOperationActive = FDialogRotation ;
01611 FOperationActive -> update();
01612 FOperationActive -> setVisible(true);
01613 updateStatusBar() ;
01614 repaint();
01615 }
01616
01617 void Window :: callbackScaleWindow()
01618 {
01619 resetActiveOperations();
01620 getControler() -> setMode(MODE_SCALE);
01621 FOperationActive = FDialogHomothetie ;
01622 FOperationActive -> update();
01623 FOperationActive -> setVisible(true);
01624 updateStatusBar() ;
01625 repaint();
01626 }
01627
01628
01629 void Window :: callbackIntuitiveTopoSew()
01630 {
01631 if (getControler() -> intuitiveTopoSew()) repaint() ;
01632 else updateStatusBar() ;
01633 }
01634
01635 void Window :: callbackIntuitiveGeoSew()
01636 {
01637 if (getControler() -> intuitiveGeoSew()) repaint() ;
01638 else updateStatusBar() ;
01639 }
01640
01641 void Window :: callbackTopoSew0()
01642 {
01643 if (getControler() -> topoSew(0)) repaint() ;
01644 else updateStatusBar() ;
01645 }
01646
01647 void Window :: callbackTopoSew1()
01648 {
01649 if (getControler() -> topoSew(1)) repaint() ;
01650 else updateStatusBar() ;
01651 }
01652
01653 void Window :: callbackGeoSew1()
01654 {
01655 if (getControler() -> geoSew(1)) repaint() ;
01656 else updateStatusBar() ;
01657 }
01658
01659 void Window ::callbackTopoSew2()
01660 {
01661 if (getControler() -> topoSew(2)) repaint() ;
01662 else updateStatusBar() ;
01663 }
01664
01665 void Window :: callbackGeoSew2()
01666 {
01667 if (getControler() -> geoSew(2)) repaint() ;
01668 else updateStatusBar() ;
01669 }
01670
01671 void Window :: callbackTopoSew3()
01672 {
01673 if (getControler() -> topoSew(3)) repaint() ;
01674 else updateStatusBar() ;
01675 }
01676
01677 void Window :: callbackGeoSew3()
01678 {
01679 if (getControler() -> geoSew(3)) repaint() ;
01680 else updateStatusBar() ;
01681 }
01682
01683 void Window :: callbackTopoSew1borders()
01684 {
01685 if (getControler() -> topoSewBorders(1)) repaint() ;
01686 else updateStatusBar() ;
01687 }
01688
01689 void Window :: callbackGeoSew1borders()
01690 {
01691 if (getControler() -> geoSewBorders(1)) repaint() ;
01692 else updateStatusBar() ;
01693 }
01694
01695 void Window :: callbackTopoSew2borders()
01696 {
01697 if (getControler() -> topoSewBorders(2)) repaint() ;
01698 else updateStatusBar() ;
01699 }
01700
01701 void Window :: callbackGeoSew2borders()
01702 {
01703 if (getControler() -> geoSewBorders(2)) repaint();
01704 else updateStatusBar() ;
01705 }
01706
01707 void Window :: callbackInvertLastOperation()
01708 {
01709 if (getControler() -> invertLastOperation()) repaint() ;
01710 else updateStatusBar() ;
01711 }
01712
01713 void Window :: callbackInvertLastOperationGeometry()
01714 {
01715 if (getControler() -> invertLastOperationGeometry()) repaint() ;
01716 else updateStatusBar() ;
01717 }
01718
01719
01720 void Window :: callbackIntuitiveUnsew()
01721 {
01722 if (getControler() -> intuitiveUnsew()) repaint() ;
01723 else updateStatusBar() ;
01724 }
01725
01726 void Window :: callbackUnsew0()
01727 {
01728 if (getControler() -> unsew(0)) repaint();
01729 else updateStatusBar() ;
01730 }
01731
01732 void Window :: callbackUnsew1()
01733 {
01734 if (getControler() -> unsew(1)) repaint() ;
01735 else updateStatusBar() ;
01736 }
01737
01738 void Window :: callbackUnsew2()
01739 {
01740 if (getControler() -> unsew(2)) repaint() ;
01741 else updateStatusBar() ;
01742 }
01743
01744 void Window :: callbackUnsew3()
01745 {
01746 if (getControler() -> unsew(3)) repaint() ;
01747 else updateStatusBar() ;
01748 }
01749
01750
01751 void Window :: callbackIntuitivePlate()
01752 {
01753 if (getControler() -> intuitivePlate()) repaint() ;
01754 else updateStatusBar() ;
01755 }
01756
01757 void Window :: callbackPlate0()
01758 {
01759 if (getControler() -> plate(0)) repaint() ;
01760 else updateStatusBar() ;
01761 }
01762
01763 void Window :: callbackPlate1()
01764 {
01765 if (getControler() -> plate(1)) repaint() ;
01766 else updateStatusBar() ;
01767 }
01768
01769 void Window :: callbackPlate2()
01770 {
01771 if (getControler() -> plate(2)) repaint() ;
01772 else updateStatusBar() ;
01773 }
01774
01775 void Window :: callbackPlate1borders()
01776 {
01777 if (getControler() -> plateBorders(1)) repaint() ;
01778 else updateStatusBar() ;
01779 }
01780
01781 void Window :: callbackPlate2borders()
01782 {
01783 if (getControler() -> plateBorders(2)) repaint() ;
01784 else updateStatusBar() ;
01785 }
01786
01787
01788 void Window :: callbackIntuitiveMerge()
01789 {
01790 if (getControler() -> intuitiveMerge()) repaint() ;
01791 else updateStatusBar() ;
01792 }
01793
01794 void Window :: callbackMergeEdges()
01795 {
01796 if (getControler() -> merge(1)) repaint() ;
01797 else updateStatusBar() ;
01798 }
01799
01800 void Window :: callbackMergeFaces()
01801 {
01802 if (getControler() -> merge(2)) repaint() ;
01803 else updateStatusBar() ;
01804 }
01805
01806 void Window :: callbackMergeVolumes()
01807 {
01808 if (getControler() -> merge(3)) repaint() ;
01809 else updateStatusBar() ;
01810 }
01811
01812 void Window :: callbackMergeColinearEdges()
01813 {
01814 if (getControler() -> mergeColinearEdges()) repaint() ;
01815 else updateStatusBar() ;
01816 }
01817
01818 void Window :: callbackMergeCoplanarFaces()
01819 {
01820 if (getControler() -> mergeCoplanarFaces()) repaint() ;
01821 else updateStatusBar() ;
01822 }
01823
01825 void Window :: callbackMergeFacesWithoutDisconnection()
01826 {
01827 if (getControler()->removeMarkedEdgesWithoutDisconnection()) repaint();
01828 else updateStatusBar() ;
01829 }
01830
01831 void Window :: callbackRemoveMarkedFacesButKeepBalls()
01832 {
01833 if (getControler()->removeMarkedFacesButKeepBalls()) repaint();
01834 else updateStatusBar() ;
01835 }
01836
01838 void Window :: callbackShiftAllEdgesIncidentToVertex()
01839 {
01840 if (getControler() -> shiftAllEdgesIncidentToVertex()) repaint() ;
01841 else updateStatusBar() ;
01842 }
01843
01845 void Window :: callbackRemoveDanglingEdges()
01846 {
01847 if (getControler() -> removeDanglingEdges()) repaint() ;
01848 else updateStatusBar() ;
01849 }
01850
01851
01852 void Window :: callbackIntuitiveContract()
01853 {
01854 if (getControler() -> contextContract()) repaint() ;
01855 else updateStatusBar() ;
01856 }
01857
01858 void Window :: callbackContractEdges()
01859 {
01860 if (getControler() -> contract(1)) repaint() ;
01861 else updateStatusBar() ;
01862 }
01863
01864 void Window :: callbackContractFaces()
01865 {
01866 if (getControler() -> contract(2)) repaint() ;
01867 else updateStatusBar() ;
01868 }
01869
01870 void Window :: callbackContractVolumes()
01871 {
01872 if (getControler() -> contract(3)) repaint() ;
01873 else updateStatusBar() ;
01874 }
01875
01876 void Window :: callbackDelNullEdges()
01877 {
01878 if (getControler() -> delNullEdges()) repaint() ;
01879 else updateStatusBar() ;
01880 }
01881
01882 void Window :: callbackDelFlatFaces()
01883 {
01884 if (getControler() -> delFlatFaces()) repaint() ;
01885 else updateStatusBar() ;
01886 }
01887
01888 void Window :: callbackDelFlatVolumes()
01889 {
01890 if (getControler() -> delFlatVolumes()) repaint() ;
01891 else updateStatusBar() ;
01892 }
01893
01894
01895 void Window :: callbackInsertVertex()
01896 {
01897 if (getControler() -> insertVertex()) repaint() ;
01898 else updateStatusBar() ;
01899 }
01900
01901 void Window :: callbackInsertEdge()
01902 {
01903 if (getControler() -> insertEdge()) repaint() ;
01904 else updateStatusBar() ;
01905 }
01906
01907 void Window :: callbackInsertFace()
01908 {
01909 if (getControler() -> insertFace()) repaint() ;
01910 else updateStatusBar() ;
01911 }
01912
01913
01914 void Window :: callbackIntuitiveStopUp()
01915 {
01916 if (getControler() -> intuitiveStopUp()) repaint() ;
01917 else updateStatusBar() ;
01918 }
01919
01920 void Window :: callbackStopUp0()
01921 {
01922 if (getControler() -> stopUp(0)) repaint() ;
01923 else updateStatusBar() ;
01924 }
01925
01926 void Window :: callbackStopUp1()
01927 {
01928 if (getControler() -> stopUp(1)) repaint() ;
01929 else updateStatusBar() ;
01930 }
01931
01932 void Window :: callbackStopUp2()
01933 {
01934 if (getControler() -> stopUp(2)) repaint() ;
01935 else updateStatusBar() ;
01936 }
01937
01938 void Window :: callbackStopUp3()
01939 {
01940 if (getControler() -> stopUp(3)) repaint() ;
01941 else updateStatusBar() ;
01942 }
01943
01944
01945 void Window :: callbackContextTriangulate()
01946 {
01947 if (getControler() -> contextTriangulate()) repaint() ;
01948 else updateStatusBar() ;
01949 }
01950
01951 void Window :: callbackTriangulateEdges()
01952 {
01953 if (getControler() -> triangulate(1)) repaint() ;
01954 else updateStatusBar() ;
01955 }
01956
01957 void Window :: callbackTriangulateFaces()
01958 {
01959 if (getControler() -> triangulate(2)) repaint() ;
01960 else updateStatusBar() ;
01961 }
01962
01963 void Window :: callbackTriangulateVolumes()
01964 {
01965 if (getControler() -> triangulate(3)) repaint() ;
01966 else updateStatusBar() ;
01967 }
01968
01969 void Window :: callbackSwapEdge()
01970 {
01971 if (getControler() -> swapEdge()) repaint() ;
01972 else updateStatusBar() ;
01973 }
01974
01975 void Window :: callbackTriangulateGeoFaces()
01976 {
01977 if (getControler() -> triangulateGeoFaces()) repaint() ;
01978 else updateStatusBar() ;
01979 }
01980
01981
01982
01983 void Window :: callbackQuadrangulateFaces()
01984 {
01985 if (getControler() -> quadrangulateFaces()) repaint() ;
01986 else updateStatusBar() ;
01987 }
01988
01989 void Window :: callbackBasicQuadrangulateFaces()
01990 {
01991 if (getControler() -> basicQuadrangulateFaces()) repaint() ;
01992 else updateStatusBar() ;
01993 }
01994
01995
01996 void Window :: callbackDual2d()
01997 {
01998 if (getControler() -> dual2d()) repaint() ;
01999 else updateStatusBar() ;
02000 }
02001
02002 void Window :: callbackDual3d()
02003 {
02004 if (getControler() -> dual3d()) repaint() ;
02005 else updateStatusBar() ;
02006 }
02007
02008
02009 void Window :: callbackIntuitiveExtrudeByNormal()
02010 {
02011 if (getControler() -> intuitiveExtrudeByNormal()) repaint() ;
02012 else updateStatusBar() ;
02013 }
02014
02015 void Window :: callbackExtrude0ByNormal()
02016 {
02017 if (getControler() -> extrudeByNormal(0)) repaint() ;
02018 else updateStatusBar() ;
02019 }
02020
02021 void Window :: callbackExtrude1ByNormal()
02022 {
02023 if (getControler() ->extrudeByNormal(1)) repaint() ;
02024 else updateStatusBar() ;
02025 }
02026
02027 void Window :: callbackExtrude2ByNormal()
02028 {
02029 if (getControler() -> extrudeByNormal(2)) repaint() ;
02030 else updateStatusBar() ;
02031 }
02032
02033 void Window :: callbackExtrude1ByPath()
02034 {
02035 if (getControler() -> extrudeByPath(1)) repaint() ;
02036 else updateStatusBar() ;
02037 }
02038
02039 void Window :: callbackExtrude2ByPath()
02040 {
02041 if (getControler() -> extrudeByPath(2)) repaint() ;
02042 else updateStatusBar() ;
02043 }
02044
02045 void Window :: callbackExtrude1ByRevolution()
02046 {
02047 if (getControler() -> extrudeByRevolution(1)) repaint() ;
02048 else updateStatusBar() ;
02049 }
02050
02051 void Window :: callbackExtrude2ByRevolution()
02052 {
02053 if (getControler() -> extrudeByRevolution(2)) repaint() ;
02054 else updateStatusBar() ;
02055 }
02056
02057 void Window :: callbackThicken()
02058 {
02059 if (getControler() -> thicken()) repaint() ;
02060 else updateStatusBar() ;
02061 }
02062
02063
02064
02065 void Window::callbackMeshEdge()
02066 {
02067 #ifdef MODULE_MESH
02068 if (getControler() -> meshEdges()) repaint() ;
02069 else updateStatusBar() ;
02070 #endif //MODULE_MESH
02071 }
02072 void Window::callbackMeshSquare01()
02073 {
02074 #ifdef MODULE_MESH
02075 callbackMeshSquare(0 , 1) ;
02076 #endif //MODULE_MESH
02077 }
02078
02079 void Window::callbackMeshSquare02()
02080 {
02081 #ifdef MODULE_MESH
02082 callbackMeshSquare(0 , 2) ;
02083 #endif //MODULE_MESH
02084 }
02085
02086 void Window::callbackMeshSquare12()
02087 {
02088 #ifdef MODULE_MESH
02089 callbackMeshSquare(1 , 2) ;
02090 #endif //MODULE_MESH
02091 }
02092
02093 void Window::callbackMeshSquare(int i , int j)
02094 {
02095 #ifdef MODULE_MESH
02096 if (getControler() -> meshSquares(i , j)) repaint() ;
02097 else updateStatusBar() ;
02098 #endif //MODULE_MESH
02099 }
02100
02101 void Window::callbackMeshCube01()
02102 {
02103 #ifdef MODULE_MESH
02104 callbackMeshCube(0 , 1) ;
02105 #endif //MODULE_MESH
02106 }
02107
02108 void Window::callbackMeshCube02()
02109 {
02110 #ifdef MODULE_MESH
02111 callbackMeshCube(0 , 2) ;
02112 #endif //MODULE_MESH
02113 }
02114
02115 void Window::callbackMeshCube03()
02116 {
02117 #ifdef MODULE_MESH
02118 callbackMeshCube(0 , 3) ;
02119 #endif //MODULE_MESH
02120 }
02121
02122 void Window::callbackMeshCube12()
02123 {
02124 #ifdef MODULE_MESH
02125 callbackMeshCube(1 , 2) ;
02126 #endif //MODULE_MESH
02127 }
02128
02129 void Window::callbackMeshCube13()
02130 {
02131 #ifdef MODULE_MESH
02132 callbackMeshCube(1 , 3) ;
02133 #endif //MODULE_MESH
02134 }
02135
02136 void Window::callbackMeshCube23()
02137 {
02138 #ifdef MODULE_MESH
02139 callbackMeshCube(2 , 3) ;
02140 #endif //MODULE_MESH
02141 }
02142
02143 void Window::callbackMeshCube(int i , int j)
02144 {
02145 #ifdef MODULE_MESH
02146 if (getControler() -> meshCubes(i , j)) repaint() ;
02147 else updateStatusBar() ;
02148 #endif //MODULE_MESH
02149 }
02150
02151 void Window :: callbackSmooth1()
02152 {
02153 #ifdef MODULE_MESH
02154 if (getControler() -> smoothEdges()) repaint() ;
02155 else updateStatusBar();
02156 #endif //MODULE_MESH
02157 }
02158
02159 void Window :: callbackSmooth2()
02160 {
02161 #ifdef MODULE_MESH
02162 if (getControler() -> smoothSquares()) repaint() ;
02163 else updateStatusBar();
02164 #endif //MODULE_MESH
02165 }
02166
02167 void Window :: callbackSmooth3()
02168 {
02169 #ifdef MODULE_MESH
02170 if (getControler() -> smoothCubes()) repaint() ;
02171 else updateStatusBar();
02172 #endif //MODULE_MESH
02173 }
02174
02175
02176 void Window::callbackRoundVertices()
02177 {
02178 #ifdef MODULE_ROUNDING
02179 roundVertices(false);
02180 #endif // MODULE_ROUNDING
02181 }
02182
02183 void Window::callbackRoundVerticesDig()
02184 {
02185 #ifdef MODULE_ROUNDING
02186 roundVertices(true);
02187 #endif // MODULE_ROUNDING
02188 }
02189
02190 void Window::roundVertices(bool ADig)
02191 {
02192 #ifdef MODULE_ROUNDING
02193 if (getControler() -> roundVertices(ADig)) repaint() ;
02194 else updateStatusBar() ;
02195 #endif // MODULE_ROUNDING
02196 }
02197
02198 void Window::callbackRoundEdges2d()
02199 {
02200 #ifdef MODULE_ROUNDING
02201 roundEdges(false, false, false);
02202 #endif // MODULE_ROUNDING
02203 }
02204
02205 void Window::callbackRoundEdges2dDig()
02206 {
02207 #ifdef MODULE_ROUNDING
02208 roundEdges(false, true, false);
02209 #endif // MODULE_ROUNDING
02210 }
02211
02212 void Window::callbackRoundEdges3d()
02213 {
02214 #ifdef MODULE_ROUNDING
02215 roundEdges(true, false, false);
02216 #endif // MODULE_ROUNDING
02217 }
02218
02219 void Window::callbackRoundEdges3dDig()
02220 {
02221 #ifdef MODULE_ROUNDING
02222 roundEdges(true, true, false);
02223 #endif // MODULE_ROUNDING
02224 }
02225
02226 void Window::callbackRoundEdges2dWithSetback()
02227 {
02228 #ifdef MODULE_ROUNDING
02229 roundEdges(false, false, true);
02230 #endif // MODULE_ROUNDING
02231 }
02232
02233 void Window::callbackRoundEdges2dDigWithSetback()
02234 {
02235 #ifdef MODULE_ROUNDING
02236 roundEdges(false, true, true);
02237 #endif // MODULE_ROUNDING
02238 }
02239
02240 void Window::callbackRoundEdges3dWithSetback()
02241 {
02242 #ifdef MODULE_ROUNDING
02243 roundEdges(true, false, true);
02244 #endif // MODULE_ROUNDING
02245 }
02246
02247 void Window::callbackRoundEdges3dDigWithSetback()
02248 {
02249 #ifdef MODULE_ROUNDING
02250 roundEdges(true, true, true);
02251 #endif // MODULE_ROUNDING
02252 }
02253
02254 void Window::roundEdges(bool A3D, bool ADig, bool ASetback)
02255 {
02256 #ifdef MODULE_ROUNDING
02257 if (getControler() -> roundEdges(A3D, ADig, ASetback)) repaint() ;
02258 else updateStatusBar() ;
02259 #endif // MODULE_ROUNDING
02260 }
02261
02262
02263
02264 void Window :: callbackTriangulateTopoFaces()
02265 {
02266 #ifdef MODULE_TRIANGULATION
02267 if (getControler() -> triangulateTopoFaces()) repaint() ;
02268 else updateStatusBar() ;
02269 #endif // MODULE_TRIANGULATION
02270 }
02271
02272 void Window :: callbackMarkNonUniformFaces()
02273 {
02274 #ifdef MODULE_TRIANGULATION
02275 if (getControler() -> markNonUniformFaces()) repaint() ;
02276 else updateStatusBar() ;
02277 #endif // MODULE_TRIANGULATION
02278 }
02279
02280 void Window :: callbackOptimizeSelectedEdges()
02281 {
02282 #ifdef MODULE_TRIANGULATION
02283 if (getControler() -> optimizeSelectedEdges()) repaint() ;
02284 else updateStatusBar() ;
02285 #endif // MODULE_TRIANGULATION
02286 }
02287
02288 void Window :: callbackDelaunayTriangulation()
02289 {
02290 #ifdef MODULE_TRIANGULATION
02291 if (getControler() -> createDelaunayTriangulation()) repaint() ;
02292 else updateStatusBar() ;
02293 #endif // MODULE_TRIANGULATION
02294 }
02295
02296 void Window :: callbackOptimizedDelaunayTriangulation()
02297 {
02298 #ifdef MODULE_TRIANGULATION
02299 if (getControler() -> createOptimizedDelaunayTriangulation()) repaint() ;
02300 else updateStatusBar() ;
02301 #endif // MODULE_TRIANGULATION
02302 }
02303
02304
02305 void Window :: callbackCorefine2dSegmentsSweeping()
02306 {
02307 #ifdef MODULE_COREFINEMENT
02308 if (getControler() ->corefine2dSegmentsSweeping()) repaint() ;
02309 else updateStatusBar() ;
02310 #endif // COREFINEMENT
02311 }
02312
02313 void Window :: callbackCorefine2dSegmentsPropagation()
02314 {
02315 #ifdef MODULE_COREFINEMENT
02316 if (getControler() ->corefine2dSegmentsPropagation()) repaint() ;
02317 else updateStatusBar() ;
02318 #endif // COREFINEMENT
02319 }
02320
02321 void Window :: callbackBooleanOperations2d()
02322 {
02323 #ifdef MODULE_COREFINEMENT
02324 if (getControler() ->booleanOperations2d()) repaint() ;
02325 else updateStatusBar() ;
02326 #endif // COREFINEMENT
02327 }
02328
02329 void Window :: callbackCorefine3dMeshes()
02330 {
02331 #ifdef MODULE_COREFINEMENT
02332 if (getControler() ->corefine3dMeshes()) repaint() ;
02333 else updateStatusBar() ;
02334 #endif // COREFINEMENT
02335 }
02336
02337 void Window :: callbackCorefine3dFaces()
02338 {
02339 #ifdef MODULE_COREFINEMENT
02340 if (getControler() ->corefine3dFaces()) repaint() ;
02341 else updateStatusBar() ;
02342 #endif // COREFINEMENT
02343 }
02344
02345 void Window :: callbackCorefineMarked3dFaces()
02346 {
02347 #ifdef MODULE_COREFINEMENT
02348 if (getControler() ->corefineMarked3dFaces()) repaint() ;
02349 else updateStatusBar() ;
02350 #endif // COREFINEMENT
02351 }
02352
02353 void Window :: callbackCorefineMarked3dMeshesWith()
02354 {
02355 #ifdef MODULE_COREFINEMENT
02356 if (getControler() ->corefineMarked3dMeshesWith()) repaint() ;
02357 else updateStatusBar() ;
02358 #endif // COREFINEMENT
02359 }
02360
02361 void Window :: callbackBooleanOperations3d()
02362 {
02363 #ifdef MODULE_COREFINEMENT
02364 if (getControler() ->booleanOperations3d()) repaint() ;
02365 else updateStatusBar() ;
02366 #endif // COREFINEMENT
02367 }
02368
02369
02370 void Window :: callbackUncertainZone()
02371 {
02372 #ifdef MODULE_GEOLOGY
02373 if (getControler() ->createUncertainZone()) repaint() ;
02374 else updateStatusBar() ;
02375 #endif // MODULE_GEOLOGY
02376 }
02377
02378 void Window :: callbackCreateNearestIntersections()
02379 {
02380 #ifdef MODULE_GEOLOGY
02381 if (getControler() ->createNearestIntersections()) repaint() ;
02382 else updateStatusBar() ;
02383 #endif // MODULE_GEOLOGY
02384 }
02385
02386 void Window :: callbackExtendSelectedBorders()
02387 {
02388 #ifdef MODULE_GEOLOGY
02389 if (getControler() ->extendSelectedBorders()) repaint() ;
02390 else updateStatusBar() ;
02391 #endif // MODULE_GEOLOGY
02392 }
02393
02394 void Window :: callbackExtendSelectedBordersToSurface()
02395 {
02396 #ifdef MODULE_GEOLOGY
02397 if (getControler() ->extendSelectedBordersToSurface()) repaint() ;
02398 else updateStatusBar() ;
02399 #endif // MODULE_GEOLOGY
02400 }
02401
02402 void Window :: callbackSmoothSelection()
02403 {
02404 #ifdef MODULE_GEOLOGY
02405 if (getControler() ->smoothSelection()) repaint() ;
02406 else updateStatusBar() ;
02407 #endif // MODULE_GEOLOGY
02408 }
02409
02410 void Window :: callbackRelaxSelection()
02411 {
02412 #ifdef MODULE_GEOLOGY
02413 if (getControler() ->relaxSelection()) repaint() ;
02414 else updateStatusBar() ;
02415 #endif // MODULE_GEOLOGY
02416 }
02417
02418 void Window :: callbackSimplifyMesh()
02419 {
02420 #ifdef MODULE_GEOLOGY
02421 if (getControler() ->simplifyMesh()) repaint() ;
02422 else updateStatusBar() ;
02423 #endif // MODULE_GEOLOGY
02424 }
02425
02426 void Window :: callbackCenterSelection()
02427 {
02428 #ifdef MODULE_GEOLOGY
02429 if (getControler() ->centerSelection()) repaint() ;
02430 else updateStatusBar() ;
02431 #endif // MODULE_GEOLOGY
02432 }
02433
02434 void Window :: callbackPlateVerticesOnFaces()
02435 {
02436 #ifdef MODULE_GEOLOGY
02437 if (getControler() ->plateVerticesOnFaces()) repaint() ;
02438 else updateStatusBar() ;
02439 #endif // MODULE_GEOLOGY
02440 }
02441
02442 void Window :: callbackPlateVerticesOnEdges()
02443 {
02444 #ifdef MODULE_GEOLOGY
02445 if (getControler() ->plateVerticesOnEdges()) repaint() ;
02446 else updateStatusBar() ;
02447 #endif // MODULE_GEOLOGY
02448 }
02449
02450 void Window :: callbackPlateVerticesOnVertices()
02451 {
02452 #ifdef MODULE_GEOLOGY
02453 if (getControler() ->plateVerticesOnVertices()) repaint() ;
02454 else updateStatusBar() ;
02455 #endif // MODULE_GEOLOGY
02456 }
02457
02458 void Window :: callbackSelectMacroVertices()
02459 {
02460 #ifdef MODULE_GEOLOGY
02461 if (getControler() ->selectMacroVertices()) repaint() ;
02462 else updateStatusBar() ;
02463 #endif // MODULE_GEOLOGY
02464 }
02465
02466 void Window :: callbackSelectAllMacroEdges()
02467 {
02468 #ifdef MODULE_GEOLOGY
02469 if (getControler() ->selectAllMacroEdges()) repaint() ;
02470 else updateStatusBar() ;
02471 #endif // MODULE_GEOLOGY
02472 }
02473
02474 void Window :: callbackSelectMacroEdges()
02475 {
02476 #ifdef MODULE_GEOLOGY
02477 if (getControler() ->selectMacroEdges()) repaint() ;
02478 else updateStatusBar() ;
02479 #endif // MODULE_GEOLOGY
02480 }
02481
02482 void Window :: callbackSelectMacroFaces()
02483 {
02484 #ifdef MODULE_GEOLOGY
02485 if (getControler() ->selectMacroFaces()) repaint() ;
02486 else updateStatusBar() ;
02487 #endif // MODULE_GEOLOGY
02488 }
02489
02490 void Window :: callbackSelectBordersBetweenSelectedDarts()
02491 {
02492 #ifdef MODULE_GEOLOGY
02493 if (getControler() ->selectBordersBetweenSelectedDarts()) repaint() ;
02494 else updateStatusBar() ;
02495 #endif // MODULE_GEOLOGY
02496 }
02497
02498 void Window :: callbackHolesRefinement()
02499 {
02500 #ifdef MODULE_GEOLOGY
02501
02502
02503 if (FCreationActive != NULL)
02504 {
02505 FCreationActive -> cancel() ;
02506 FCreationActive = NULL ;
02507 }
02508 else if (FOperationActive != NULL)
02509 {
02510 FOperationActive -> close() ;
02511 FOperationActive = NULL ;
02512 }
02513 else if (FMeshActive != NULL)
02514 {
02515 FMeshActive -> reject() ;
02516 FMeshActive = NULL ;
02517 }
02518
02519 FMeshActive = new MeshHolesGestion(this , getControler()) ;
02520 FMeshActive -> show() ;
02521 updateStatusBar();
02522 #endif // MODULE_GEOLOGY
02523 }
02524
02525 void Window :: callbackTriangulateHoles()
02526 {
02527 #ifdef MODULE_GEOLOGY
02528 if (getControler() ->triangulateHoles()) repaint() ;
02529 else updateStatusBar() ;
02530 #endif // MODULE_GEOLOGY
02531 }
02532
02533 void Window :: callbackFillHolesOnMeshes()
02534 {
02535 #ifdef MODULE_GEOLOGY
02536 if (getControler() ->fillHolesOnMeshes()) repaint() ;
02537 else updateStatusBar() ;
02538 #endif // MODULE_GEOLOGY
02539 }
02540
02541 void Window :: callbackFailleDetection()
02542 {
02543 #ifdef MODULE_GEOLOGY
02544
02545
02546 if (FCreationActive != NULL)
02547 {
02548 FCreationActive -> cancel() ;
02549 FCreationActive = NULL ;
02550 }
02551 else if (FOperationActive != NULL)
02552 {
02553 FOperationActive -> close() ;
02554 FOperationActive = NULL ;
02555 }
02556 else if (FMeshActive != NULL)
02557 {
02558 FMeshActive -> reject() ;
02559 FMeshActive = NULL ;
02560 }
02561
02562 FMeshActive = new MeshFailleGestion(this , getControler()) ;
02563 FMeshActive -> show() ;
02564 updateStatusBar();
02565 #endif // MODULE_GEOLOGY
02566 }
02567
02568 void Window :: callbackExtractDetectedFailles()
02569 {
02570 #ifdef MODULE_GEOLOGY
02571 if (getControler() ->extractDetectedFailles()) repaint() ;
02572 else updateStatusBar() ;
02573 #endif // MODULE_GEOLOGY
02574 }
02575
02576 void Window :: callbackExtensionFailleSurface()
02577 {
02578 #ifdef MODULE_GEOLOGY
02579
02580
02581 if (FCreationActive != NULL)
02582 {
02583 FCreationActive -> cancel() ;
02584 FCreationActive = NULL ;
02585 }
02586 else if (FOperationActive != NULL)
02587 {
02588 FOperationActive -> close() ;
02589 FOperationActive = NULL ;
02590 }
02591 else if (FMeshActive != NULL)
02592 {
02593 FMeshActive -> reject() ;
02594 FMeshActive = NULL ;
02595 }
02596
02597 FMeshActive = new MeshExtension(this , getControler()) ;
02598 FMeshActive -> show() ;
02599 updateStatusBar();
02600 #endif // MODULE_GEOLOGY
02601 }
02602
02603
02604
02605
02606
02607
02608
02609
02610
02611 void Window :: callbackMeshSimplification()
02612 {
02613 #ifdef MODULE_GEOLOGY
02614
02615
02616 if (FCreationActive != NULL)
02617 {
02618 FCreationActive -> cancel() ;
02619 FCreationActive = NULL ;
02620 }
02621 else if (FOperationActive != NULL)
02622 {
02623 FOperationActive -> close() ;
02624 FOperationActive = NULL ;
02625 }
02626 else if (FMeshActive != NULL)
02627 {
02628 FMeshActive -> reject() ;
02629 FMeshActive = NULL ;
02630 }
02631
02632 FMeshActive = new MeshSimplification(this , getControler()) ;
02633 FMeshActive -> show() ;
02634 updateStatusBar();
02635 #endif // MODULE_GEOLOGY
02636 }
02637
02638
02639
02640
02641
02642
02643
02644
02645
02646
02647
02648
02649
02650
02651
02652
02653
02654
02655 void Window :: callbackImportGr2d()
02656 {
02657 #ifdef MODULE_GEOLOGY
02658 char* filename = getOpenFileName("Importer Gr2D") ;
02659 if (filename != NULL)
02660 {
02661 if (getControler() -> importGr2d(filename)) repaint() ;
02662 else updateStatusBar() ;
02663 }
02664 #endif // MODULE_GEOLOGY
02665 }
02666
02667 void Window :: callbackImportXyz()
02668 {
02669 #ifdef MODULE_GEOLOGY
02670 char* filename = getOpenFileName("Importer XYZ") ;
02671 if (filename != NULL)
02672 {
02673 if (getControler() -> importXyz(filename)) repaint() ;
02674 else updateStatusBar() ;
02675 }
02676 #endif // MODULE_GEOLOGY
02677
02678 }
02679
02680 void Window :: callbackImportTs()
02681 {
02682 #ifdef MODULE_GEOLOGY
02683
02684 char* filename = getOpenFileName("Importer TS") ;
02685 if (filename != NULL)
02686 {
02687 if (getControler() -> importTs(filename)) repaint() ;
02688 else updateStatusBar() ;
02689 }
02690 #endif // MODULE_GEOLOGY
02691 }
02692
02693 void Window :: callbackImportCloud()
02694 {
02695 #ifdef MODULE_GEOLOGY
02696 char* filename = getOpenFileName("Importer Nuage de point") ;
02697 if (filename != NULL)
02698 {
02699 if (getControler() -> importCloud(filename)) repaint() ;
02700 else updateStatusBar() ;
02701 }
02702 #endif // MODULE_GEOLOGY
02703 }
02704
02705 void Window :: callbackImportVrml()
02706 {
02707 #ifdef MODULE_GEOLOGY
02708
02709 char* filename = getOpenFileName("Importer VRML") ;
02710
02711 if (filename != NULL)
02712 {
02713 if (getControler() -> importVrml(filename)) repaint() ;
02714 else updateStatusBar() ;
02715 }
02716 #endif // MODULE_GEOLOGY
02717 }
02718
02719 void Window :: callbackExportTs()
02720 {
02721 #ifdef MODULE_GEOLOGY
02722
02723 char* filename = getSaveFileName("Exporter TS") ;
02724
02725 if (filename != NULL)
02726 {
02727 if (getControler() -> exportTs(filename)) repaint() ;
02728 else updateStatusBar() ;
02729 }
02730 #endif // MODULE_GEOLOGY
02731 }
02732
02733 void Window :: callbackImportGr2dOk()
02734 {
02735 #ifdef MODULE_GEOLOGY
02736
02737
02738
02739 #endif // MODULE_GEOLOGY
02740 }
02741
02742 void Window :: callbackImportXyzOk()
02743 {
02744 #ifdef MODULE_GEOLOGY
02745
02746
02747
02748 #endif // MODULE_GEOLOGY
02749 }
02750
02751 void Window :: callbackImportTsOk()
02752 {
02753 #ifdef MODULE_GEOLOGY
02754
02755
02756
02757 #endif // MODULE_GEOLOGY
02758 }
02759
02760 void Window :: callbackImportCloudOk()
02761 {
02762 #ifdef MODULE_GEOLOGY
02763
02764
02765
02766 #endif // MODULE_GEOLOGY
02767 }
02768
02769
02770
02771
02772 void Window :: callbackMaterializeBarycenter()
02773 {
02774 if (getControler() ->materializeBarycenter()) repaint() ;
02775 else updateStatusBar() ;
02776 }
02777
02778 void Window :: callbackMaterializeAxe()
02779 {
02780 if (getControler() ->materializeAxe()) repaint() ;
02781 else updateStatusBar() ;
02782 }
02783
02784 void Window :: callbackMaterializePlane()
02785 {
02786 if (getControler() ->materializePlane()) repaint() ;
02787 else updateStatusBar() ;
02788 }
02789
02790 void Window :: callbackMaterializeNormalVector()
02791 {
02792 if (getControler() ->materializeNormalVector()) repaint() ;
02793 else updateStatusBar() ;
02794 }
02795
02796 void Window :: callbackMaterializeOrthoPlane()
02797 {
02798 if (getControler() ->materializeOrthoPlane()) repaint() ;
02799 else updateStatusBar() ;
02800 }
02801
02802 void Window :: callbackMaterializeReferential()
02803 {
02804 if (getControler() ->materializeReferential()) repaint() ;
02805 else updateStatusBar() ;
02806 }
02807
02808
02809
02810
02811 void Window :: callbackReinitSelection()
02812 {
02813 if (getControler() -> unmarkAllCurrentSelectionLevel()) repaint() ;
02814 else updateStatusBar() ;
02815 }
02816
02817 void Window :: callbackNegateSelection()
02818 {
02819 if (getControler() -> negateAllCurrentSelectionLevel()) repaint() ;
02820 else updateStatusBar() ;
02821 }
02822
02823 void Window :: callbackSwapSelections()
02824 {
02825 if (getControler() -> swapCurrentSelectionLevelWithNext()) repaint() ;
02826 else updateStatusBar() ;
02827 }
02828
02829 void Window :: callbackDuplicateSelection()
02830 {
02831 if (getControler() -> duplicateSelection()) repaint() ;
02832 else updateStatusBar() ;
02833 }
02834
02835 void Window :: callbackDeleteSelection()
02836 {
02837 if (getControler() -> deleteSelection()) repaint() ;
02838 else updateStatusBar() ;
02839 }
02840
02841 void Window :: callbackGoForward1()
02842 {
02843 if (getControler() -> goForward1()) repaint() ;
02844 else updateStatusBar() ;
02845 }
02846
02847 void Window :: callbackGoBackward1()
02848 {
02849 if (getControler() -> goBackward1()) repaint() ;
02850 else updateStatusBar();
02851 }
02852
02853 void Window :: callbackGoLeft1()
02854 {
02855 if (getControler() -> goLeft1()) repaint() ;
02856 else updateStatusBar();
02857 }
02858
02859 void Window :: callbackGoRight1()
02860 {
02861 if (getControler() -> goRight1()) repaint() ;
02862 else updateStatusBar();
02863 }
02864 void Window :: callbackGoForward1Rep()
02865 {
02866 if (getControler() -> goForward1Rep()) repaint() ;
02867 else updateStatusBar();
02868 }
02869
02870 void Window :: callbackGoBackward1Rep()
02871 {
02872 if (getControler() -> goBackward1Rep()) repaint() ;
02873 else updateStatusBar();
02874 }
02875
02876 void Window :: callbackGoLeft1Rep()
02877 {
02878 if (getControler() -> goLeft1Rep()) repaint() ;
02879 else updateStatusBar();
02880 }
02881
02882 void Window :: callbackGoRight1Rep()
02883 {
02884 if (getControler() -> goRight1Rep()) repaint() ;
02885 else updateStatusBar();
02886 }
02887
02888 void Window :: callbackGoForward0()
02889 {
02890 if (getControler() -> goForward0()) repaint() ;
02891 else updateStatusBar();
02892 }
02893
02894 void Window :: callbackGoBackward0()
02895 {
02896 if (getControler() -> goBackward0()) repaint() ;
02897 else updateStatusBar();
02898 }
02899
02900 void Window :: callbackGoLeft0()
02901 {
02902 if (getControler() -> goLeft0()) repaint() ;
02903 else updateStatusBar();
02904 }
02905
02906 void Window :: callbackGoRight0()
02907 {
02908 if (getControler() -> goRight1()) repaint() ;
02909 else updateStatusBar();
02910 }
02911
02912 void Window :: callbackGoForward0Rep()
02913 {
02914 if (getControler() -> goForward0Rep()) repaint() ;
02915 else updateStatusBar();
02916 }
02917
02918 void Window :: callbackGoBackward0Rep()
02919 {
02920 if (getControler() -> goBackward0Rep()) repaint() ;
02921 else updateStatusBar();
02922 }
02923
02924 void Window :: callbackGoLeft0Rep()
02925 {
02926 if (getControler() -> goLeft0Rep()) repaint() ;
02927 else updateStatusBar();
02928 }
02929
02930 void Window :: callbackGoRight0Rep()
02931 {
02932 if (getControler() -> goRight0Rep()) repaint() ;
02933 else updateStatusBar();
02934 }
02935
02936 void Window :: callbackMarkInterior2()
02937 {
02938 if (getControler() ->markInterior(2)) repaint() ;
02939 else updateStatusBar() ;
02940 }
02941
02942 void Window :: callbackMarkInterior3()
02943 {
02944 if (getControler() ->markInterior(3)) repaint() ;
02945 else updateStatusBar() ;
02946 }
02947
02948 void Window :: callbackIntuitiveSelectBorders()
02949 {
02950 if (getControler() ->intuitiveSelectBorders()) repaint() ;
02951 else updateStatusBar() ;
02952 }
02953
02954 void Window :: callbackSelect0borders()
02955 {
02956 if (getControler() ->selectBorders(0)) repaint() ;
02957 else updateStatusBar() ;
02958 }
02959
02960 void Window :: callbackSelect1borders()
02961 {
02962 if (getControler() ->selectBorders(1)) repaint() ;
02963 else updateStatusBar() ;
02964 }
02965
02966 void Window :: callbackSelect2borders()
02967 {
02968 if (getControler() ->selectBorders(2)) repaint() ;
02969 else updateStatusBar() ;
02970 }
02971
02972 void Window :: callbackSelect3borders()
02973 {
02974 if (getControler() ->selectBorders(3)) repaint() ;
02975 else updateStatusBar() ;
02976 }
02977
02978 void Window :: callbackSelectNonPlanarFaces()
02979 {
02980 if (getControler() ->selectNonPlanarFaces()) repaint() ;
02981 else updateStatusBar() ;
02982 }
02983
02984 void Window :: callbackSelectIncidents()
02985 {
02986 if (getControler() ->selectIncidents()) repaint() ;
02987 else updateStatusBar() ;
02988 }
02989
02990 void Window :: callbackGoAlpha0()
02991 {
02992 if (getControler() ->goAlpha0()) repaint() ;
02993 else updateStatusBar() ;
02994 }
02995 void Window :: callbackGoAlpha1()
02996 {
02997 if (getControler() ->goAlpha1()) repaint() ;
02998 else updateStatusBar() ;
02999 }
03000 void Window :: callbackGoAlpha2()
03001 {
03002 if (getControler() ->goAlpha2()) repaint() ;
03003 else updateStatusBar() ;
03004 }
03005 void Window :: callbackGoAlpha3()
03006 {
03007 if (getControler() ->goAlpha3()) repaint() ;
03008 else updateStatusBar() ;
03009 }
03010
03011
03012
03013 void Window :: tile()
03014 {
03015 FWorkspace -> tile() ;
03016 }
03017
03018 void Window :: cascade()
03019 {
03020 FWorkspace -> cascade() ;
03021 }
03022
03023 void Window :: addView3D()
03024 {
03025 GLWindow * vue = new GLWindow(VIEW_XYZ , FWorkspace ,
03026 this , FVueMere , FSelection) ;
03027 vue -> setMinimumSize(200 , 200) ;
03028 vue -> show() ;
03029 }
03030
03031 void Window :: addViewMulti()
03032 {
03033 GLMultiWindow * vue = new GLMultiWindow(FWorkspace , this , FVueMere,
03034 FSelection) ;
03035 vue -> setMinimumSize(200 , 200) ;
03036 vue -> show() ;
03037 }
03038
03039 void Window :: addViewXY()
03040 {
03041 GLWindow * vue = new GLWindow(VIEW_XY , FWorkspace ,
03042 this , FVueMere , FSelection) ;
03043 vue -> setMinimumSize(200 , 200) ;
03044 vue -> show() ;
03045 }
03046
03047 void Window :: addViewYZ()
03048 {
03049 GLWindow * vue = new GLWindow(VIEW_YZ , FWorkspace ,
03050 this , FVueMere , FSelection) ;
03051 vue -> setMinimumSize(200 , 200) ;
03052 vue -> show() ;
03053 }
03054
03055 void Window :: addViewZX()
03056 {
03057 GLWindow * vue = new GLWindow(VIEW_XZ , FWorkspace ,
03058 this , FVueMere , FSelection) ;
03059 vue -> setMinimumSize(200 , 200) ;
03060 vue -> show() ;
03061 }
03062
03063 void Window :: basculeView3D()
03064 {
03065 bascule(VIEW_XYZ) ;
03066 }
03067
03068 void Window :: basculeViewXY()
03069 {
03070 bascule(VIEW_XY) ;
03071 }
03072
03073 void Window :: basculeViewYZ()
03074 {
03075 bascule(VIEW_YZ) ;
03076 }
03077
03078 void Window :: basculeViewZX()
03079 {
03080 bascule(VIEW_XZ) ;
03081 }
03082
03083 void Window :: basculeViewMulti()
03084 {
03085 bascule(VIEW_ISO) ;
03086 }
03087
03088 void Window :: deleteView()
03089 {
03090 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03091 active -> closeEvent(NULL) ;
03092 }
03093
03094 void Window :: OperationUngroupAllGeneral()
03095 {
03096 FControler -> viewUngroupAll() ;
03097 repaint() ;
03098 }
03099
03100 void Window :: OperationUngroupAllPrecompiles()
03101 {
03102 FControler -> viewUngroupAllPrecompiles() ;
03103 repaint() ;
03104 }
03105
03106 void Window :: OperationUngroupAllEyePos()
03107 {
03108 FControler -> viewUngroupAllParameter(PARAMETER_EYE_POSITION) ;
03109 repaint() ;
03110 }
03111
03112 void Window :: OperationUngroupAllAimedPos()
03113 {
03114 FControler -> viewUngroupAllParameter(PARAMETER_AIMED_POSITION) ;
03115 repaint() ;
03116 }
03117
03118 void Window :: OperationUngroupAllDrawing()
03119 {
03120 FControler -> viewUngroupAllParameter(PARAMETER_DRAWING) ;
03121 repaint() ;
03122 }
03123
03124 void Window :: OperationUngroupGeneral()
03125 {
03126 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03127 FControler -> viewUngroup(active -> getCliquedViewId()) ;
03128 repaint() ;
03129 }
03130
03131 void Window :: OperationUngroupPrecompiles()
03132 {
03133 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03134 FControler -> viewUngroupPrecompiles(active -> getCliquedViewId()) ;
03135 repaint() ;
03136 }
03137
03138 void Window :: OperationUngroupEyePos()
03139 {
03140 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03141 FControler -> viewUngroupParameter(active -> getCliquedViewId() ,
03142 PARAMETER_EYE_POSITION) ;
03143 repaint() ;
03144 }
03145
03146 void Window :: OperationUngroupAimedPos()
03147 {
03148 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03149 FControler -> viewUngroupParameter(active -> getCliquedViewId() ,
03150 PARAMETER_AIMED_POSITION) ;
03151 repaint() ;
03152 }
03153
03154 void Window :: OperationUngroupDrawing()
03155 {
03156 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03157 FControler -> viewUngroupParameter(active -> getCliquedViewId() ,
03158 PARAMETER_DRAWING) ;
03159 repaint() ;
03160 }
03161
03162 void Window :: OperationGroupAllGeneral()
03163 {
03164 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03165 FControler -> viewGroupAll(active -> getCliquedViewId()) ;
03166 repaint() ;
03167 }
03168
03169 void Window :: OperationGroupAllPrecomp()
03170 {
03171 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03172 FControler -> viewGroupAllPrecompiles(active -> getCliquedViewId()) ;
03173 repaint() ;
03174 }
03175
03176 void Window :: OperationGroupAllEyePos()
03177 {
03178 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03179 FControler -> viewGroupAllParameter(active -> getCliquedViewId() ,
03180 PARAMETER_EYE_POSITION) ;
03181 repaint() ;
03182 }
03183
03184 void Window :: OperationGroupAllAimedPos()
03185 {
03186 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03187 FControler -> viewGroupAllParameter(active -> getCliquedViewId() ,
03188 PARAMETER_AIMED_POSITION) ;
03189 repaint() ;
03190 }
03191
03192 void Window :: OperationGroupAllDrawing()
03193 {
03194 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03195 FControler -> viewGroupAllParameter(active -> getCliquedViewId() ,
03196 PARAMETER_DRAWING) ;
03197 repaint() ;
03198 }
03199
03200 void Window :: OperationGroupGeneral()
03201 {
03202 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03203 FControler -> viewGroup(active -> getCliquedViewId(),
03204 FDoubleCliquee -> getDoubleCliquedViewId());
03205 repaint() ;
03206 }
03207
03208 void Window :: OperationGroupPrecomp()
03209 {
03210 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03211 FControler->viewGroupPrecompiles(active -> getCliquedViewId(),
03212 FDoubleCliquee->getDoubleCliquedViewId());
03213 repaint() ;
03214 }
03215
03216 void Window :: OperationGroupEyePos()
03217 {
03218 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03219 FControler -> viewGroupParameter(active -> getCliquedViewId() ,
03220 FDoubleCliquee -> getDoubleCliquedViewId(),
03221 PARAMETER_EYE_POSITION) ;
03222 repaint() ;
03223 }
03224
03225 void Window :: OperationGroupAimedPos()
03226 {
03227 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03228 FControler -> viewGroupParameter(active -> getCliquedViewId() ,
03229 FDoubleCliquee -> getDoubleCliquedViewId(),
03230 PARAMETER_AIMED_POSITION) ;
03231 repaint() ;
03232 }
03233
03234 void Window :: OperationGroupDrawing()
03235 {
03236 GLWindow * active = ((GLWindow *) FWorkspace -> activeWindow()) ;
03237 FControler -> viewGroupParameter(active -> getCliquedViewId() ,
03238 FDoubleCliquee -> getDoubleCliquedViewId(),
03239 PARAMETER_DRAWING) ;
03240 repaint() ;
03241 }
03242
03243 void Window :: mireOrigine()
03244 {
03245 if (getControler()->lookAtOrigin(getCurrentViewId()))
03246 repaint();
03247 else updateStatusBar();
03248 }
03249
03250 void Window :: mireFace()
03251 {
03252 if (getControler()->lookAtFaceBary(getCurrentViewId()))
03253 repaint();
03254 else updateStatusBar() ;
03255 }
03256
03257 void Window :: mireSommet()
03258 {
03259 if (getControler()->lookAtLast(getCurrentViewId()))
03260 repaint();
03261 else updateStatusBar();
03262 }
03263
03264 void Window :: mireVolume()
03265 {
03266 if (getControler()->lookAtVolumeBary(getCurrentViewId()))
03267 repaint();
03268 else updateStatusBar();
03269 }
03270
03271 void Window :: mireCompConnexe()
03272 {
03273 if (getControler()->lookAtCcBary(getCurrentViewId()))
03274 repaint();
03275 else updateStatusBar();
03276 }
03277
03278 void Window :: mireBrinsMarques()
03279 {
03280 if (getControler()->lookAtSelectedBary(getCurrentViewId()))
03281 repaint();
03282 else updateStatusBar();
03283 }
03284
03285 void Window :: mireBrins()
03286 {
03287 if (getControler()->lookAtAllBary(getCurrentViewId()))
03288 repaint() ;
03289 else updateStatusBar() ;
03290 }
03291
03292 void Window::callbackTopologicalView()
03293 {
03294 #ifdef MODULE_SPAMOD
03295 callbackSpamodViews(SPAMOD_TOPOLOGICAL);
03296 #endif // MODULE_SPAMOD
03297 }
03298
03299 void Window::callbackEuclidianView()
03300 {
03301 #ifdef MODULE_SPAMOD
03302 callbackSpamodViews(SPAMOD_EUCLIDIAN);
03303 #endif // MODULE_SPAMOD
03304 }
03305
03306 void Window::callbackAnalyticView()
03307 {
03308 #ifdef MODULE_SPAMOD
03309 callbackSpamodViews(SPAMOD_ANALYTIC);
03310 #endif // MODULE_SPAMOD
03311 }
03312
03313 void Window::callbackVoxelView()
03314 {
03315 #ifdef MODULE_SPAMOD
03316 callbackSpamodViews(SPAMOD_VOXEL);
03317 #endif // MODULE_SPAMOD
03318 }
03319
03320 void Window::callbackK2View()
03321 {
03322 #ifdef MODULE_SPAMOD
03323 callbackSpamodViews(SPAMOD_K2);
03324 #endif // MODULE_SPAMOD
03325 }
03326
03327
03328 void Window::callbackBackToBurstView()
03329 {
03330 #ifdef MODULE_SPAMOD
03331 callbackSpamodViews(SPAMOD_NONE);
03332 #endif // MODULE_SPAMOD
03333 }
03334
03335
03336 bool Window::callbackSpamodViews(TSpamodViewMode mode)
03337 {
03338 #ifdef MODULE_SPAMOD
03339 if (mode != SPAMOD_NONE)
03340 {
03341 getControler()->viewEnablePrecompile(getCurrentViewId(),
03342 PRECOMPILE_SPAMOD);
03343
03344 getControler()->viewDisablePrecompile(getCurrentViewId(),
03345 PRECOMPILE_DART);
03346 getControler()->viewDisablePrecompile(getCurrentViewId(),
03347 PRECOMPILE_FACE);
03348 getControler()->viewDisablePrecompile(getCurrentViewId(),
03349 PRECOMPILE_SEW);
03350 getControler()->viewDisablePrecompile(getCurrentViewId(),
03351 PRECOMPILE_VERTEX);
03352 }
03353 else
03354 {
03355 getControler()->viewDisablePrecompile(getCurrentViewId(),
03356 PRECOMPILE_SPAMOD);
03357
03358 if (getSewsDisplay())
03359 getControler()->viewEnablePrecompile(getCurrentViewId(),
03360 PRECOMPILE_SEW);
03361
03362 if (getVerticesDisplay())
03363 getControler()->viewEnablePrecompile(getCurrentViewId(),
03364 PRECOMPILE_VERTEX);
03365
03366 if (getFacesDisplay())
03367 getControler()->viewEnablePrecompile(getCurrentViewId(),
03368 PRECOMPILE_FACE);
03369
03370 getControler()->viewEnablePrecompile(getCurrentViewId(),
03371 PRECOMPILE_DART);
03372 }
03373
03374 getParameterSpamod()->setViewMode(mode);
03375 repaint();
03376 #endif // MODULE_SPAMOD
03377
03378 return true;
03379 }
03380
03381 void Window::callbackSpamodSwitchToNextView()
03382 {
03383 #ifdef MODULE_SPAMOD
03384 getParameterSpamod()->setNextViewMode();
03385 callbackSpamodViews(getParameterSpamod()->getViewMode());
03386 #endif // MODULE_SPAMOD
03387 }
03388
03389 void Window :: callbackHideAllWindow()
03390 {
03391 if (FCreationActive != NULL && FCreationActive -> isVisible())
03392 {
03393 FCreationActive -> cancel();
03394
03395 }
03396 if (FOperationActive != NULL && FOperationActive -> isVisible())
03397 FOperationActive -> callbackClose() ;
03398
03399 if (FOptionsFrame != NULL && FOptionsFrame -> isVisible())
03400 {
03401 FOptionsFrame -> setFVisible(false) ;
03402 FOptionsFrame -> close() ;
03403 }
03404 if (FOperationChanfreinage != NULL &&
03405 FOperationChanfreinage -> isVisible())
03406 FOperationChanfreinage -> close() ;
03407 if (FOptionsCarac != NULL && FOptionsCarac -> isVisible())
03408 FOptionsCarac -> close() ;
03409 if (FDialogDo != NULL && FDialogDo -> isVisible())
03410 FDialogDo -> close() ;
03411 if (FCouleurs != NULL && FCouleurs->isVisible())
03412 FCouleurs -> close() ;
03413 }
03414
03415
03416 CParameterAimedPosition* Window::getParameterAimedPosition() const
03417 { return getControler()->getParameterAimedPosition(getCurrentViewId()); }
03418
03419 CParameterDrawing* Window::getParameterDrawing() const
03420 { return getControler()->getParameterDrawing(getCurrentViewId()); }
03421
03422 CParameterEyePosition* Window::getParameterEyePosition() const
03423 { return getControler()->getParameterEyePosition(getCurrentViewId()); }
03424
03425 CParameterAimedPoint* Window::getParameterAimedPoint() const
03426 { return getControler()->getParameterAimedPoint(getCurrentViewId()); }
03427
03428 CParameterAxis* Window::getParameterAxis() const
03429 { return getControler()->getParameterAxis(getCurrentViewId()); }
03430
03431 CParameterGrid* Window::getParameterGrid() const
03432 { return getControler()->getParameterGrid(getCurrentViewId()); }
03433
03434 CParameterSew* Window::getParameterSew() const
03435 { return getControler()->getParameterSew(getCurrentViewId()); }
03436
03437 CParameterDart* Window::getParameterDart() const
03438 { return getControler()->getParameterDart(getCurrentViewId()); }
03439
03440 #ifdef MODULE_SPAMOD
03441 CParameterSpamod* Window::getParameterSpamod() const
03442 { return getControler()->getParameterSpamod(getCurrentViewId()); }
03443 #endif // MODULE_SPAMOD