Moka Ihm Qt
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
options-couleurs.qt.cc
Go to the documentation of this file.
1 /*
2  * Moka : Un modeleur de 3-G-cartes.
3  * Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS,
6  * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/
7  *
8  * This file is part of Moka
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #include "options-couleurs.qt.hh"
25 #include "window.qt.hh"
26 #include "SpaceWidget.qt.hh"
27 #include "HtmlEntities.hh"
28 
29 #include <QtGui/QPixmap>
30 #include <QtGui/QColorDialog>
31 #include <Qt3Support/Q3Accel>
32 
33 //**********************************************************
34 // Elements dont on peut modifier la couleur
35 //**********************************************************
36 static QString elementLabs [ 27 ] =
37 {
38  "Faces",
39  "Background",
40  "Unselected darts",
41  "Selected darts",
42  "Last selected dart",
43  "0-removed darts",
44  "1-removed darts",
45  "Vertices",
46  "0-sews",
47  "1-sews",
48  "2-sews",
49  "3-sews",
50  "Grid",
51  "Ox Axis",
52  "Oy Axis",
53  "Oz Axis",
54  "Origin",
55  "Normal vector",
56  "Transformation",
57  "Preview",
58  "Preview2",
59 } ;
60 
61 //************************************************************
62 // Constructeur
63 //************************************************************
65  :
66  QToolBar("Colors", parent),
67  FParent(parent),
68  FUpdate(false)
69 {
70  setVisible(false) ;
71  parent -> addToolBar(Qt::BottomToolBarArea, this);
72  setAllowedAreas(Qt::BottomToolBarArea | Qt::TopToolBarArea);
73 
74  // Construction des widgets
75  FModifiables = new QComboBox(this) ;
76 #ifdef MODULE_ARCHITECTURE
77  for (int i = 0 ; i < 26 ; i++)
78 #else
79  for (int i = 0 ; i < 19 ; i++)
80 #endif
81  FModifiables -> addItem(elementLabs [ i ]) ;
82 
83  FCouleur = new QPushButton(this) ;
84  FCouleur -> setMinimumSize(30 , 20) ;
85  FCouleur -> setMaximumSize(30 , 20) ;
86 
87  FEpaisseur = new QSpinBox(this) ;
88  FEpaisseur -> setMinimum(1);
89  FEpaisseur -> setMaximum(10);
90  FEpaisseur -> setAccelerated(true);
91 
92  FTransparence = new FloatSpinBox(0.1 , 0.0 , 1.0) ;
93 
94  FFin = new QPushButton(QIcon(":/boutonAnnuler.png"), "Close" , this) ;
95 
96  // Mise en place des ecoutes
97  QObject :: connect(FCouleur , SIGNAL(clicked()) , this ,
98  SLOT(openDialog())) ;
99  QObject :: connect(FFin , SIGNAL(clicked()) , this ,
100  SLOT(close())) ;
101  QObject :: connect(FEpaisseur , SIGNAL(valueChanged(int)) , this ,
102  SLOT(callbackEpaisseur())) ;
103  QObject :: connect(FTransparence , SIGNAL(valueChanged(double)) , this ,
104  SLOT(callbackTransparence())) ;
105  QObject :: connect(FModifiables , SIGNAL(activated(int)) , this ,
106  SLOT(changeColor())) ;
107 
108  Q3Accel * Raccourci = new Q3Accel(this) ;
109  Raccourci -> insertItem(QKeySequence(Qt::Key_Space) , 2) ;
110  Raccourci -> connectItem(2 , this , SLOT(close())) ;
111 
112  addWidget(new SpaceWidget(15, 1));
113  addWidget(FModifiables);
114  addWidget(new SpaceWidget(15, 1));
115  addWidget(FCouleur);
116  addWidget(new SpaceWidget(15, 1));
117  addWidget(FEpaisseur);
118  addWidget(new SpaceWidget(5, 1));
119  addWidget(FTransparence);
120  addWidget(new SpaceWidget(15, 1));
121  addWidget(FFin);
122 }
123 
124 //******************************************************
125 // Destructeur
126 //******************************************************
128 
129 //******************************************************
130 // SLOTS
131 //******************************************************
133 {
134  QColor choix = QColorDialog :: getColor() ;
135 
136  // On regarde si l'utilisateur n'a pas annule
137  if (choix . isValid())
138  {
139  int r , g , b ;
140  choix . getRgb(&r , &g , &b) ;
141  setR(r) ;
142  setG(g) ;
143  setB(b) ;
144  FParent -> repaint() ;
145  colorButton() ;
146  }
147 }
148 
150 {
151  setVisible(false) ;
152 }
153 
155 {
156  setVisible(true) ;
157  changeColor();
158 }
159 
161 {
162  colorButton() ;
163  griseBoutons() ;
164 }
165 
166 void OptionCouleurs :: colorButton()
167 {
168  float color[3] = { 0.0, 0.0, 0.0 };
169  FUpdate = true ;
170  TViewId FLastClikedViewId = FParent ->getCurrentViewId() ;
171  switch (FModifiables -> currentIndex())
172  {
173  case _FACE :
174  color[0] = FParent->getControler() ->
175  getParameterFace(FLastClikedViewId) -> getCLFace(0) ;
176  color[1] = (FParent->getControler()->
177  getParameterFace(FLastClikedViewId)->getCLFace(1));
178  color[2] = (FParent->getControler()->
179  getParameterFace(FLastClikedViewId)->getCLFace(2));
180  FTransparence -> setValuef(FParent->getControler()->
181  getParameterFace(FLastClikedViewId)->
182  getBLFace());
183  break;
184  case _FOND :
185  color[0] = (FParent->getControler()->
186  getParameterDrawing(FLastClikedViewId)->
187  getCLBackground(0));
188  color[1] = (FParent->getControler()->
189  getParameterDrawing(FLastClikedViewId)->
190  getCLBackground(1));
191  color[2] = (FParent->getControler()->
192  getParameterDrawing(FLastClikedViewId)->
193  getCLBackground(2));
194  break;
195  case _UNSEL_DART :
196  color[0] = (FParent->getControler()->
197  getParameterDart(FLastClikedViewId)->
198  getCLUnsel(FParent->getControler()->getSelectionLevel(),
199  0));
200  color[1] = (FParent->getControler()->
201  getParameterDart(FLastClikedViewId)->
202  getCLUnsel(FParent->getControler()->getSelectionLevel(),
203  1));
204  color[2] = (FParent->getControler()->
205  getParameterDart(FLastClikedViewId)->
206  getCLUnsel(FParent->getControler()->getSelectionLevel(),
207  2));
208  FEpaisseur->setValue(FParent->getControler()->
209  getParameterDart(FLastClikedViewId)->
210  getLWDarts());
211  break;
212  case _SEL_DART :
213  color[0] = (FParent->getControler()->
214  getParameterDart(FLastClikedViewId)->
215  getCLSel(FParent->getControler()->getSelectionLevel(),
216  0));
217  color[1] = (FParent->getControler()->
218  getParameterDart(FLastClikedViewId)->
219  getCLSel(FParent->getControler()->getSelectionLevel(),
220  1));
221  color[2] = (FParent->getControler()->
222  getParameterDart(FLastClikedViewId)->
223  getCLSel(FParent->getControler()->getSelectionLevel(),
224  2));
225  FEpaisseur->setValue(FParent->getControler()->
226  getParameterDart(FLastClikedViewId)->
227  getLWDarts());
228  break;
229  case _LAST_DART :
230  color[0] = (FParent->getControler()->
231  getParameterDart(FLastClikedViewId)->
232  getCLLastSel(FParent->getControler()->getSelectionLevel(),
233  0));
234  color[1] = (FParent->getControler()->
235  getParameterDart(FLastClikedViewId)->
236  getCLLastSel(FParent->getControler()->getSelectionLevel(),
237  1));
238  color[2] = (FParent->getControler()->
239  getParameterDart(FLastClikedViewId)->
240  getCLLastSel(FParent->getControler()->getSelectionLevel(),
241  2));
242  FEpaisseur->setValue(FParent->getControler()->
243  getParameterDart(FLastClikedViewId)->
244  getLWDarts());
245  break;
246  case _0DELETE_DART :
247  color[0] = (FParent->getControler()->
248  getParameterDart(FLastClikedViewId)->
249  getCL0Remove(FParent->getControler()->getSelectionLevel(),
250  0));
251  color[1] = (FParent->getControler()->
252  getParameterDart(FLastClikedViewId)->
253  getCL0Remove(FParent->getControler()->getSelectionLevel(),
254  1));
255  color[2] = (FParent->getControler()->
256  getParameterDart(FLastClikedViewId)->
257  getCL0Remove(FParent->getControler()->getSelectionLevel(),
258  2));
259  FEpaisseur->setValue(FParent->getControler()->
260  getParameterDart(FLastClikedViewId)->
261  getLWDarts());
262  break;
263  case _1DELETE_DART :
264  color[0] = (FParent->getControler()->
265  getParameterDart(FLastClikedViewId)->
266  getCL1Remove(FParent->getControler()->getSelectionLevel(),
267  0));
268  color[1] = (FParent->getControler()->
269  getParameterDart(FLastClikedViewId)->
270  getCL1Remove(FParent->getControler()->getSelectionLevel(),
271  1));
272  color[2] = (FParent->getControler()->
273  getParameterDart(FLastClikedViewId)->
274  getCL1Remove(FParent->getControler()->getSelectionLevel(),
275  2));
276  FEpaisseur->setValue(FParent->getControler()->
277  getParameterDart(FLastClikedViewId)->
278  getLWDarts());
279  break;
280  case _VERTEX :
281  color[0] = (FParent->getControler()->
282  getParameterVertex(FLastClikedViewId)->
283  getCLVertex(0));
284  color[1] = (FParent->getControler()->
285  getParameterVertex(FLastClikedViewId)->
286  getCLVertex(1));
287  color[2] = (FParent->getControler()->
288  getParameterVertex(FLastClikedViewId)->
289  getCLVertex(2));
290  FEpaisseur->setValue(FParent->getControler()->
291  getParameterVertex(FLastClikedViewId)->
292  getSVertex());
293  break;
294  case _0_SEW :
295  color[0] = (FParent->getControler()->
296  getParameterSew(FLastClikedViewId)->
297  getCLSew(0, 0));
298  color[1] = (FParent->getControler()->
299  getParameterSew(FLastClikedViewId)->
300  getCLSew(0, 1));
301  color[2] = (FParent->getControler()->
302  getParameterSew(FLastClikedViewId)->
303  getCLSew(0, 2));
304  FEpaisseur->setValue(FParent->getControler()->
305  getParameterSew(FLastClikedViewId)->
306  getLWSew(0));
307  break;
308  case _1_SEW :
309  color[0] = (FParent->getControler()->
310  getParameterSew(FLastClikedViewId)->
311  getCLSew(1, 0));
312  color[1] = (FParent->getControler()->
313  getParameterSew(FLastClikedViewId)->
314  getCLSew(1, 1));
315  color[2] = (FParent->getControler()->
316  getParameterSew(FLastClikedViewId)->
317  getCLSew(1, 2));
318  FEpaisseur->setValue(FParent->getControler()->
319  getParameterSew(FLastClikedViewId)->
320  getLWSew(1));
321  break;
322  case _2_SEW :
323  color[0] = (FParent->getControler()->
324  getParameterSew(FLastClikedViewId)->
325  getCLSew(2, 0));
326  color[1] = (FParent->getControler()->
327  getParameterSew(FLastClikedViewId)->
328  getCLSew(2, 1));
329  color[2] = (FParent->getControler()->
330  getParameterSew(FLastClikedViewId)->
331  getCLSew(2, 2));
332  FEpaisseur->setValue(FParent->getControler()->
333  getParameterSew(FLastClikedViewId)->
334  getLWSew(2));
335  break;
336  case _3_SEW :
337  color[0] = (FParent->getControler()->
338  getParameterSew(FLastClikedViewId)->
339  getCLSew(3, 0));
340  color[1] = (FParent->getControler()->
341  getParameterSew(FLastClikedViewId)->
342  getCLSew(3, 1));
343  color[2] = (FParent->getControler()->
344  getParameterSew(FLastClikedViewId)->
345  getCLSew(3, 2));
346  FEpaisseur->setValue(FParent->getControler()->
347  getParameterSew(FLastClikedViewId)->
348  getLWSew(3));
349  break;
350  case _GRID :
351  color[0] = (FParent->getControler()->
352  getParameterGrid(FLastClikedViewId)->getCLGrid(0));
353  color[1] = (FParent->getControler()->
354  getParameterGrid(FLastClikedViewId)->getCLGrid(1));
355  color[2] = (FParent->getControler()->
356  getParameterGrid(FLastClikedViewId)->getCLGrid(2));
357  FEpaisseur->setValue(FParent->getControler()->
358  getParameterGrid(FLastClikedViewId)->
359  getLWGrid());
360  break;
361  case _OX_AXIS :
362  color[0] = (FParent->getControler()->
363  getParameterAxis(FLastClikedViewId)->
364  getCLAxisX(0));
365  color[1] = (FParent->getControler()->
366  getParameterAxis(FLastClikedViewId)->
367  getCLAxisX(1));
368  color[2] = (FParent->getControler()->
369  getParameterAxis(FLastClikedViewId)->
370  getCLAxisX(2));
371  FEpaisseur->setValue(FParent->getControler()->
372  getParameterAxis(FLastClikedViewId)->
373  getLWAxis());
374  break;
375  case _OY_AXIS :
376  color[0] = (FParent->getControler()->
377  getParameterAxis(FLastClikedViewId)->
378  getCLAxisY(0));
379  color[1] = (FParent->getControler()->
380  getParameterAxis(FLastClikedViewId)->
381  getCLAxisY(1));
382  color[2] = (FParent->getControler()->
383  getParameterAxis(FLastClikedViewId)->
384  getCLAxisY(2));
385  FEpaisseur->setValue(FParent->getControler()->
386  getParameterAxis(FLastClikedViewId)->
387  getLWAxis());
388  break;
389  case _OZ_AXIS :
390  color[0] = (FParent->getControler()->
391  getParameterAxis(FLastClikedViewId)->
392  getCLAxisZ(0));
393  color[1] = (FParent->getControler()->
394  getParameterAxis(FLastClikedViewId)->
395  getCLAxisZ(1));
396  color[2] = (FParent->getControler()->
397  getParameterAxis(FLastClikedViewId)->
398  getCLAxisZ(2));
399  FEpaisseur->setValue(FParent->getControler()->
400  getParameterAxis(FLastClikedViewId)->
401  getLWAxis());
402  break;
403  case _AIMED_POINT :
404  color[0] = (FParent->getControler()->
405  getParameterAimedPoint(FLastClikedViewId)->
406  getCLAimedPoint(0));
407  color[1] = (FParent->getControler()->
408  getParameterAimedPoint(FLastClikedViewId)->
409  getCLAimedPoint(1));
410  color[2] = (FParent->getControler()->
411  getParameterAimedPoint(FLastClikedViewId)->
412  getCLAimedPoint(2));
413  FEpaisseur->setValue(FParent->getControler()->
414  getParameterAimedPoint(FLastClikedViewId)->
415  getLWAimedPoint());
416  break;
417  case _NORMAL_VECTOR :
418  color[0] = (FParent->getControler()->
419  getParameterNormalVector(FLastClikedViewId)->
420  getCLNormalVector(0));
421  color[1] = (FParent->getControler()->
422  getParameterNormalVector(FLastClikedViewId)->
423  getCLNormalVector(1));
424  color[2] = (FParent->getControler()->
425  getParameterNormalVector(FLastClikedViewId)->
426  getCLNormalVector(2));
427  FEpaisseur->setValue(FParent->getControler()->
428  getParameterNormalVector(FLastClikedViewId)->
429  getLWNormalVector());
430  break;
432  color[0] =
433  (FParent->getControler()->
434  getParameterObjectTransformation(FLastClikedViewId)->
435  getCLObjectTransformation(0));
436  color[1] =
437  (FParent->getControler()->
438  getParameterObjectTransformation(FLastClikedViewId)->
439  getCLObjectTransformation(1));
440  color[2] =
441  (FParent->getControler()->
442  getParameterObjectTransformation(FLastClikedViewId)->
443  getCLObjectTransformation(2));
444  FEpaisseur->
445  setValue(FParent->getControler()->
446  getParameterObjectTransformation(FLastClikedViewId)->
447  getLWObjectTransformation());
448  break;
449  case _OBJECT_PREVIEW :
450  color[0] =
451  (FParent->getControler()->
452  getParameterPreview(FLastClikedViewId)->
453  getCLPreview(0));
454  color[1] =
455  (FParent->getControler()->
456  getParameterPreview(FLastClikedViewId)->
457  getCLPreview(1));
458  color[2] =
459  (FParent->getControler()->
460  getParameterPreview(FLastClikedViewId)->
461  getCLPreview(2));
462  FEpaisseur->
463  setValue(FParent->getControler()->
464  getParameterPreview(FLastClikedViewId)->
465  getLWPreview());
466  break;
467  case _OBJECT_PREVIEW_BAD :
468  color[0] =
469  (FParent->getControler()->
470  getParameterPreview(FLastClikedViewId)->
471  getCLPreviewBad(0));
472  color[1] =
473  (FParent->getControler()->
474  getParameterPreview(FLastClikedViewId)->
475  getCLPreviewBad(1));
476  color[2] =
477  (FParent->getControler()->
478  getParameterPreview(FLastClikedViewId)->
479  getCLPreviewBad(2));
480  FEpaisseur->
481  setValue(FParent->getControler()->
482  getParameterPreview(FLastClikedViewId)->
483  getLWPreview());
484  break;
485  }
486 
487  QPixmap * coul = new QPixmap(30 , 30) ;
488  coul -> fill(QColor((int)(color[0]* 255) , (int)(color[1]*255) ,
489  (int)(color[2]*255))) ;
490  FCouleur -> setIcon(QIcon(*coul));
491 
492  FUpdate = false ;
493  FParent -> repaint() ;
494 }
495 
496 void OptionCouleurs :: setColor(int num , float value)
497 {
498  TViewId FLastClikedViewId = FParent -> getCurrentViewId() ;
499 
500  switch (FModifiables -> currentIndex())
501  {
502  case _FACE :
503  FParent -> getControler()->
504  getParameterFace(FLastClikedViewId)->setCLFace(num, value);
505  break;
506  case _FOND :
507  FParent -> getControler()->getParameterDrawing(FLastClikedViewId)->
508  setCLBackground(num, value);
509  break;
510  case _UNSEL_DART :
511  FParent -> getControler()->getParameterDart(FLastClikedViewId)->
512  setCLUnsel(FParent->getControler()->getSelectionLevel(), num, value);
513  break;
514  case _SEL_DART :
515  FParent -> getControler()->getParameterDart(FLastClikedViewId)->
516  setCLSel(FParent -> getControler()->getSelectionLevel(), num, value);
517  break;
518  case _LAST_DART :
519  FParent -> getControler()->getParameterDart(FLastClikedViewId)->
520  setCLLastSel(FParent -> getControler()->getSelectionLevel(),
521  num, value);
522  break;
523  case _0DELETE_DART :
524  FParent -> getControler()->getParameterDart(FLastClikedViewId)->
525  setCL0Remove(FParent -> getControler()->getSelectionLevel(),
526  num, value);
527  break;
528  case _1DELETE_DART :
529  FParent -> getControler()->getParameterDart(FLastClikedViewId)->
530  setCL1Remove(FParent -> getControler()->getSelectionLevel(),
531  num, value);
532  break;
533  case _VERTEX :
534  FParent -> getControler()->
535  getParameterVertex(FLastClikedViewId)->setCLVertex(num, value);
536  break;
537  case _0_SEW :
538  FParent -> getControler()->
539  getParameterSew(FLastClikedViewId)->setCLSew(0, num, value);
540  break;
541  case _1_SEW :
542  FParent -> getControler()->
543  getParameterSew(FLastClikedViewId)->setCLSew(1, num, value);
544  break;
545  case _2_SEW :
546  FParent -> getControler()->
547  getParameterSew(FLastClikedViewId)->setCLSew(2, num, value);
548  break;
549  case _3_SEW :
550  FParent -> getControler()->
551  getParameterSew(FLastClikedViewId)->setCLSew(3, num, value);
552  break;
553  case _GRID :
554  FParent -> getControler()->
555  getParameterGrid(FLastClikedViewId)->setCLGrid(num, value);
556  break;
557  case _OX_AXIS :
558  FParent -> getControler()->
559  getParameterAxis(FLastClikedViewId)->setCLAxisX(num, value);
560  break;
561  case _OY_AXIS :
562  FParent -> getControler()->
563  getParameterAxis(FLastClikedViewId)->setCLAxisY(num, value);
564  break;
565  case _OZ_AXIS :
566  FParent -> getControler()->
567  getParameterAxis(FLastClikedViewId)->setCLAxisZ(num, value);
568  break;
569  case _AIMED_POINT :
570  FParent -> getControler()->
571  getParameterAimedPoint(FLastClikedViewId)->
572  setCLAimedPoint(num, value);
573  break;
574  case _NORMAL_VECTOR :
575  FParent -> getControler()->
576  getParameterNormalVector(FLastClikedViewId)->
577  setCLNormalVector(num, value);
578  break;
580  FParent -> getControler()->
581  getParameterObjectTransformation(FLastClikedViewId)->
582  setCLObjectTransformation(num, value);
583  break;
584  case _OBJECT_PREVIEW :
585  FParent -> getControler()->getParameterPreview(FLastClikedViewId)->
586  setCLPreview(num, value);
587  break;
588  case _OBJECT_PREVIEW_BAD :
589  FParent -> getControler()->getParameterPreview(FLastClikedViewId)->
590  setCLPreviewBad(num, value);
591  break;
592  }
593 }
594 
595 void OptionCouleurs :: setR(int r)
596 {
597  setColor(0 , ((float) r) / 255);
598 }
599 
600 void OptionCouleurs :: setG(int g)
601 {
602  setColor(1 , ((float) g) / 255) ;
603 }
604 
605 void OptionCouleurs :: setB(int b)
606 {
607  setColor(2 , ((float) b) / 255) ;
608 }
609 
611 {
612  if (! FUpdate)
613  {
614  TViewId FLastClikedViewId = FParent->getCurrentViewId() ;
615  int w = FEpaisseur -> value() ;
616 
617  switch (FModifiables -> currentIndex())
618  {
619  case _UNSEL_DART :
620  case _SEL_DART :
621  case _LAST_DART :
622  FParent -> getControler()->
623  getParameterDart(FLastClikedViewId)->setLWDarts(w);
624  break;
625  case _VERTEX :
626  FParent -> getControler()->
627  getParameterVertex(FLastClikedViewId)->setSVertex(w);
628  break;
629  case _0_SEW :
630  FParent -> getControler()->
631  getParameterSew(FLastClikedViewId)->setLWSew(0, w);
632  break;
633  case _1_SEW :
634  FParent -> getControler()->
635  getParameterSew(FLastClikedViewId)->setLWSew(1, w);
636  break;
637  case _2_SEW :
638  FParent -> getControler()->
639  getParameterSew(FLastClikedViewId)->setLWSew(2, w);
640  break;
641  case _3_SEW :
642  FParent -> getControler()->
643  getParameterSew(FLastClikedViewId)->setLWSew(3, w);
644  break;
645  case _GRID :
646  FParent -> getControler()->
647  getParameterGrid(FLastClikedViewId)->setLWGrid(w);
648  break;
649  case _OX_AXIS :
650  FParent -> getControler()->
651  getParameterAxis(FLastClikedViewId)->setLWAxis(w);
652  break;
653  case _OY_AXIS :
654  FParent -> getControler()->
655  getParameterAxis(FLastClikedViewId)->setLWAxis(w);
656  break;
657  case _OZ_AXIS :
658  FParent -> getControler()->
659  getParameterAxis(FLastClikedViewId)->setLWAxis(w);
660  break;
661  case _AIMED_POINT :
662  FParent -> getControler()->
663  getParameterAimedPoint(FLastClikedViewId)->setLWAimedPoint(w);
664  break;
665  case _NORMAL_VECTOR :
666  FParent -> getControler()->
667  getParameterNormalVector(FLastClikedViewId)->
668  setLWNormalVector(w);
669  break;
671  FParent -> getControler()->
672  getParameterObjectTransformation(FLastClikedViewId)->
673  setLWObjectTransformation(w);
674  break;
675  case _OBJECT_PREVIEW :
676  case _OBJECT_PREVIEW_BAD :
677  FParent -> getControler()->getParameterPreview(FLastClikedViewId)
678  ->setLWPreview(w);
679  break;
680  default:
681  break;
682  }
683  FParent -> repaint() ;
684  }
685 }
686 
688 {
689  if (! FUpdate)
690  {
691  float a = FTransparence -> valuef() ;
692  TViewId FLastClikedViewId = FParent -> getCurrentViewId() ;
693  switch (FModifiables -> currentIndex())
694  {
695  case _FACE :
696  FParent -> getControler() ->
697  getParameterFace(FLastClikedViewId)->setBLFace(a);
698  break;
699  default:
700  break;
701  }
702  FParent -> repaint() ;
703  }
704 }
705 
706 void OptionCouleurs :: griseBoutons()
707 {
708  FEpaisseur -> setEnabled(false) ;
709  FTransparence -> setEnabled(false) ;
710 
711  switch (FModifiables -> currentIndex())
712  {
713  case _FACE :
714  FTransparence -> setEnabled(true) ;
715  break ;
716  case _UNSEL_DART :
717  case _SEL_DART :
718  case _LAST_DART :
719  FEpaisseur -> setEnabled(true) ;
720  break;
721  case _VERTEX :
722  FEpaisseur -> setEnabled(true) ;
723  break;
724  case _0_SEW :
725  FEpaisseur -> setEnabled(true) ;
726  break;
727  case _1_SEW :
728  FEpaisseur -> setEnabled(true) ;
729  break;
730  case _2_SEW :
731  FEpaisseur -> setEnabled(true) ;
732  break;
733  case _3_SEW :
734 
735  FEpaisseur -> setEnabled(true) ; break;
736  case _GRID :
737  FEpaisseur -> setEnabled(true) ;
738  break;
739  case _OX_AXIS :
740  FEpaisseur -> setEnabled(true) ;
741  break;
742  case _OY_AXIS :
743  FEpaisseur -> setEnabled(true) ;
744  break;
745  case _OZ_AXIS :
746  FEpaisseur -> setEnabled(true) ;
747  break;
748  case _AIMED_POINT :
749  FEpaisseur -> setEnabled(true) ;
750  break;
751  case _NORMAL_VECTOR :
752  FEpaisseur -> setEnabled(true) ;
753  break;
755 
756  FEpaisseur -> setEnabled(true) ;
757  break;
758  case _OBJECT_PREVIEW :
759  case _OBJECT_PREVIEW_BAD :
760  FEpaisseur -> setEnabled(true) ;
761  break;
762  default:
763  break ;
764  }
765 }