OpenNI 1.3.2
Public Member Functions | Static Public Member Functions
xn::Context Class Reference

#include <XnCppWrapper.h>

List of all members.

Public Member Functions

 Context ()
 Context (XnContext *pContext)
 Context (const Context &other)
 ~Context ()
Contextoperator= (const Context &other)
XnContextGetUnderlyingObject () const
XnStatus Init ()
XnStatus RunXmlScript (const XnChar *strScript, EnumerationErrors *pErrors=NULL)
XnStatus RunXmlScript (const XnChar *strScript, ScriptNode &scriptNode, EnumerationErrors *pErrors=NULL)
XnStatus RunXmlScriptFromFile (const XnChar *strFileName, EnumerationErrors *pErrors=NULL)
XnStatus RunXmlScriptFromFile (const XnChar *strFileName, ScriptNode &scriptNode, EnumerationErrors *pErrors=NULL)
XnStatus InitFromXmlFile (const XnChar *strFileName, EnumerationErrors *pErrors=NULL)
XnStatus InitFromXmlFile (const XnChar *strFileName, ScriptNode &scriptNode, EnumerationErrors *pErrors=NULL)
XnStatus OpenFileRecording (const XnChar *strFileName)
XnStatus OpenFileRecording (const XnChar *strFileName, ProductionNode &playerNode)
XnStatus CreateMockNode (XnProductionNodeType type, const XnChar *strName, ProductionNode &mockNode)
XnStatus CreateMockNodeBasedOn (ProductionNode &originalNode, const XnChar *strName, ProductionNode &mockNode)
XnStatus CreateCodec (XnCodecID codecID, ProductionNode &initializerNode, Codec &codec)
XnStatus AddRef ()
void Release ()
void Shutdown ()
XnStatus AddLicense (const XnLicense &License)
XnStatus EnumerateLicenses (XnLicense *&aLicenses, XnUInt32 &nCount) const
XnStatus EnumerateProductionTrees (XnProductionNodeType Type, const Query *pQuery, NodeInfoList &TreesList, EnumerationErrors *pErrors=NULL) const
XnStatus CreateAnyProductionTree (XnProductionNodeType type, Query *pQuery, ProductionNode &node, EnumerationErrors *pErrors=NULL)
XnStatus CreateProductionTree (NodeInfo &Tree)
XnStatus CreateProductionTree (NodeInfo &Tree, ProductionNode &node)
XnStatus EnumerateExistingNodes (NodeInfoList &list) const
XnStatus EnumerateExistingNodes (NodeInfoList &list, XnProductionNodeType type) const
XnStatus FindExistingNode (XnProductionNodeType type, ProductionNode &node) const
XnStatus GetProductionNodeByName (const XnChar *strInstanceName, ProductionNode &node) const
XnStatus GetProductionNodeInfoByName (const XnChar *strInstanceName, NodeInfo &nodeInfo) const
XnStatus StartGeneratingAll ()
XnStatus StopGeneratingAll ()
XnStatus SetGlobalMirror (XnBool bMirror)
XnBool GetGlobalMirror ()
XnStatus GetGlobalErrorState ()
XnStatus RegisterToErrorStateChange (XnErrorStateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
void UnregisterFromErrorStateChange (XnCallbackHandle hCallback)
XnStatus WaitAndUpdateAll ()
XnStatus WaitAnyUpdateAll ()
XnStatus WaitOneUpdateAll (ProductionNode &node)
XnStatus WaitNoneUpdateAll ()
XnStatus AutoEnumerateOverSingleInput (NodeInfoList &List, XnProductionNodeDescription &description, const XnChar *strCreationInfo, XnProductionNodeType InputType, EnumerationErrors *pErrors, Query *pQuery=NULL) const
void SetHandle (XnContext *pContext)
void TakeOwnership (XnContext *pContext)

Static Public Member Functions

static void FreeLicensesList (XnLicense aLicenses[])

Detailed Description

Represents an OpenNI context object.


Constructor & Destructor Documentation

xn::Context::Context ( ) [inline]

Ctor.

xn::Context::Context ( XnContext pContext) [inline]

Ctor

Parameters:
pContext[in] Underlying C object
xn::Context::Context ( const Context other) [inline]

Copy Ctor

Parameters:
other[in] Another context. Note that the context will only be destroyed when The original object is destroyed.
xn::Context::~Context ( ) [inline]

Dtor.


Member Function Documentation

XnStatus xn::Context::AddLicense ( const XnLicense License) [inline]
For full details and usage, see xnAddLicense

Adds a reference to the context object.

For full details and usage, see xnContextAddRef

XnStatus xn::Context::AutoEnumerateOverSingleInput ( NodeInfoList List,
XnProductionNodeDescription description,
const XnChar *  strCreationInfo,
XnProductionNodeType  InputType,
EnumerationErrors pErrors,
Query pQuery = NULL 
) const [inline]
For full details and usage, see xnAutoEnumerateOverSingleInput

XnStatus xn::Context::CreateAnyProductionTree ( XnProductionNodeType  type,
Query pQuery,
ProductionNode node,
EnumerationErrors pErrors = NULL 
) [inline]

Enumerates for production trees for a specific node type, and creates the first found tree. This function is a shortcut version for using xnEnumerateProductionTrees(), iterating the list, and then calling xnCreateProductionTree().

For full details and usage, see xnCreateAnyProductionTree

XnStatus xn::Context::CreateCodec ( XnCodecID  codecID,
ProductionNode initializerNode,
Codec codec 
) [inline]
For full details and usage, see xnCreateCodec

XnStatus xn::Context::CreateMockNode ( XnProductionNodeType  type,
const XnChar *  strName,
ProductionNode mockNode 
) [inline]

Creates a production node which is only a mock. This node does not represent an actual node, but only keeps a state and implements an interface above it. Mock nodes are useful when simulating nodes for playing recordings, or for use in tests. See also xnCreateMockNodeBasedOn().

For full details and usage, see xnCreateMockNode

XnStatus xn::Context::CreateMockNodeBasedOn ( ProductionNode originalNode,
const XnChar *  strName,
ProductionNode mockNode 
) [inline]

Creates a production node which is only a mock, base on the type and properties of another node. This node does not represent an actual node, but only keeps a state and implements an interface above it. Mock nodes are useful when simulating nodes for playing recordings, or for use in tests. See also xnCreateMockNode().

For full details and usage, see xnCreateMockNodeBasedOn

Creates a production node. If the tree specifies additional needed nodes, and those nodes do not exist, they will be created too, and passed to this node as input.

For full details and usage, see xnCreateProductionTree

Creates a production node. If the tree specifies additional needed nodes, and those nodes do not exist, they will be created too, and passed to this node as input.

For full details and usage, see xnCreateProductionTree

Gets a list of all existing node in the context. Each node that was returned increases its ref count. The list must be freed using xnNodeInfoListFree().

For full details and usage, see xnEnumerateExistingNodes

Gets a list of all existing node in the context. Each node that was returned increases its ref count. The list must be freed using xnNodeInfoListFree().

For full details and usage, see xnEnumerateExistingNodesByType

XnStatus xn::Context::EnumerateLicenses ( XnLicense *&  aLicenses,
XnUInt32 &  nCount 
) const [inline]
For full details and usage, see xnEnumerateLicenses

XnStatus xn::Context::EnumerateProductionTrees ( XnProductionNodeType  Type,
const Query pQuery,
NodeInfoList TreesList,
EnumerationErrors pErrors = NULL 
) const [inline]

Enumerates all available production trees for a specific node type. The trees populated in the list should be freed by calling xnNodeInfoListFree() once not needed.

For full details and usage, see xnEnumerateProductionTrees

For full details and usage, see xnFindExistingNodeByType

static void xn::Context::FreeLicensesList ( XnLicense  aLicenses[]) [inline, static]
For full details and usage, see xnFreeLicensesList

Gets the global error state of the context. If one of the nodes in the context is in error state, that state will be returned. If more than one node is in error state, XN_STATUS_MULTIPLE_NODES_ERROR is returned. An application can query each node error state by calling xnGetNodeErrorState().

For full details and usage, see xnGetGlobalErrorState

XnBool xn::Context::GetGlobalMirror ( ) [inline]

Gets the global mirror flag.

For full details and usage, see xnGetGlobalMirror

XnStatus xn::Context::GetProductionNodeByName ( const XnChar *  strInstanceName,
ProductionNode node 
) const [inline]
For full details and usage, see xnGetNodeHandleByName

XnStatus xn::Context::GetProductionNodeInfoByName ( const XnChar *  strInstanceName,
NodeInfo nodeInfo 
) const [inline]
For full details and usage, see xnGetNodeHandleByName

Gets the underlying C object.

Initializes the OpenNI library.

For full details and usage, see xnInit

XnStatus xn::Context::InitFromXmlFile ( const XnChar *  strFileName,
EnumerationErrors pErrors = NULL 
) [inline]

Initializes OpenNI context, and then configures it using the given file. NOTE: when using this function, the context will be the owner of the created nodes, so those nodes and the context will only be destroyed if calling xnShutdown(). It is highly suggested to use xnInitFromXmlFileEx() instead, which returns a node referencing created nodes, making the caller owner of those nodes.

For full details and usage, see xnInitFromXmlFile

XnStatus xn::Context::InitFromXmlFile ( const XnChar *  strFileName,
ScriptNode scriptNode,
EnumerationErrors pErrors = NULL 
) [inline]

Initializes OpenNI context, and then configures it using the given file. NOTE: when using this function, the context will be the owner of the created nodes, so those nodes and the context will only be destroyed if calling xnShutdown(). It is highly suggested to use xnInitFromXmlFileEx() instead, which returns a node referencing created nodes, making the caller owner of those nodes.

For full details and usage, see xnInitFromXmlFile

XnStatus xn::Context::OpenFileRecording ( const XnChar *  strFileName) [inline]

Opens a recording file, adding all nodes in it to the context. NOTE: when using this function, the context will be the owner of the created player node, so this nodes and the context will only be destroyed if calling xnShutdown(). It is highly suggested to use xnContextOpenFileRecordingEx() instead, which returns the player node, making the caller owner of this node.

For full details and usage, see xnContextOpenFileRecording

XnStatus xn::Context::OpenFileRecording ( const XnChar *  strFileName,
ProductionNode playerNode 
) [inline]

Opens a recording file, adding all nodes in it to the context. NOTE: when using this function, the context will be the owner of the created player node, so this nodes and the context will only be destroyed if calling xnShutdown(). It is highly suggested to use xnContextOpenFileRecordingEx() instead, which returns the player node, making the caller owner of this node.

For full details and usage, see xnContextOpenFileRecording

Context& xn::Context::operator= ( const Context other) [inline]
XnStatus xn::Context::RegisterToErrorStateChange ( XnErrorStateChangedHandler  handler,
void *  pCookie,
XnCallbackHandle hCallback 
) [inline]

Registers a callback function to global error state changes.

For full details and usage, see xnRegisterToGlobalErrorStateChange

void xn::Context::Release ( ) [inline]

Releases a context object, decreasing its ref count by 1. If reference count has reached 0, the context will be destroyed.

For full details and usage, see xnContextRelease

XnStatus xn::Context::RunXmlScript ( const XnChar *  strScript,
EnumerationErrors pErrors = NULL 
) [inline]

Runs an XML script in the given context. NOTE: when using this function, the context will be the owner of the created nodes, so those nodes and the context will only be destroyed if calling xnShutdown(). It is highly suggested to use xnContextRunXmlScriptEx() instead, which returns a node referencing created nodes, making the caller owner of those nodes.

For full details and usage, see xnContextRunXmlScript

XnStatus xn::Context::RunXmlScript ( const XnChar *  strScript,
ScriptNode scriptNode,
EnumerationErrors pErrors = NULL 
) [inline]

Runs an XML script in the given context. NOTE: when using this function, the context will be the owner of the created nodes, so those nodes and the context will only be destroyed if calling xnShutdown(). It is highly suggested to use xnContextRunXmlScriptEx() instead, which returns a node referencing created nodes, making the caller owner of those nodes.

For full details and usage, see xnContextRunXmlScript

XnStatus xn::Context::RunXmlScriptFromFile ( const XnChar *  strFileName,
EnumerationErrors pErrors = NULL 
) [inline]

Runs an XML script in the given context. NOTE: when using this function, the context will be the owner of the created nodes, so those nodes and the context will only be destroyed if calling xnShutdown(). It is highly suggested to use xnContextRunXmlScriptFromFileEx() instead, which returns a node referencing created nodes, making the caller owner of those nodes.

For full details and usage, see xnContextRunXmlScriptFromFile

XnStatus xn::Context::RunXmlScriptFromFile ( const XnChar *  strFileName,
ScriptNode scriptNode,
EnumerationErrors pErrors = NULL 
) [inline]

Runs an XML script in the given context. NOTE: when using this function, the context will be the owner of the created nodes, so those nodes and the context will only be destroyed if calling xnShutdown(). It is highly suggested to use xnContextRunXmlScriptFromFileEx() instead, which returns a node referencing created nodes, making the caller owner of those nodes.

For full details and usage, see xnContextRunXmlScriptFromFile

XnStatus xn::Context::SetGlobalMirror ( XnBool  bMirror) [inline]

Sets the global mirror flag. This will set all current existing nodes' mirror state, and also affect future created nodes. The default mirror flag is FALSE.

For full details and usage, see xnSetGlobalMirror

void xn::Context::SetHandle ( XnContext pContext) [inline]

Replaces the underlying C object pointed to by this object.

void xn::Context::Shutdown ( ) [inline]

Shuts down an OpenNI context, destroying all its nodes. Do not call any function of this context or any correlated node after calling this method. NOTE: this function destroys the context and all the nodes it holds and so should be used very carefully. Normally you should just call xnContextRelease()

For full details and usage, see xnShutdown

Make sure all generators are generating data.

For full details and usage, see xnStartGeneratingAll

Stop all generators from generating data.

For full details and usage, see xnStopGeneratingAll

void xn::Context::TakeOwnership ( XnContext pContext) [inline]

Unregisters a callback function which was registered using xnRegisterToGlobalErrorStateChange().

For full details and usage, see xnUnregisterFromGlobalErrorStateChange

Updates all generators nodes in the context, waiting for all to have new data.

For full details and usage, see xnWaitAndUpdateAll

Updates all generators nodes in the context, once any of them have new data.

For full details and usage, see xnWaitAnyUpdateAll

Updates all generator nodes in the context, without any waiting. If a node has new data, it will be updated.

For full details and usage, see xnWaitNoneUpdateAll

Updates all generators nodes in the context, waiting for a specific one to have new data.

For full details and usage, see xnWaitOneUpdateAll


The documentation for this class was generated from the following file: