Instructions if the OK-Button has been pressed.
166{
168 {
169 return;
170 }
171
172 if ((this->xLengthEdit->text().toDouble() <= 0) ||
173 (this->yLengthEdit->text().toDouble() <= 0) ||
174 (this->zLengthEdit->text().toDouble() <= 0))
175 {
177 return;
178 }
179
180 if ((this->xElemEdit->text().toDouble() <= 0) ||
181 (this->yElemEdit->text().toDouble() <= 0) ||
182 (this->zElemEdit->text().toDouble() <= 0))
183 {
184 OGSError::box(
"Number of elements needs to be larger than 0.");
185 return;
186 }
187
188 GeoLib::Point const origin(this->xOriginEdit->text().toDouble(),
189 this->yOriginEdit->text().toDouble(),
190 this->zOriginEdit->text().toDouble());
191 std::string
const name(this->meshNameEdit->text().toStdString());
193 if (this->lineButton->isChecked())
194 {
195 if (this->meshExtentButton->isChecked())
196 {
198 this->xLengthEdit->text().toDouble(),
199 this->xElemEdit->text().toInt(), origin, name);
200 }
201 else
202 {
204 this->xElemEdit->text().toInt(),
205 this->xLengthEdit->text().toDouble(), origin, name);
206 }
207 }
208 else if (this->triButton->isChecked())
209 {
210 if (this->meshExtentButton->isChecked())
211 {
213 this->xLengthEdit->text().toDouble(),
214 this->yLengthEdit->text().toDouble(),
215 this->xElemEdit->text().toInt(),
216 this->yElemEdit->text().toInt(), origin, name);
217 }
218 else
219 {
221 this->xElemEdit->text().toInt(),
222 this->yElemEdit->text().toInt(),
223 this->xLengthEdit->text().toDouble(),
224 this->yLengthEdit->text().toDouble(), origin, name);
225 }
226 }
227 else if (this->quadButton->isChecked())
228 {
229 if (this->meshExtentButton->isChecked())
230 {
232 this->xLengthEdit->text().toDouble(),
233 this->yLengthEdit->text().toDouble(),
234 this->xElemEdit->text().toInt(),
235 this->yElemEdit->text().toInt(), origin, name);
236 }
237 else
238 {
240 this->xElemEdit->text().toInt(),
241 this->yElemEdit->text().toInt(),
242 this->xLengthEdit->text().toDouble(),
243 this->yLengthEdit->text().toDouble(), origin, name);
244 }
245 }
246 else if (this->prismButton->isChecked())
247 {
248 if (this->meshExtentButton->isChecked())
249 {
251 this->xLengthEdit->text().toDouble(),
252 this->yLengthEdit->text().toDouble(),
253 this->zLengthEdit->text().toDouble(),
254 this->xElemEdit->text().toInt(),
255 this->yElemEdit->text().toInt(),
256 this->zElemEdit->text().toInt(), origin, name);
257 }
258 else
259 {
261 this->xLengthEdit->text().toDouble(),
262 this->yLengthEdit->text().toDouble(),
263 this->zLengthEdit->text().toDouble(),
264 this->xElemEdit->text().toInt(),
265 this->yElemEdit->text().toInt(),
266 this->zElemEdit->text().toInt(), origin, name);
267 }
268 }
269 else if (this->hexButton->isChecked())
270 {
271 if (this->meshExtentButton->isChecked())
272 {
274 this->xLengthEdit->text().toDouble(),
275 this->yLengthEdit->text().toDouble(),
276 this->zLengthEdit->text().toDouble(),
277 this->xElemEdit->text().toInt(),
278 this->yElemEdit->text().toInt(),
279 this->zElemEdit->text().toInt(), origin, name);
280 }
281 else
282 {
284 this->xElemEdit->text().toInt(),
285 this->yElemEdit->text().toInt(),
286 this->zElemEdit->text().toInt(),
287 this->xLengthEdit->text().toDouble(),
288 this->yLengthEdit->text().toDouble(),
289 this->zLengthEdit->text().toDouble(), origin, name);
290 }
291 }
292
293 if (mesh == nullptr)
294 {
296 return;
297 }
298
299 auto* const mat_ids = mesh->getProperties().createNewPropertyVector<int>(
301 assert(mat_ids != nullptr);
302 mat_ids->resize(mesh->getNumberOfElements());
304 this->done(QDialog::Accepted);
305}
void meshAdded(MeshLib::Mesh *mesh)
bool inputIsEmpty() const
Checks if all necessary inputs have been specified.
static void box(const QString &e)