34#include <NDEVR/DesignObjectBase.h>
35#include <NDEVR/RWLock.h>
36#include <NDEVR/TranslatedString.h>
77 , e_geometry = 0x00000002
78 , e_material = 0x00000004
80 , e_effect = 0x00000010
81 , e_layer = 0x00000020
82 , e_scene = 0x00000040
83 , e_camera = 0x00000080
84 , e_selection = 0x00000100
102 , e_editable_description
105 , e_asc_modified_time
106 , e_desc_modified_time
107 , e_bounds_modified_time
109 , e_creation_software
115 , e_allow_interactions
121 , e_is_application_locked
122 , e_is_application_owned
124 , e_selection_ignored
126 , e_untranslated_string_data
127 , e_translated_string_data
128 , e_uncompressed_data
135 , e_design_property_size
179 bool isDesignType(
uint04 mode)
const;
180 bool validateDesignObject()
const;
182 void setActiveFilters(
const JSONNode& node);
183 template<
class t_type>
186 propertyTable().get()[m_base->property_index[cast<uint04>(property)]].set(index(), value);
190 m_uuid = getProperty<UUID>(property);
203 debug_name = getProperty<String>(property);
213 propertyTable().get()[m_base->property_index[cast<uint04>(property)]].set(index(), value);
234 propertyTable().get()[m_base->property_index[cast<uint04>(property)]].set(index(), value);
250 template<
class t_type>
253 if (getProperty<t_type>(property) != value)
256 setProperty(property, value);
257 updateDesignModifiedTime();
262 template<
class t_type>
265 return propertyTable().get()[m_base->property_index[cast<uint04>(property)]].get<t_type>(index());
268 template<
class t_type>
271 return !
isNaN(getProperty<t_type>(property));
275 return propertyTable().get()[m_base->property_index[cast<uint04>(property)]].isSame(index(), value);
279 return propertyTable().get()[m_base->property_index[cast<uint04>(property)]].isSame(index(), value);
283 return propertyTable().get()[m_base->property_index[cast<uint04>(property)]].beginsWith(index(), value, ignore_case);
287 return propertyTable().get()[m_base->property_index[cast<uint04>(property)]].beginsWith(index(), value, ignore_case);
291 return propertyTable().get()[m_base->property_index[cast<uint04>(property)]].contains(index(), value, ignore_case);
295 return propertyTable().get()[m_base->property_index[cast<uint04>(property)]].contains(index(), value, ignore_case);
297 template<
class t_type>
300 if (hasProperty<t_type>(property))
301 return getProperty<t_type>(property);
302 uint04 parent_index = getDesignParentIndex();
303 while (!
isNaN(parent_index))
311 return getProperty<t_type>(property);
315 [[nodiscard]]
String getIcon()
const;
317 [[nodiscard]]
uint04 getDesignParentIndex()
const;
319 [[nodiscard]]
Time getModifiedTime()
const;
321 void updateDesignModifiedTime(
Time time = Time::SystemTime());
322 void updateCreatedTime();
329 bool hasMetaData(
const String& index)
const;
330 [[nodiscard]]
const JSONNode& metaData(
const String& index)
const;
331 [[nodiscard]]
const JSONNode& metaData()
const;
332 void setMetaData(
const JSONNode& node);
334 void setMetaData(
const String& index,
const String& data);
335 void setMetaData(
const String& index,
const bool& data);
336 void setMetaData(
const String& index,
const fltp08& data);
337 void setMetaData(
const String& index,
const uint04& data);
338 void clearMetaData(
const String& index);
339 void updateMetaData(
const String& index,
const String& data,
const void* lock_ptr =
nullptr);
340 void updateMetaData(
const String& index,
const fltp08& data,
const void* lock_ptr =
nullptr);
341 void updateMetaData(
const String& index,
const bool& data,
const void* lock_ptr =
nullptr);
342 void removeMetaData(
const String& index,
const void* lock_ptr =
nullptr);
343 void appendData(
const String& data,
bool compressed);
352 operator bool()
const
357 [[nodiscard]]
UUID uuid()
const;
358 void updateDesignTransform(
const Matrix<fltp08>& transform,
const void* lock =
nullptr);
359 void setDesignVisible(
bool is_visible);
360 void updateDesignVisible(
bool is_visible,
const void* lock =
nullptr);
363 [[nodiscard]]
Scene getScene()
const;
367 void onNameChange(
const String& new_name);
387 static const bool Unsigned =
false;
388 static const bool Float =
false;
389 static const bool Integer =
false;
390 static const bool Number =
false;
391 static const bool Enum =
false;
394 static const bool Boolean =
false;
402 struct hash<NDEVR::DesignObject>
407 std::size_t value = 0;
410 value = value * 256 + (s[i + 0U] ^ s[i + 8U]);
#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
bool operator!=(const VkVertexInputAttributeDescription &a, const VkVertexInputAttributeDescription &b)
Definition VulkanRenderObject.cpp:10
bool operator==(const VkVertexInputAttributeDescription &a, const VkVertexInputAttributeDescription &b)
Definition VulkanRenderObject.cpp:18
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition DesignObjectBase.h:140
Definition DesignObject.h:66
bool doesPropertyContain(DesignProperty property, const String &value, bool ignore_case) const
Definition DesignObject.h:289
bool isProperty(DesignProperty property, const char *value) const
Definition DesignObject.h:277
static constexpr const char * FilePathDesignNameVariable()
Definition DesignObject.h:364
bool doesPropertyBeginWith(DesignProperty property, const String &value, bool ignore_case) const
Definition DesignObject.h:281
bool isValid() const
Definition DesignObject.h:362
uint04 designIndex() const
Definition DesignObject.h:345
t_type getInheritedProperty(DesignProperty property) const
Definition DesignObject.h:298
uint04 index() const
Definition DesignObject.h:344
void updateProperty(DesignProperty property, const t_type &value, const void *lock=nullptr)
Definition DesignObject.h:251
void setProperty(DesignProperty property, const UUID &value)
Definition DesignObject.h:211
t_type getProperty(DesignProperty property) const
Definition DesignObject.h:263
bool doesPropertyContain(DesignProperty property, const char *value, bool ignore_case) const
Definition DesignObject.h:293
bool hasProperty(DesignProperty property) const
Definition DesignObject.h:269
DesignObjectType
Definition DesignObject.h:75
void setProperty(DesignProperty property, const t_type &value)
Definition DesignObject.h:184
uint04 getDesignParentIndex() const
Definition DesignObject.cpp:220
DesignProperty
Definition DesignObject.h:94
void setProperty(DesignProperty property, const String &value)
Definition DesignObject.h:224
DesignObjectBase & base() const
Definition DesignObject.h:356
bool doesPropertyBeginWith(DesignProperty property, const char *value, bool ignore_case) const
Definition DesignObject.h:285
bool isProperty(DesignProperty property, const String &value) const
Definition DesignObject.h:273
Definition Pointer.hpp:303
JavaScript Object Notation or JSON is an open - standard file format that uses human - readable text ...
Definition JSONParser.h:121
Definition Matrix.hpp:173
Matrix< t_type, t_cols, t_rows > invert() const
Definition Matrix.hpp:649
Definition Pointer.hpp:62
Definition StringStream.h:62
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
A vertex.
Definition Vertex.hpp:54
constexpr bool DESIGN_PRIM
Definition DesignObject.h:47
constexpr bool operator<(const Vector< vec_1_size, t_type > &v1, const Vector< vec_2_size, t_type > &v2)
Definition VectorFunctions.hpp:770
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
@ e_file
Definition ModuleResourceManager.h:36
constexpr bool operator>(const Vector< vec_1_size, t_type > &v1, const Vector< vec_2_size, t_type > &v2)
Definition VectorFunctions.hpp:758
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
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
Definition BaseValues.hpp:272
static constexpr ObjectInfo< DesignObject, false, false > VectorSub()
Definition DesignObject.h:395
Information about the object.
Definition ObjectInfo.h:56
std::size_t operator()(const NDEVR::DesignObject &d) const noexcept
Definition DesignObject.h:404