DzImportMgr Class Reference
[Manager ObjectsFile Input and Output Objects]

Manager of all scene file importer classes. More...

Inheritance diagram for DzImportMgr:

QObject Object List of all members.

Methods

Boolean canImport (String filename)
DzImporter findImporter (String filename)
DzImporter findImporterByClassName (String className)
Number findImporterIndex (String filename)
String getImportFileName ()
String getImportPath () const
Number getNumImporters ()
void makeGeometryFileFilter (DzFileFilter filter, String defaultFilter="", Boolean makeAllFilesEntry=true)
void makeImportFileFilter (DzFileFilter filter, String defaultFilter="", Boolean makeAllFilesEntry=true)
DzError readFile (String filename, Number importerIdx, DzFileIOSettings options)
DzError readFile (String filename, Number importerIdx=-1)
DzShape readGeometry (String filename, Number importerIdx, DzFileIOSettings options)
DzShape readGeometry (String filename, Number importerIdx=-1)
void setImportFileName (String fileName)
void setImportPath (String path)

Signals

void fileImported ()
 Signature: "fileImported()"
void fileImportStarting ()
 Signature: "fileImportStarting()"

Detailed Description

Manager of all scene file importer classes.

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().


Member Function Documentation

Boolean DzImportMgr::canImport ( String  filename  ) 

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

Parameters:
filename The name of the file to try to find an importer for.
Returns:
true if an importer was found that can read the given file.

void DzImportMgr::fileImported (  )  [signal]

Signature: "fileImported()"

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

void DzImportMgr::fileImportStarting (  )  [signal]

Signature: "fileImportStarting()"

Emitted just before importing a file.

DzImporter DzImportMgr::findImporter ( String  filename  ) 

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

Parameters:
filename The name of the file to try to find an importer for.
Returns:
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 DzImportMgr::findImporterByClassName ( String  className  ) 

Attempts to locate an importer class type by name.

Parameters:
className The class name of the importer to find.
Returns:
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 DzImportMgr::findImporterIndex ( String  filename  ) 

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

Parameters:
filename The name of the file to try to find an importer for.
Returns:
The index of a matching importer, or -1 if none was found.

String DzImportMgr::getImportFileName (  ) 

Gets the full import file name.

Returns:
The full import file name.

QString DzImportMgr::getImportPath (  )  const

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.

Returns:
The default import directory.

int DzImportMgr::getNumImporters (  ) 

Returns:
The number of importers currently supported.

void DzImportMgr::makeGeometryFileFilter ( DzFileFilter  filter,
String  defaultFilter = "",
Boolean  makeAllFilesEntry = true 
)

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

Parameters:
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 DzImportMgr::makeImportFileFilter ( DzFileFilter  filter,
String  defaultFilter = "",
Boolean  makeAllFilesEntry = true 
)

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

Parameters:
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 DzImportMgr::readFile ( String  filename,
Number  importerIdx,
DzFileIOSettings  options 
)

Import the contents of a file into the scene.

Parameters:
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.
Returns:
DZ_NO_ERROR if the file import was successfull.

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

Import the contents of a file into the scene.

Parameters:
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.
Returns:
DZ_NO_ERROR if the file import was successfull.

DzShape DzImportMgr::readGeometry ( String  filename,
Number  importerIdx,
DzFileIOSettings  options 
)

Reads the geometry file into a new shape.

Parameters:
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.
Returns:
The new shape that the geometry was read into, NULL on failure.

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

Reads the geometry file into a new shape.

Parameters:
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.
Returns:
The new shape that the geometry was read into, NULL on failure.

void DzImportMgr::setImportFileName ( String  fileName  ) 

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

Parameters:
path The full file name .

void DzImportMgr::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.

Parameters:
path The new default import directory.


Generated on Thu Sep 24 12:21:12 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.