33#include <NDEVR/Editor.h>
34#include <NDEVR/QTModelManager.h>
35#include <NDEVR/PointWidget.h>
36#include <NDEVR/QTTools.h>
37#include <NDEVR/Toggle.h>
38#include <NDEVR/Model.h>
50 setWindowTitle(
_tqs(
"Size"));
52 m_size_widget->setUnitToApplicationDistanceUnit();
53 m_size_widget->setLabel(
X,
_t(
"Width"));
54 m_size_widget->setLabel(
Y,
_t(
"Length"));
55 m_size_widget->setLabel(
Z,
_t(
"Height"));
56 connect(m_size_widget, &PointWidget::editingFinished,
this, &SizeOperationsWidget::setSizeFromDialogSlot);
58 QVBoxLayout* layout =
new QVBoxLayout();
60 m_lock_aspect_ratio_toggle =
new Toggle();
61 m_lock_aspect_ratio_toggle->setup(
_t(
"Lock Aspect Ratio"),
"", [](
Button*)
65 m_lock_aspect_ratio_toggle->setChecked(
true);
66 layout->addWidget(m_size_widget);
67 layout->addWidget(m_lock_aspect_ratio_toggle);
77 m_size_widget->setDimensionCount(2);
79 m_size_widget->setDimensionCount(3);
80 m_size_widget->setPoint(
abs(size));
86 WLock lock = m_design_object->manager()->writeLock();
89 if (m_lock_aspect_ratio_toggle->isChecked())
92 for (
uint01 i = 0; i < 3; i++)
94 if (
abs(size[i] - original_size[i]) > 0.001)
96 if(original_size[i] != 0.0)
97 size = (size[i] / original_size[i]) * original_size;
102 m_design_object->getAs<
Model>().setSize(
abs(size));
103 m_design_object->update();
#define _t(english_string)
Definition Translator.h:87
Definition Pointer.hpp:303
Matrix< t_type, t_cols, t_rows > invert() const
Definition Matrix.hpp:649
Vector< 3, fltp08 > size() const
Definition Model.cpp:223
Matrix< fltp08 > getParentTransform() const
Definition Model.cpp:128
Definition Vertex.hpp:341
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
constexpr Angle< t_angle_type > abs(const Angle< t_angle_type > &value)
Definition AngleFunctions.h:750
@ Y
Definition BaseValues.hpp:202
@ X
Definition BaseValues.hpp:200
@ Z
Definition BaseValues.hpp:204