33#include <NDEVR/DesignObject.h>
44#if NDEVR_SUPPORTS_BONES
50 template<
class t_type>
71 , e_ignore_rotation = 2
72 , e_ignore_scale_distortion = 3
73 , e_use_only_for_offset = 4
74 , e_orient_to_camera = 5
76 , e_scale_to_camera = 7
81 e_inherited_is_visible = 0
82 , e_inherited_has_no_focus = 1
83 , e_inherited_is_tree_visible = 2
84 , e_inherited_not_selected = 3
85 , e_inherited_is_manager_visible = 4
86 , e_inherited_can_delete = 5
87 , e_inherited_does_not_follow_camera = 6
88 , e_inherited_does_not_orient_to_camera = 7
89 , e_inherited_does_not_scale_to_camera = 8
90 , e_inherited_not_deleted = 9
91 , e_inherited_not_application_owned = 10
92 , e_inherited_exportable = 11
97 e_descendent_selected = 0
98 , e_descendent_focussed = 1
99 , e_descendent_deletion_blocked = 2
105 , e_fixed_bounding_box
107 , e_calculation_ignored
108 , e_can_select_children
109 , e_complete_transform
110 , e_material_mode_solid
111 , e_material_mode_outline
112 , e_material_mode_vertices
113 , e_parent_matrix_flags
115 , e_global_selection_bounds
118 , e_personal_inherited_flags
121 , e_personal_descended_flags
122 , e_application_constructed
123 , e_application_constructed_parent_base
124 , e_model_property_size
140 template<
class t_type>
143 m_base->model_table.get()[m_base->model_property_index[cast<uint04>(property)]].set(m_design_index, value);
145 template<
class t_type>
148 if (getModelProperty<t_type>(property) != type)
150 WLock wLock(lock_ptr);
151 setModelProperty(property, type);
152 updateModifiedTime();
155 template<
class t_type>
158 return m_base->model_table.get()[m_base->model_property_index[cast<uint04>(property)]].get<t_type>(m_design_index);
162 return m_base->model_table.get()[m_base->model_property_index[cast<uint04>(property)]].isSame(m_design_index, value);
166 return m_base->model_table.get()[m_base->model_property_index[cast<uint04>(property)]].isSame(m_design_index, value);
170 return propertyTable().get()[m_base->model_property_index[cast<uint04>(property)]].contains(m_design_index, value, ignore_case);
174 return propertyTable().get()[m_base->model_property_index[cast<uint04>(property)]].contains(m_design_index, value, ignore_case);
178 void deleteModel(
bool delete_children,
bool remove_from_parent =
true);
182 [[nodiscard]]
bool isOfType(
const char* type)
const;
204 , e_by_selectable_children
245#if NDEVR_SUPPORTS_BONES
246 Bone createSceneBone()
const;
247 bool hasBone(
uint04 index = 0)
const;
248 uint04 getNumOfBones()
const;
249 Bone getBone(
uint04 index = 0)
const;
250 Bone getSceneBone(
UUID id)
const;
254 void setBoneGroupIndex(
uint04 bone_group_index,
uint04 sub_index = 0);
287 template<
class t_type>
294 values.
add(t_type(models[i]));
301 template<
class t_type>
308 values.
add(t_type(models[i]));
410 void validate(
bool validate_children =
true)
const;
438 operator bool()
const
457 void setChildEffectSize(
uint04 child_size);
458 void setChildSize(
uint04 child_size);
459 void setGeometryIndex(
uint04 geo_index);
461 void setMaterialIndex(
uint04 material_index);
462 void setEffectIndex(
uint04 material_index,
uint04 sub_index = 0);
471 static const uint01 Dimensions = 0;
472 static const bool Vector =
false;
473 static const bool Buffer =
false;
475 static const bool Pointer =
false;
476 static const bool Unsigned =
false;
477 static const bool Float =
false;
478 static const bool Integer =
false;
479 static const bool Number =
false;
480 static const bool Enum =
false;
481 static const bool String =
false;
482 static const bool Color =
false;
483 static const bool Boolean =
false;
522 static const uint01 Dimensions = 0;
523 static const bool Vector =
false;
524 static const bool Buffer =
false;
526 static const bool Pointer =
false;
527 static const bool Unsigned =
false;
528 static const bool Float =
false;
529 static const bool Integer =
false;
530 static const bool Number =
false;
531 static const bool Enum =
false;
532 static const bool String =
false;
533 static const bool Color =
false;
534 static const bool Boolean =
false;
549 struct hash<NDEVR::Model>
551 std::size_t operator()(
const NDEVR::Model& d)
const noexcept
554 std::size_t value = 0;
556 value = value * 256 + (s[i + 0U] ^ s[i + 8U]);
561 struct hash<NDEVR::Scene>
563 std::size_t operator()(
const NDEVR::Scene& d)
const noexcept
566 std::size_t value = 0;
568 value = value * 256 + (s[i + 0U] ^ s[i + 8U]);
The primary angle storage class for this API. Stores an angle in an optimized format.
Definition StringStream.h:540
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:55
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
void add(t_type &&object)
Adds object to the end of the buffer.
Definition Buffer.hpp:186
constexpr t_index_type size() const
Definition Buffer.hpp:823
The core Color class in the NDEVR API. Colors can be defined in several ways. The ACIColor is compact...
Definition Color.h:41
Provides the underlying data storage for the NDEVR Scene Model heirarchy.
Definition DesignObjectBase.h:150
A low-level database object that can be used to access general stored properties within the NDEVR Mod...
Definition DesignObject.h:67
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
A core class that provides a dynamic effect to an object in a model heirarchy.
Definition Effect.h:45
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
A core class within the model heirarchy containing vertex-based data (Usually 3D data) within a set c...
Definition Geometry.h:64
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:51
Definition Matrix.hpp:176
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
BitFlag descendedFlagsNoCache(bool complete_cache_ignore) const
Buffer< Effect, uint04, ObjectAllocator< false > > getEffectChildren() const
void setGeometryChild(const Geometry &geo)
void invalidateVisibleBounds()
Time getDescModifiedTime(bool include_self) const
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getSceneModelsByType(const String &type, uint04 max_count=Constant< uint04 >::Max, bool include_deleted=false) const
fltp08 calculateLength(const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid) const
Vertex< 3, fltp08 > globalCenterOfRotation() const
Model getSceneModel(UUID id) const
Buffer< uint04 > getChildIndices() const
void calculateSmoothTextures(Vector< 3, fltp08 > origin, fltp08 scale)
Matrix< fltp08 > getCompleteTransform() const
Model getSceneLayer(UUID id) const
Dictionary< UUID, DesignObject > copyFrom(const Model &model, bool deep_copy, bool copy_ids=false, bool recursive=true)
Buffer< Material, uint04, ObjectAllocator< DESIGN_PRIM > > getMaterialChildren() const
void invalidateTransformCache()
bool doesModelPropertyContain(ModelProperty property, const char *value, bool ignore_case) const
Definition Model.h:172
Vector< 3, fltp08 > size() const
void colorByChannel(Material &mat, const String &channel, fltp08 avg=Constant< fltp08 >::Invalid) const
bool hasEffect(uint04 index=0) const
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getDescendentsByType(const String &type, uint04 max_count=Constant< uint04 >::Max) const
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getDescendentsByName(const String &name, uint04 max_count=Constant< uint04 >::Max) const
void calculateNormals(NormalMode mode, Angle< fltp08 > smoothing_angle)
void setTransform(const Matrix< fltp08 > &transform)
Buffer< t_type > getTypeDescendents(const String &type) const
Definition Model.h:302
Geometry getGeometry() const
Vertex< 3, fltp08 > centerAlignModel()
Matrix< fltp08 > getParentTransform() const
ModelColorMode
Definition Model.h:202
void setMaterialMode(MaterialMode vertex, MaterialMode outline, MaterialMode solid)
void updateModifiedTime(Time time=Time::SystemTime())
void createChildren(uint04 child_size)
Model(uint04 index, DesignObjectBase *base)
void clearMaterialDescendents()
void deleteModel(bool delete_children, bool remove_from_parent=true)
Vector< 3, fltp08 > calculateAverageDirection(const Matrix< fltp08 > &parent_transform=Constant< Matrix< fltp08 > >::Invalid) const
Buffer< Material, uint04, ObjectAllocator< DESIGN_PRIM > > getMaterialDescendents(bool local_only=false) const
Material getMaterial(PrimitiveProperty property) const
void updateModelProperty(ModelProperty property, const t_type &type, const void *lock_ptr=nullptr)
Definition Model.h:146
Buffer< Effect, uint04, ObjectAllocator< false > > getEffectDescendents() const
Bounds< 3, fltp08 > globalBounds() const
Vector< 32, bool > personalInheritedFlags() const
Model()
Definition Model.h:128
bool doesModelPropertyContain(ModelProperty property, const String &value, bool ignore_case) const
Definition Model.h:168
void setParentMatrixFlag(ParentMatrixFlags flag, bool value)
void updateFrom(const Model &model, bool check_resources)
Buffer< Material, uint04, ObjectAllocator< DESIGN_PRIM > > getMaterialDescendentsByName(const String &name, uint04 max_count=Constant< uint04 >::Max) const
void updateDescendedFlagsCache(bool force_update_all=false)
Material createSceneMaterial() const
void calculateTangentSpace(bool calc_tan, bool calc_bitan)
void hasDescendents(bool &has_point, bool &has_line, bool &has_mesh) const
Material getSceneMaterial(UUID id) const
DesignObjectBase * childBase() const
uint04 getDirectLayerIndex() const
TranslatedString displayNamePath(const String &seperator=":") const
void overrideMaterialDescendents(PrimitiveProperty property, MaterialMode override_desc)
void invalidateGlobalBoundsDesc()
bool hasMeshDescendent() const
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > explodeModel()
uint04 getEffectIndex(uint04 child_index=0) const
MaterialMode
Definition Model.h:61
Effect createSceneEffect() const
Geometry createSceneGeometry() const
void invalidateGlobalBoundsAsc()
bool isModelProperty(ModelProperty property, const String &value) const
Definition Model.h:160
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getChildrenByName(const String &name) const
bool hasGeometryDescendent() const
Buffer< GeometryType > descendentGeometryTypes() const
Model getChild(uint04 child) const
bool hasChild(uint04 child_index) const
Model(const DesignObject &obj)
uint04 vertexCount() const
uint04 getChildIndex() const
Vector< 32, bool > inheritedPersonalFlagsNoCache() const
void removeDuplicateVertices(fltp08 epsilon, void *lock, ProgressInfo *log=nullptr)
Buffer< Material, uint04, ObjectAllocator< DESIGN_PRIM > > getMaterialDescendents(PrimitiveProperty property) const
Model(DesignObjectBase *base)
uint04 getGeometryIndex() const
void removeMaterial(PrimitiveProperty property)
void setMaterial(const Material &material)
uint04 getNumOfEffects() const
uint04 getMaterialIndex(PrimitiveProperty property) const
uint04 parentToChildReference() const
bool hasDirectLayer() const
void setNormalMode(NormalMode mode, Angle< fltp08 > smoothing_angle, ProgressInfo *log)
String getModelIcon() const
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getSceneModelsByName(const String &name, uint04 max_count=Constant< uint04 >::Max, bool include_deleted=false) const
uint04 visibleVertexCount() const
Buffer< std::pair< Model, Geometry >, uint04, ObjectAllocator< DESIGN_PRIM > > getClippingGeometry() const
BitFlag parentMatrixFlags() const
Time getAscModifiedTime(bool include_self, bool include_layer=true) const
void addChild(Model &child)
BitFlag personalDescendedFlags() const
uint04 childToParentReference() const
void setChildIndex(uint04 child, uint04 id)
void updateInheritedFlagsCache(bool force_update_all=false, bool update_personal_flags=false)
DescendedFlags
Definition Model.h:96
bool isModelProperty(ModelProperty property, const char *value) const
Definition Model.h:164
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getSceneModels(bool include_deleted=false, bool local_only=false) const
fltp08 calculateSurfaceArea(const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid) const
Vector< 32, bool > inheritedFlags() const
bool isOfType(const char *type) const
bool hasPointsDescendent() const
Bounds< 3, fltp08 > getBounds() const
Effect createChildEffect()
Vector< 2, fltp08 > calculateHVLength(const Matrix< fltp08 > &parent_transform=Constant< Matrix< fltp08 > >::Invalid) const
void removeChild(const Model &model)
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getDescendents(bool include_deleted=false, bool local_only=false) const
Effect getSceneEffect(UUID id) const
Effect getEffect(uint04 index=0) const
Model findDescendentByName(const String &name) const
void setWindingMode(WindingMode mode)
Model createChild(uint04 child_slot)
Material createChildMaterial(bool copy_child=false)
Vector< 2, fltp08 > calculateVolumeAndSurfaceArea(const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid, const void *lock=nullptr) const
void addChild(uint04 child_index)
bool hasMaterial(PrimitiveProperty property) const
void validate(bool validate_children=true) const
void addPerVertexColorFromMaterialConstant(UVType constant_index)
uint04 getParentIndex() const
Bounds< 3, fltp08 > getSelectionBounds() const
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getDescendentsByNameAndType(const String &name, const String &type, uint04 max_count=Constant< uint04 >::Max) const
InheritedFlags
Definition Model.h:80
void setGeometryChild(uint04 geo_index)
Model findDescendentByType(const String &type) const
void calculateIndexNeighborList()
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getChildrenByType(const String &type) const
fltp08 calculateVolume(const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid) const
BitFlag descendedFlags() const
Bounds< 3, fltp08 > globalSelectionBounds() const
Buffer< Geometry, uint04, ObjectAllocator< DESIGN_PRIM > > getSceneGeometries() const
void setParentMatrixFlags(BitFlag flags)
RGBColor customModelColor(ModelColorMode mode) const
bool isTreeVisible() const
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getChildren() const
void setMaterial(PrimitiveProperty property, const Material &material)
Geometry getSceneGeometry(uint04 index) const
void setMaterial(uint04 material_index)
Buffer< t_type > getTypeChildren(const String &type) const
Definition Model.h:288
BitFlag descendedPersonalFlagsNoCache() const
bool isApplicationOwned() const
bool hasLayerRootMaterial(PrimitiveProperty property) const
bool hasHoles(PrimitiveProperty property) const
void setIsLayer(bool is_layer)
void overrideMaterialDescendents(MaterialMode vertex, MaterialMode outline, MaterialMode solid)
bool exportIgnored() const
void setOrientation(const Vector< 3, Angle< fltp08 > > &new_orientation, const void *lock=nullptr)
Buffer< Geometry, uint04, ObjectAllocator< DESIGN_PRIM > > getGeometryDescendents(bool remove_redundant=true, uint04 max_count=Constant< uint04 >::Max) const
bool hasDescendent(const UUID &id) const
void setModelProperty(ModelProperty property, const t_type &value)
Definition Model.h:141
Model getFamilyMember(uint04 index) const
DesignObjectBase * parentBase() const
Geometry createChildGeometry()
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getSceneLayers(bool include_deleted=false) const
bool hasSelectedDescendent() const
uint04 childCount() const
void setOrientation(const Vector< 3, Angle< sint04 > > &new_orientation, const void *lock=nullptr)
void updateTransform(const Matrix< fltp08 > &transform, const void *lock=nullptr)
Material getRootMaterial(PrimitiveProperty property) const
Buffer< Material, uint04, ObjectAllocator< DESIGN_PRIM > > getSceneMaterials() const
static Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > ReduceToRoots(const Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > &children, const std::function< bool(const Model &, const Set< Model > &)> &filter)
Matrix< fltp08 > applyTransformToParent(const Matrix< fltp08 > &parent_mat) const
Model createSceneModel() const
t_type getModelProperty(ModelProperty property) const
Definition Model.h:156
bool isOfType(const String &type) const
void swapChildren(uint04 a, uint04 b)
void setSize(const Vector< 3, fltp08 > &size)
void updateVisibleRecursive(bool is_visible)
void setMaterialMode(PrimitiveProperty property, MaterialMode option)
Geometry getSceneGeometry(UUID id) const
void updateDescTime(const Time &time, bool include_self)
Model getRootMaterialModel(PrimitiveProperty property)
void setMaterial(PrimitiveProperty property, uint04 material_index)
Bounds< 3, fltp08 > getBoundsOfVisible() const
Buffer< Effect, uint04, ObjectAllocator< false > > getSceneEffects() const
void updateAscTime(const Time &time, bool include_self)
Buffer< UUID > getChildrenIDs() const
ParentMatrixFlags
Definition Model.h:68
bool hasLinearDescendent() const
uint04 getChildLayerIndex() const
Material getSceneMaterial(uint04 index) const
ModelProperty
Definition Model.h:103
MaterialMode getMaterialMode(PrimitiveProperty property) const
void updateVisible(bool is_visible)
uint04 getChildIndex(uint04 child) const
bool hasDescendent(const Model &model) const
Dictionary< UUID, DesignObject > copyMaterialProperties(const Model &model)
void setLayer(Model layer)
void removeMaterial(const Material &material)
TranslatedString displayName() const
Buffer< Model, uint04, ObjectAllocator< DESIGN_PRIM > > getChildrenByType(const Buffer< String > &type) const
Vector< 32, bool > inheritedFlagsNoCache(bool complete_cache_ignore) const
Model createSceneLayer() const
Material createChildMaterial(PrimitiveProperty property, bool copy_child=false)
Definition MemoryManager.h:261
Provides shared ownership of a dynamically allocated object.
Definition Pointer.hpp:71
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:54
The root Model that is responsible for storing the underlying data for all Scene Models.
Definition Model.h:492
bool hasVertexColumn(const String &name) const
Scene(const TranslatedString &name, Scene &application_scene, DesignObjectBase *base=nullptr)
Scene(const Model &model)
bool hasVertexIndexColumn() const
void createDefaultMaterial()
const TableColumn & vertexColumn(const String &name) const
TableColumn & vertexColumn(const String &name)
Scene(const String &file, DesignObjectBase *base=nullptr)=delete
static const Scene CreateApplicationScene(const TranslatedString &string)
Scene(const File &file, DesignObjectBase *base=nullptr)
Scene(const TranslatedString &name, DesignObjectBase *base=nullptr)
const TableColumn & vertexColumn(VertexProperty property) const
bool isApplicationOwned() const
bool hasVertexColumn(VertexProperty property) const
Buffer< UUID > allObjectIDs(bool include_deleted) const
Scene(DesignObjectBase *base)
Scene applicationScene() const
const TableColumn & vertexIndexColumn() const
Container that stores unique elements in no particular order, and which allow for fast retrieval or i...
Definition Model.h:51
The core String class for the NDEVR API.
Definition String.h:69
A virtual storage type that is used with Table class to store data where the actual mechanism for sto...
Definition TableColumn.h:76
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
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
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
Used to lock a particular variable for writing. Only one write lock can be created when no read locks...
Definition RWLock.h:115
NormalMode
Definition DesignObjectBase.h:105
VertexProperty
Definition DesignObjectBase.h:52
@ e_by_layer
Definition CADEntities.h:48
constexpr bool DESIGN_PRIM
Definition DesignObject.h:47
PrimitiveProperty
Definition DesignObjectBase.h:44
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
@ e_type
Definition ModuleResourceManager.h:56
WindingMode
Definition DesignObjectBase.h:97
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
UVType
Channels that describe how an object should interact with light.
Definition DesignObjectBase.h:133
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
Information about the object.
Definition ObjectInfo.h:54