Implement the Proper Interface

Note that OpenNI has a different interface for a node implementation (MPI) than the actual API of the node. Although they seem superficially very similar, the MPI and API interfaces are different.

The module's MPI interfaces (C++ ones) are defined in file XnModuleCppInterface.h.

The following table lists current OpenNI node types and their module interface.

Node Type | Module Interface
--- | ---
Production Node | xn::ModuleProductionNode
Device | xn::ModuleDevice
Generator | xn::ModuleGenerator
Recorder | xn::ModuleRecorder
Player | xn::ModulePlayer
Map Generator | xn::ModuleMapGenerator
Depth Generator | xn::ModuleDepthGenerator
Image Generator | xn::ModuleImageGenerator
IR Generator | xn::ModuleIRGenerator
Gestures Generator | xn::ModuleGestureGenerator
Scene Analyzer | xn::ModuleSceneAnalyzer
Hands Generator | xn::ModuleHandsGenerator
User Generator | xn::ModuleUserGenerator
Audio Generator | xn::ModuleAudioGenerator
Codec | xn::ModuleCodec
Script | xn::ModuleScriptNode

When you want to create a new class, it must inherit virtually from the corresponding interface. For example, if you are developing a hand generator, the class declaration must be as follows:

class MyHandGenerator: public virtual xn::ModuleHandsGenerator
{
...
};
xn::ModuleHandsGenerator
Definition XnModuleCppInterface.h:452