COLLADA 1.4 DOM: daeInterface Class Reference

COLLADA

daeInterface Class Reference

#include <daeInterface.h>

Inheritance diagram for daeInterface:

Inheritance graph
[legend]
List of all members.

Detailed Description

The daeInterface class provides an interface with the COLLADA runtime database.

Public Member Functions

virtual ~daeInterface ()
 Destructor.
Database setup
management of the database that stores the COLLADA elements.

virtual daeDatabasegetDatabase ()=0
 Gets the COLLADA runtime database currently being used.
virtual daeInt setDatabase (daeDatabase *database)=0
 Sets the COLLADA runtime database to use.
IOPlugin setup
handle the backend, which can import or export the COLLADA database to a file system, to a runtime or to any other storage system.

virtual daeIOPlugingetIOPlugin ()=0
 Gets the daeIOPlugin currently set.
virtual daeInt setIOPlugin (daeIOPlugin *plugin)=0
 Sets the plugin which will be the interface between the COLLADA runtime database and the rest of the system.
Integration Library Setup
definition of an integration library to use when processing COLLADA file. It defines a framework for a user to insert a source code that will be called in the context of an import or export. Hence, it's the preferred way of accessing COLLADA runtime structure and convert between COLLADA and the user's runtime.

virtual daeIntegrationLibraryFunc getIntegrationLibrary ()=0
 Gets the integration library register function currently being used.
virtual daeInt setIntegrationLibrary (daeIntegrationLibraryFunc regFunc)=0
 Sets the integration library register function.
Batch import/export operations
import or export a COLLADA database by using the daeIOPlugin currently set.

virtual daeInt load (daeString name, daeString docBuffer=NULL)=0
 Loads a COLLADA document into the runtime database.
virtual daeInt save (daeString collectionName, daeBool replace=true)=0
 Saves a single collection/document back to the location it was loaded from.
virtual daeInt save (daeUInt collectionIndex=0, daeBool replace=true)=0
 Saves a single collection/document back to the location it was loaded from.
virtual daeInt saveAs (daeString name, daeString collectionName, daeBool replace=true)=0
 Saves a single collection/document from the runtime database by name.
virtual daeInt saveAs (daeString name, daeUInt collectionIndex=0, daeBool replace=true)=0
 Saves a single collection/document from the runtime database by index.
virtual daeInt unload (daeString name)=0
 Unloads a specific collection from the runtime database.
virtual daeInt clear ()=0
 Unloads all the collections of the runtime database.
Import/export progress
virtual void getProgress (daeInt *bytesParsed, daeInt *lineNumber, daeInt *totalBytes, daeBool reset=false)=0
 Gets the progress of load() operation.
Main DOM Query
virtual domCOLLADAgetDom (daeString name)=0
 Gets the COLLADA tree root of a given collection.
virtual daeString getDomVersion ()=0
 Gets the COLLADA schema version that was used to build the DOM classes.
virtual daeInt setDom (daeString name, domCOLLADA *dom)=0
 Sets or inserts a COLLADA tree into the database.

Member Function Documentation

virtual daeInt daeInterface::clear  )  [pure 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.

Implemented in DAE.

virtual daeDatabase* daeInterface::getDatabase  )  [pure virtual]
 

Gets the COLLADA runtime database currently being used.

Returns:
Returns the database currently being used.

Implemented in DAE.

virtual domCOLLADA* daeInterface::getDom daeString  name  )  [pure 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.

Implemented in DAE.

virtual daeString daeInterface::getDomVersion  )  [pure 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)

Implemented in DAE.

virtual daeIntegrationLibraryFunc daeInterface::getIntegrationLibrary  )  [pure virtual]
 

Gets the integration library register function currently being used.

Returns:
Returns the integration library register function currently being used.

Implemented in DAE.

virtual daeIOPlugin* daeInterface::getIOPlugin  )  [pure virtual]
 

Gets the daeIOPlugin currently set.

Returns:
Returns the daeIOPlugin currently set on the interface.

Implemented in DAE.

virtual void daeInterface::getProgress daeInt *  bytesParsed,
daeInt *  lineNumber,
daeInt *  totalBytes,
daeBool  reset = false
[pure 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.

Implemented in DAE.

virtual daeInt daeInterface::load daeString  name,
daeString  docBuffer = NULL
[pure 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.

Implemented in DAE.

virtual daeInt daeInterface::save daeUInt  collectionIndex = 0,
daeBool  replace = true
[pure 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.

Implemented in DAE.

virtual daeInt daeInterface::save daeString  collectionName,
daeBool  replace = true
[pure 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.

Implemented in DAE.

virtual daeInt daeInterface::saveAs daeString  name,
daeUInt  collectionIndex = 0,
daeBool  replace = true
[pure 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.

Implemented in DAE.

virtual daeInt daeInterface::saveAs daeString  name,
daeString  collectionName,
daeBool  replace = true
[pure 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.

Implemented in DAE.

virtual daeInt daeInterface::setDatabase daeDatabase database  )  [pure 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.

Implemented in DAE.

virtual daeInt daeInterface::setDom daeString  name,
domCOLLADA dom
[pure 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.

Implemented in DAE.

virtual daeInt daeInterface::setIntegrationLibrary daeIntegrationLibraryFunc  regFunc  )  [pure 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.

Implemented in DAE.

virtual daeInt daeInterface::setIOPlugin daeIOPlugin plugin  )  [pure 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.

Implemented in DAE.

virtual daeInt daeInterface::unload daeString  name  )  [pure 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.

Implemented in DAE.


The documentation for this class was generated from the following file:
  • C:/SVN_wf/COLLADA_DOM/include/dae/daeInterface.h

©2005 Sony Computer Entertainment Inc.. All Rights Reserved.
Generated on Fri Feb 10 16:47:00 2006 for COLLADA 1.4 DOM by doxygen 1.4.3