NDEVR
API Documentation
FactoryOptions

User-defined options that define preferences for importing and exporting using IOFactory objects. More...

Inheritance diagram for FactoryOptions:
[legend]
Collaboration diagram for FactoryOptions:
[legend]

Public Types

enum class  GeoReferenceProperties {
  e_data_cant_be_geo_referenced , e_data_geo_referenced , e_user_place_with_cursor , e_user_geo_reference_dialog ,
  e_prompt_user_all , e_prompt_user_no_existing_reference
}
 Controls how geo-referencing is handled for imported data. More...
enum class  ImportMergeProperties {
  e_duplicate , e_ignore_import , e_replace , e_remap_imported ,
  e_merge_and_replace_from_file , e_merge_and_ignore_from_file
}
 Controls how duplicate or conflicting data is resolved when importing into an existing scene. More...
enum class  IncludeProperties : uint01 {
  e_ignore = 0 , e_include_default_precision = 1 , e_include_high_precision = 2 , e_generate_default_precision = 3 ,
  e_generate_high_precision = 4 , e_not_supported
}
 Describes how a particular data field (vertex property or geometry type) should be handled during import or export. More...
enum  NormalGenerationModel { e_flat , e_smooth }
 Controls how vertex normals are generated during import post-processing. More...

Public Member Functions

void finishReadingINI (INIFactory &factory) override
 Performs any finalization after INI deserialization completes.
bool generateValue (GeometryType property) const
 Checks whether the given geometry type should be generated if it does not already exist.
bool generateValue (VertexProperty property) const
 Checks whether the given vertex property should be generated if it does not already exist.
virtual void getINI (INIFactory &factory) override
 Reads or writes all option fields to/from the INI factory.
bool operator!= (const FactoryOptions &options) const
 Compares two FactoryOptions for inequality.
bool operator== (const FactoryOptions &options) const
 Compares two FactoryOptions for equality.
void postProcess (Model &model, ProgressInfo &info, const void *lock) const
 Applies post-processing steps to an imported model based on the current option flags (e.g., normals generation, mesh optimization, winding correction, degenerate removal).
void prepareForINI (INIFactory &factory) override
 Prepares internal state before INI serialization begins.
void setToDefaultUnits ()
 Resets the unit manager to system-default units.
void setupDefaultMaterial (GeometryType type, Material &mat) const
 Configures a Material with default visual properties based on the geometry type and current option values (e.g., default color, line thickness, two-sided).
bool useHighPrecision (GeometryType property) const
 Checks whether the given geometry type should use high-precision storage.
bool useHighPrecision (VertexProperty property) const
 Checks whether the given vertex property should use high-precision storage.
bool useValue (GeometryType property) const
 Checks whether the given geometry type should be included (not ignored).
bool useValue (VertexProperty property) const
 Checks whether the given vertex property should be included (not ignored).
Public Member Functions inherited from INIInterface
 INIInterface ()
 Constructs an INIInterface with no default INI file.
 INIInterface (const File &default_ini)
 Constructs an INIInterface with the specified default INI file.
virtual ~INIInterface ()
 Virtual destructor for safe polymorphic cleanup.
virtual bool readINIOptions ()
 Reads INI options from the default INI file.
virtual bool readINIOptions (File &ini_file)
 Reads INI options from the specified INI file.
virtual bool saveINIOptions (bool multithead=false)
 Saves INI options to the default INI file.
virtual bool saveINIOptions (File &ini_file, bool multithead=false)
 Saves INI options to the specified INI file.
void setDefaultINIFile (const File &file)
 Sets the default INI file path used for reading and writing options.
virtual void writeToLog (const StringView &title, LogPtr log, uint01 log_level=2U)
 Writes the current INI options to the specified log with a title.
virtual void writeToLog (LogPtr log, uint01 log_level=2U)
 Writes the current INI options to the specified log.

Public Attributes

bool application_locked = false
 Whether the imported data should be locked from user editing.
bool application_owned = false
 Whether the imported data is owned by the application (not user-managed).
AsciiOptions ascii
 Options for reading or writing ASCII files.
bool center_model = false
 Whether to translate the model so its center is at the origin.
bool combine_mesh_instances = false
 Whether to merge identical mesh instances into a single mesh.
CompressionMode compression_mode = CompressionMode::e_default_compression
 Compression mode for export.
bool convert_degenerates = false
 Whether to convert degenerate primitives (e.g., zero-area triangles).
Dictionary< String, GenericOptionGroupcustom_options
 Importer/exporter-specific custom option groups.
RGBColor default_color
 Color applied when the source data has no color information.
UUID default_coord_projection = Constant<UUID>::Invalid
 Default coordinate projection UUID. Invalid means none specified.
fltp04 default_line_thickness = 1.0
 Default rendered line thickness.
fltp04 default_mesh_thickness = 1.0
 Default rendered mesh edge thickness.
fltp04 default_point_size = 20.0
 Default rendered point size in pixels.
ImportMergeProperties duplicate_name_behavior = ImportMergeProperties::e_duplicate
 How to handle objects with duplicate names on import.
ImportMergeProperties duplicate_uuid_behavior = ImportMergeProperties::e_duplicate
 How to handle objects with duplicate UUIDs on import.
Set< StringAllocatingViewexclusion_model_types
 Model types to exclude from reading or writing.
bool find_invalid_data = false
 Whether to detect and flag invalid geometry data.
bool fix_inward_normals = false
 Whether to flip normals that point inward.
bool flatten_model = false
 Whether to flatten the model hierarchy into a single level.
bool flip_UV_coordinates = false
 Whether to flip UV coordinates vertically (invert V axis).
bool generate_trees = true
 Whether to generate spatial tree structures for the imported data.
bool generate_UV_mappings = false
 Whether to generate UV texture coordinates if they are missing.
GeoReferenceProperties geo_reference_behavior = GeoReferenceProperties::e_data_geo_referenced
 How geo-referencing is resolved during import.
Vector< cast< uint01 >(GeometryType::e_geometry_type_size), IncludePropertiesgeometry_properties
 Per-geometry-type inclusion/generation settings.
String icon
 Optional dataset icon identifier.
bool ignore_invisible = false
 Whether to skip invisible objects during import/export.
bool is_auto_save = false
 Whether this operation is an automatic save (not user-initiated).
bool is_user_action = false
 Whether this operation was triggered directly by a user action.
bool join_identical_vertices = false
 Whether to merge vertices with identical positions and attributes.
bool load_images_to_memory = true
 Whether to load referenced images into memory rather than streaming from disk.
bool multithread = true
 Whether to allow multithreaded import/export processing.
String name
 Optional dataset name.
NormalGenerationModel normal_generation_mode = e_smooth
 The model used when generating vertex normals.
Angle< fltp08normal_smooth_angle = Constant<Angle<fltp08>>::Invalid
 Maximum angle between faces for smooth normal blending. Invalid means use factory default.
bool optimize_meshes = false
 Whether to optimize mesh data for rendering performance.
bool optimize_model_hierarchy = false
 Whether to simplify the model hierarchy by removing redundant nodes.
PasswordString owner_password
 Owner-level password for encrypted file formats.
bool preserve_high_precision_values = false
 Whether to preserve high-precision (fltp08) vertex values.
bool show_dialog_for_export = true
 Whether to show an options dialog before exporting.
bool show_dialog_for_import = true
 Whether to show an options dialog before importing.
bool show_properties_after_complete = false
 Whether to show a properties dialog after the operation completes.
Matrix< fltp08transform
 A top-level transform applied to all imported/exported data.
bool tree_is_visible = true
 Whether the imported model tree is initially visible.
bool triangulate = false
 Whether to convert all polygons to triangles.
bool two_sided = false
 Whether materials should default to two-sided rendering.
UnitManager units
 Unit definitions for coordinate and measurement conversion.
bool use_cameras = true
 Whether to import camera objects from the file.
PasswordString user_password
 User-level password for encrypted file formats.
bool validate_geometry = false
 Whether to validate geometry integrity after import.
Vector< cast< uint01 >(VertexProperty::Vertex_Property_Size), IncludePropertiesvector_properties
 Per-vertex-property inclusion/generation settings.
WindingMode wind_triangles = WindingMode::e_no_winding
 Triangle winding mode to enforce during post-processing.
bool wireframe = false
 Whether to render meshes in wireframe mode.

Static Public Attributes

static ApplicationOption< bool > DefaultExportOnlyVisible
 Application-wide default for exporting only visible objects.

Protected Member Functions

bool canPostProcessVertices () const
 Checks whether any post-processing flags affecting vertices are enabled.

Additional Inherited Members

Protected Attributes inherited from INIInterface
File m_default_ini
 The default file path used for reading and writing INI options.

Detailed Description

User-defined options that define preferences for importing and exporting using IOFactory objects.


Stores all configurable parameters for file I/O operations, including vertex property handling, geometry type filtering, coordinate projections, mesh post-processing flags, and ASCII-specific settings. Inherits from INIInterface to support serialization to and from INI configuration files.

See also
IOFactory, ModelFactory, FactoryFeatures

Definition at line 57 of file FactoryOptions.h.

Member Enumeration Documentation

◆ GeoReferenceProperties

Controls how geo-referencing is handled for imported data.


Enumerator
e_data_cant_be_geo_referenced 

The data format does not support geo-referencing.

e_data_geo_referenced 

The data already contains valid geo-reference information.

e_user_place_with_cursor 

The user will manually place the data using a cursor.

e_user_geo_reference_dialog 

A dialog will be shown for the user to provide geo-reference info.

e_prompt_user_all 

Always prompt the user for geo-referencing, even if data has it.

e_prompt_user_no_existing_reference 

Prompt the user only when no existing geo-reference is found.

Definition at line 105 of file FactoryOptions.h.

◆ ImportMergeProperties

Controls how duplicate or conflicting data is resolved when importing into an existing scene.


Enumerator
e_duplicate 

Always imports, creating duplicates if they exist.

e_ignore_import 

Ignores any duplicate data from the file.

e_replace 

Replaces any existing duplicate data with file data.

e_remap_imported 

Remaps imported data (e.g., rename, change value).

e_merge_and_replace_from_file 

Merges data when possible, replaces otherwise.

e_merge_and_ignore_from_file 

Merges data when possible, ignores otherwise.

Definition at line 92 of file FactoryOptions.h.

◆ IncludeProperties

Describes how a particular data field (vertex property or geometry type) should be handled during import or export.


Values are ordered by increasing level of effort: ignore, include at default or high precision, or generate if the data does not already exist.

Enumerator
e_ignore 

Ignores the field even if it exists.

e_include_default_precision 

Includes the field if it exists; may reduce precision.

e_include_high_precision 

Includes the field if it exists; preserves full precision.

e_generate_default_precision 

Generates the field if possible, at default precision.

e_generate_high_precision 

Generates the field if possible, at high precision.

e_not_supported 

The field is not supported by the current factory.

Definition at line 79 of file FactoryOptions.h.

◆ NormalGenerationModel

Controls how vertex normals are generated during import post-processing.


Enumerator
e_flat 

Generates flat normals (one normal per face).

e_smooth 

Generates smooth normals by averaging adjacent face normals.

Definition at line 66 of file FactoryOptions.h.

Member Function Documentation

◆ canPostProcessVertices()

bool FactoryOptions::canPostProcessVertices ( ) const
protected

Checks whether any post-processing flags affecting vertices are enabled.


Returns
True if at least one vertex post-processing option is active.

◆ finishReadingINI()

void FactoryOptions::finishReadingINI ( INIFactory & factory)
overridevirtual

Performs any finalization after INI deserialization completes.


Parameters
[in]factoryThe INI factory used for serialization.

Reimplemented from INIInterface.

◆ generateValue() [1/2]

bool FactoryOptions::generateValue ( GeometryType property) const

Checks whether the given geometry type should be generated if it does not already exist.


Parameters
[in]propertyThe geometry type to query.
Returns
True if the geometry type is set to generate.

◆ generateValue() [2/2]

bool FactoryOptions::generateValue ( VertexProperty property) const
inline

Checks whether the given vertex property should be generated if it does not already exist.


Parameters
[in]propertyThe vertex property to query.
Returns
True if the property is set to e_generate_default_precision or higher.

Definition at line 160 of file FactoryOptions.h.

References cast(), e_generate_default_precision, and vector_properties.

◆ getINI()

virtual void FactoryOptions::getINI ( INIFactory & factory)
overridevirtual

Reads or writes all option fields to/from the INI factory.


Parameters
[in]factoryThe INI factory used for serialization.

Implements INIInterface.

◆ operator!=()

bool FactoryOptions::operator!= ( const FactoryOptions & options) const
inline

Compares two FactoryOptions for inequality.


Parameters
[in]optionsThe other FactoryOptions to compare against.
Returns
True if any field differs.

Definition at line 203 of file FactoryOptions.h.

◆ operator==()

bool FactoryOptions::operator== ( const FactoryOptions & options) const

Compares two FactoryOptions for equality.


Parameters
[in]optionsThe other FactoryOptions to compare against.
Returns
True if all fields are equal.

◆ postProcess()

void FactoryOptions::postProcess ( Model & model,
ProgressInfo & info,
const void * lock ) const

Applies post-processing steps to an imported model based on the current option flags (e.g., normals generation, mesh optimization, winding correction, degenerate removal).


Parameters
[in]modelThe model to post-process.
[in]infoProgress reporting interface.
[in]lockAn opaque lock pointer for thread-safe operations.

◆ prepareForINI()

void FactoryOptions::prepareForINI ( INIFactory & factory)
overridevirtual

Prepares internal state before INI serialization begins.


Parameters
[in]factoryThe INI factory used for serialization.

Reimplemented from INIInterface.

◆ setToDefaultUnits()

void FactoryOptions::setToDefaultUnits ( )

Resets the unit manager to system-default units.


◆ setupDefaultMaterial()

void FactoryOptions::setupDefaultMaterial ( GeometryType type,
Material & mat ) const

Configures a Material with default visual properties based on the geometry type and current option values (e.g., default color, line thickness, two-sided).


Parameters
[in]typeThe geometry type to set defaults for.
[in]matThe material to configure.

◆ useHighPrecision() [1/2]

bool FactoryOptions::useHighPrecision ( GeometryType property) const

Checks whether the given geometry type should use high-precision storage.


Parameters
[in]propertyThe geometry type to query.
Returns
True if the geometry type is configured for high precision.

◆ useHighPrecision() [2/2]

bool FactoryOptions::useHighPrecision ( VertexProperty property) const

Checks whether the given vertex property should use high-precision storage.


Parameters
[in]propertyThe vertex property to query.
Returns
True if the property is configured for high precision.

◆ useValue() [1/2]

bool FactoryOptions::useValue ( GeometryType property) const
inline

Checks whether the given geometry type should be included (not ignored).


Parameters
[in]propertyThe geometry type to query.
Returns
True if the geometry type is not set to e_ignore, or false if out of range.

Definition at line 177 of file FactoryOptions.h.

References cast(), e_geometry_type_size, e_ignore, and geometry_properties.

◆ useValue() [2/2]

bool FactoryOptions::useValue ( VertexProperty property) const
inline

Checks whether the given vertex property should be included (not ignored).


Parameters
[in]propertyThe vertex property to query.
Returns
True if the property is not set to e_ignore.

Definition at line 150 of file FactoryOptions.h.

References cast(), e_ignore, and vector_properties.


The documentation for this class was generated from the following file: