15#include <QRadioButton>
24 auto *grid =
new QGridLayout;
53 grid->addWidget(
m_xlabel, row, 0, Qt::AlignRight);
54 grid->addWidget(
m_midx, row, 1);
59 grid->addWidget(
m_midy, row, 1);
63 grid->addWidget(
m_zlabel, row, 0, Qt::AlignRight);
64 grid->addWidget(
m_midz, row, 1);
110 QString valx(
"0.0"), valy(
"0.0"), valz(
"0.0");
111 if (!
m_midx->text().isEmpty()) {
114 if (!
m_midy->text().isEmpty()) {
121 if (!
m_midz->text().isEmpty()) {
130 tag =
"<" + elem_name +
" x=\"" + valx +
"\" y=\"" + valy +
"\" z= \"" + valz +
"\" />\n";
132 tag =
"<" + elem_name +
" r=\"" + valx +
"\" t=\"" + valy +
"\" p= \"" + valz +
"\" />\n";
164 return "(" + result +
")";
174 auto *units =
new QComboBox;
175 QStringList unit_labels(
"mm");
178 units->addItems(unit_labels);
189 switch (start_unit) {
191 converted = QString::number(
value.toDouble() / 100.0);
194 converted = QString::number(
value.toDouble() / 1000.0);
226 auto *main_layout =
new QVBoxLayout(
this);
230 auto *rad_layout =
new QHBoxLayout;
231 rad_layout->addWidget(
new QLabel(
"Radius: "));
238 main_layout->addLayout(rad_layout);
269 auto *main_layout =
new QVBoxLayout(
this);
273 auto *rad_layout =
new QHBoxLayout;
274 rad_layout->addWidget(
new QLabel(
"Radius: "));
281 auto *hgt_layout =
new QHBoxLayout;
282 hgt_layout->addWidget(
new QLabel(
"Height: "));
293 main_layout->addLayout(rad_layout);
294 main_layout->addLayout(hgt_layout);
296 main_layout->addWidget(
m_axis);
303 QString valr(
"0.0"), valh(
"0.0");
310 QString xmldef =
"<cylinder id=\"" +
m_idvalue +
333 auto *main_layout =
new QVBoxLayout(
this);
337 auto *rad_layout =
new QHBoxLayout;
338 rad_layout->addWidget(
new QLabel(
"Radius: "));
349 main_layout->addLayout(rad_layout);
351 main_layout->addWidget(
m_axis);
362 QString xmldef =
"<infinite-cylinder id=\"" +
m_idvalue +
366 "</infinite-cylinder>\n";
382 auto *main_layout =
new QVBoxLayout(
this);
386 auto *rad_layout =
new QHBoxLayout;
387 rad_layout->addWidget(
new QLabel(
"Inner radius: "));
393 auto *rad2_layout =
new QHBoxLayout;
394 rad2_layout->addWidget(
new QLabel(
"Outer radius: "));
400 auto *dep_layout =
new QHBoxLayout;
401 dep_layout->addWidget(
new QLabel(
" Depth: "));
407 auto *arc_layout =
new QHBoxLayout;
408 arc_layout->addWidget(
new QLabel(
"Arc: "));
410 arc_layout->addWidget(
new QLabel(
" deg "));
412 main_layout->addLayout(rad_layout);
413 main_layout->addLayout(rad2_layout);
414 main_layout->addLayout(dep_layout);
415 main_layout->addLayout(arc_layout);
422 QString valir(
"0.0"), valor(
"0.0"), vald(
"0.0"), vala(
"0.0");
436 QString xmldef =
"<slice-of-cylinder-ring id=\"" +
m_idvalue +
438 "<inner-radius val=\"" +
441 "<outer-radius val=\"" +
450 "</slice-of-cylinder-ring>\n";
467 auto *main_layout =
new QVBoxLayout(
this);
471 auto *hgt_layout =
new QHBoxLayout;
472 hgt_layout->addWidget(
new QLabel(
"Height: "));
478 auto *ang_layout =
new QHBoxLayout;
479 ang_layout->addWidget(
new QLabel(
"Angle: "));
481 ang_layout->addWidget(
new QLabel(
" deg "));
488 m_axis->setTitle(
"Base-to-Tip Axis");
490 main_layout->addLayout(hgt_layout);
491 main_layout->addLayout(ang_layout);
493 main_layout->addWidget(
m_axis);
500 QString valh(
"0.0"), valan(
"0.0");
508 QString xmldef =
"<cone id=\"" +
m_idvalue +
532 auto *main_layout =
new QVBoxLayout(
this);
535 auto *ang_layout =
new QHBoxLayout;
536 ang_layout->addWidget(
new QLabel(
"Angle: "));
538 ang_layout->addWidget(
new QLabel(
" deg "));
545 m_axis->setTitle(
"Base-to-Tip Axis");
547 main_layout->addLayout(ang_layout);
549 main_layout->addWidget(
m_axis);
556 QString valan(
"0.0");
561 QString xmldef =
"<infinite-cone id=\"" +
m_idvalue +
565 "</infinite-cone>\n";
582 auto *main_layout =
new QVBoxLayout(
this);
586 m_plane->setTitle(
"Point in plane");
589 m_normal->setTitle(
"Point normal to plane");
591 main_layout->addWidget(
m_plane);
617 auto *main_layout =
new QVBoxLayout(
this);
661 auto *main_layout =
new QVBoxLayout(
this);
double value
The value of the point.
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.
PointGroupBox * m_left_frt_top
PointGroupBox * m_left_bck_bot
PointGroupBox * m_right_frt_bot
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.
PointGroupBox * m_left_bck_top
PointGroupBox * m_left_frt_top
PointGroupBox * m_right_bck_top
static int g_nhexahedrons
The number of objects that currently exist.
PointGroupBox * m_left_bck_bot
Corner points.
PointGroupBox * m_right_bck_bot
PointGroupBox * m_right_frt_bot
QString writeXML() const override
Write the XML definition of a sphere.
PointGroupBox * m_left_frt_bot
PointGroupBox * m_right_frt_top
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.
QRadioButton * m_cartesian
PointGroupBox(QWidget *parent=nullptr)
QString write3DElement(const QString &elem_name) const
Write the element tag for a 3D point.
QRadioButton * m_spherical
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.