29 #include <QtGui/QPixmap>
30 #include <QtGui/QLabel>
41 GMap3d :: CControlerGMap * controler ) :
48 FAffX =
new QLabel (
" X : " ) ;
49 FSaisieX =
new FloatSpinBox ( 0.5 , -1000 ,1000 , 2 , 0.1 ) ;
50 FAffY =
new QLabel (
" Y : " ) ;
51 FSaisieY =
new FloatSpinBox ( 0.5 , -1000 ,1000 , 2 , 0.1 ) ;
52 FAffZ =
new QLabel (
" Z : " ) ;
53 FSaisieZ =
new FloatSpinBox ( 0.5 , -1000 ,1000 , 2 , 0.1 ) ;
55 addWidget(
new QLabel (
" Position : " ));
65 QIcon p1 (
":/boutonCreer.png" ) ;
66 QIcon p2 (
":/boutonSupprimer.png" ) ;
68 FNouveau =
new QPushButton ( p1 , *
HTML::decode(
"Create new") ,
70 FSupprimer =
new QPushButton ( p2 ,
"Delete last" ,
this ) ;
72 QObject::connect ( FNouveau , SIGNAL ( clicked ( ) ) ,
this,
73 SLOT ( prolong ( ) ) ) ;
74 QObject::connect ( FSupprimer , SIGNAL ( clicked ( ) ) ,
this,
75 SLOT (shorten ( ) ) ) ;
78 addWidget(FSupprimer);
82 FChoix -> getOptions ( ) -> setEnabled (
false ) ;
89 QObject::connect ( FSaisieX , SIGNAL ( valueChanged (
double ) ) ,
this,
90 SLOT ( lastVertexChanged ( ) ) ) ;
91 QObject::connect ( FSaisieY , SIGNAL ( valueChanged (
double ) ) ,
this,
92 SLOT ( lastVertexChanged ( ) ) ) ;
93 QObject::connect ( FSaisieZ , SIGNAL ( valueChanged (
double ) ) ,
this,
94 SLOT ( lastVertexChanged ( ) ) ) ;
105 if (
FControler -> getParameterPolylinePosition() -> getNbVertices() > 0 )
107 getParameterPolylinePosition() ->
117 void CreationBrin :: setNewVertex (
const CVertex & v )
122 FSaisieX -> setValuef ( v . getX ( ) ) ;
123 FSaisieY -> setValuef ( v . getY ( ) ) ;
124 FSaisieZ -> setValuef ( v . getZ ( ) ) ;
129 void CreationBrin :: clearLastVertex ( )
131 FSaisieX -> setValuef ( 0 ) ;
132 FSaisieY -> setValuef ( 0 ) ;
133 FSaisieZ -> setValuef ( 0 ) ;
136 void CreationBrin :: lastVertexChanged ( )
140 CVertex vertex ( FSaisieX -> valuef ( ) ,
141 FSaisieY -> valuef ( ) ,
142 FSaisieZ -> valuef ( ) ) ;
144 if (
FControler -> getParameterPolylinePosition()->getNbVertices()==0)
145 FControler -> getParameterPolylinePosition()->addVertex(vertex);
147 FControler -> getParameterPolylinePosition()->setLastVertex(vertex);
154 void CreationBrin :: close ( )
159 void CreationBrin :: prolong ( )
161 CVertex vertex( FSaisieX -> valuef ( ) ,
162 FSaisieY -> valuef ( ) ,
163 FSaisieZ -> valuef ( ) ) ;
165 FControler -> getParameterPolylinePosition ( ) -> addVertex ( vertex ) ;
170 void CreationBrin :: shorten ( )
172 if (
FControler -> getParameterPolylinePosition( ) -> getNbVertices ( ) > 0 )
174 FControler -> getParameterPolylinePosition ( ) -> removeLastVertex ( ) ;