API Documentation
Loading...
Searching...
No Matches
ModelFactory Class Reference

The core logic for importing and exporting files from the model heirarchy. Stores a series of IOFactory children that can define when and how they are able to export or import data. More...

#include <ModelFactory.h>

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

Public Member Functions

void addFactory (IOFactory *factory)
 
void addFactory (String extension, IOFactory *factory)
 
virtual bool canRead (const FactoryParameters &file) override
 
virtual bool canRead (const File &file) override
 
virtual bool canWrite (const FactoryParameters &file) override
 
virtual bool canWrite (const File &file) override
 
void clearFactories ()
 
virtual FactoryOptions defaultReadOptions (const FactoryParameters &file) const override
 
virtual FactoryOptions defaultWriteOptions (const FactoryParameters &file) const override
 
virtual bool determineExtension (const File &file, String &extension) override
 
void enableExtension (String extension, const String &read_password, const String &write_password)
 
void enableFactory (const String &factory, const String &read_password, const String &write_password)
 
void enableFactory (IOFactory *factory, const String &read_password, const String &write_password)
 
FactoryFeatures factoryFeatures (const FactoryParameters &file, bool is_import) const override
 
virtual Buffer< UUIDfilterModelsToExport (Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, const FileFormat &export_format) const override
 
virtual String getIcon (const File &file) override
 
virtual void getSupportedFormats (Buffer< FileFormat > &formats, bool is_read) override
 
virtual void getSupportedFormats (Buffer< FileFormat > &formats, const File &file) override
 
virtual void getSupportedFormats (Buffer< FileFormat > &formats, DesignObjectLookup *lookup, const Buffer< UUID > &models) override
 
virtual void getSupportedFormatsByModelType (Buffer< FileFormat > &formats, bool is_read, const String &model_type) override
 
virtual bool readFile (FactoryParameters &file) override
 
virtual bool updateFromFile (const FactoryParameters &file, const FactoryOptions &old_options) override
 
virtual bool writeFile (FactoryParameters &file) override
 
- Public Member Functions inherited from IOFactory
virtual bool canRead (const FileFormat &file)
 
virtual bool canWrite (const FileFormat &file)
 
String factoryReadAppFeature () const
 
String factoryWriteAppFeature () const
 
void getSupportedFormats (Buffer< FileFormat > &formats)
 
virtual void getSupportedFormatsForExtension (Buffer< FileFormat > &formats, bool is_read, const String &extension)
 
 IOFactory (const String &factory_name)
 
virtual bool isAutoEnabled () const
 
virtual bool isFactoryEnabled (bool is_read) const
 
const Stringname () const
 
bool readFileWithDefaultSettings (const File &file, DesignObjectLookup *lookup)
 
Buffer< ScenereadScenesFromFile (const File &file)
 
void throwIfNotEnabled (bool is_read)
 
bool writeScenesToFile (const File &file, const Buffer< Scene > &scene)
 
virtual ~IOFactory ()
 

Static Public Member Functions

static ModelFactoryDefaultFactory ()
 
- Static Public Member Functions inherited from IOFactory
static void EnableExtension (const String &extension, const String &read_password, const String &write_password)
 
static void EnableFactory (const String &factory, const String &read_password, const String &write_password)
 
static void EnableFactory (IOFactory *factory, const String &read_password, const String &write_password)
 

Protected Member Functions

 ModelFactory ()
 
 ~ModelFactory ()
 

Protected Attributes

Dictionary< String, IOFactory * > m_extension_factories
 
Dictionary< String, Stringm_extension_read_passwords
 
Dictionary< String, Stringm_extension_write_passwords
 
Buffer< IOFactory * > * m_factory_objects
 
Dictionary< String, IOFactory * > m_named_factories
 

Detailed Description

The core logic for importing and exporting files from the model heirarchy. Stores a series of IOFactory children that can define when and how they are able to export or import data.


Based on options will select the proper IOFactory to perform the import or export task.

Constructor & Destructor Documentation

◆ ModelFactory()

ModelFactory ( )
protected

◆ ~ModelFactory()

~ModelFactory ( )
protected

Member Function Documentation

◆ addFactory() [1/2]

void addFactory ( IOFactory * factory)

◆ addFactory() [2/2]

void addFactory ( String extension,
IOFactory * factory )

◆ canRead() [1/2]

virtual bool canRead ( const FactoryParameters & file)
overridevirtual

Reimplemented from IOFactory.

◆ canRead() [2/2]

virtual bool canRead ( const File & file)
overridevirtual

Reimplemented from IOFactory.

◆ canWrite() [1/2]

virtual bool canWrite ( const FactoryParameters & file)
overridevirtual

Reimplemented from IOFactory.

◆ canWrite() [2/2]

virtual bool canWrite ( const File & file)
overridevirtual

Reimplemented from IOFactory.

◆ clearFactories()

void clearFactories ( )

◆ DefaultFactory()

static ModelFactory & DefaultFactory ( )
static

◆ defaultReadOptions()

virtual FactoryOptions defaultReadOptions ( const FactoryParameters & file) const
overridevirtual

Reimplemented from IOFactory.

◆ defaultWriteOptions()

virtual FactoryOptions defaultWriteOptions ( const FactoryParameters & file) const
overridevirtual

Reimplemented from IOFactory.

◆ determineExtension()

virtual bool determineExtension ( const File & file,
String & extension )
overridevirtual

Reimplemented from IOFactory.

◆ enableExtension()

void enableExtension ( String extension,
const String & read_password,
const String & write_password )

◆ enableFactory() [1/2]

void enableFactory ( const String & factory,
const String & read_password,
const String & write_password )

◆ enableFactory() [2/2]

void enableFactory ( IOFactory * factory,
const String & read_password,
const String & write_password )

◆ factoryFeatures()

FactoryFeatures factoryFeatures ( const FactoryParameters & file,
bool is_import ) const
overridevirtual

Implements IOFactory.

◆ filterModelsToExport()

virtual Buffer< UUID > filterModelsToExport ( Buffer< UUID > models_to_check,
const DesignObjectLookup * lookup,
const FileFormat & export_format ) const
overridevirtual

Reimplemented from IOFactory.

◆ getIcon()

virtual String getIcon ( const File & file)
overridevirtual

Reimplemented from IOFactory.

◆ getSupportedFormats() [1/3]

virtual void getSupportedFormats ( Buffer< FileFormat > & formats,
bool is_read )
overridevirtual

Implements IOFactory.

◆ getSupportedFormats() [2/3]

virtual void getSupportedFormats ( Buffer< FileFormat > & formats,
const File & file )
inlineoverridevirtual

Reimplemented from IOFactory.

◆ getSupportedFormats() [3/3]

virtual void getSupportedFormats ( Buffer< FileFormat > & formats,
DesignObjectLookup * lookup,
const Buffer< UUID > & models )
overridevirtual

Reimplemented from IOFactory.

◆ getSupportedFormatsByModelType()

virtual void getSupportedFormatsByModelType ( Buffer< FileFormat > & formats,
bool is_read,
const String & model_type )
overridevirtual

Reimplemented from IOFactory.

◆ readFile()

virtual bool readFile ( FactoryParameters & file)
overridevirtual

Implements IOFactory.

◆ updateFromFile()

virtual bool updateFromFile ( const FactoryParameters & file,
const FactoryOptions & old_options )
overridevirtual

Reimplemented from IOFactory.

◆ writeFile()

virtual bool writeFile ( FactoryParameters & file)
overridevirtual

Implements IOFactory.

Member Data Documentation

◆ m_extension_factories

Dictionary<String, IOFactory*> m_extension_factories
protected

◆ m_extension_read_passwords

Dictionary<String, String> m_extension_read_passwords
protected

◆ m_extension_write_passwords

Dictionary<String, String> m_extension_write_passwords
protected

◆ m_factory_objects

Buffer<IOFactory*>* m_factory_objects
protected

◆ m_named_factories

Dictionary<String, IOFactory*> m_named_factories
protected

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