User Tools

Site Tools


DzImportMgr

Manager of all scene file importer classes.

More...

Inherits :

Methods

DAZ Script
BooleancanImport ( String filename )
DzImporterfindImporter ( String filename )
DzImporterfindImporterByClassName ( String className )
NumberfindImporterIndex ( String filename )
StringgetImportFileName ()
StringgetImportPath ()
NumbergetNumImporters ()
BooleanisImporting ()
voidmakeGeometryFileFilter ( DzFileFilter filter, String defaultFilter=“”, Boolean makeAllFilesEntry=true )
voidmakeImportFileFilter ( DzFileFilter filter, String defaultFilter=“”, Boolean makeAllFilesEntry=true )
DzErrorreadFile ( String filename, Number importerIdx=-1 )
DzErrorreadFile ( String filename, Number importerIdx, DzFileIOSettings options )
shape_dzreadGeometry ( String filename, Number importerIdx, DzFileIOSettings options )
shape_dzreadGeometry ( String filename, Number importerIdx=-1 )
voidsetImportFileName ( String fileName )
voidsetImportPath ( String path )

Signals

Detailed Description

There is only one instance of this manager in an application. This instance is created and owned by DzApp. Don't create an instance of this class, but rather request a pointer to it from DzApp via DzApp::getImportMgr().

See Also:

Methods


Boolean : canImport( String filename )

Calls recognize() on each of the importers and attempts to match an importer with the filename.

Parameter(s):

  • filename - The name of the file to try to find an importer for.

Return Value:

  • true if an importer was found that can read the given file.

DzImporter : findImporter( String filename )

Calls recognize() on each of the importers and attempts to match an importer with the filename.

Parameter(s):

  • filename - The name of the file to try to find an importer for.

Return Value:

  • A new instance of the matching importer, or NULL if none was found. The caller takes ownership of this pointer and is responsible for deleting it.

DzImporter : findImporterByClassName( String className )

Attempts to locate an importer class type by name.

Parameter(s):

  • className - The class name of the importer to find.

Return Value:

  • A new instance of the matching importer, or NULL if none was found. The caller takes ownership of this pointer and is responsible for deleting it.

Number : findImporterIndex( String filename )

Calls recognize() on each of the importers and attempts to match an importer with the filename.

Parameter(s):

  • filename - The name of the file to try to find an importer for.

Return Value:

  • The index of a matching importer, or -1 if none was found.

String : getImportFileName()

Gets the full import file name.

Return Value:

  • The full import file name.

String : getImportPath()

Gets the default import directory - this is typically the last directory that the user imported a file from, and will be the directory that user will be taken to next time the file import dialog is displayed.

Return Value:

  • The default import directory.

Number : getNumImporters()

Return Value:

  • The number of importers currently supported.

Boolean : isImporting()

Return Value:

  • True if there is currently a file being imported, false otherwise.

void : makeGeometryFileFilter( DzFileFilter filter, String defaultFilter=“”, Boolean makeAllFilesEntry=true )

Populates the given filter with all the geometry types recognized by the import manager.

Parameter(s):

  • filter - The filter to populate
  • defaultFilter - The filter to set as the default
  • makeAllFilesEntry - If true, an extra filter is appended to the list that matches all the valid extensions.

void : makeImportFileFilter( DzFileFilter filter, String defaultFilter=“”, Boolean makeAllFilesEntry=true )

Populates the given filter with all the types recognized by the import manager.

Parameter(s):

  • filter - The filter to populate
  • defaultFilter - The filter to set as the default
  • makeAllFilesEntry - If true, an extra filter is appended to the list that matches all the valid extensions.

DzError : readFile( String filename, Number importerIdx=-1 )

Import the contents of a file into the scene.

Parameter(s):

  • filename - The name of the file to import. This must be the full filename including the path to the file.
  • importerIdx - The index of the importer class to use. If this is less than 0, then the recognize function of the importer classes will be called with the fileName to attempt to find an appropiate importer.
  • filer - The fileload filter for this type of import defaults to NULL

Return Value:

  • DZ_NO_ERROR if the file import was successfull.

DzError : readFile( String filename, Number importerIdx, DzFileIOSettings options )

Import the contents of a file into the scene.

Parameter(s):

  • filename - The name of the file to import. This must be the full filename including the path to the file.
  • importerIdx - The index of the importer class to use. If this is less than 0, then the recognize function of the importer classes will be called with the fileName to attempt to find an appropiate importer.
  • filer - The fileload filter for this type of import defaults to NULL

Return Value:

  • DZ_NO_ERROR if the file import was successfull.

shape_dz : readGeometry( String filename, Number importerIdx, DzFileIOSettings options )

Reads the geometry file into a new shape.

Parameter(s):

  • filename - The full path of the file to import.
  • importerIdx - The index of the importer to use, if invalid (<0) the file's extension will be used to select an appropriate importer.

Return Value:

  • The new shape that the geometry was read into, NULL on failure.

shape_dz : readGeometry( String filename, Number importerIdx=-1 )

Reads the geometry file into a new shape.

Parameter(s):

  • filename - The full path of the file to import.
  • importerIdx - The index of the importer to use, if invalid (<0) the file's extension will be used to select an appropriate importer.

Return Value:

  • The new shape that the geometry was read into, NULL on failure.

void : setImportFileName( String fileName )

Sets the import file name - this is the full file name that file was import

Parameter(s):

  • path - The full file name .

void : setImportPath( String path )

Sets the default import directory - this is the directory that user will be taken to next time the file import dialog is displayed.

Parameter(s):

  • path - The new default import directory.

Signals


void : fileImported()

Signature:“fileImported()”

Emitted after importing a file. This may not always be emitted after every fileImportStarting() signal if there were errors during file loading.

TODO: Add description.


void : fileImportStarting()

Signature:“fileImportStarting()”

Emitted just before importing a file.

TODO: Add description.