![]() |
NDEVR
API Documentation
|
Reads and writes NDV files. More...
Public Member Functions | |
| virtual bool | canRead (const FactoryParameters &file) override |
| Checks whether this factory can read the file described by the given parameters. | |
| virtual bool | canWrite (const FactoryParameters &file) override |
| Checks whether this factory can write the file described by the given parameters. | |
| virtual bool | canWrite (const FileFormat &file) override |
| Checks whether this factory can write files in the given format. | |
| FactoryOptions | defaultReadOptions (const FactoryParameters &file) const override |
| Returns the default read options for the given file parameters. | |
| FactoryOptions | defaultWriteOptions (const FactoryParameters &file) const override |
| Returns the default write options for the given file parameters. | |
| virtual bool | determineExtension (const File &file, String &extension) override |
| Attempts to determine the file extension for the given file. | |
| FactoryFeatures | factoryFeatures (const FactoryParameters &file, bool is_import) const override |
| Returns the feature set supported by this factory for the given parameters. | |
| String | getIcon (const File &file) override |
| Returns the icon associated with the given file. | |
| virtual void | getSupportedFormats (Buffer< FileFormat > &formats, bool is_read) override |
| Populates the given buffer with the file formats supported by this factory. | |
| virtual bool | readFile (FactoryParameters ¶ms) override |
| Reads an NDV file and populates the factory parameters with the resulting model data. | |
| uint08 | version (const File &file) |
| Returns the NDV format version stored in the given file. | |
| virtual bool | writeFile (FactoryParameters ¶ms) override |
| Writes model data to an NDV file as described by the factory parameters. | |
| Public Member Functions inherited from IOFactory | |
| IOFactory (const StringView &factory_name) | |
| Constructs an IOFactory with the given factory name. | |
| virtual | ~IOFactory () |
| Virtual destructor. | |
| 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 File &file) |
| Checks whether this factory can write the given file. | |
| 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. | |
| void | getSupportedFormats (Buffer< FileFormat > &formats) |
| Populates the given buffer with all supported file formats (both read and write). | |
| 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 | AddSetupCallback (NDVSetupCallback *callback) |
| Registers an NDVSetupCallback to be invoked during NDV file import. | |
| static uint08 | CurrentVersion () |
| Returns the current NDV format version used by this factory for writing. | |
| static NDVFactory & | DefaultFactory () |
| Returns the singleton NDVFactory instance. | |
| static FileFormat | NDVFormat () |
| Returns the FileFormat descriptor for the NDV file format. | |
| static String | ReadData (const File &file) |
| Reads raw data content from an NDV file as a String. | |
| static String | ReadIcon (const File &file, ImageFactory &factory) |
| Reads the icon resource embedded in an NDV file. | |
| static void | RemoveSetupCallback (NDVSetupCallback *callback) |
| Unregisters a previously added NDVSetupCallback. | |
| Static Public Member Functions inherited from IOFactory | |
| 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. | |
Protected Member Functions | |
| NDVFactory () | |
| Protected constructor. | |
Reads and writes NDV files.
NDV files are optionally compressed data dumps of the internal structure of model hierarchies.
NDVSetupCallbacks can be used to modify objects when they are imported.
Definition at line 73 of file NDVFactory.h.
|
protected |
Protected constructor.
Use DefaultFactory() to obtain the singleton instance.
Referenced by DefaultFactory().
|
static |
Registers an NDVSetupCallback to be invoked during NDV file import.
| [in] | callback | The callback to add. |
|
overridevirtual |
Checks whether this factory can read the file described by the given parameters.
| [in] | file | The factory parameters describing the file to check. |
Reimplemented from IOFactory.
|
overridevirtual |
Checks whether this factory can write the file described by the given parameters.
| [in] | file | The factory parameters describing the file to check. |
Reimplemented from IOFactory.
|
overridevirtual |
Checks whether this factory can write files in the given format.
| [in] | file | The FileFormat to check. |
Reimplemented from IOFactory.
|
static |
Returns the current NDV format version used by this factory for writing.
|
static |
Returns the singleton NDVFactory instance.
References NDVFactory().
Referenced by TransitIncidentManager::readCache(), and TransitIncidentManager::saveCache().
|
overridevirtual |
Returns the default read options for the given file parameters.
| [in] | file | The factory parameters describing the file context. |
Reimplemented from IOFactory.
|
overridevirtual |
Returns the default write options for the given file parameters.
| [in] | file | The factory parameters describing the file context. |
Reimplemented from IOFactory.
|
overridevirtual |
Attempts to determine the file extension for the given file.
| [in] | file | The file to examine. |
| [in] | extension | Receives the determined extension string on success. |
Reimplemented from IOFactory.
|
overridevirtual |
Returns the feature set supported by this factory for the given parameters.
| [in] | file | The factory parameters describing the file context. |
| [in] | is_import | Whether the operation is an import (true) or export (false). |
Implements IOFactory.
|
overridevirtual |
Populates the given buffer with the file formats supported by this factory.
| [in] | formats | The buffer to populate with supported FileFormat entries. |
| [in] | is_read | Whether to return formats supported for reading (true) or writing (false). |
Implements IOFactory.
|
static |
Returns the FileFormat descriptor for the NDV file format.
Referenced by TransitIncidentManager::readCache(), and TransitIncidentManager::saveCache().
|
overridevirtual |
Reads an NDV file and populates the factory parameters with the resulting model data.
| [in] | params | The factory parameters containing the file to read and receiving the output. |
Implements IOFactory.
Referenced by TransitIncidentManager::readCache().
|
static |
Reads the icon resource embedded in an NDV file.
| [in] | file | The NDV file to read the icon from. |
| [in] | factory | The ImageFactory used to decode the icon data. |
|
static |
Returns the NDV format version stored in the given file.
| [in] | file | The NDV file to query. |
|
overridevirtual |
Writes model data to an NDV file as described by the factory parameters.
| [in] | params | The factory parameters containing the models and target file. |
Implements IOFactory.
Referenced by TransitIncidentManager::saveCache().