********************************************************************************
***************       OpenNI Development Guidelines       **********************
********************************************************************************

Adding new APIs
-----------------
Adding new function to any node/capability is a Sisyphean labor, and steps are 
always forgotten, so here's a short list of all neccessary steps.
First of all, determine if the functions are between OpenNI and the module only,
are API functions for applications only, or both (where OpenNI is a pass-through
to the module).

1. Module Interface (if those functions is a vendor-specific function)
    - XnModuleInterface.h
	    - If this is a new node, or new capability, define a new struct.
		- If this is a new node, add a pointer to the base node struct.
		- Add function pointers to the struct - one for each new function.
		  NOTE: changing existing struct should only be made at the end. NEVER ADD ANYTHING
          IN THE MIDDLE OF AN EXISTING STRUCT. This will break backwards-compatibility.
		- If this is a new capability, add a pointer to this struct in the 
		  corresponding node struct.
	- XnModuleCppInterface.h
	    - If this is a new node, or new capability, define a new class.
		- If this is a new node, make the class inherit virtually from the base node.
		- Add pure virtual functions to the class - one for each new function.
		- If this is a new capability, add a GetXXXInterface() function in the 
		  corresponding node struct.
	- XnModuleCFunctions.h
		- Implement all the new C functions. Each implementation should convert the 
		  XnModuleNodeHandle to a ModuleProductionNode pointer and then dynamic_cast
		  it to the needed node type. If the function belongs to a capability, 
		  the corresponding GetXXXInterface() function should be called to access
		  the capability interface. The call the requested method.
		  NOTE: no validation of parameters is required. This is OpenNI's responsibility
		  (we'll get to that).
		- If this is a new node, or new capability, add a __ModuleGetXXXInterface function 
		  which gets the struct declared in XnModuleInterface.h and fills it up.
		- If this is a new capability, add a call to the new __ModuleGetXXXInterface function
		  in the __ModuleGetXXXInterface function of the corresponding node.
    - XnModuleCppRegistration.h
	    - If this is a new node, add it to the __ModuleGetGetInterfaceFunc function.
	- XnModuleInterfaceContainers.h
		- If this is a new node, create a new interface container for it.
		- If this is a new capability, add the struct to the corresponding node interface
		  container. Don't forget to memset it and set a pointer to it in the ctor.
	- XnTypeManager
	    - If this is a new node, in TypeManager ctor, add the type.
	- XnModuleLoader
	    - If this is a new node, add Load and Validate methods for it. Add a call to
		  the Load method in LoadSpecificInterface().
		- Check if those function are defined in the corresponding Validate function.

2. OpenNI API (if those functions are application interfaces)
    - XnPrdNode.h
	    - Add the new set of functions as API calls.
    - XnOpenNI.cpp
	    - Implement the API. If needed, call the module functions.
	- XnCppInterface.h
	    - If this is a new node, or new capability, define a new class.
		- If this is a new node, make the class inherit from the base node.
		- If this is a new capability, make the class inherit from Capability.
		- Add inline functions to the class - one for each new function. Those should
		  call the C API directly.
		- If this is a new capability, add a GetXXXCap() method in the 
		  corresponding node class.
    - OpenNI.Net
	    - Add it to C# wrappers
		
	- To make the data exposed by those function recorded and played-back:
		- Add the functions to the mock node.
	    - Add reading in NodeWatcher.
		- Add setting in Mock node.
		
