API Documentation
Loading...
Searching...
No Matches
DesignObjectBase.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Design
28File: DesignObjectBase
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Table.h>
35#include <NDEVR/Pointer.h>
36#include <NDEVR/RandomColorGenerator.h>
37namespace NDEVR
38{
39 class JSONNode;
40 template<uint01 t_dims, class t_type>
41 class RTree;
42
44 {
45 Outline // lines
46 , Solid
47 , Vertices //vertex highlighting/drawing
49 };
50 NDEVR_DESIGN_T_API template class NDEVR_DESIGN_API StringStream<PrimitiveProperty>;
52 {
53 Position = 0
54 , Normal = 1
55 , Tangent = 2
56 , BiTangent = 3
57 , Color = 4
58 , Texture = 5
59 , BitFlag = 6
60 , Bones = 7
62 , Region = 9
64 , Invalid = 255
65 };
66 NDEVR_DESIGN_T_API template class NDEVR_DESIGN_API StringStream<VertexProperty>;
76
78 {
79 e_is_selected = 0x01
80 , e_is_hidden = 0x02
81 , e_is_locked = 0x04
82 , e_is_deleted = 0x08
84 };
103 NDEVR_DESIGN_T_API template class NDEVR_DESIGN_API StringStream<WindingMode>;
111 NDEVR_DESIGN_T_API template class NDEVR_DESIGN_API StringStream<NormalMode>;
112 /**--------------------------------------------------------------------------------------------------
113 \brief Used with Geometry to describe how vertices and indices are used to form shapes
114 **/
115 enum class PrimitiveMode
116 {
118 , e_point
119 , e_lines
120 , e_polyline
121 , e_triangle
124 , e_grid
127 };
128 NDEVR_DESIGN_T_API template class NDEVR_DESIGN_API StringStream<PrimitiveMode>;
129 /**--------------------------------------------------------------------------------------------------
130 \brief Channels that describe how an object should interact with light.
131 **/
132 enum class UVType
133 {
134 e_KD
135 , e_KS
136 , e_KA
137 , e_reflect
138 , e_emmisive
139 , e_normal
140 , e_displace
141 , e_uv_size
142 };
143 NDEVR_DESIGN_T_API template class NDEVR_DESIGN_API StringStream<UVType>;
144 class WLock;
145 /**--------------------------------------------------------------------------------------------------
146 \brief Provides the underlying data storage for the NDEVR Scene Model heirarchy.
147 \hidecollaborationgraph
148 **/
150 {
151 public:
152
153 DesignObjectBase(bool is_app_owned);
156 NDEVR_DESIGN_API DesignObjectBase(BinaryFile& file, uint08 version_number, DesignObjectBase* application_base = nullptr);
157 //Tables
164#if NDEVR_SUPPORTS_BONES
165 DynamicPointer<Table> bone_table;
167 uint04 bone_child_index = Constant<uint04>::Invalid;
168#endif
171
172 //Design Object
197
198 //Material
223
224 //Geometry Table
232 uint04 model_parents_column = Constant<uint04>::Invalid;
248
249 uint04 primitive_index_column = Constant<uint04>::Invalid;
250 uint04 primitive_fan_column = Constant<uint04>::Invalid;
251 uint04 primitive_flag_column = Constant<uint04>::Invalid;
252
253 uint04 index_mode_offset_column = Constant<uint04>::Invalid;
254 uint04 index_mode_size_column = Constant<uint04>::Invalid;
255
256 uint04 index_fan_offset_column = Constant<uint04>::Invalid;
257 uint04 index_fan_size_column = Constant<uint04>::Invalid;
258
259
260 uint04 face_to_edge_column = Constant<uint04>::Invalid;
261 uint04 edge_to_face_column = Constant<uint04>::Invalid;
266 uint04 vertex_offset_column = Constant<uint04>::Invalid;
267 uint04 vertex_count_column = Constant<uint04>::Invalid;
268 uint04 vertex_reserved_count_column = Constant<uint04>::Invalid;
269
270 uint04 solid_vertex_offset_column = Constant<uint04>::Invalid;
271 uint04 solid_vertex_count_column = Constant<uint04>::Invalid;
272 uint04 solid_vertex_reserved_count_column = Constant<uint04>::Invalid;
273
274
275 //Vertex Table
280 uint04 neighbor_index_location = Constant<uint04>::Invalid;
281
282 //Model
285 uint04 selection_location = Constant<uint04>::Invalid;
286 uint04 local_child_location = Constant<uint04>::Invalid;
287 uint04 external_child_location = Constant<uint04>::Invalid;
288
289
290 uint04 model_geometry_index = Constant<uint04>::Invalid;
291 uint04 effect_child_index = Constant<uint04>::Invalid;
293
294 //Effect
300
306 bool hasRTree(UUID id) const;
307 bool isApplicationOwned() const;
312 NDEVR_DESIGN_API void mapFromFile(BinaryFile& file, uint08 version_number);
313
314 NDEVR_DESIGN_API void mapTreeToFile(BinaryFile& file, int mode) const;
316
318
319 const RandomColorGenerator& randomColorGenerator() const { return m_color_generator; }
322#ifdef _DEBUG
323 public:
324 const void* lock_ptr_check = nullptr;
325#endif
326 protected:
331 };
332}
333
334
335
#define NDEVR_DESIGN_API
Definition DLLInfo.h:55
#define NDEVR_DESIGN_T_API
Definition DLLInfo.h:56
Logic for reading or writing to a binary file including logic for.
Definition BinaryFile.h:59
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:55
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
The core Color class in the NDEVR API. Colors can be defined in several ways. The ACIColor is compact...
Definition Color.h:41
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
Provides the underlying data storage for the NDEVR Scene Model heirarchy.
Definition DesignObjectBase.h:150
DynamicPointer< Table > effect_table
Definition DesignObjectBase.h:169
void mapTreesFromFile(BinaryFile &file, uint08 version_number)
const DynamicPointer< RTree< 3, fltp04 > > & getRTree(UUID id)
DynamicPointer< Table > property_table
Definition DesignObjectBase.h:158
void writeMetaDataToColumn() const
DynamicPointer< Table > primitive_index_table
Definition DesignObjectBase.h:160
DynamicPointer< Table > geometry_table
Definition DesignObjectBase.h:163
DynamicPointer< Table > vertex_table
Definition DesignObjectBase.h:159
DesignObjectBase(bool is_app_owned)
RandomColorGenerator m_color_generator
Definition DesignObjectBase.h:320
void mapFromFile(BinaryFile &file, uint08 version_number)
Dictionary< UUID, DynamicPointer< RTree< 3, fltp04 > > > m_r_trees
Definition DesignObjectBase.h:317
DesignObjectBase(BinaryFile &file, uint08 version_number, DesignObjectBase *application_base=nullptr)
DynamicPointer< Table > model_table
Definition DesignObjectBase.h:161
Buffer< JSONNode, uint04, ObjectAllocator< false > > cached_meta_data
Definition DesignObjectBase.h:170
const RandomColorGenerator & randomColorGenerator() const
Definition DesignObjectBase.h:319
void setRTree(UUID id, const DynamicPointer< RTree< 3, fltp04 > > &tree)
DesignObjectBase *const application_base
Definition DesignObjectBase.h:321
void fetchDataColumns(Buffer< DynamicPointer< TableColumn > > &columns)
DynamicPointer< Table > material_table
Definition DesignObjectBase.h:162
void mapTreeToFile(BinaryFile &file, int mode) const
bool isApplicationOwned() const
const ConstPointer< RTree< 3, fltp04 > > & getRTree(UUID id) const
void mapToFile(BinaryFile &file) const
void removeRTree(UUID id)
DesignObjectBase(DesignObjectBase *application_base)
bool hasRTree(UUID id) const
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
Definition GeometryVertices.h:11
Generates random colors based off of some specified settings.
Definition RandomColorGenerator.h:45
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Used to lock a particular variable for writing. Only one write lock can be created when no read locks...
Definition RWLock.h:115
Definition ACIColor.h:37
NormalMode
Definition DesignObjectBase.h:105
VertexProperty
Definition DesignObjectBase.h:52
GeometryType
Definition DesignObjectBase.h:86
VertexFlags
Definition DesignObjectBase.h:68
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
PrimitiveBitFlags
Definition DesignObjectBase.h:78
PrimitiveMode
Used with Geometry to describe how vertices and indices are used to form shapes.
Definition DesignObjectBase.h:116
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
Definition BaseValues.hpp:106
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
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