#include <daeDatabase.h>

Public Member Functions | |
| virtual daeInt | changeElementID (daeElement *element, daeString newID)=0 |
| virtual daeInt | changeElementSID (daeElement *element, daeString newSID)=0 |
| virtual daeInt | clear ()=0 |
| daeInt | createCollection (daeString name, daeDocument **document=NULL) |
| daeInt | createCollection (daeString name, daeElement *dom, daeDocument **document=NULL) |
| virtual daeInt | createDocument (daeString name, daeDocument **document=NULL)=0 |
| virtual daeInt | createDocument (daeString name, daeElement *dom, daeDocument **document=NULL, bool zaeRootDocument=false, const std::string &extractedFileURI="")=0 |
| daeDatabase (DAE &dae) | |
| daeDocument * | getCollection (daeString name) |
| daeDocument * | getCollection (daeUInt index) |
| daeUInt | getCollectionCount () |
| daeString | getCollectionName (daeUInt index) |
| virtual DAE * | getDAE () |
| daeDocument * | getDoc (daeUInt index) |
| virtual daeDocument * | getDocument (daeString name, bool skipUriNormalization=false)=0 |
| virtual daeDocument * | getDocument (daeUInt index)=0 |
| virtual daeUInt | getDocumentCount ()=0 |
| virtual daeString | getDocumentName (daeUInt index)=0 |
| virtual daeInt | getElement (daeElement **pElement, daeInt index, daeString name=NULL, daeString type=NULL, daeString file=NULL)=0 |
| virtual daeUInt | getElementCount (daeString name=NULL, daeString type=NULL, daeString file=NULL)=0 |
| virtual daeUInt | getTypeCount ()=0 |
| virtual daeString | getTypeName (daeUInt index)=0 |
| daeElement * | idLookup (const std::string &id, daeDocument *doc) |
| virtual std::vector< daeElement * > | idLookup (const std::string &id)=0 |
| daeInt | insertCollection (daeDocument *c) |
| daeInt | insertCollection (daeString name, daeDocument **document=NULL) |
| daeInt | insertCollection (daeString name, daeElement *dom, daeDocument **document=NULL) |
| virtual daeInt | insertDocument (daeDocument *c)=0 |
| virtual daeInt | insertDocument (daeString name, daeDocument **document=NULL)=0 |
| virtual daeInt | insertDocument (daeString name, daeElement *dom, daeDocument **document=NULL, bool zaeRootDocument=false, const std::string &extractedFileURI="")=0 |
| virtual daeInt | insertElement (daeDocument *document, daeElement *element)=0 |
| daeBool | isCollectionLoaded (daeString name) |
| virtual daeBool | isDocumentLoaded (daeString name)=0 |
| daeInt | removeCollection (daeDocument *document) |
| virtual daeInt | removeDocument (daeDocument *document)=0 |
| virtual daeInt | removeElement (daeDocument *document, daeElement *element)=0 |
| virtual daeInt | setMeta (daeMetaElement *_topMeta)=0 |
| virtual void | sidLookup (const std::string &sid, std::vector< daeElement * > &matchingElements, daeDocument *doc=NULL)=0 |
| std::vector< daeElement * > | sidLookup (const std::string &sid, daeDocument *doc=NULL) |
| template<typename T > | |
| void | typeLookup (std::vector< T * > &matchingElements, daeDocument *doc=NULL) |
| template<typename T > | |
| std::vector< T * > | typeLookup (daeDocument *doc=NULL) |
| virtual void | typeLookup (daeInt typeID, std::vector< daeElement * > &matchingElements, daeDocument *doc=NULL)=0 |
| std::vector< daeElement * > | typeLookup (daeInt typeID, daeDocument *doc=NULL) |
| virtual | ~daeDatabase () |
Protected Attributes | |
| DAE & | dae |
The daeDatabase class defines the COLLADA runtime database interface.
Definition at line 24 of file daeDatabase.h.
| daeDatabase::daeDatabase | ( | DAE & | dae | ) |
Constructor
| virtual daeDatabase::~daeDatabase | ( | ) | [inline, virtual] |
Destructor
Definition at line 25 of file daeDatabase.h.
| virtual daeInt daeDatabase::changeElementID | ( | daeElement * | element, | |
| daeString | newID | |||
| ) | [pure virtual] |
Updates the database to reflect a change to the ID of a daeElement.
| element | daeElement whose ID is going to change. | |
| newID | The ID that will be assigned to the element. |
DAE_OK if the database was successfully updated, otherwise returns a negative value as defined in daeError.h. Implemented in daeSTLDatabase.
| virtual daeInt daeDatabase::changeElementSID | ( | daeElement * | element, | |
| daeString | newSID | |||
| ) | [pure virtual] |
Updates the database to reflect a change to the sid of a daeElement.
| element | daeElement whose sid is going to change. | |
| newSID | The sid that will be assigned to the element. |
DAE_OK if the database was successfully updated, otherwise returns a negative value as defined in daeError.h. Implemented in daeSTLDatabase.
| virtual daeInt daeDatabase::clear | ( | ) | [pure virtual] |
Unloads all of the documents of the runtime database. This function frees all the dom* objects created so far, except any objects on which you still have a smart pointer reference (daeSmartRef).
DAE_OK if all documents successfully unloaded, otherwise returns a negative value as defined in daeError.h. Implemented in daeSTLDatabase.
| daeInt daeDatabase::createCollection | ( | daeString | name, | |
| daeDocument ** | document = NULL | |||
| ) | [inline] |
Definition at line 294 of file daeDatabase.h.
| daeInt daeDatabase::createCollection | ( | daeString | name, | |
| daeElement * | dom, | |||
| daeDocument ** | document = NULL | |||
| ) | [inline] |
Definition at line 291 of file daeDatabase.h.
| virtual daeInt daeDatabase::createDocument | ( | daeString | name, | |
| daeDocument ** | document = NULL | |||
| ) | [pure virtual] |
Creates a new domCOLLADA root element and a new document; returns an error if the document name already exists.
| name | Name of the new document, must be a valid URI. | |
| document | Pointer to a daeDocument pointer that receives the document created |
Implemented in daeSTLDatabase.
| virtual daeInt daeDatabase::createDocument | ( | daeString | name, | |
| daeElement * | dom, | |||
| daeDocument ** | document = NULL, |
|||
| bool | zaeRootDocument = false, |
|||
| const std::string & | extractedFileURI = "" | |||
| ) | [pure virtual] |
Creates a new document, defining its root as the dom object; returns an error if the document name already exists.
| name | Name of the new document, must be a valid URI. | |
| dom | Existing domCOLLADA root element of the document | |
| document | Pointer to a daeDocument pointer that receives the document created | |
| zaeRootDocument | Indicates if the new document is the root document of a ZAE archive. | |
| extractedFileURI | URI to extracted dae file. |
DAE_OK if the document was created successfully, otherwise returns a negative value as defined in daeError.h. daeElement passed in as dom should always be a domCOLLADA object, the API may enforce this in the future. Implemented in daeSTLDatabase.
| daeDocument* daeDatabase::getCollection | ( | daeString | name | ) | [inline] |
Definition at line 309 of file daeDatabase.h.
| daeDocument* daeDatabase::getCollection | ( | daeUInt | index | ) | [inline] |
Definition at line 306 of file daeDatabase.h.
| daeUInt daeDatabase::getCollectionCount | ( | ) | [inline] |
Definition at line 303 of file daeDatabase.h.
Definition at line 312 of file daeDatabase.h.
| virtual DAE* daeDatabase::getDAE | ( | ) | [virtual] |
| daeDocument* daeDatabase::getDoc | ( | daeUInt | index | ) |
Gets a document based on the document index.
| index | Index of the document to get. |
| virtual daeDocument* daeDatabase::getDocument | ( | daeString | name, | |
| bool | skipUriNormalization = false | |||
| ) | [pure virtual] |
Gets a document based on the document name.
| name | The name of the document as a URI. | |
| skipUriNormalization | Use the document name as is; don't normalize it first. This is mostly for improved performance. |
Implemented in daeSTLDatabase.
| virtual daeDocument* daeDatabase::getDocument | ( | daeUInt | index | ) | [pure virtual] |
Gets a document based on the document index.
| index | Index of the document to get. |
Implemented in daeSTLDatabase.
| virtual daeUInt daeDatabase::getDocumentCount | ( | ) | [pure virtual] |
Gets the number of documents.
Implemented in daeSTLDatabase.
Gets a document name.
| index | Index of the document to get. |
Implemented in daeSTLDatabase.
| virtual daeInt daeDatabase::getElement | ( | daeElement ** | pElement, | |
| daeInt | index, | |||
| daeString | name = NULL, |
|||
| daeString | type = NULL, |
|||
| daeString | file = NULL | |||
| ) | [pure virtual] |
Implemented in daeSTLDatabase.
| virtual daeUInt daeDatabase::getElementCount | ( | daeString | name = NULL, |
|
| daeString | type = NULL, |
|||
| daeString | file = NULL | |||
| ) | [pure virtual] |
Implemented in daeSTLDatabase.
| virtual daeUInt daeDatabase::getTypeCount | ( | ) | [pure virtual] |
Implemented in daeSTLDatabase.
Implemented in daeSTLDatabase.
| daeElement* daeDatabase::idLookup | ( | const std::string & | id, | |
| daeDocument * | doc | |||
| ) |
Find an element with the given ID in a specific document.
| id | The ID to match on. | |
| doc | The document to search in. |
| virtual std::vector<daeElement*> daeDatabase::idLookup | ( | const std::string & | id | ) | [pure virtual] |
Lookup elements by ID, searching through all documents.
| id | The ID to match on. |
Implemented in daeSTLDatabase.
| daeInt daeDatabase::insertCollection | ( | daeDocument * | c | ) | [inline] |
Definition at line 297 of file daeDatabase.h.
| daeInt daeDatabase::insertCollection | ( | daeString | name, | |
| daeDocument ** | document = NULL | |||
| ) | [inline] |
Definition at line 288 of file daeDatabase.h.
| daeInt daeDatabase::insertCollection | ( | daeString | name, | |
| daeElement * | dom, | |||
| daeDocument ** | document = NULL | |||
| ) | [inline] |
Definition at line 285 of file daeDatabase.h.
| virtual daeInt daeDatabase::insertDocument | ( | daeDocument * | c | ) | [pure virtual] |
Inserts an already existing document into the database.
| c | The document to insert. |
Implemented in daeSTLDatabase.
| virtual daeInt daeDatabase::insertDocument | ( | daeString | name, | |
| daeDocument ** | document = NULL | |||
| ) | [pure virtual] |
Creates a new domCOLLADA root element and a new document; returns an error if the document name already exists.
| name | Name of the new document, must be a valid URI. | |
| document | Pointer to a daeDocument pointer that receives the document created |
Implemented in daeSTLDatabase.
| virtual daeInt daeDatabase::insertDocument | ( | daeString | name, | |
| daeElement * | dom, | |||
| daeDocument ** | document = NULL, |
|||
| bool | zaeRootDocument = false, |
|||
| const std::string & | extractedFileURI = "" | |||
| ) | [pure virtual] |
Creates a new document, defining its root as the dom object; returns an error if the document name already exists.
| name | Name of the new document, must be a valid URI. | |
| dom | Existing domCOLLADA root element of the document | |
| document | Pointer to a daeDocument pointer that receives the document created | |
| zaeRootDocument | Indicates if the new document is the root document of a ZAE archive. | |
| extractedFileURI | URI to extracted dae file. |
DAE_OK if the document was created successfully, otherwise returns a negative value as defined in daeError.h. daeElement passed in as dom should always be a domCOLLADA object, the API may enforce this in the future. Implemented in daeSTLDatabase.
| virtual daeInt daeDatabase::insertElement | ( | daeDocument * | document, | |
| daeElement * | element | |||
| ) | [pure virtual] |
Inserts a daeElement into the runtime database.
| document | Document in which the daeElement lives. | |
| element | daeElement to insert in the database |
DAE_OK if element successfully inserted, otherwise returns a negative value as defined in daeError.h. Implemented in daeSTLDatabase.
Definition at line 315 of file daeDatabase.h.
Indicates if a document is loaded or not.
| name | Name of the document as a URI. |
Implemented in daeSTLDatabase.
| daeInt daeDatabase::removeCollection | ( | daeDocument * | document | ) | [inline] |
Definition at line 300 of file daeDatabase.h.
| virtual daeInt daeDatabase::removeDocument | ( | daeDocument * | document | ) | [pure virtual] |
Removes a document from the database.
| document | Document to remove from the database |
Implemented in daeSTLDatabase.
| virtual daeInt daeDatabase::removeElement | ( | daeDocument * | document, | |
| daeElement * | element | |||
| ) | [pure virtual] |
Removes a daeElement from the runtime database; not implemented in the reference STL implementation.
| document | Document in which the daeElement lives. | |
| element | Element to remove. |
DAE_OK if element successfully removed, otherwise returns a negative value as defined in daeError.h. Implemented in daeSTLDatabase.
| virtual daeInt daeDatabase::setMeta | ( | daeMetaElement * | _topMeta | ) | [pure virtual] |
Sets the top meta object. Called by dae::setDatabase() when the database changes. It passes to this function the top meta object, which is the root of a hierarchy of daeMetaElement objects. This top meta object is capable of creating any of the root objects in the DOM tree.
| _topMeta | Top meta object to use to create objects to fill the database. |
Implemented in daeSTLDatabase.
| virtual void daeDatabase::sidLookup | ( | const std::string & | sid, | |
| std::vector< daeElement * > & | matchingElements, | |||
| daeDocument * | doc = NULL | |||
| ) | [pure virtual] |
Same as the previous method, but the results are returned via a parameter instead of a return value, for extra efficiency.
| sid | The sid to match on. | |
| matchingElements | The array of matching elements. | |
| doc | The document to search in, or NULL to search in all documents. Note - This function currently isn't implemented in the default database. |
Implemented in daeSTLDatabase.
| std::vector<daeElement*> daeDatabase::sidLookup | ( | const std::string & | sid, | |
| daeDocument * | doc = NULL | |||
| ) |
Lookup elements by sid.
| sid | The sid to match on. | |
| doc | The document to search in, or NULL to search in all documents. |
| void daeDatabase::typeLookup | ( | std::vector< T * > & | matchingElements, | |
| daeDocument * | doc = NULL | |||
| ) | [inline] |
Same as the previous method, but returns the array of matching elements via a reference parameter for additional efficiency.
| matchingElements | The array of matching elements. | |
| doc | The document to search in, or NULL to search in all documents. |
Definition at line 227 of file daeDatabase.h.
| std::vector<T*> daeDatabase::typeLookup | ( | daeDocument * | doc = NULL |
) | [inline] |
Lookup elements by type ID.
| doc | The document to search in, or NULL to search in all documents. |
Definition at line 214 of file daeDatabase.h.
| virtual void daeDatabase::typeLookup | ( | daeInt | typeID, | |
| std::vector< daeElement * > & | matchingElements, | |||
| daeDocument * | doc = NULL | |||
| ) | [pure virtual] |
Same as the previous method, but returns the array of matching elements via a reference parameter for additional efficiency.
| typeID | The type to match on, e.g. domNode::ID(). | |
| matchingElements | The array of matching elements. | |
| doc | The document to search in, or NULL to search in all documents. |
Implemented in daeSTLDatabase.
| std::vector<daeElement*> daeDatabase::typeLookup | ( | daeInt | typeID, | |
| daeDocument * | doc = NULL | |||
| ) |
Lookup elements by type ID.
| typeID | The type to match on, e.g. domNode::ID(). | |
| doc | The document to search in, or NULL to search in all documents. |
DAE& daeDatabase::dae [protected] |
Definition at line 320 of file daeDatabase.h.