29 #include <QtGui/QHBoxLayout>
30 #include <QtGui/QGridLayout>
31 #include <QtGui/QLabel>
32 #include <QtGui/QVBoxLayout>
34 #define SCALE_MAX (1.0)
36 static QString elementLabs [ 2 ] =
46 QWidget ( parentTab ) ,
47 FParentTab ( parentTab ) ,
51 QVBoxLayout * placement =
new QVBoxLayout (
this ) ;
53 QWidget * WidgetHaut =
new QWidget (
this ) ;
54 QGridLayout * haut =
new QGridLayout ( WidgetHaut ) ;
57 FTypeEclatement=
new QGroupBox ( *
HTML::decode(
"Splitted view" ) );
58 QVBoxLayout* tet_vbl =
new QVBoxLayout(FTypeEclatement);
63 tet_vbl -> addWidget ( FBurstView[i] );
65 connect ( FBurstView[i] , SIGNAL ( clicked (
int ) ) ,
69 haut -> addWidget ( FTypeEclatement, 0, 0 ) ;
72 FInteractivite =
new QGroupBox (
"Interactives modifications" ) ;
73 FInteractivite -> setCheckable (
true);
74 FInteractivite -> setChecked (
true) ;
76 QVBoxLayout* int_vbl =
new QVBoxLayout(FInteractivite);
77 FIAppliquer =
new QPushButton (
"Apply Modifications" ) ;
78 FIAppliquer -> setEnabled (
false ) ;
81 FIRecuperer -> setEnabled (
false ) ;
83 int_vbl -> addWidget(FIAppliquer);
84 int_vbl -> addWidget(FIRecuperer);
86 connect ( FInteractivite , SIGNAL ( clicked ( ) ) ,
89 connect ( FIAppliquer , SIGNAL ( clicked ( ) ) ,
92 connect ( FIRecuperer , SIGNAL ( clicked () ) ,
95 haut -> addWidget ( FInteractivite, 1, 0 ) ;
98 FPrereglages =
new QGroupBox ( *
HTML::decode(
"Presets") ) ;
99 QGridLayout * prereglage =
new QGridLayout ( FPrereglages ) ;
101 FPCompacte =
new QPushButton (
"Compacted view (Shift-F8)") ;
103 new QPushButton ( *
HTML::decode(
"Semi-splitted view (Shift-F9)")) ;
105 "Splitted view, style \"moKa\" (Shift-F10)")) ;
106 FPTopofil=
new QPushButton(*
HTML::decode(
"Splitted View, style "
107 "\"Topofil\" (Shift-F11)")) ;
108 FPSommets =
new QPushButton (
"Vertices" ) ;
110 FPFaces =
new QPushButton (
"Faces" ) ;
111 FPVolumes =
new QPushButton (
"Volumes" ) ;
113 prereglage -> addWidget ( FPCompacte , 1 , 0 ) ;
114 prereglage -> addWidget ( FPSemiEclatee , 2 , 0 ) ;
115 prereglage -> addWidget ( FPMoka , 3 , 0 ) ;
116 prereglage -> addWidget ( FPTopofil , 4 , 0 ) ;
117 prereglage -> addWidget ( FPSommets , 1 , 1 ) ;
118 prereglage -> addWidget ( FPAretes , 2 , 1 ) ;
119 prereglage -> addWidget ( FPFaces , 3 , 1 ) ;
120 prereglage -> addWidget ( FPVolumes , 4 , 1 ) ;
122 haut -> addWidget ( FPrereglages, 0, 1, 2, 1 ) ;
125 FParametres =
new QGroupBox ( *
HTML::decode(
"Parameters") ) ;
126 QGridLayout * parametre =
new QGridLayout ( FParametres ) ;
128 FAffEclatement =
new QLabel (
"Splitting" ) ;
129 FAffPosition =
new QLabel (
"Position" ) ;
130 FAffEpaisseur =
new QLabel (
"Thickening" ) ;
132 parametre -> addWidget ( FAffEclatement , 1 , 1 ) ;
133 parametre -> addWidget ( FAffPosition , 1 , 4 ) ;
134 parametre -> addWidget ( FAffEpaisseur , 1 , 6 ) ;
136 const char * alpha [] = {
"Alpha0 :",
"Alpha1 :",
"Alpha2 :",
"Alpha3 :" };
137 const char * couture [] = {
"0-Sews" ,
"1-Sews" ,
"2-Sews" ,
140 for (
int i = 0 ; i < 4 ; i++ )
143 FParAlpha [i] =
new QLabel ( alpha [i] , FParametres ) ;
144 FParEclatement [i] =
new QSlider ( FParametres ) ;
145 FParEclatement [i] -> setMinimum ( 0 ) ;
146 FParEclatement [i] -> setMaximum ( 100 ) ;
147 FParEclatement [i] -> setSingleStep ( 3 ) ;
148 FParEclatement [i] -> setValue ( 0 ) ;
149 FParEclatement [i] -> setOrientation ( Qt::Horizontal );
151 FParAffEclatement [i] =
new QLabel ( 0 , FParametres ) ;
152 FParCouture [i] =
new QCheckBox ( couture [i] , FParametres ) ;
154 FParPosition [i] =
new QSlider ( FParametres ) ;
155 FParPosition [i] -> setMinimum ( 0 ) ;
156 FParPosition [i] -> setMaximum ( 100 ) ;
157 FParPosition [i] -> setSingleStep ( 3 ) ;
158 FParPosition [i] -> setValue ( 0 ) ;
159 FParPosition [i] -> setOrientation ( Qt::Horizontal );
161 FParAffPosition [i] =
new QLabel ( 0 , FParametres ) ;
162 FParEpaisseur [i] =
new QSpinBox ( FParametres ) ;
163 FParEpaisseur [i] -> setMinimum ( 1 ) ;
164 FParEpaisseur [i] -> setMaximum ( 10 ) ;
165 FParEpaisseur [i] -> setAccelerated(
true);
167 parametre -> addWidget ( FParAlpha [i] , i+2 , 0 ) ;
168 parametre -> addWidget ( FParEclatement [i] , i+2 , 1 ) ;
169 parametre -> addWidget ( FParAffEclatement [i] , i+2 , 2 ) ;
170 parametre -> addWidget ( FParCouture [i] , i+2 , 3 ) ;
171 parametre -> addWidget ( FParPosition [i] , i+2 , 4 ) ;
172 parametre -> addWidget ( FParAffPosition [i] , i+2 , 5 ) ;
173 parametre -> addWidget ( FParEpaisseur [i] , i+2 , 6 ) ;
176 placement -> addWidget ( WidgetHaut ) ;
177 placement -> addWidget ( FParametres ) ;
179 connect ( FPCompacte , SIGNAL ( clicked () ) ,
182 connect ( FPSemiEclatee , SIGNAL ( clicked () ) ,
185 connect ( FPMoka , SIGNAL ( clicked () ) ,
188 connect ( FPTopofil , SIGNAL ( clicked () ) ,
191 connect ( FPSommets , SIGNAL ( clicked () ) ,
194 connect ( FPAretes , SIGNAL ( clicked () ) ,
197 connect ( FPFaces , SIGNAL ( clicked () ) ,
200 connect ( FPVolumes , SIGNAL ( clicked () ) ,
204 QObject :: connect ( FParEclatement [0] ,
205 SIGNAL ( valueChanged (
int ) ) ,
208 QObject :: connect ( FParEclatement [1] ,
209 SIGNAL ( valueChanged (
int ) ) ,
212 QObject :: connect ( FParEclatement [2] ,
213 SIGNAL ( valueChanged (
int ) ) ,
216 QObject :: connect ( FParEclatement [3] ,
217 SIGNAL ( valueChanged (
int ) ) ,
222 QObject :: connect ( FParCouture [0] ,
223 SIGNAL ( clicked ( ) ) ,
226 QObject :: connect ( FParCouture [1] ,
227 SIGNAL ( clicked ( ) ) ,
230 QObject :: connect ( FParCouture [2] ,
231 SIGNAL ( clicked ( ) ) ,
234 QObject :: connect ( FParCouture [3] ,
235 SIGNAL ( clicked ( ) ) ,
240 QObject :: connect ( FParPosition [0] ,
241 SIGNAL ( valueChanged (
int ) ) ,
244 QObject :: connect ( FParPosition [1] ,
245 SIGNAL ( valueChanged (
int ) ) ,
248 QObject :: connect ( FParPosition [2] ,
249 SIGNAL ( valueChanged (
int ) ) ,
252 QObject :: connect ( FParPosition [3] ,
253 SIGNAL ( valueChanged (
int ) ) ,
258 QObject :: connect ( FParEpaisseur [0] ,
259 SIGNAL ( valueChanged (
int ) ) ,
262 QObject :: connect ( FParEpaisseur [1] ,
263 SIGNAL ( valueChanged (
int ) ) ,
266 QObject :: connect ( FParEpaisseur [2] ,
267 SIGNAL ( valueChanged (
int ) ) ,
270 QObject :: connect ( FParEpaisseur [3] ,
271 SIGNAL ( valueChanged (
int ) ) ,
290 CParameterSew * p = FParent -> getParameterSew ( ) ;
292 for (
int i = 0 ; i < 4 ; ++i )
295 setValueEclatement ( FParent -> getControler ( ) ->
296 getMapBurstCoef ( i ) , i ) ;
298 setValuePosition ( p -> getSewPosCoef ( i ) , i ) ;
300 FParCouture [ i ] -> setChecked ( p -> getDisplayAlpha ( i ) ) ;
301 FParEpaisseur [ i ] -> setValue( p -> getLWSew ( i ) ) ;
304 FParCouture [ i ] -> setEnabled ( FParent -> getSewsDisplay ( ) );
306 FParEpaisseur [ i ] -> setEnabled ( FParent -> getSewsDisplay ( )
307 && p -> getDisplayAlpha ( i ) ) ;
309 FParPosition [ i ] -> setEnabled( FParent -> getSewsDisplay ( )
310 && p -> getDisplayAlpha ( i ) ) ;
311 FParAffPosition [ i ] -> setEnabled ( FParent -> getSewsDisplay ( )
312 && p -> getDisplayAlpha ( i ) ) ;
314 FBurstView[FParent -> getControler() -> getBurstMethod()]
315 -> setChecked(
true ) ;
320 FParent -> repaint ( ) ;
346 if ( ! FUpdate )
update ( ) ;
363 char ValEclatement [8] ;
364 sprintf ( ValEclatement ,
"%5.2f",
getAlphaCoef ( 0 ) ) ;
365 FParAffEclatement [ 0 ] -> setText ( ValEclatement ) ;
367 FParent -> getControler ( ) -> setMapBurstCoef ( 0 ,
getAlphaCoef ( 0 ) ) ;
368 FParent -> repaint ( ) ;
376 char ValEclatement [8] ;
377 sprintf ( ValEclatement ,
"%5.2f",
378 (
float ( FParEclatement [ 1 ] -> value ( ) ) ) / 100.0 ) ;
379 FParAffEclatement [ 1 ] -> setText ( ValEclatement ) ;
381 FParent -> getControler ( ) -> setMapBurstCoef ( 1 ,
getAlphaCoef ( 1 ) ) ;
382 FParent -> repaint ( ) ;
390 char ValEclatement [8] ;
391 sprintf ( ValEclatement ,
"%5.2f" ,
392 (
float ( FParEclatement [ 2 ] -> value ( ) ) ) / 100.0 ) ;
393 FParAffEclatement [ 2 ] -> setText ( ValEclatement ) ;
395 FParent -> getControler ( ) -> setMapBurstCoef ( 2 ,
getAlphaCoef ( 2 ) ) ;
396 FParent -> repaint ( ) ;
404 char ValEclatement [8] ;
405 sprintf ( ValEclatement ,
"%5.2f",
406 (
float ( FParEclatement [ 3 ] -> value ( ) ) ) / 100.0 ) ;
407 FParAffEclatement [ 3 ] -> setText ( ValEclatement ) ;
409 FParent -> getControler ( ) -> setMapBurstCoef ( 3 ,
getAlphaCoef ( 3 ) ) ;
410 FParent -> repaint ( ) ;
419 char ValPosition [8] ;
420 sprintf ( ValPosition ,
"%5.2f",
421 (
float ( FParPosition [ 0 ] -> value ( ) ) ) / 100.0 ) ;
422 FParAffPosition[0] -> setText ( ValPosition ) ;
423 FParent -> repaint ( ) ;
431 char ValPosition [8] ;
432 sprintf ( ValPosition ,
"%5.2f",
433 (
float ( FParPosition [ 1 ] -> value ( ) ) ) / 100.0 ) ;
434 FParAffPosition [ 1 ] -> setText ( ValPosition ) ;
435 FParent -> repaint ( ) ;
443 char ValPosition [8] ;
444 sprintf ( ValPosition ,
"%5.2f",
445 (
float ( FParPosition [ 2 ] -> value ( ) ) ) / 100.0 ) ;
446 FParAffPosition [ 2 ] -> setText ( ValPosition ) ;
447 FParent -> repaint ( ) ;
455 char ValPosition [8] ;
456 sprintf ( ValPosition ,
"%5.2f",
457 (
float ( FParPosition [ 3 ] -> value ( ) ) ) / 100.0 ) ;
458 FParAffPosition [ 3 ] -> setText ( ValPosition ) ;
459 FParent -> repaint ( ) ;
467 FParent -> repaint ( ) ;
475 FParent -> repaint ( ) ;
483 FParent -> repaint ( ) ;
491 FParent -> repaint ( ) ;
499 FParent -> repaint ( ) ;
507 FParent -> repaint ( ) ;
515 FParent -> repaint ( ) ;
523 FParent -> repaint ( ) ;
576 return ( ( (
float) FParEclatement [i] -> value ( ) ) / 100.0 ) ;
582 return ( ( (
float ) FParPosition [i] -> value ( ) ) / 100.0 ) ;
588 return FParCouture [i] -> isChecked ( ) ;
594 return FParEpaisseur [i] -> value ( ) ;
600 return FInteractivite -> isChecked ( ) ;
616 FParent -> repaint ( ) ;
631 FParent -> repaint ( ) ;
645 FParent -> repaint ( ) ;
655 setValueEclatement ( v , i ) ;
658 FParent -> getControler ( ) -> setMapBurstCoef ( i , v) ;
668 setValuePosition ( v , i ) ;
670 FParent -> getParameterSew ( ) -> setSewPosCoef ( i , v ) ;
678 FParCouture [ i ] -> setChecked ( b ) ;
680 FParPosition [ i ] -> setEnabled ( b &&
681 FParent -> getSewsDisplay ( ) ) ;
682 FParAffPosition [ i ] -> setEnabled ( b &&
683 FParent -> getSewsDisplay ( ) ) ;
684 FParEpaisseur [ i ] -> setEnabled( b &&
685 FParent -> getSewsDisplay ( ) ) ;
688 FParent -> getParameterSew ( ) -> setDisplayAlpha ( i , b ) ;
698 FParEpaisseur [ i ] -> setValue ( w ) ;
701 FParent -> getParameterSew ( ) -> setLWSew ( i , w ) ;
707 FInteractivite -> setChecked ( b ) ;
708 FIAppliquer -> setEnabled ( !b ) ;
709 FIRecuperer -> setEnabled ( !b ) ;
717 for (
int i = 0 ; i < 4 ; ++i )
719 FParent-> getControler ( ) ->setMapBurstCoef ( i ,
getAlphaCoef ( i ) );
720 FParent-> getParameterSew()->setSewPosCoef ( i ,
getSewposCoef ( i ) );
721 FParent-> getParameterSew()->setDisplayAlpha ( i ,
getSewDisplay ( i ) );
722 FParent-> getParameterSew()->setLWSew ( i ,
getSewWidth ( i ) );
726 FParent -> repaint ( ) ;
773 default: assert (
false ) ; break ;
778 void OptionsVue :: setValueEclatement ( TCoordinate c ,
int i )
780 FParEclatement [ i ] -> setValue (
int ( c * 100.0 ) ) ;
781 char ValEclatement [8] ;
782 sprintf ( ValEclatement ,
"%5.2f",
783 (
float ( FParEclatement [ i ] -> value ( ) ) ) / 100.0 ) ;
784 FParAffEclatement[i] -> setText ( ValEclatement ) ;
787 void OptionsVue :: setValuePosition (
float f ,
int i )
789 FParPosition [ i ] -> setValue (
int ( f *100.0) ) ;
790 char ValPosition [8] ;
791 sprintf ( ValPosition ,
"%5.2f",
792 (
float ( FParPosition [ i ] -> value ( ) ) ) / 100.0 ) ;
793 FParAffPosition[i] -> setText ( ValPosition ) ;