Mantid
Loading...
Searching...
No Matches
SampleShapeHelpers.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7//------------------------------------------
8// Includes
9//-----------------------------------------
11
12#include <QComboBox>
13#include <QGridLayout>
14#include <QLabel>
15#include <QRadioButton>
16
17using namespace MantidQt::CustomDialogs;
18
19//--------------------------------------------------------//
20// PointGroupBox helper class
21//--------------------------------------------------------//
22
23PointGroupBox::PointGroupBox(QWidget *parent) : QGroupBox(parent), m_icoord(0) {
24 auto *grid = new QGridLayout;
25
26 // The line edit fields
27 m_midx = new QLineEdit;
28 m_midy = new QLineEdit;
29 m_midz = new QLineEdit;
30
34
35 // Radio selections
36 m_cartesian = new QRadioButton("Cartesian");
37 m_cartesian->setChecked(true);
38 m_spherical = new QRadioButton("Spherical");
39
40 connect(m_cartesian, SIGNAL(clicked(bool)), this, SLOT(changeToCartesian()));
41 connect(m_spherical, SIGNAL(clicked(bool)), this, SLOT(changeToSpherical()));
42
43 int row(0);
44 grid->addWidget(m_cartesian, row, 0, 1, 2);
45 grid->addWidget(m_spherical, row, 2, 1, 2);
46 ++row;
47 // labels
48 m_xlabel = new QLabel("x: ");
49 m_ylabel = new QLabel("y: ");
50 m_zlabel = new QLabel("z: ");
51
52 // x
53 grid->addWidget(m_xlabel, row, 0, Qt::AlignRight);
54 grid->addWidget(m_midx, row, 1);
55 grid->addWidget(m_xunits, row, 2);
56 ++row;
57 // y
58 grid->addWidget(m_ylabel, row, 0); //, Qt::AlignRight);
59 grid->addWidget(m_midy, row, 1);
60 grid->addWidget(m_yunits, row, 2);
61 ++row;
62 // z
63 grid->addWidget(m_zlabel, row, 0, Qt::AlignRight);
64 grid->addWidget(m_midz, row, 1);
65 grid->addWidget(m_zunits, row, 2);
66
67 setLayout(grid);
68}
69
70// Switch to cartesian coordinates
72 if (m_icoord == 0)
73 return;
74
75 m_xlabel->setText("x: ");
76 m_ylabel->setText("y: ");
77 m_zlabel->setText("z: ");
78
79 m_yunits->setItemText(0, "mm");
80 m_zunits->setItemText(0, "mm");
81 m_yunits->setEnabled(true);
82 m_zunits->setEnabled(true);
83
84 m_icoord = 0;
85}
86
87// Switch to spherical coordinates
89 if (m_icoord == 1)
90 return;
91
92 m_xlabel->setText("r: ");
93 m_ylabel->setText("theta: ");
94 m_zlabel->setText("phi: ");
95
96 // Units are in degrees for theta and phi
97 m_yunits->setItemText(0, "deg");
98 m_zunits->setItemText(0, "deg");
99 m_yunits->setEnabled(false);
100 m_zunits->setEnabled(false);
101
102 m_icoord = 1;
103}
104
109QString PointGroupBox::write3DElement(const QString &elem_name) const {
110 QString valx("0.0"), valy("0.0"), valz("0.0");
111 if (!m_midx->text().isEmpty()) {
112 valx = ShapeDetails::convertToMetres(m_midx->text(), ShapeDetails::Unit(m_xunits->currentIndex()));
113 }
114 if (!m_midy->text().isEmpty()) {
115 if (m_icoord == 0) {
116 valy = ShapeDetails::convertToMetres(m_midy->text(), ShapeDetails::Unit(m_yunits->currentIndex()));
117 } else {
118 valy = m_midy->text();
119 }
120 }
121 if (!m_midz->text().isEmpty()) {
122 if (m_icoord == 0) {
123 valz = ShapeDetails::convertToMetres(m_midz->text(), ShapeDetails::Unit(m_zunits->currentIndex()));
124 } else {
125 valz = m_midz->text();
126 }
127 }
128 QString tag;
129 if (m_icoord == 0) {
130 tag = "<" + elem_name + " x=\"" + valx + "\" y=\"" + valy + "\" z= \"" + valz + "\" />\n";
131 } else {
132 tag = "<" + elem_name + " r=\"" + valx + "\" t=\"" + valy + "\" p= \"" + valz + "\" />\n";
133 }
134 return tag;
135}
136
137//----------------------------------------------------//
138// Operation class member function
139//---------------------------------------------------//
147QString Operation::toString(const QString &left, const QString &right) const {
148 QString result;
149 switch (binaryop) {
150 // union
151 case 1:
152 result = left + ":" + right;
153 break;
154 // difference (intersection of the complement)
155 case 2:
156 result = left + " (# " + right + ")";
157 break;
158 // intersection
159 case 0:
160 default:
161 result = left + " " + right;
162 break;
163 }
164 return "(" + result + ")";
165}
166
167//----------------------------------------------------//
168// Base ShapeDetails
169//---------------------------------------------------//
174 auto *units = new QComboBox;
175 QStringList unit_labels("mm");
176 unit_labels << "cm"
177 << "m";
178 units->addItems(unit_labels);
179 return units;
180}
181
187QString ShapeDetails::convertToMetres(const QString &value, Unit start_unit) {
188 QString converted;
189 switch (start_unit) {
191 converted = QString::number(value.toDouble() / 100.0);
192 break;
194 converted = QString::number(value.toDouble() / 1000.0);
195 break;
196 default:
197 converted = value;
198 }
199 return converted;
200}
201
207
213
214//--------------------------------------------//
215// Sphere
216//--------------------------------------------//
219
221SphereDetails::SphereDetails(QWidget *parent) : ShapeDetails(parent) {
222 // Update number of sphere objects and the set the ID of this one
223 ++g_nspheres;
224 m_idvalue = "sphere_" + QString::number(g_nspheres);
225
226 auto *main_layout = new QVBoxLayout(this);
227 // radius
228 m_radius_box = new QLineEdit;
230 auto *rad_layout = new QHBoxLayout;
231 rad_layout->addWidget(new QLabel("Radius: "));
232 rad_layout->addWidget(m_radius_box);
233 rad_layout->addWidget(m_runits);
234
236 m_centre->setTitle("Centre");
237
238 main_layout->addLayout(rad_layout);
239 main_layout->addWidget(m_centre);
240}
241
245QString SphereDetails::writeXML() const {
246 QString valr("0.0");
247 if (!m_radius_box->text().isEmpty()) {
248 valr = convertToMetres(m_radius_box->text(), ShapeDetails::Unit(m_runits->currentIndex()));
249 }
250 QString xmldef = "<sphere id=\"" + m_idvalue + "\">\n" + m_centre->write3DElement("centre") + "<radius val=\"" +
251 valr +
252 "\" />\n"
253 "</sphere>\n";
254 return xmldef;
255}
256
257//--------------------------------------------------------//
258// Cylinder
259//--------------------------------------------------------//
262
266 ++g_ncylinders;
267 m_idvalue = "cylinder_" + QString::number(g_ncylinders);
268
269 auto *main_layout = new QVBoxLayout(this);
270 // radius
271 m_radius_box = new QLineEdit;
273 auto *rad_layout = new QHBoxLayout;
274 rad_layout->addWidget(new QLabel("Radius: "));
275 rad_layout->addWidget(m_radius_box);
276 rad_layout->addWidget(m_runits);
277
278 // height
279 m_height_box = new QLineEdit;
281 auto *hgt_layout = new QHBoxLayout;
282 hgt_layout->addWidget(new QLabel("Height: "));
283 hgt_layout->addWidget(m_height_box);
284 hgt_layout->addWidget(m_hunits);
285
286 // Point boxes
288 m_lower_centre->setTitle("Bottom Base Centre");
289
290 m_axis = new PointGroupBox;
291 m_axis->setTitle("Axis");
292
293 main_layout->addLayout(rad_layout);
294 main_layout->addLayout(hgt_layout);
295 main_layout->addWidget(m_lower_centre);
296 main_layout->addWidget(m_axis);
297}
298
303 QString valr("0.0"), valh("0.0");
304 if (!m_radius_box->text().isEmpty()) {
305 valr = convertToMetres(m_radius_box->text(), ShapeDetails::Unit(m_runits->currentIndex()));
306 }
307 if (!m_height_box->text().isEmpty()) {
308 valh = convertToMetres(m_height_box->text(), ShapeDetails::Unit(m_hunits->currentIndex()));
309 }
310 QString xmldef = "<cylinder id=\"" + m_idvalue +
311 "\" >\n"
312 "<radius val=\"" +
313 valr +
314 "\" />\n"
315 "<height val=\"" +
316 valh + "\" />\n" + m_lower_centre->write3DElement("centre-of-bottom-base") +
317 m_axis->write3DElement("axis") + "</cylinder>\n";
318 return xmldef;
319}
320
321//--------------------------------------------------------//
322// InfiniteCylinder
323//--------------------------------------------------------//
326
330 ++g_ninfcyls;
331 m_idvalue = "infcyl_" + QString::number(g_ninfcyls);
332
333 auto *main_layout = new QVBoxLayout(this);
334 // radius
335 m_radius_box = new QLineEdit;
337 auto *rad_layout = new QHBoxLayout;
338 rad_layout->addWidget(new QLabel("Radius: "));
339 rad_layout->addWidget(m_radius_box);
340 rad_layout->addWidget(m_runits);
341
342 // Point boxes
344 m_centre->setTitle("Centre");
345
346 m_axis = new PointGroupBox;
347 m_axis->setTitle("Axis");
348
349 main_layout->addLayout(rad_layout);
350 main_layout->addWidget(m_centre);
351 main_layout->addWidget(m_axis);
352}
353
358 QString valr("0.0");
359 if (!m_radius_box->text().isEmpty()) {
360 valr = convertToMetres(m_radius_box->text(), ShapeDetails::Unit(m_runits->currentIndex()));
361 }
362 QString xmldef = "<infinite-cylinder id=\"" + m_idvalue +
363 "\" >\n"
364 "<radius val=\"" +
365 valr + "\" />\n" + m_centre->write3DElement("centre") + m_axis->write3DElement("axis") +
366 "</infinite-cylinder>\n";
367 return xmldef;
368}
369
370//--------------------------------------------------------//
371// SliceOfCylinderRing
372//--------------------------------------------------------//
375
379 ++g_ncylrings;
380 m_idvalue = "cylslice_" + QString::number(g_ncylrings);
381
382 auto *main_layout = new QVBoxLayout(this);
383 // inner radius
384 m_rinner_box = new QLineEdit;
386 auto *rad_layout = new QHBoxLayout;
387 rad_layout->addWidget(new QLabel("Inner radius: "));
388 rad_layout->addWidget(m_rinner_box);
389 rad_layout->addWidget(m_iunits);
390 // Outer
391 m_router_box = new QLineEdit;
393 auto *rad2_layout = new QHBoxLayout;
394 rad2_layout->addWidget(new QLabel("Outer radius: "));
395 rad2_layout->addWidget(m_router_box);
396 rad2_layout->addWidget(m_ounits);
397 // Depth
398 m_depth_box = new QLineEdit;
400 auto *dep_layout = new QHBoxLayout;
401 dep_layout->addWidget(new QLabel(" Depth: "));
402 dep_layout->addWidget(m_depth_box);
403 dep_layout->addWidget(m_dunits);
404
405 // Arc
406 m_arc_box = new QLineEdit;
407 auto *arc_layout = new QHBoxLayout;
408 arc_layout->addWidget(new QLabel("Arc: "));
409 arc_layout->addWidget(m_arc_box);
410 arc_layout->addWidget(new QLabel(" deg "));
411
412 main_layout->addLayout(rad_layout);
413 main_layout->addLayout(rad2_layout);
414 main_layout->addLayout(dep_layout);
415 main_layout->addLayout(arc_layout);
416}
417
422 QString valir("0.0"), valor("0.0"), vald("0.0"), vala("0.0");
423 if (!m_rinner_box->text().isEmpty()) {
424 valir = convertToMetres(m_rinner_box->text(), ShapeDetails::Unit(m_iunits->currentIndex()));
425 }
426 if (!m_router_box->text().isEmpty()) {
427 valor = convertToMetres(m_router_box->text(), ShapeDetails::Unit(m_ounits->currentIndex()));
428 }
429 if (!m_depth_box->text().isEmpty()) {
430 vald = convertToMetres(m_depth_box->text(), ShapeDetails::Unit(m_dunits->currentIndex()));
431 }
432 if (!m_arc_box->text().isEmpty()) {
433 vala = m_arc_box->text();
434 }
435
436 QString xmldef = "<slice-of-cylinder-ring id=\"" + m_idvalue +
437 "\" >\n"
438 "<inner-radius val=\"" +
439 valir +
440 "\" />\n"
441 "<outer-radius val=\"" +
442 valor +
443 "\" />\n"
444 "<depth val=\"" +
445 vald +
446 "\" />\n"
447 "<arc val=\"" +
448 vala +
449 "\" />\n"
450 "</slice-of-cylinder-ring>\n";
451
452 return xmldef;
453}
454
455//--------------------------------------------------------//
456// Cone
457//--------------------------------------------------------//
460
462ConeDetails::ConeDetails(QWidget *parent) : ShapeDetails(parent) {
464 ++g_ncones;
465 m_idvalue = "cone_" + QString::number(g_ncones);
466
467 auto *main_layout = new QVBoxLayout(this);
468 // Height
469 m_height_box = new QLineEdit;
471 auto *hgt_layout = new QHBoxLayout;
472 hgt_layout->addWidget(new QLabel("Height: "));
473 hgt_layout->addWidget(m_height_box);
474 hgt_layout->addWidget(m_hunits);
475
476 // Angle
477 m_angle_box = new QLineEdit;
478 auto *ang_layout = new QHBoxLayout;
479 ang_layout->addWidget(new QLabel("Angle: "));
480 ang_layout->addWidget(m_angle_box);
481 ang_layout->addWidget(new QLabel(" deg "));
482
483 // Point boxes
485 m_tippoint->setTitle("Tip point");
486
487 m_axis = new PointGroupBox;
488 m_axis->setTitle("Base-to-Tip Axis");
489
490 main_layout->addLayout(hgt_layout);
491 main_layout->addLayout(ang_layout);
492 main_layout->addWidget(m_tippoint);
493 main_layout->addWidget(m_axis);
494}
495
499QString ConeDetails::writeXML() const {
500 QString valh("0.0"), valan("0.0");
501 if (!m_height_box->text().isEmpty()) {
502 valh = convertToMetres(m_height_box->text(), ShapeDetails::Unit(m_hunits->currentIndex()));
503 }
504 if (!m_angle_box->text().isEmpty()) {
505 valan = m_angle_box->text();
506 }
507
508 QString xmldef = "<cone id=\"" + m_idvalue +
509 "\" >\n"
510 "<height val=\"" +
511 valh +
512 "\" />\n"
513 "<angle val=\"" +
514 valan + "\" />\n" + m_tippoint->write3DElement("tip-point") + m_axis->write3DElement("axis") +
515 "</cone>\n";
516
517 return xmldef;
518}
519
520//--------------------------------------------------------//
521// InfiniteCone
522//--------------------------------------------------------//
525
529 ++g_ninfcones;
530 m_idvalue = "infcone_" + QString::number(g_ninfcones);
531
532 auto *main_layout = new QVBoxLayout(this);
533 // Angle
534 m_angle_box = new QLineEdit;
535 auto *ang_layout = new QHBoxLayout;
536 ang_layout->addWidget(new QLabel("Angle: "));
537 ang_layout->addWidget(m_angle_box);
538 ang_layout->addWidget(new QLabel(" deg "));
539
540 // Point boxes
542 m_tippoint->setTitle("Tip point");
543
544 m_axis = new PointGroupBox;
545 m_axis->setTitle("Base-to-Tip Axis");
546
547 main_layout->addLayout(ang_layout);
548 main_layout->addWidget(m_tippoint);
549 main_layout->addWidget(m_axis);
550}
551
556 QString valan("0.0");
557 if (!m_angle_box->text().isEmpty()) {
558 valan = m_angle_box->text();
559 }
560
561 QString xmldef = "<infinite-cone id=\"" + m_idvalue +
562 "\" >\n"
563 "<angle val=\"" +
564 valan + "\" />\n" + m_tippoint->write3DElement("tip-point") + m_axis->write3DElement("axis") +
565 "</infinite-cone>\n";
566
567 return xmldef;
568}
569
570//--------------------------------------------------------//
571// InfinitePlane
572//--------------------------------------------------------//
575
579 ++g_ninfplanes;
580 m_idvalue = "infplane_" + QString::number(g_ninfplanes);
581
582 auto *main_layout = new QVBoxLayout(this);
583
584 // Point boxes
586 m_plane->setTitle("Point in plane");
587
589 m_normal->setTitle("Point normal to plane");
590
591 main_layout->addWidget(m_plane);
592 main_layout->addWidget(m_normal);
593}
594
599 QString xmldef = "<infinite-plane id=\"" + m_idvalue + "\" >\n" + m_plane->write3DElement("point-in-plane") +
600 m_normal->write3DElement("normal-to-plane") + "</infinite-plane>\n";
601
602 return xmldef;
603}
604
605//--------------------------------------------------------//
606// Cuboid
607//--------------------------------------------------------//
610
612CuboidDetails::CuboidDetails(QWidget *parent) : ShapeDetails(parent) {
614 ++g_ncuboids;
615 m_idvalue = "cuboid_" + QString::number(g_ncuboids);
616
617 auto *main_layout = new QVBoxLayout(this);
618
619 // Point boxes
621 m_left_frt_bot->setTitle("Left front bottom point");
622
624 m_left_frt_top->setTitle("Left front top point");
625
627 m_left_bck_bot->setTitle("Left back bottom point");
628
630 m_right_frt_bot->setTitle("Right front bottom point");
631
632 main_layout->addWidget(m_left_frt_bot);
633 main_layout->addWidget(m_left_frt_top);
634 main_layout->addWidget(m_left_bck_bot);
635 main_layout->addWidget(m_right_frt_bot);
636}
637
641QString CuboidDetails::writeXML() const {
642 QString xmldef = "<cuboid id=\"" + m_idvalue + "\" >\n" + m_left_frt_bot->write3DElement("left-front-bottom-point") +
643 m_left_frt_top->write3DElement("left-front-top-point") +
644 m_left_bck_bot->write3DElement("left-back-bottom-point") +
645 m_right_frt_bot->write3DElement("right-front-bottom-point") + "</cuboid>\n";
646 return xmldef;
647}
648
649//--------------------------------------------------------//
650// Hexahedron
651//--------------------------------------------------------//
654
659 m_idvalue = "hexahedron_" + QString::number(g_nhexahedrons);
660
661 auto *main_layout = new QVBoxLayout(this);
662
663 // Point boxes
665 m_left_bck_bot->setTitle("Left back bottom point");
666
668 m_left_frt_bot->setTitle("Left front bottom point");
669
671 m_right_frt_bot->setTitle("Right front bottom point");
672
674 m_right_bck_bot->setTitle("Right back bottom point");
675
677 m_left_bck_top->setTitle("Left back top point");
678
680 m_left_frt_top->setTitle("Left front top point");
681
683 m_right_frt_top->setTitle("Right front top point");
684
686 m_right_bck_top->setTitle("Right back top point");
687
688 main_layout->addWidget(m_left_bck_bot);
689 main_layout->addWidget(m_left_frt_bot);
690 main_layout->addWidget(m_right_bck_bot);
691 main_layout->addWidget(m_right_frt_bot);
692 main_layout->addWidget(m_left_bck_top);
693 main_layout->addWidget(m_left_frt_top);
694 main_layout->addWidget(m_right_bck_top);
695 main_layout->addWidget(m_right_frt_top);
696}
697
702 QString xmldef =
703 "<hexahedron id=\"" + m_idvalue + "\" >\n" + m_left_bck_bot->write3DElement("left-back-bottom-point") +
704 m_left_frt_bot->write3DElement("left-front-bottom-point") +
705 m_right_bck_bot->write3DElement("right-back-bottom-point") +
706 m_right_frt_bot->write3DElement("right-front-bottom-point") +
707 m_left_bck_top->write3DElement("left-back-top-point") + m_left_frt_top->write3DElement("left-front-top-point") +
708 m_right_bck_top->write3DElement("right-back-top-point") +
709 m_right_frt_top->write3DElement("right-front-top-point") + "</hexahedron>\n";
710 return xmldef;
711}
712
713// This is not implemented in OpenCascade yet
714
715//--------------------------------------------------------//
716// Torus
717//--------------------------------------------------------//
719// int TorusDetails::g_ntori = 0;
720
721// /// Default constructor
722// TorusDetails::TorusDetails(QWidget *parent) : ShapeDetails(parent)
723// {
724// /// Update number of sphere objects and the set the ID of this one
725// ++g_ntori;
726// m_idvalue = "torus_" + QString::number(g_ntori);
727
728// QVBoxLayout *main_layout = new QVBoxLayout(this);
729
730// //Radi
731// m_tube_rad = new QLineEdit;
732// m_tunits = createLengthUnitsCombo();
733// QHBoxLayout *tub_layout = new QHBoxLayout;
734// tub_layout->addWidget(new QLabel("Tube radius: "));
735// tub_layout->addWidget(m_tube_rad);
736// tub_layout->addWidget(m_tunits);
737
738// m_inner_rad = new QLineEdit;
739// m_iunits = createLengthUnitsCombo();
740// QHBoxLayout *hol_layout = new QHBoxLayout;
741// hol_layout->addWidget(new QLabel("Hole radius: "));
742// hol_layout->addWidget(m_inner_rad);
743// hol_layout->addWidget(m_iunits);
744
745// //Point boxes
746// m_centre = new PointGroupBox;
747// m_centre->setTitle("Centre");
748
749// m_axis = new PointGroupBox;
750// m_axis->setTitle("Axis");
751
752// main_layout->addLayout(tub_layout);
753// main_layout->addLayout(hol_layout);
754// main_layout->addWidget(m_centre);
755// main_layout->addWidget(m_axis);
756// }
757
758// /**
759// * Write the XML definition
760// */
761// QString TorusDetails::writeXML() const
762// {
763// QString valt("0.0"), vali("0.0");
764// if( !m_tube_rad->text().isEmpty() )
765// {
766// valt = convertToMetres(m_tube_rad->text(),
767// ShapeDetails::Unit(m_tunits->currentIndex()));
768// }
769// if( !m_inner_rad->text().isEmpty() )
770// {
771// vali = convertToMetres(m_inner_rad->text(),
772// ShapeDetails::Unit(m_iunits->currentIndex()));
773// }
774// QString xmldef =
775// "<torus id=\"" + m_idvalue + "\" >\n"
776// "<radius-tube val=\"" + valt + "\" />\n"
777// "<radius-from-centre-to-tube val=\"" + vali + "\" />\n" +
778// m_centre->write3DElement("centre") +
779// m_axis->write3DElement("axis") +
780// "</torus>\n";
781// return xmldef;
782// }
double value
The value of the point.
Definition: FitMW.cpp:51
double left
Definition: LineProfile.cpp:80
double right
Definition: LineProfile.cpp:81
QLineEdit * m_height_box
Line edits to enter values.
QString writeXML() const override
Write the XML definition of a sphere.
ConeDetails(QWidget *parent=nullptr)
Default constructor.
PointGroupBox * m_tippoint
Centre and axis point boxes.
static int g_ncones
The number of objects that currently exist.
PointGroupBox * m_left_frt_bot
Corner points.
CuboidDetails(QWidget *parent=nullptr)
Default constructor.
QString writeXML() const override
Write the XML definition of a sphere.
static int g_ncuboids
The number of objects that currently exist.
static int g_ncylinders
The number of objects that currently exist.
CylinderDetails(QWidget *parent=nullptr)
Default constructor.
QString writeXML() const override
Write the XML definition.
QLineEdit * m_radius_box
Line edits to enter values.
PointGroupBox * m_lower_centre
Centre and axis point boxes.
HexahedronDetails(QWidget *parent=nullptr)
Default constructor.
static int g_nhexahedrons
The number of objects that currently exist.
PointGroupBox * m_left_bck_bot
Corner points.
QString writeXML() const override
Write the XML definition of a sphere.
PointGroupBox * m_tippoint
Centre and axis point boxes.
InfiniteConeDetails(QWidget *parent=nullptr)
Default constructor.
QLineEdit * m_angle_box
Line edits to enter values.
static int g_ninfcones
The number of objects that currently exist.
QString writeXML() const override
Write the XML definition of a sphere.
QLineEdit * m_radius_box
Line edits to enter values.
QString writeXML() const override
Write the XML definition.
PointGroupBox * m_centre
Centre and axis point boxes.
static int g_ninfcyls
The number of objects that currently exist.
InfiniteCylinderDetails(QWidget *parent=nullptr)
Default constructor.
QString writeXML() const override
Write the XML definition of a sphere.
InfinitePlaneDetails(QWidget *parent=nullptr)
Default constructor.
static int g_ninfplanes
The number of objects that currently exist.
PointGroupBox * m_plane
Centre and axis point boxes.
A custom group box for a 3D point.
QString write3DElement(const QString &elem_name) const
Write the element tag for a 3D point.
The base class for the details widgets.
void setComplementFlag(bool flag)
Set the complement flag.
bool m_isComplement
Take the complement of the shape.
bool getComplementFlag() const
Get complement flag.
static QComboBox * createLengthUnitsCombo()
Create a new length units box.
static QString convertToMetres(const QString &value, Unit start_unit)
Convert a string value from the given unit to metres (static)
QString m_idvalue
ID string of this object.
QLineEdit * m_rinner_box
Line edits to enter values.
QString writeXML() const override
Write the XML definition of a sphere.
SliceOfCylinderRingDetails(QWidget *parent=nullptr)
Default constructor.
static int g_ncylrings
The number of objects that currently exist.
SphereDetails(QWidget *parent=nullptr)
Default constructor.
static int g_nspheres
The number of objects that currently exist.
QString writeXML() const override
Write the XML definition.
QComboBox * m_runits
Radius unit choice.
PointGroupBox * m_centre
Centre point group box.
QLineEdit * m_radius_box
Line edit for radius value.
QString toString(const QString &left, const QString &right) const
Return the string that represnts the result of this operation.
int binaryop
The stored operation.