DAE Class Reference
#include <dae.h>
Inheritance diagram for DAE:
[legend]Collaboration diagram for DAE:
[legend]List of all members.
Detailed Description
The
DAE
class implements a standard interface to the COLLADA runtime database.
DAE
serves as a wrapper for the entire pipeline ensuring a consistent interface, regardless of extensions to or replacements for the various API components. It provides methods to load, store, translate and query COLLADA elements. A DAE
object automatically creates and initializes default versions of the COLLADA backend, the COLLADA runtime database, and registered integration libraries.
|
Public Member Functions |
| DAE () |
| Constructor.
|
virtual | ~DAE () |
| Destructor.
|
virtual daeDatabase * | getDatabase () |
| Gets the COLLADA runtime database currently being used.
|
virtual daeInt | setDatabase (daeDatabase *database) |
| Sets the COLLADA runtime database to use.
|
virtual daeIOPlugin * | getIOPlugin () |
| Gets the daeIOPlugin currently set.
|
virtual daeInt | setIOPlugin (daeIOPlugin *plugin) |
| Sets the plugin which will be the interface between the COLLADA runtime database and the rest of the system.
|
virtual daeIntegrationLibraryFunc | getIntegrationLibrary () |
| Gets the integration library register function currently being used.
|
virtual daeInt | setIntegrationLibrary (daeIntegrationLibraryFunc regFunc) |
| Sets the integration library register function.
|
virtual daeInt | load (daeString name, daeString docBuffer=NULL) |
| Loads a COLLADA document into the runtime database.
|
virtual daeInt | save (daeString collectionName, daeBool replace=true) |
| Saves a single collection/document back to the location it was loaded from.
|
virtual daeInt | save (daeUInt collectionIndex, daeBool replace=true) |
| Saves a single collection/document back to the location it was loaded from.
|
virtual daeInt | saveAs (daeString name, daeString collectionName, daeBool replace=true) |
| Saves a single collection/document from the runtime database by name.
|
virtual daeInt | saveAs (daeString name, daeUInt collectionIndex=0, daeBool replace=true) |
| Saves a single collection/document from the runtime database by index.
|
virtual daeInt | unload (daeString name) |
| Unloads a specific collection from the runtime database.
|
virtual daeInt | clear () |
| Unloads all the collections of the runtime database.
|
virtual void | getProgress (daeInt *bytesParsed, daeInt *lineNumber, daeInt *totalBytes, daeBool reset=false) |
| Gets the progress of load() operation.
|
virtual domCOLLADA * | getDom (daeString name) |
| Gets the COLLADA tree root of a given collection.
|
virtual daeString | getDomVersion () |
| Gets the COLLADA schema version that was used to build the DOM classes.
|
virtual daeInt | setDom (daeString name, domCOLLADA *dom) |
| Sets or inserts a COLLADA tree into the database.
|
Static Public Member Functions |
static void | cleanup () |
| Before exiting an application, call cleanup() to release all static meta information associated with the COLLADA api.
|
Member Function Documentation
void DAE::cleanup |
( |
|
) |
[static] |
|
|
Before exiting an application, call cleanup() to release all static meta information associated with the COLLADA api.
The daeMetaElement::releaseMetas() and daeAtomicType::uninitializeKnownTypes() functions are called if there are no remaining instances of a DAE . - Note:
- This function is useless when called by the application in a non-static context. It should be called after you delete your DAE object.
|
daeInt DAE::clear |
( |
|
) |
[virtual] |
|
|
Unloads all the collections of the runtime database.
This function frees all the dom* objects and integration objects created so far, except the object on which the user still has a smart pointer reference. - Returns:
- Returns DAE_OK if all collections unloaded successfully, otherwise returns a negative value as defined in daeError.h.
Implements daeInterface. |
|
Gets the COLLADA runtime database currently being used.
- Returns:
- Returns the database currently being used.
Implements daeInterface. |
domCOLLADA * DAE::getDom |
( |
daeString |
name |
) |
[virtual] |
|
|
Gets the COLLADA tree root of a given collection.
- Parameters:
-
| name | Collection name, for the file daeIOPlugin , this will be the filename for a file. |
- Returns:
- Returns the
domCOLLADA root object of the collection, or NULL if the collection is not found.
Implements daeInterface. |
daeString DAE::getDomVersion |
( |
|
) |
[virtual] |
|
|
Gets the COLLADA schema version that was used to build the DOM classes.
- Returns:
- a text string with the version number in it (ie: 1.3.1)
Implements daeInterface. |
daeIntegrationLibraryFunc DAE::getIntegrationLibrary |
( |
|
) |
[virtual] |
|
|
Gets the integration library register function currently being used.
- Returns:
- Returns the integration library register function currently being used.
Implements daeInterface. |
void DAE::getProgress |
( |
daeInt * |
bytesParsed, |
|
|
daeInt * |
lineNumber, |
|
|
daeInt * |
totalBytes, |
|
|
daeBool |
reset = false |
|
) |
[virtual] |
|
|
Gets the progress of load() operation.
This function can be used from another thread to check the progress of a load() operation. The user can update a progress bar bytesParsed/totalBytes gives the percentage of progress of the operation. - Parameters:
-
| bytesParsed | Pointer to an integer that receives the number of bytes already consumed from the file, can be NULL if the user don't want to retrieve this information. |
| lineNumber | Pointer to an integer that receives the number of lines read so far, can be NULL. |
| totalBytes | Pointer to an integer that receives the total number of bytes in the file currently being loaded, can be NULL. |
| reset | Indicates whether to reset the counters. A value of false is the default behavior that fits most usage. Set it to true to reset the bytesParsed and lineNumber counters. The system resets the counter at the beginning of each file. |
Implements daeInterface. |
daeInt DAE::load |
( |
daeString |
name, |
|
|
daeString |
docBuffer = NULL |
|
) |
[virtual] |
|
|
Loads a COLLADA document into the runtime database.
- Parameters:
-
| name | the document to load. The format for this is defined by the IO plugin being used, in most cases this will be an rfc 2396 compliant relative or absolute URI. Please check the class documentation for the IO plugin you are using for specific restrictions. Not all IO plugins support all types of URIs. |
| docBuffer | A string containing the text of the document to load. This is an optional attribute and should only be used if the document has already been loaded into memory. |
- Returns:
- Returns DAE_OK if success, a negative value defined in daeError.h otherwise.
Implements daeInterface. |
daeInt DAE::save |
( |
daeUInt |
collectionIndex, |
|
|
daeBool |
replace = true |
|
) |
[virtual] |
|
|
Saves a single collection/document back to the location it was loaded from.
- Parameters:
-
| collectionIndex | the index of a loaded collection to be saved. |
| replace | If set to false, save won't save over top of an existing document and will return a DAE_ERR_BACKEND_FILE_EXISTS error. |
- Returns:
- Returns DAE_OK if success, a negative value defined in daeError.h otherwise.
Implements daeInterface. |
daeInt DAE::save |
( |
daeString |
collectionName, |
|
|
daeBool |
replace = true |
|
) |
[virtual] |
|
|
Saves a single collection/document back to the location it was loaded from.
- Parameters:
-
| collectionName | the name of the loaded collection to be saved, in most cases this will be an rfc 2396 compliant URI but some IO plugins may work differently. Please check the class documentation for the IO plugin you are using for specific restrictions. |
| replace | If set to false, save won't save over top of an existing document and will return a DAE_ERR_BACKEND_FILE_EXISTS error. |
- Returns:
- Returns DAE_OK if success, a negative value defined in daeError.h otherwise.
Implements daeInterface. |
daeInt DAE::saveAs |
( |
daeString |
name, |
|
|
daeUInt |
collectionIndex = 0 , |
|
|
daeBool |
replace = true |
|
) |
[virtual] |
|
|
Saves a single collection/document from the runtime database by index.
- Parameters:
-
| name | the name to save the document to. The format for this is defined by the IO plugin being used, in most cases this will be an rfc 2396 compliant relative or absolute URI. Please check the class documentation for the IO plugin you are using for specific restrictions. Not all IO plugins support all types of URIs. |
| collectionIndex | the index of the collection/document to save, 0 is the first document loaded...etc. Defaults to saving the first document loaded |
| replace | If set to false, saveAs won't save over top of an existing document and will return a DAE_ERR_BACKEND_FILE_EXISTS error. |
- Returns:
- Returns DAE_OK if success, a negative value defined in daeError.h otherwise.
Implements daeInterface. |
daeInt DAE::saveAs |
( |
daeString |
name, |
|
|
daeString |
collectionName, |
|
|
daeBool |
replace = true |
|
) |
[virtual] |
|
|
Saves a single collection/document from the runtime database by name.
- Parameters:
-
| name | the name to save the document to. The format for this is defined by the IO plugin being used, in most cases this will be an rfc 2396 compliant relative or absolute URI. Please check the class documentation for the IO plugin you are using for specific restrictions. Not all IO plugins support all types of URIs. |
| collectionName | the name of the collection/document to save. This is also defined by the IO plugin, in most cases this will be the URI of where the document was loaded from. |
| replace | If set to false, saveAs won't save over top of an existing document and will return a DAE_ERR_BACKEND_FILE_EXISTS error. |
- Returns:
- Returns DAE_OK if success, a negative value defined in daeError.h otherwise.
Implements daeInterface. |
daeInt DAE::setDatabase |
( |
daeDatabase * |
database |
) |
[virtual] |
|
|
Sets the COLLADA runtime database to use.
- Parameters:
-
| database | Database that stores the COLLADA data, if set to NULL a default database is set. |
- Returns:
- Returns
DAE_OK if success, otherwise, returns a negative error value as defined in daeError.h.
Implements daeInterface. |
daeInt DAE::setDom |
( |
daeString |
name, |
|
|
domCOLLADA * |
dom |
|
) |
[virtual] |
|
|
Sets or inserts a COLLADA tree into the database.
The system creates a default database if none is set and then creates a collection if the collection doesn't already exist. The collection keeps a reference on the daeElement , so you can then delete your own reference to the object safely. - Parameters:
-
| name | the collection name, may be an absolute or relative URI. The URI will be resolved to an absolute version and then compared with the absolute version of the collection's URI. If the URI contains a fragment, it is stripped out. |
| dom | Root tree. |
- Returns:
- Returns DAE_OK if success, otherwise returns a negative value as defined in daeError.h.
Implements daeInterface. |
daeInt DAE::setIntegrationLibrary |
( |
daeIntegrationLibraryFunc |
regFunc |
) |
[virtual] |
|
|
Sets the integration library register function.
- Parameters:
-
| regFunc | Integration library register function to use. |
- Returns:
- Returns DAE_OK if success, a negative value defined in daeError.h otherwise.
Implements daeInterface. |
daeInt DAE::setIOPlugin |
( |
daeIOPlugin * |
plugin |
) |
[virtual] |
|
|
Sets the plugin which will be the interface between the COLLADA runtime database and the rest of the system.
It can be used to read or write from a native XML file, to convert, or to store in a more complex structure like a storage database. - Parameters:
-
| plugin | Plugin to use, if set to NULL a default plugin is set. |
- Returns:
- Returns
DAE_OK if success, otherwise, returns a negative error value as defined in daeError.h.
Implements daeInterface. |
daeInt DAE::unload |
( |
daeString |
name |
) |
[virtual] |
|
|
Unloads a specific collection from the runtime database.
- Parameters:
-
| name | Name of the collection to remove. |
- Returns:
- Returns DAE_OK if unloaded successfully, otherwise returns a negative value as defined in daeError.h.
- Note:
- This function is not currently implemented.
Implements daeInterface. |
The documentation for this class was generated from the following files:
- C:/SVN_wf/COLLADA_DOM/include/dae.h
- C:/SVN_wf/COLLADA_DOM/src/dae/dae.cpp
©2005 Sony Computer Entertainment Inc.. All Rights Reserved.
Generated on Fri Feb 10 16:46:38 2006 for COLLADA 1.4 DOM by 1.4.3