33#include <NDEVR/DesignObjectChooser.h>
34#include <NDEVR/ContainerWidget.h>
35#include <NDEVR/QCustomDockWidget.h>
36#include <NDEVR/PointWidget.h>
37#include <NDEVR/ResizeVisibleAnimation.h>
38#include <NDEVR/ModelEditController.h>
51 QVBoxLayout* layout =
new QVBoxLayout();
55 setWindowTitle(
_tqs(
"Library"));
83 if (
isNaN(current_size))
86 for (
uint04 i = 0; i < 3; i++)
88 if (current_size[i] != 0.0)
89 scale[i] = n_size[i] / current_size[i];
92 m_editor->setOriginalTransform(current_transform);
105 m_model_chooser->widget().updateFromArchive(true, false, false);
109 m_model_chooser->widget().updateFromArchive(true, false, false);
120 m_selected_id = id.last();
122 m_selected_id = Constant<UUID>::NaN;
123 m_editor->addNextFinishedCallback(nullptr);
125 m_editor->edit_mode.set(ModelEditController::ModelEditMode::e_no_edit);
126 if (m_manager->libraryManager()->hasID(m_selected_id))
128 Model lib_object = m_manager->libraryManager()->loadObject(m_selected_id, true);
130 model.copyFrom(lib_object, true);
131 m_size_widget->setPoint((model.getTransform() * model.getSelectionBounds()).span());
132 ResizeVisibleAnimation::run(m_size_widget, true, true);
133 if(rubber_stamp_button->isChecked())
134 m_editor->edit_mode.set(ModelEditController::e_rubber_stamp);
136 m_editor->edit_mode.set(ModelEditController::e_place);
137 m_manager->addModel(model);
138 m_editor->setActiveModel(model.uuid());
139 m_editor->addNextFinishedCallback([this](bool, UUID)
141 QTTools::postToThread([this]
143 m_model_chooser->widget().setSelected({});
144 ResizeVisibleAnimation::run(m_size_widget, false, true);
150 ResizeVisibleAnimation::run(m_size_widget, false, true);
163 m_model_chooser->widget().setCategory(category);
#define _t(english_string)
Definition Translator.h:87
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition DesignObjectChooser.h:42
void onSelectedSignal(Buffer< UUID > id)
@ e_single_selection
Definition DesignObjectGallery.h:48
bool isValid() const
Definition DesignObject.h:362
Model model(const UUID &id, bool allow_deleted=false) const
Definition DesignObjectLookup.cpp:1683
Definition Pointer.hpp:303
constexpr t_type * rawptr() const
Definition Pointer.hpp:325
void modelRemoved(UUID id)
Definition Matrix.hpp:173
static constexpr Matrix< t_type > ScalerMatrix(t_type scale)
Definition Matrix.hpp:304
void updateModifiedTime(Time time=Time::SystemTime())
Definition Model.cpp:2289
Bounds< 3, fltp08 > getSelectionBounds() const
Definition Model.cpp:172
Definition QTModelManager.h:94
virtual DynamicPointer< LibraryManager > libraryManager()
Definition QTModelManager.cpp:924
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
@ e_drop_center
Definition RibbonArea.h:50
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
constexpr bool isNaN(const t_type &value)
Query if 'value' is valid or invalid.
Definition BaseFunctions.hpp:200
@ Y
Definition BaseValues.hpp:202
@ X
Definition BaseValues.hpp:200
@ Z
Definition BaseValues.hpp:204