Data Generation

Production nodes that are also producing data are called Generators. To ease configuration of such nodes, it was decided that those nodes do not actually produce any data until specifically asked to do so. This allows the application to configure any property it needs before actually starting to stream data. Starting generation is done using xnStartGenerating() or xn::Generator::StartGenerating(). The application may also want sometimes to stop the generation without actually destroying the node (for example, if it does not need this data in current state, but does not want to loose configuration changes, or wants to have the option to continue data streaming faster (instead of initializing it again). To do so, the application may call xnStopGenerating() or xn::Generator::StopGenerating.

In addition, for easier access, OpenNI supplies two functions that control all generators in the context: xnStartGeneratingAll() (xn::Context::StartGeneratingAll()) and xnStopGeneratingAll() (xn::Context::StopGeneratingAll()).