API Documentation
Loading...
Searching...
No Matches
IOFactory Class Referenceabstract

A service that provides Import/Export functionality for a model heirarchy. These can be registered with a EnableFactory to allow the user to export/import to certain file formats. In order to provide support for new file formats, classes should overrdide this class and then add themselves using EnableFactory. More...

#include <IOFactory.h>

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

Public Member Functions

virtual bool canRead (const FactoryParameters &file)
 
virtual bool canRead (const File &file)
 
virtual bool canRead (const FileFormat &file)
 
virtual bool canWrite (const FactoryParameters &file)
 
virtual bool canWrite (const File &file)
 
virtual bool canWrite (const FileFormat &file)
 
virtual FactoryOptions defaultReadOptions (const FactoryParameters &file) const
 
virtual FactoryOptions defaultWriteOptions (const FactoryParameters &file) const
 
virtual bool determineExtension (const File &file, String &extension)
 
virtual FactoryFeatures factoryFeatures (const FactoryParameters &file, bool is_import) const =0
 
String factoryReadAppFeature () const
 
String factoryWriteAppFeature () const
 
virtual Buffer< UUIDfilterModelsToExport (Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, const FileFormat &export_format) const
 
virtual String getIcon (const File &file)
 
void getSupportedFormats (Buffer< FileFormat > &formats)
 
virtual void getSupportedFormats (Buffer< FileFormat > &formats, bool is_read)=0
 
virtual void getSupportedFormats (Buffer< FileFormat > &formats, const File &file)
 
virtual void getSupportedFormats (Buffer< FileFormat > &formats, DesignObjectLookup *lookup, const Buffer< UUID > &models)
 
virtual void getSupportedFormatsByModelType (Buffer< FileFormat > &formats, bool is_read, const String &model_type)
 
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)
 
virtual bool updateFromFile (const FactoryParameters &file, const FactoryOptions &old_options)
 
bool writeScenesToFile (const File &file, const Buffer< Scene > &scene)
 
virtual ~IOFactory ()
 

Static Public Member Functions

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)
 

Friends

class ModelFactory
 

Detailed Description

A service that provides Import/Export functionality for a model heirarchy. These can be registered with a EnableFactory to allow the user to export/import to certain file formats. In order to provide support for new file formats, classes should overrdide 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.

Constructor & Destructor Documentation

◆ IOFactory()

IOFactory ( const String & factory_name)

◆ ~IOFactory()

virtual ~IOFactory ( )
virtual

Member Function Documentation

◆ canRead() [1/3]

virtual bool canRead ( const FactoryParameters & file)
virtual

◆ canRead() [2/3]

virtual bool canRead ( const File & file)
virtual

Reimplemented in IredesPatternFactory, and ModelFactory.

◆ canRead() [3/3]

virtual bool canRead ( const FileFormat & file)
virtual

◆ canWrite() [1/3]

virtual bool canWrite ( const FactoryParameters & file)
virtual

Reimplemented in ModelFactory, NDVFactory, and PDFFactory.

◆ canWrite() [2/3]

virtual bool canWrite ( const File & file)
virtual

Reimplemented in ModelFactory, and PDFFactory.

◆ canWrite() [3/3]

virtual bool canWrite ( const FileFormat & file)
virtual

Reimplemented in NDVFactory, and PDFFactory.

◆ defaultReadOptions()

◆ defaultWriteOptions()

◆ determineExtension()

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

◆ EnableExtension()

static void EnableExtension ( const String & extension,
const String & read_password,
const String & write_password )
static

◆ EnableFactory() [1/2]

static void EnableFactory ( const String & factory,
const String & read_password,
const String & write_password )
static

◆ EnableFactory() [2/2]

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

◆ factoryFeatures()

◆ factoryReadAppFeature()

String factoryReadAppFeature ( ) const

◆ factoryWriteAppFeature()

String factoryWriteAppFeature ( ) const

◆ filterModelsToExport()

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

◆ getIcon()

virtual String getIcon ( const File & file)
virtual

◆ getSupportedFormats() [1/4]

void getSupportedFormats ( Buffer< FileFormat > & formats)

◆ getSupportedFormats() [2/4]

◆ getSupportedFormats() [3/4]

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

Reimplemented in ModelFactory.

◆ getSupportedFormats() [4/4]

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

Reimplemented in AsciiFactory, ModelFactory, and PDFFactory.

◆ getSupportedFormatsByModelType()

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

◆ getSupportedFormatsForExtension()

virtual void getSupportedFormatsForExtension ( Buffer< FileFormat > & formats,
bool is_read,
const String & extension )
virtual

◆ isAutoEnabled()

virtual bool isAutoEnabled ( ) const
virtual

◆ isFactoryEnabled()

virtual bool isFactoryEnabled ( bool is_read) const
virtual

◆ name()

const String & name ( ) const
inline

◆ readFileWithDefaultSettings()

bool readFileWithDefaultSettings ( const File & file,
DesignObjectLookup * lookup )

◆ readScenesFromFile()

Buffer< Scene > readScenesFromFile ( const File & file)

◆ throwIfNotEnabled()

void throwIfNotEnabled ( bool is_read)

◆ updateFromFile()

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

Reimplemented in ModelFactory.

◆ writeScenesToFile()

bool writeScenesToFile ( const File & file,
const Buffer< Scene > & scene )

Friends And Related Symbol Documentation

◆ ModelFactory

friend class ModelFactory
friend

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