34#include <NDEVR/QTModelManager.h>
35#include <NDEVR/Model.h>
36#include <NDEVR/UUID.h>
40 template<
class t_type>
67 template<>
struct ObjectChecker<Camera> {
68 static bool is(
const UUID&
id, QTModelManager* manager)
70 return manager->hasCamera(
id);
92 , m_manager(object.m_manager)
100 template<
class t_type>
110 template<
class t_type>
113 lib_assert(m_manager->hasObjectID(m_id),
"Tried to access NaN id in QTModel");
118 template<
class t_type>
121 return m_manager->object(m_id).getProperty<t_type>(property);
123 template<
class t_type>
126 return getAs<Model>().getModelProperty<t_type>(property);
128 template<
class t_type>
131 return getAs<Material>().getMaterialProperty<t_type>(property);
133 template<
class t_type>
136 return getAs<Geometry>().getGeometryProperty<t_type>(property);
142 return getAs<Model>().displayName();
144 return getAs<Material>().displayName();
145 return getProperty<TranslatedString>(DesignObject::e_name);
162 lib_assert(m_manager == other.
m_manager,
"Cannot set equal to Design Object from another Manager");
168 return getAs<DesignObject>();
176 emit selectedSignal(
id);
182 emit deletedSignal(
id);
186 emit updatedSignal(uuid());
190 emit descendentUpdatedSignal(uuid());
195 m_manager->deleteObject(uuid());
199 m_manager->object(uuid()).updateDesignModifiedTime();
204 m_manager->setFocus(uuid());
209 m_manager->setSelected({ m_id });
212 void zoomToModel()
const
214 m_manager->setViewportFocus(uuid());
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
Definition DesignObject.h:66
bool isValid() const
Definition DesignObject.h:362
DesignProperty
Definition DesignObject.h:94
bool hasObjectID(const UUID &id, bool allow_deleted=false) const
Definition DesignObjectLookup.cpp:1792
bool hasGeometryID(const UUID &id) const
Definition DesignObjectLookup.cpp:1808
Model modelOrLayer(const UUID &id, bool allow_deleted=false) const
Definition DesignObjectLookup.cpp:1674
bool hasMaterialID(const UUID &id) const
Definition DesignObjectLookup.cpp:1801
bool hasSelectionInfo(const UUID &id) const
Definition DesignObjectLookup.cpp:1847
Definition DesignSelection.h:19
Definition Pointer.hpp:303
GeometryProperty
Definition Geometry.h:99
MaterialProperties
Definition Material.h:108
ModelProperty
Definition Model.h:99
Definition QTDesignObject.h:81
void deleteObject()
Definition QTDesignObject.h:193
t_type getModelProperty(Model::ModelProperty property) const
Definition QTDesignObject.h:124
void setSelected(bool is_selected)
Definition QTDesignObject.h:206
QTDesignObject(const UUID &object, QTModelManager *manager)
Definition QTDesignObject.h:85
void updateDescendent()
Definition QTDesignObject.h:188
UUID id() const
Definition QTDesignObject.h:150
t_type getGeometryProperty(Geometry::GeometryProperty property) const
Definition QTDesignObject.h:134
void updateObject()
Definition QTDesignObject.h:184
UUID m_id
Definition QTDesignObject.h:225
UUID uuid() const
Definition QTDesignObject.h:106
void updatedSignal(UUID id)
QTModelManager * manager() const
Definition QTDesignObject.h:154
DesignObject get() const
Definition QTDesignObject.h:166
void deleteModel(UUID id)
Definition QTDesignObject.h:179
void descendentUpdatedSignal(UUID id)
QTDesignObject(const QTDesignObject &object)
Definition QTDesignObject.h:89
QTDesignObject & operator=(const QTDesignObject &other)
Definition QTDesignObject.h:160
t_type getAs() const
Definition QTDesignObject.h:111
~QTDesignObject()
Definition QTDesignObject.h:95
t_type getMaterialProperty(Material::MaterialProperties property) const
Definition QTDesignObject.h:129
void update()
Definition QTDesignObject.h:197
QTModelManager * m_manager
Definition QTDesignObject.h:226
t_type getProperty(DesignObject::DesignProperty property) const
Definition QTDesignObject.h:119
bool is() const
Definition QTDesignObject.h:101
void deletedSignal(UUID id)
void selectedSignal(UUID id)
void setFocus(bool focus)
Definition QTDesignObject.h:201
void updateSelected(UUID id, bool is_selected)
Definition QTDesignObject.h:171
TranslatedString displayName() const
Definition QTDesignObject.h:139
Definition QTModelManager.h:94
Definition TranslatedString.h:9
constexpr bool isNaN(const t_type &value)
Query if 'value' is valid or invalid.
Definition BaseFunctions.hpp:200
static bool is(const UUID &id, QTModelManager *manager)
Definition QTDesignObject.h:43
static bool is(const UUID &id, QTModelManager *manager)
Definition QTDesignObject.h:75
static bool is(const UUID &id, QTModelManager *manager)
Definition QTDesignObject.h:55
static bool is(const UUID &id, QTModelManager *manager)
Definition QTDesignObject.h:61
static bool is(const UUID &id, QTModelManager *manager)
Definition QTDesignObject.h:49
Definition QTDesignObject.h:41
static bool is(const DynamicPointer< DesignObject > &object)