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 };
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 };
76
78 {
79 e_is_selected = 0x01
80 , e_is_hidden = 0x02
81 , e_is_locked = 0x04
82 , e_is_deleted = 0x08
84 };
112 enum class PrimitiveMode
113 {
115 , e_point
116 , e_lines
117 , e_polyline
118 , e_triangle
121 , e_grid
124 };
126 enum class UVType
127 {
128 e_KD
129 , e_KS
130 , e_KA
131 , e_reflect
132 , e_emmisive
133 , e_normal
134 , e_displace
135 , e_uv_size
136 };
138 class WLock;
140 {
141 public:
142
143 DesignObjectBase(bool is_app_owned);
144 DesignObjectBase(DesignObjectBase* application_base);
146 NDEVR_DESIGN_API DesignObjectBase(BinaryFile& file, uint08 version_number, DesignObjectBase* application_base = nullptr);
147 //Tables
154#if NDEVR_SUPPORTS_BONES
155 DynamicPointer<Table> bone_table;
156 uint04 bone_index = Constant<uint04>::NaN;
157 uint04 bone_child_index = Constant<uint04>::NaN;
158#endif
161
162 //Design Object
187
188 //Material
213
214 //Geometry Table
222 uint04 model_parents_column = Constant<uint04>::NaN;
238
239 uint04 primitive_index_column = Constant<uint04>::NaN;
240 uint04 primitive_fan_column = Constant<uint04>::NaN;
241 uint04 primitive_flag_column = Constant<uint04>::NaN;
242
243 uint04 index_mode_offset_column = Constant<uint04>::NaN;
244 uint04 index_mode_size_column = Constant<uint04>::NaN;
245
246 uint04 index_fan_offset_column = Constant<uint04>::NaN;
247 uint04 index_fan_size_column = Constant<uint04>::NaN;
248
249
250 uint04 face_to_edge_column = Constant<uint04>::NaN;
251 uint04 edge_to_face_column = Constant<uint04>::NaN;
256 uint04 vertex_offset_column = Constant<uint04>::NaN;
257 uint04 vertex_count_column = Constant<uint04>::NaN;
258 uint04 vertex_reserved_count_column = Constant<uint04>::NaN;
259
260 uint04 solid_vertex_offset_column = Constant<uint04>::NaN;
261 uint04 solid_vertex_count_column = Constant<uint04>::NaN;
262 uint04 solid_vertex_reserved_count_column = Constant<uint04>::NaN;
263
264
265 //Vertex Table
270 uint04 neighbor_index_location = Constant<uint04>::NaN;
271
272 //Model
273 uint04 parent_location = Constant<uint04>::NaN;
275 uint04 selection_location = Constant<uint04>::NaN;
276 uint04 local_child_location = Constant<uint04>::NaN;
277 uint04 external_child_location = Constant<uint04>::NaN;
278
279
280 uint04 model_geometry_index = Constant<uint04>::NaN;
281 uint04 effect_child_index = Constant<uint04>::NaN;
283
284 //Effect
290
291 WLock lockRTrees();
292 const ConstPointer<RTree<3, fltp04>>& getRTree(UUID id) const;
293 const DynamicPointer<RTree<3, fltp04>>& getRTree(UUID id);
294 void setRTree(UUID id, const DynamicPointer<RTree<3, fltp04>>& tree);
295 void removeRTree(UUID id);
296 bool hasRTree(UUID id) const;
297 bool isApplicationOwned() const;
298 void readMetaDataFromColumn();
299 NDEVR_DESIGN_API void writeMetaDataToColumn() const;
300 NDEVR_DESIGN_API void fetchDataColumns(Buffer<DynamicPointer<TableColumn>>& columns);
301 NDEVR_DESIGN_API void mapToFile(BinaryFile& file) const;
302 NDEVR_DESIGN_API void mapFromFile(BinaryFile& file, uint08 version_number);
303
304 NDEVR_DESIGN_API void mapTreeToFile(BinaryFile& file, int mode) const;
305 NDEVR_DESIGN_API void mapTreesFromFile(BinaryFile& file, uint08 version_number);
306
308
309 const RandomColorGenerator& randomColorGenerator() const { return m_color_generator; }
312#ifdef _DEBUG
313 public:
314 const void* lock_ptr_check = nullptr;
315#endif
316 protected:
317 void createTables();
318 void createPropertyTable();
319 void linkTables();
320 void setDefaultValues();
321 };
322}
323
324
325
#define NDEVR_DESIGN_API
Definition DLLInfo.h:77
#define NDEVR_DESIGN_T_API
Definition DLLInfo.h:78
Definition BinaryFile.h:51
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:68
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition Color.h:36
Definition GraphicsPipeline.h:42
Definition DesignObjectBase.h:140
DynamicPointer< Table > effect_table
Definition DesignObjectBase.h:159
DynamicPointer< Table > property_table
Definition DesignObjectBase.h:148
DynamicPointer< Table > primitive_index_table
Definition DesignObjectBase.h:150
DynamicPointer< Table > geometry_table
Definition DesignObjectBase.h:153
DynamicPointer< Table > vertex_table
Definition DesignObjectBase.h:149
RandomColorGenerator m_color_generator
Definition DesignObjectBase.h:310
Dictionary< UUID, DynamicPointer< RTree< 3, fltp04 > > > m_r_trees
Definition DesignObjectBase.h:307
DynamicPointer< Table > model_table
Definition DesignObjectBase.h:151
Buffer< JSONNode, uint04, ObjectAllocator< false > > cached_meta_data
Definition DesignObjectBase.h:160
const RandomColorGenerator & randomColorGenerator() const
Definition DesignObjectBase.h:309
DesignObjectBase *const application_base
Definition DesignObjectBase.h:311
DynamicPointer< Table > material_table
Definition DesignObjectBase.h:152
Definition Dictionary.h:48
Definition Pointer.hpp:303
Definition RTree.hpp:1014
Definition RandomColorGenerator.h:34
Definition StringStream.h:62
Definition UUID.h:66
Definition RWLock.h:99
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:98
PrimitiveBitFlags
Definition DesignObjectBase.h:78
PrimitiveMode
Definition DesignObjectBase.h:113
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer -Can represent exact integer values 0 thro...
Definition BaseValues.hpp:132
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:120
UVType
Definition DesignObjectBase.h:127
Definition BaseValues.hpp:272