29 #include <QtGui/QLabel>
30 #include <QtGui/QHBoxLayout>
37 GMap3d :: CControlerGMap * controler ) :
41 QWidget * widget =
new QWidget ;
43 QHBoxLayout * wid_hbl =
new QHBoxLayout ( widget );
44 wid_hbl -> setSpacing(0);
45 wid_hbl -> setContentsMargins (0,0,0,0);
47 FAffSub =
new QLabel (
" Subdivisions: " ) ;
49 FSaisiePar =
new QSpinBox ;
50 FSaisiePar -> setMinimum ( 3 );
51 FSaisiePar -> setMaximum ( 100000 );
52 FSaisiePar -> setAccelerated(
true);
55 FSaisieMer =
new QSpinBox ;
56 FSaisieMer -> setMinimum ( 3 );
57 FSaisieMer -> setMaximum ( 100000 );
58 FSaisieMer -> setAccelerated(
true);
60 FAffRayon =
new QLabel (
"Small radius/Large radius : " ) ;
62 FSaisieRayon =
new QSlider ( Qt::Horizontal ) ;
63 FSaisieRayon -> setTickPosition ( QSlider::TicksBothSides ) ;
64 FSaisieRayon -> setMinimum ( 0 ) ;
65 FSaisieRayon -> setMaximum ( 100 ) ;
66 FSaisieRayon -> setSingleStep ( 1 ) ;
67 FSaisieRayon -> setFixedWidth (200);
69 FAffValRayon =
new QLabel ;
71 wid_hbl -> addWidget(FAffSub);
72 wid_hbl -> addWidget(FAffPar);
73 wid_hbl -> addWidget(FSaisiePar);
75 wid_hbl -> addWidget(FAffMer);
76 wid_hbl -> addWidget(FSaisieMer);
78 wid_hbl -> addWidget(FAffRayon);
79 wid_hbl -> addWidget(FSaisieRayon);
80 wid_hbl -> addWidget(FAffValRayon);
85 wid_hbl -> addStretch(1);
93 QObject::connect ( FSaisiePar , SIGNAL ( valueChanged (
int ) ) ,
this,
94 SLOT ( callbackParallels ( ) ) ) ;
95 QObject::connect ( FSaisieMer , SIGNAL ( valueChanged (
int ) ) ,
this,
96 SLOT ( callbackMeridians ( ) ) ) ;
97 QObject::connect ( FSaisieRayon , SIGNAL ( valueChanged (
int ) ) ,
this ,
98 SLOT ( callbackRR ( ) ) ) ;
114 FSaisieMer->setValue(
FControler->getParameterCreation()
115 ->getTorusNbMeridians());
116 FSaisiePar->setValue(
FControler->getParameterCreation()
117 ->getTorusNbParallels());
118 FSaisieRayon->setValue(
int(
FControler->getParameterCreation()
119 ->getTorusRadiusRapport()*100.0)) ;
124 void CreationTore :: callbackMeridians ( )
129 void CreationTore :: callbackParallels ( )
134 void CreationTore :: callbackRR ( )
153 return FSaisieMer -> value ();
158 return FSaisiePar -> value ();
163 float v = FSaisieRayon -> value () / 100.0 ;
171 FControler -> getParameterCreation()->setTorusNbMeridians(m);
178 FControler -> getParameterCreation()->setTorusNbParallels(p);
185 assert(v>=0); assert(v<=1);
186 FControler->getParameterCreation()->setTorusRadiusRapport(v);