Difference between revisions of "DOM resolver subsystem"

From COLLADA Public Wiki
Jump to navigation Jump to search
(→‎How it works: a little copy edit)
(→‎Default behavior: creat link to .raw files since I suspect this term might be used elsewhere)
Line 11: Line 11:
 
* The main resolver, <code>daeLIBXMLResolver</code>, resolves elements from [[COLLADA document]]s (.dae or .xml) with the ''file'' or ''http'' URI scheme. This can resolve elements from the same document or external document references.
 
* The main resolver, <code>daeLIBXMLResolver</code>, resolves elements from [[COLLADA document]]s (.dae or .xml) with the ''file'' or ''http'' URI scheme. This can resolve elements from the same document or external document references.
  
* The newly added [[DOM raw resolver class]], <code>daeRawResolver</code>, resolves only .raw files with the ''file'' URI scheme. A .raw file contains COLLADA source element <code>float_array</code> and <code>int_array</code> data in binary form.
+
* The newly added [[DOM raw resolver class]], <code>daeRawResolver</code>, resolves only [[.raw file]]s with the ''file'' URI scheme.  
  
 
Instantiating an object of a class that inherits from <code>daeURIResolver</code> adds a custom resolver to the [[COLLADA DOM]].
 
Instantiating an object of a class that inherits from <code>daeURIResolver</code> adds a custom resolver to the [[COLLADA DOM]].

Revision as of 22:47, 20 March 2007

Summary: The resolver subsystem manages the resolution of URIs based on a URI's scheme and filename extensions.

Purpose

The resolver subsystem allows for custom URI resolvers to be written and added to the COLLADA DOM. These resolvers can be used to load various types of external references-- for example, binary representations of mesh data--or to provide access to different data systems--for example, using a database to access elements.

Default behavior

By default, the COLLADA DOM has only two resolvers:

  • The main resolver, daeLIBXMLResolver, resolves elements from COLLADA documents (.dae or .xml) with the file or http URI scheme. This can resolve elements from the same document or external document references.

Instantiating an object of a class that inherits from daeURIResolver adds a custom resolver to the COLLADA DOM.

How it works

The base class daeURIResolver contains a static array named _KnownResolvers that contains resolvers. The constuctor for daeURIResolver adds a reference to this to this list of resolvers. When a DOM URI class attempts to resolve itself, it searches through the _KnownResolvers list for a resolver that matches its URI scheme and file extension. When an appropriate resolver is found, the resolver is then asked to resolve the current URI.

Related classes and functions