![]() |
NDEVR
API Documentation
|
A service that provides Import/Export functionality for a model hierarchy. More...
Public Member Functions | |
| IOFactory (const StringView &factory_name) | |
| Constructs an IOFactory with the given factory name. | |
| virtual | ~IOFactory () |
| Virtual destructor. | |
| virtual bool | canRead (const FactoryParameters &file) |
| Checks whether this factory can read using the given FactoryParameters. | |
| virtual bool | canRead (const File &file) |
| Checks whether this factory can read the given file. | |
| virtual bool | canRead (const FileFormat &file) |
| Checks whether this factory can read the given file format. | |
| virtual bool | canWrite (const FactoryParameters &file) |
| Checks whether this factory can write using the given FactoryParameters. | |
| virtual bool | canWrite (const File &file) |
| Checks whether this factory can write the given file. | |
| virtual bool | canWrite (const FileFormat &file) |
| Checks whether this factory can write the given file format. | |
| virtual FactoryOptions | defaultReadOptions (const FactoryParameters &file) const |
| Returns the default read options for the given factory parameters. | |
| virtual FactoryOptions | defaultWriteOptions (const FactoryParameters &file) const |
| Returns the default write options for the given factory parameters. | |
| virtual bool | determineExtension (const File &file, String &extension) |
| Attempts to determine the file extension for the given file. | |
| virtual FactoryFeatures | factoryFeatures (const FactoryParameters &file, bool is_import) const =0 |
| Returns the features and configurable options for this factory given the parameters. | |
| String | factoryReadAppFeature () const |
| Returns the application feature string required for read operations. | |
| String | factoryWriteAppFeature () const |
| Returns the application feature string required for write operations. | |
| virtual Buffer< UUID > | filterModelsToExport (Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, const FileFormat &export_format) const |
| Filters a list of model UUIDs to only those that can be exported in the given format. | |
| virtual String | getIcon (const File &file) |
| Returns the icon name associated with the given file type. | |
| void | getSupportedFormats (Buffer< FileFormat > &formats) |
| Populates the given buffer with all supported file formats (both read and write). | |
| virtual void | getSupportedFormats (Buffer< FileFormat > &formats, bool is_read)=0 |
| Populates the given buffer with supported file formats for reading or writing. | |
| virtual void | getSupportedFormats (Buffer< FileFormat > &formats, const File &file) |
| Populates the given buffer with formats supported for the specified file. | |
| virtual void | getSupportedFormats (Buffer< FileFormat > &formats, DesignObjectLookup *lookup, const Buffer< UUID > &models) |
| Populates the given buffer with formats supported for writing the specified models. | |
| virtual void | getSupportedFormatsByModelType (Buffer< FileFormat > &formats, bool is_read, const StringView &model_type) |
| Populates the given buffer with formats matching a specific model type. | |
| virtual void | getSupportedFormatsForExtension (Buffer< FileFormat > &formats, bool is_read, const StringView &extension) |
| Populates the given buffer with formats matching a specific file extension. | |
| virtual bool | isAutoEnabled () const |
| Checks whether this factory is automatically enabled without requiring a password. | |
| virtual bool | isFactoryEnabled (bool is_read) const |
| Checks whether this factory is enabled for reading or writing. | |
| const String & | name () const |
| Returns the name of this factory. | |
| Buffer< UUID > | readFileWithDefaultSettings (const File &file, DesignObjectLookup *lookup) |
| Reads a file using default settings and returns the UUIDs of the created models. | |
| Buffer< Scene > | readScenesFromFile (const File &file) |
| Reads scenes from a file and returns them as a buffer of Scene objects. | |
| void | throwIfNotEnabled (bool is_read) |
| Throws an exception if the factory is not enabled for the given operation direction. | |
| virtual bool | updateFromFile (const FactoryParameters &file, const FactoryOptions &old_options) |
| Updates the factory parameters from a file, comparing against old options. | |
| bool | writeScenesToFile (const File &file, const Buffer< Scene > &scene) |
| Writes a buffer of scenes to a file. | |
Static Public Member Functions | |
| static void | EnableExtension (const StringView &extension, const StringView &read_password, const StringView &write_password) |
| Enables a specific file extension with the given read and write passwords. | |
| static void | EnableFactory (const StringView &factory, const StringView &read_password, const StringView &write_password) |
| Enables a factory by name with the given read and write passwords. | |
| static void | EnableFactory (IOFactory *factory, const StringView &read_password, const StringView &write_password) |
| Registers an IOFactory instance with the system, enabling it for read and/or write. | |
Private Member Functions | |
| virtual bool | readFile (FactoryParameters &file)=0 |
| Reads data from a file into the design object hierarchy. | |
| virtual bool | writeFile (FactoryParameters &file)=0 |
| Writes data from the design object hierarchy to a file. | |
A service that provides Import/Export functionality for a model hierarchy.
These can be registered with EnableFactory to allow the user to export/import to certain file formats. In order to provide support for new file formats, classes should override this class and then add themselves using EnableFactory.
For write operations we will first send which data structures the user wishes to export, if it is possible for a certain implementation to write those data structures, it will then be asked to provide available write formats. If the user chooses the provided format FactoryFeatures will be requested to see what options to show the user. The factory can then write this data.
For read operations we will first ask which extensions are supported. If the user chooses a file with the supported extension, FactoryFeatures will be requested to see what options to show the user. The factory can then read this data.
Definition at line 247 of file IOFactory.h.
| IOFactory::IOFactory | ( | const StringView & | factory_name | ) |
Constructs an IOFactory with the given factory name.
| [in] | factory_name | The unique name identifying this factory. |
Referenced by ModelFactory::addFactory(), ModelFactory::addFactory(), EnableFactory(), and ModelFactory::enableFactory().
|
virtual |
Virtual destructor.
|
virtual |
Checks whether this factory can read using the given FactoryParameters.
| [in] | file | The FactoryParameters describing the read operation. |
Reimplemented in AsciiFactory, GeoSlamFactory, GeoTiffFactory, KMLFactory, LASFactory, LASPerformanceFactory, ModelFactory, NDVFactory, OMFFactory, PDFFactory, and QuickbooksFactory.
|
virtual |
Checks whether this factory can read the given file.
| [in] | file | The file to check. |
Reimplemented in CommandJSON, DNBJSONFactory, GeoTiffFactory, IredesPatternFactory, LandXMLFactory, ModelFactory, OWLFactory, SceneDump, UnityAssetFactory, and ZippedOffset.
|
virtual |
Checks whether this factory can read the given file format.
| [in] | file | The FileFormat to check. |
|
virtual |
Checks whether this factory can write using the given FactoryParameters.
| [in] | file | The FactoryParameters describing the write operation. |
Reimplemented in ModelFactory, NDVFactory, OMFFactory, PDFFactory, and QuickbooksFactory.
|
virtual |
Checks whether this factory can write the given file.
| [in] | file | The file to check. |
Reimplemented in CommandJSON, DNBJSONFactory, ModelFactory, OWLFactory, PDFFactory, SceneDump, UnityAssetFactory, and ZippedOffset.
|
virtual |
Checks whether this factory can write the given file format.
| [in] | file | The FileFormat to check. |
Reimplemented in NDVFactory, and PDFFactory.
|
virtual |
Returns the default read options for the given factory parameters.
| [in] | file | The FactoryParameters describing the read operation. |
Reimplemented in AsciiFactory, AssimpFactory, CommandJSON, DNBJSONFactory, DVI3DSpreadsheetFactory, DXFFactory, E57Factory, GeoSlamFactory, GeoTiffFactory, KMLFactory, LandXMLFactory, LASFactory, LASPerformanceFactory, ModelFactory, NDVFactory, OWLFactory, SceneDump, SHPFactory, UnityAssetFactory, XLXSFactory, and ZippedOffset.
|
virtual |
Returns the default write options for the given factory parameters.
| [in] | file | The FactoryParameters describing the write operation. |
Reimplemented in AsciiFactory, AssimpFactory, CommandJSON, DNBJSONFactory, DXFFactory, E57Factory, GeoSlamFactory, KMLFactory, LASFactory, LASPerformanceFactory, ModelFactory, NDVFactory, OWLFactory, PDFFactory, SceneDump, SHPFactory, UnityAssetFactory, and ZippedOffset.
Attempts to determine the file extension for the given file.
| [in] | file | The file to inspect. |
| [in] | extension | Output parameter populated with the determined extension. |
Reimplemented in CommandJSON, DNBJSONFactory, DXFFactory, LASFactory, LASPerformanceFactory, ModelFactory, NDVFactory, OWLFactory, SceneDump, UnityAssetFactory, and ZippedOffset.
|
static |
Enables a specific file extension with the given read and write passwords.
| [in] | extension | The file extension to enable (e.g., "obj", "csv"). |
| [in] | read_password | The password or license key enabling read operations. |
| [in] | write_password | The password or license key enabling write operations. |
|
static |
Enables a factory by name with the given read and write passwords.
| [in] | factory | The name of the factory to enable. |
| [in] | read_password | The password or license key enabling read operations. |
| [in] | write_password | The password or license key enabling write operations. |
|
static |
Registers an IOFactory instance with the system, enabling it for read and/or write.
| [in] | factory | The IOFactory instance to register. |
| [in] | read_password | The password or license key enabling read operations. |
| [in] | write_password | The password or license key enabling write operations. |
References IOFactory().
|
pure virtual |
Returns the features and configurable options for this factory given the parameters.
| [in] | file | The FactoryParameters describing the operation. |
| [in] | is_import | True for import operations, false for export operations. |
Implemented in AsciiFactory, AssimpFactory, CommandJSON, DNBJSONFactory, DVI3DSpreadsheetFactory, DXFFactory, E57Factory, GeoSlamFactory, GeoTiffFactory, KMLFactory, LandXMLFactory, LASFactory, LASPerformanceFactory, MagneticCalibrationFactory, ModelFactory, NDVFactory, OWLFactory, PDFFactory, QuickbooksFactory, RockWorksFactory, SceneDump, SHPFactory, SketchupFactory, UnityAssetFactory, XLXSFactory, and ZippedOffset.
| String IOFactory::factoryReadAppFeature | ( | ) | const |
Returns the application feature string required for read operations.
| String IOFactory::factoryWriteAppFeature | ( | ) | const |
Returns the application feature string required for write operations.
|
virtual |
Filters a list of model UUIDs to only those that can be exported in the given format.
| [in] | models_to_check | The candidate model UUIDs to filter. |
| [in] | lookup | The DesignObjectLookup used to resolve the models. |
| [in] | export_format | The target export format. |
Reimplemented in AsciiFactory, AssimpFactory, CommandJSON, DNBJSONFactory, E57Factory, GeoSlamFactory, KMLFactory, LASFactory, LASPerformanceFactory, MagneticCalibrationFactory, ModelFactory, OWLFactory, RockWorksFactory, SceneDump, SHPFactory, UnityAssetFactory, and ZippedOffset.
Returns the icon name associated with the given file type.
| [in] | file | The file to get the icon for. |
Reimplemented in AsciiFactory, AssimpFactory, CommandJSON, DNBJSONFactory, LandXMLFactory, ModelFactory, NDVFactory, OWLFactory, SceneDump, UnityAssetFactory, and ZippedOffset.
| void IOFactory::getSupportedFormats | ( | Buffer< FileFormat > & | formats | ) |
Populates the given buffer with all supported file formats (both read and write).
| [in] | formats | The buffer to populate with supported FileFormat entries. |
|
pure virtual |
Populates the given buffer with supported file formats for reading or writing.
| [in] | formats | The buffer to populate with supported FileFormat entries. |
| [in] | is_read | True to get read formats, false to get write formats. |
Implemented in AsciiFactory, AssimpFactory, CommandJSON, DNBJSONFactory, DVI3DSpreadsheetFactory, DXFFactory, E57Factory, GeoSlamFactory, GeoTiffFactory, IredesPatternFactory, KMLFactory, LandXMLFactory, LASFactory, LASPerformanceFactory, MagneticCalibrationFactory, ModelFactory, NDVFactory, OWLFactory, PDFFactory, QuickbooksFactory, RockWorksFactory, SceneDump, SHPFactory, SketchupFactory, UnityAssetFactory, XLXSFactory, and ZippedOffset.
|
virtual |
Populates the given buffer with formats supported for the specified file.
| [in] | formats | The buffer to populate with supported FileFormat entries. |
| [in] | file | The file to check for supported formats. |
Reimplemented in ModelFactory.
|
virtual |
Populates the given buffer with formats supported for writing the specified models.
| [in] | formats | The buffer to populate with supported FileFormat entries. |
| [in] | lookup | The DesignObjectLookup used to resolve the models. |
| [in] | models | The UUIDs of the models to check for export support. |
Reimplemented in AsciiFactory, AssimpFactory, ModelFactory, and PDFFactory.
|
virtual |
Populates the given buffer with formats matching a specific model type.
| [in] | formats | The buffer to populate with matching FileFormat entries. |
| [in] | is_read | True to get read formats, false to get write formats. |
| [in] | model_type | The model type string to filter by. |
Reimplemented in AsciiFactory, DNBJSONFactory, IredesPatternFactory, and ModelFactory.
|
virtual |
Populates the given buffer with formats matching a specific file extension.
| [in] | formats | The buffer to populate with matching FileFormat entries. |
| [in] | is_read | True to get read formats, false to get write formats. |
| [in] | extension | The file extension to filter by (e.g., "obj", "csv"). |
|
virtual |
Checks whether this factory is automatically enabled without requiring a password.
Reimplemented in CommandJSON, DNBJSONFactory, GeoTiffFactory, OWLFactory, SceneDump, UnityAssetFactory, and ZippedOffset.
|
virtual |
Checks whether this factory is enabled for reading or writing.
| [in] | is_read | True to check read capability, false to check write capability. |
|
inline |
Returns the name of this factory.
Definition at line 262 of file IOFactory.h.
Referenced by AsciiFactory::AsciiFactory().
|
privatepure virtual |
Reads data from a file into the design object hierarchy.
| [in] | file | The FactoryParameters describing the read operation and receiving results. |
Implemented in AsciiFactory, AssimpFactory, CommandJSON, DNBJSONFactory, DVI3DSpreadsheetFactory, DXFFactory, E57Factory, GeoSlamFactory, GeoTiffFactory, IredesPatternFactory, KMLFactory, LandXMLFactory, LASFactory, LASPerformanceFactory, MagneticCalibrationFactory, ModelFactory, NDVFactory, OMFFactory, OWLFactory, PDFFactory, QuickbooksFactory, RockWorksFactory, SceneDump, SHPFactory, SketchupFactory, UnityAssetFactory, XLXSFactory, and ZippedOffset.
| Buffer< UUID > IOFactory::readFileWithDefaultSettings | ( | const File & | file, |
| DesignObjectLookup * | lookup ) |
Reads a file using default settings and returns the UUIDs of the created models.
| [in] | file | The file to read from. |
| [in] | lookup | The DesignObjectLookup used to create and resolve design objects. |
| void IOFactory::throwIfNotEnabled | ( | bool | is_read | ) |
Throws an exception if the factory is not enabled for the given operation direction.
If isAutoEnabled() returns false and the system does not detect a valid password for the operation, an exception will be thrown.
| [in] | is_read | True to check read enablement, false to check write enablement. |
|
virtual |
Updates the factory parameters from a file, comparing against old options.
| [in] | file | The FactoryParameters to update. |
| [in] | old_options | The previous FactoryOptions to compare against. |
Reimplemented in ModelFactory.
|
privatepure virtual |
Writes data from the design object hierarchy to a file.
| [in] | file | The FactoryParameters describing the write operation. |
Implemented in AsciiFactory, AssimpFactory, CommandJSON, DNBJSONFactory, DVI3DSpreadsheetFactory, DXFFactory, E57Factory, GeoSlamFactory, GeoTiffFactory, IredesPatternFactory, KMLFactory, LandXMLFactory, LASFactory, LASPerformanceFactory, MagneticCalibrationFactory, ModelFactory, NDVFactory, OMFFactory, OWLFactory, PDFFactory, QuickbooksFactory, RockWorksFactory, SceneDump, SHPFactory, SketchupFactory, UnityAssetFactory, XLXSFactory, and ZippedOffset.
Writes a buffer of scenes to a file.
| [in] | file | The file to write to. |
| [in] | scene | The buffer of Scene objects to write. |