34#include <NDEVR/QTModelManager.h>
35#include <NDEVR/Model.h>
36#include <NDEVR/UUID.h>
43 template<
class t_type>
70 template<>
struct ObjectChecker<Camera> {
71 static bool is(
const UUID&
id, QTModelManager* manager)
73 return manager->hasCamera(
id);
99 , m_manager(object.m_manager)
107 template<
class t_type>
117 template<
class t_type>
120 lib_assert(m_manager->hasObjectID(m_id),
"Tried to access Invalid id in QTModel");
125 template<
class t_type>
128 return m_manager->object(m_id).getProperty<t_type>(property);
130 template<
class t_type>
133 return getAs<Model>().getModelProperty<t_type>(property);
135 template<
class t_type>
138 return getAs<Material>().getMaterialProperty<t_type>(property);
140 template<
class t_type>
143 return getAs<Geometry>().getGeometryProperty<t_type>(property);
149 return getAs<Model>().displayName();
151 return getAs<Material>().displayName();
152 return getProperty<TranslatedString>(DesignObject::e_name);
169 lib_assert(m_manager == other.
m_manager,
"Cannot set equal to Design Object from another Manager");
175 return getAs<DesignObject>();
183 emit selectedSignal(
id);
189 emit deletedSignal(
id);
193 emit updatedSignal(uuid());
197 emit descendentUpdatedSignal(uuid());
202 m_manager->deleteObject(uuid());
206 m_manager->object(uuid()).updateDesignModifiedTime();
211 m_manager->setFocus(uuid());
216 m_manager->setSelected({ m_id });
219 void zoomToModel()
const
221 m_manager->setViewportFocus(uuid());
#define lib_assert(expression, message)
Definition LibAssert.h:61
A low-level database object that can be used to access general stored properties within the NDEVR Mod...
Definition DesignObject.h:67
bool isValid() const
Definition DesignObject.h:355
DesignProperty
Values stored in the property database.
Definition DesignObject.h:93
bool hasObjectID(const UUID &id, bool allow_deleted=false) const
bool hasGeometryID(const UUID &id) const
Model modelOrLayer(const UUID &id, bool allow_deleted=false) const
bool hasMaterialID(const UUID &id) const
bool hasSelectionInfo(const UUID &id) const
A simple structure for storing a collection of data.
Definition DesignSelection.h:26
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
A core class within the model heirarchy containing vertex-based data (Usually 3D data) within a set c...
Definition Geometry.h:64
GeometryProperty
Definition Geometry.h:99
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:51
MaterialProperties
Definition Material.h:114
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
ModelProperty
Definition Model.h:103
A pointer to a DesignObject within a QTModelManager that recieves and emits update signals based on t...
Definition QTDesignObject.h:88
void deleteObject()
Definition QTDesignObject.h:200
t_type getModelProperty(Model::ModelProperty property) const
Definition QTDesignObject.h:131
void setSelected(bool is_selected)
Definition QTDesignObject.h:213
void runCommand(const DynamicPointer< DesignCommand > &command)
QTDesignObject(const UUID &object, QTModelManager *manager)
Definition QTDesignObject.h:92
void showProperties(const PopupInfo &location=PopupInfo())
void updateDescendent()
Definition QTDesignObject.h:195
UUID id() const
Definition QTDesignObject.h:157
void postCommand(const DynamicPointer< DesignCommand > &command)
t_type getGeometryProperty(Geometry::GeometryProperty property) const
Definition QTDesignObject.h:141
void updateObject()
Definition QTDesignObject.h:191
UUID m_id
Definition QTDesignObject.h:232
UUID uuid() const
Definition QTDesignObject.h:113
void updatedSignal(UUID id)
QTModelManager * manager() const
Definition QTDesignObject.h:161
DesignObject get() const
Definition QTDesignObject.h:173
void deleteModel(UUID id)
Definition QTDesignObject.h:186
void descendentUpdatedSignal(UUID id)
QTDesignObject(const QTDesignObject &object)
Definition QTDesignObject.h:96
QTDesignObject & operator=(const QTDesignObject &other)
Definition QTDesignObject.h:167
DesignSelection getAsSelection() const
t_type getAs() const
Definition QTDesignObject.h:118
~QTDesignObject()
Definition QTDesignObject.h:102
t_type getMaterialProperty(Material::MaterialProperties property) const
Definition QTDesignObject.h:136
void update()
Definition QTDesignObject.h:204
QTModelManager * m_manager
Definition QTDesignObject.h:233
t_type getProperty(DesignObject::DesignProperty property) const
Definition QTDesignObject.h:126
bool is() const
Definition QTDesignObject.h:108
void deletedSignal(UUID id)
void selectedSignal(UUID id)
void setFocus(bool focus)
Definition QTDesignObject.h:208
void updateSelected(UUID id, bool is_selected)
Definition QTDesignObject.h:178
TranslatedString displayName() const
Definition QTDesignObject.h:146
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170
static bool is(const UUID &id, QTModelManager *manager)
Definition QTDesignObject.h:46
static bool is(const UUID &id, QTModelManager *manager)
Definition QTDesignObject.h:78
static bool is(const UUID &id, QTModelManager *manager)
Definition QTDesignObject.h:58
static bool is(const UUID &id, QTModelManager *manager)
Definition QTDesignObject.h:64
static bool is(const UUID &id, QTModelManager *manager)
Definition QTDesignObject.h:52
Used with QTDesignObject to check the type of an object.
Definition QTDesignObject.h:44
static bool is(const DynamicPointer< DesignObject > &object)