API Documentation
Loading...
Searching...
No Matches
FactoryOptions.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: IOFactory
28File: FactoryOptions
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/DesignObjectBase.h>
35#include <NDEVR/AsciiOptions.h>
36
37#include <NDEVR/INIInterface.h>
38#include <NDEVR/UnitManager.h>
39#include <NDEVR/GenericOption.h>
40#include <NDEVR/ApplicationOptions.h>
41namespace NDEVR
42{
43 class Model;
44 class Material;
45 /**--------------------------------------------------------------------------------------------------
46 \brief User-defined options that define preferences for importing and exporting using IOFactory objects
47 *-----------------------------------------------------------------------------------------------**/
49 {
50 public:
54 {
55 e_flat
56 , e_smooth
57 };
58
60 {
61 e_ignore = 0 //Ignores the field even if it exists
62 , e_include_default_precision = 1 //Includes the field if it exists, but ignores it otherwise : May reduce precision of include
63 , e_include_high_precision = 2 //Includes the field if it exists, but ignores it otherwise : Will not reduce precision of include
64 , e_generate_default_precision = 3 //generates the field, if possible
65 , e_generate_high_precision = 4 //generates the field, if possible
67 };
68
70 {
71 e_duplicate//Will always import, creating duplicates if they exist
72 , e_ignore_import//ignores any duplicate data from file
73 , e_replace//replaces any duplicate data with file data
74 , e_remap_imported//will remap (ie: rename, change value etc) any imported data
75 , e_merge_and_replace_from_file//merges data when possible, then replaces data otherwise
76 , e_merge_and_ignore_from_file//merges data when possible, then ignores_otherwise
77 };
79 {
80 e_data_geo_referenced
81 , e_user_place_with_cursor
82 , e_user_geo_reference_dialog
83 , e_prompt_user_all
84 , e_prompt_user_no_existing_reference
85 };
86
87 void prepareForINI(INIFactory& factory) override;
88 virtual void getINI(INIFactory& factory) override;
89 void finishReadingINI(INIFactory& factory) override;
91 bool useHighPrecision(VertexProperty property) const;
92 bool useValue(VertexProperty property) const
93 {
94 return (vector_properties[cast<uint01>(property)] != IncludeProperties::e_ignore);
95 }
96 bool generateValue(VertexProperty property) const
97 {
98 return (vector_properties[cast<uint01>(property)] >= IncludeProperties::e_generate_default_precision);
99 }
100
101 bool useHighPrecision(GeometryType property) const;
102 bool useValue(GeometryType property) const
103 {
104 if (property >= GeometryType::e_geometry_type_size)
105 return false;
106 return (geometry_properties[cast<uint01>(property)] != IncludeProperties::e_ignore);
107 }
108 bool generateValue(GeometryType property) const;
109
110 bool operator==(const FactoryOptions& options) const;
111 bool operator!=(const FactoryOptions& options) const
112 {
113 return !(*this == options);
114 }
116 void postProcess(Model& model, ProgressInfo* progress, const void* lock) const;
117 protected:
119 public:
121 Buffer<String> exclusion_model_types = {
122 "scanner"
123 , "bounding_box"
124 , "grips_model"
125 , "camera"
126 , "boretrak_model"
127 , "deployment_models"
128 , "calibration_ring"
129 , "text"
130 , "void_scanner"
131 , "cals_scanner"
132 , "qt_bounding_box"
133 , "station_decoration"
134 , "image_model"
135 };
143 NormalGenerationModel normal_generation_mode = e_smooth;
144 Angle<fltp08> normal_smooth_angle = Angle<fltp08>(DEGREES, 30.0);
145 WindingMode wind_triangles = WindingMode::e_no_winding;
147 UUID default_coord_projection = Constant<UUID>::Invalid;
148 fltp04 default_point_size = 20.0;
149 fltp04 default_line_thickness = 1.0;
150 fltp04 default_mesh_thickness = 1.0;
151 CompressionMode compression_mode = CompressionMode::e_default_compression;
155 bool flatten_model = false;
156 bool center_model = false;
157 bool multithread = true;
158 bool tree_is_visible = true;
159 bool application_locked = false;
160 bool convert_degenerates = false;
161 bool optimize_meshes = false;
162 bool combine_mesh_instances = false;
163 bool optimize_model_heirarchy = false;
164 bool find_invalid_data = false;
165 bool join_identical_vertices = false;
166 bool fix_inward_normals = false;
167 bool generate_UV_mappings = false;
168 bool generate_trees = true;
169 bool flip_UV_coordinates = false;
170 bool ignore_invisible = false;
171 bool two_sided = false;
172 bool wireframe = false;
173 bool triangulate = false;
174 bool validitate_geometry = false;
175 bool preserve_high_precision_values = false;
176 bool use_cameras = true;
177 bool is_auto_save = false;
178 Vector<cast<uint01>(VertexProperty::Vertex_Property_Size), IncludeProperties> vector_properties;
179 Vector<cast<uint01>(GeometryType::e_geometry_type_size), IncludeProperties> geometry_properties;
181 private:
182 String m_selected_ascii_options_all;//Used for ini
183 };
186}
#define NDEVR_FACTORY_API
Definition DLLInfo.h:79
#define NDEVR_FACTORY_T_API
Definition DLLInfo.h:80
The primary angle storage class for this API. Stores an angle in an optimized format.
Definition StringStream.h:408
The default object to store data of any type that should persist through sessions of the application.
Definition Button.h:57
Storage class for all IO options related to an Ascii file output used by an IOFactory services.
Definition AsciiOptions.h:43
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:59
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:59
User-defined options that define preferences for importing and exporting using IOFactory objects.
Definition FactoryOptions.h:49
Matrix< fltp08 > transform
Definition FactoryOptions.h:137
RGBColor default_color
Definition FactoryOptions.h:146
virtual void getINI(INIFactory &factory) override
bool useHighPrecision(GeometryType property) const
void setupDefaultMaterial(GeometryType type, Material &mat) const
Dictionary< String, GenericOptionGroup > custom_options
Definition FactoryOptions.h:136
String icon
Definition FactoryOptions.h:139
UnitManager units
Definition FactoryOptions.h:142
ImportMergeProperties
Definition FactoryOptions.h:70
void postProcess(Model &model, ProgressInfo *progress, const void *lock) const
static ApplicationOption< bool > DefaultExportOnlyVisible
Definition FactoryOptions.h:180
NormalGenerationModel
Definition FactoryOptions.h:54
bool generateValue(GeometryType property) const
ImportMergeProperties duplicate_name_behavior
Definition FactoryOptions.h:152
bool generateValue(VertexProperty property) const
Definition FactoryOptions.h:96
IncludeProperties
Definition FactoryOptions.h:60
bool useValue(VertexProperty property) const
Definition FactoryOptions.h:92
GeoReferenceProperties geo_reference_behavior
Definition FactoryOptions.h:154
void prepareForINI(INIFactory &factory) override
void finishReadingINI(INIFactory &factory) override
bool operator!=(const FactoryOptions &options) const
Definition FactoryOptions.h:111
bool operator==(const FactoryOptions &options) const
bool useHighPrecision(VertexProperty property) const
AsciiOptions ascii
Definition FactoryOptions.h:120
String user_password
Definition FactoryOptions.h:140
String name
Definition FactoryOptions.h:138
String owner_password
Definition FactoryOptions.h:141
GeoReferenceProperties
Definition FactoryOptions.h:79
Vector< cast< uint01 >(GeometryType::e_geometry_type_size), IncludeProperties > geometry_properties
Definition FactoryOptions.h:179
ImportMergeProperties duplicate_uuid_behavior
Definition FactoryOptions.h:153
Vector< cast< uint01 >(VertexProperty::Vertex_Property_Size), IncludeProperties > vector_properties
Definition FactoryOptions.h:178
bool canPostProcessVertices() const
bool useValue(GeometryType property) const
Definition FactoryOptions.h:102
Contains methods for easily reading and writing to an INI file including efficient casting,...
Definition INIReader.h:64
Contains methods for easily reading and writing to an INI file including.
Definition INIInterface.h:45
Definition Material.h:45
Definition Matrix.hpp:176
A core class that represents a node on model heirarchy. This node may contain a Geometry or.
Definition Model.h:58
A light-weight base class for Log that allows processes to update, without the need for.
Definition ProgressInfo.hpp:48
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:53
The core String class for the software.
Definition String.h:47
Logic for reading or writing to a string or a user friendly, TranslatedString.
Definition StringStream.h:118
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:62
Handles a grouping of units that can describe any number of data categories.
Definition UnitManager.h:142
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Definition ACIColor.h:37
VertexProperty
Definition DesignObjectBase.h:52
GeometryType
Definition DesignObjectBase.h:86
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:125
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:78
CompressionMode
Logical information about the type of compression implemented or requested.
Definition Compressor.h:15
WindingMode
Definition DesignObjectBase.h:97
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved.
Definition BaseValues.hpp:230