29 #include <QtGui/QLabel>
30 #include <QtGui/QHBoxLayout>
31 #include <QtGui/QVBoxLayout>
42 GMap3d :: CControlerGMap * controler) :
49 QWidget * haut =
new QWidget ;
50 QHBoxLayout * bb =
new QHBoxLayout(haut);
52 bb -> setContentsMargins(0, 0, 0, 0);
56 (
" Dimension of the cell to create: ")) ;
58 FDimCell =
new QComboBox ;
59 FDimCell -> addItem(*
HTML::decode(
"1 (edge/polyline)")) ;
60 FDimCell -> addItem(
"2 (face/grid)") ;
61 FDimCell -> addItem(
"3 (mesh/3D volume)") ;
63 FAffMai =
new QLabel(
"Mesh dimension: ") ;
65 FDimMail =
new QComboBox ;
66 FDimMail -> addItem(
"0 (no mesh)") ;
68 FDimMail -> addItem(
"2 (face mesh)") ;
69 FDimMail -> addItem(
"3 (volume mesh)") ;
71 QObject :: connect(FDimCell , SIGNAL(activated(
int)) ,
this ,
72 SLOT(callbackDimCell())) ;
73 QObject :: connect(FDimMail , SIGNAL(activated(
int)) ,
this ,
74 SLOT(callbackDimMesh())) ;
77 FAffSub =
new QLabel(
"Subdivisions : ") ;
79 FAffX =
new QLabel(
" X : ") ;
80 FSaisieX =
new QSpinBox ;
81 FSaisieX -> setMinimum(1);
82 FSaisieX -> setMaximum(1000);
83 FSaisieX -> setValue(1) ;
84 FSaisieX -> setAccelerated(
true);
86 FAffY =
new QLabel(
" Y : ") ;
87 FSaisieY =
new QSpinBox ;
88 FSaisieY -> setMinimum(1);
89 FSaisieY -> setMaximum(1000);
90 FSaisieY -> setValue(1) ;
91 FSaisieY -> setAccelerated(
true);
93 FAffZ =
new QLabel(
" Z : ") ;
94 FSaisieZ =
new QSpinBox ;
95 FSaisieZ -> setMinimum(1);
96 FSaisieZ -> setMaximum(1000);
97 FSaisieZ -> setValue(1) ;
98 FSaisieZ -> setAccelerated(
true);
100 QObject :: connect(FSaisieX , SIGNAL(valueChanged(
int)) ,
this ,
101 SLOT(callbackSubdivisions())) ;
102 QObject :: connect(FSaisieY , SIGNAL(valueChanged(
int)) ,
this ,
103 SLOT(callbackSubdivisions())) ;
104 QObject :: connect(FSaisieZ , SIGNAL(valueChanged(
int)) ,
this ,
105 SLOT(callbackSubdivisions())) ;
107 bb -> addWidget(FAffCel) ;
108 bb -> addWidget(FDimCell) ;
110 bb -> addWidget(FAffMai) ;
111 bb -> addWidget(FDimMail) ;
113 bb -> addWidget(FAffSub) ;
114 bb -> addWidget(FAffX) ;
115 bb -> addWidget(FSaisieX) ;
116 bb -> addWidget(FAffY) ;
117 bb -> addWidget(FSaisieY) ;
118 bb -> addWidget(FAffZ) ;
119 bb -> addWidget(FSaisieZ) ;
124 QWidget * bas =
new QWidget ;
125 QHBoxLayout * bh =
new QHBoxLayout(bas);
127 bh -> setContentsMargins(0, 0, 0, 0);
129 FAffFac =
new QLabel(*
HTML::decode(
" Faces created: ")) ;
130 FGauche =
new QCheckBox(
"Left ") ;
131 FDroite =
new QCheckBox(
"Right ") ;
132 FDevant =
new QCheckBox(
"Front ") ;
134 FBas =
new QCheckBox(
"Down ") ;
135 FHaut =
new QCheckBox(
"Up ") ;
138 bh -> addWidget(FAffFac) ;
139 bh -> addWidget(FGauche) ;
140 bh -> addWidget(FDroite) ;
141 bh -> addWidget(FDevant) ;
142 bh -> addWidget(FDerriere) ;
143 bh -> addWidget(FBas) ;
144 bh -> addWidget(FHaut) ;
149 QWidget * centre =
new QWidget ;
150 QVBoxLayout * bl =
new QVBoxLayout(centre);
152 bl -> setContentsMargins(0, 0, 0, 0);
153 bl -> addWidget(haut) ;
154 bl -> addWidget(bas) ;
163 QObject :: connect(FGauche , SIGNAL(clicked()) ,
this ,
164 SLOT(callbackToggleButton())) ;
165 QObject :: connect(FDroite , SIGNAL(clicked()) ,
this ,
166 SLOT(callbackToggleButton())) ;
167 QObject :: connect(FDevant , SIGNAL(clicked()) ,
this ,
168 SLOT(callbackToggleButton())) ;
169 QObject :: connect(FDerriere , SIGNAL(clicked()) ,
this ,
170 SLOT(callbackToggleButton())) ;
171 QObject :: connect(FBas , SIGNAL(clicked()) ,
this ,
172 SLOT(callbackToggleButton())) ;
173 QObject :: connect(FHaut , SIGNAL(clicked()) ,
this ,
174 SLOT(callbackToggleButton())) ;
187 FSaisieX->setValue(
FControler->getParameterCreation()
188 ->getMeshNbSubdivisionsX());
189 FSaisieY->setValue(
FControler->getParameterCreation()
190 ->getMeshNbSubdivisionsY());
191 FSaisieZ->setValue(
FControler->getParameterCreation()
192 ->getMeshNbSubdivisionsZ());
194 unsigned char toCreate =
195 FControler -> getParameterCreation()->getMeshCreatedFaces();
197 FGauche -> setChecked((toCreate & (1 << 0)) != 0) ;
198 FDroite -> setChecked((toCreate & (1 << 1)) != 0) ;
199 FDevant -> setChecked((toCreate & (1 << 2)) != 0) ;
200 FDerriere -> setChecked((toCreate & (1 << 3)) != 0) ;
201 FBas -> setChecked((toCreate & (1 << 4)) != 0) ;
202 FHaut -> setChecked((toCreate & (1 << 5)) != 0) ;
204 int dCell =
FControler->getParameterCreation()->getMeshDimension();
205 int dMail =
FControler->getParameterCreation()->getMeshSubdivisionDimension();
207 FDimCell -> setCurrentIndex(dCell - 1) ;
208 FDimMail -> setCurrentIndex(dMail) ;
210 bool b = dCell == 3 && dMail != 3 ;
212 FGauche -> setEnabled(b) ;
213 FDroite -> setEnabled(b) ;
214 FDevant -> setEnabled(b) ;
215 FDerriere -> setEnabled(b) ;
216 FBas -> setEnabled(b) ;
217 FHaut -> setEnabled(b) ;
219 FSaisieX->setEnabled(dMail != 0 && dCell > 0);
220 FSaisieY->setEnabled(dMail != 0 && dCell > 1);
221 FSaisieZ->setEnabled(dMail != 0 && dCell > 2);
227 void CreationMaillage::callbackSubdivisions()
235 void CreationMaillage::callbackToggleButton()
241 void CreationMaillage::callbackDimCell()
247 void CreationMaillage::callbackDimMesh()
260 return FSaisieX -> value() ;
263 return FSaisieY -> value() ;
266 return FSaisieZ -> value() ;
276 if (FGauche -> isChecked())
278 if (FDroite -> isChecked())
280 if (FDevant -> isChecked())
282 if (FDerriere -> isChecked())
284 if (FBas -> isChecked())
286 if (FHaut -> isChecked())
294 FControler ->getParameterCreation()->setMeshNbSubdivisionsX(x);
295 FControler ->getParameterCreation()->setMeshNbSubdivisionsY(y);
296 FControler ->getParameterCreation()->setMeshNbSubdivisionsZ(z);
304 FControler -> getParameterCreation()->setMeshCreatedFaces(c);
311 FControler -> getParameterCreation()->setMeshDimension(dim);
318 FControler->getParameterCreation()->setMeshSubdivisionDimension(dim);