OpenNI 1.0.0
Functions
Queries
C Reference

Functions

XN_C_API XnStatus xnNodeQueryAllocate (XnNodeQuery **ppQuery)
XN_C_API void xnNodeQueryFree (XnNodeQuery *pQuery)
XN_C_API XnStatus xnNodeQuerySetVendor (XnNodeQuery *pQuery, const XnChar *strVendor)
XN_C_API XnStatus xnNodeQuerySetName (XnNodeQuery *pQuery, const XnChar *strName)
XN_C_API XnStatus xnNodeQuerySetMinVersion (XnNodeQuery *pQuery, const XnVersion *pMinVersion)
XN_C_API XnStatus xnNodeQuerySetMaxVersion (XnNodeQuery *pQuery, const XnVersion *pMaxVersion)
XN_C_API XnStatus xnNodeQueryAddSupportedCapability (XnNodeQuery *pQuery, const XnChar *strNeededCapability)
XN_C_API XnStatus xnNodeQueryAddSupportedMapOutputMode (XnNodeQuery *pQuery, const XnMapOutputMode *pMapOutputMode)
XN_C_API XnStatus xnNodeQuerySetSupportedMinUserPositions (XnNodeQuery *pQuery, const XnUInt32 nCount)
XN_C_API XnStatus xnNodeQuerySetExistingNodeOnly (XnNodeQuery *pQuery, XnBool bExistingNode)
XN_C_API XnStatus xnNodeQueryAddNeededNode (XnNodeQuery *pQuery, const XnChar *strInstanceName)
XN_C_API XnStatus xnNodeQuerySetCreationInfo (XnNodeQuery *pQuery, const XnChar *strCreationInfo)
XN_C_API XnStatus xnNodeQueryFilterList (XnContext *pContext, const XnNodeQuery *pQuery, XnNodeInfoList *pList)

Detailed Description

This page details functions for building queries. Queries can be used during enumeration, and provide an easy way for filtering results before they return to user.


Function Documentation

XN_C_API XnStatus xnNodeQueryAddNeededNode ( XnNodeQuery pQuery,
const XnChar *  strInstanceName 
)

Adds a needed node.

Parameters:
pQuery[in] Query object.
strInstanceName[in] The name of the needed instance.
XN_C_API XnStatus xnNodeQueryAddSupportedCapability ( XnNodeQuery pQuery,
const XnChar *  strNeededCapability 
)

Adds a capability that the node must support. Note that for checking if a capability is supported, the node must be created (if it's not an existing one). This operation might take a bit longer...

Parameters:
pQuery[in] Query object.
strNeededCapability[in] A needed capability name.
XN_C_API XnStatus xnNodeQueryAddSupportedMapOutputMode ( XnNodeQuery pQuery,
const XnMapOutputMode pMapOutputMode 
)

Adds a MapOutputMode that the node must support. Note that for checking if a capability is supported, the node must be created (if it's not an existing one). This operation might take a bit longer...

Parameters:
pQuery[in] Query object.
pMapOutputMode[in] A map output mode. Each field of the mode can be set to (-1), meaning results will not be filtered by this field.
XN_C_API XnStatus xnNodeQueryAllocate ( XnNodeQuery **  ppQuery)

Allocates a new query object. This object must be freed using xnNodeQueryFree().

Parameters:
ppQuery[out] Created query object.
XN_C_API XnStatus xnNodeQueryFilterList ( XnContext pContext,
const XnNodeQuery pQuery,
XnNodeInfoList pList 
)

Filters a list of nodes according to query. The list will contain only nodes that match all query terms. Note that some query terms might require creation of a node, and thus may take longer.

Parameters:
pContext[in] OpenNI Context object.
pQuery[in] Query object.
pList[in] The list to be filtered.
XN_C_API void xnNodeQueryFree ( XnNodeQuery pQuery)

Frees a query object previously created using xnNodeQueryAllocate().

Parameters:
pQuery[in] Query object.
XN_C_API XnStatus xnNodeQuerySetCreationInfo ( XnNodeQuery pQuery,
const XnChar *  strCreationInfo 
)

Sets the creation info field of a query object.

Parameters:
pQuery[in] Query object.
strCreationInfo[in] The creation info to set in the query.
XN_C_API XnStatus xnNodeQuerySetExistingNodeOnly ( XnNodeQuery pQuery,
XnBool  bExistingNode 
)

Filter results so that only existing nodes will be returned.

Parameters:
pQuery[in] Query object.
bExistingNode[in] TRUE to return only existing ones, FALSE otherwise.
XN_C_API XnStatus xnNodeQuerySetMaxVersion ( XnNodeQuery pQuery,
const XnVersion pMaxVersion 
)

Sets the maximum required version.

Parameters:
pQuery[in] Query object.
pMaxVersion[in] Max Version.
XN_C_API XnStatus xnNodeQuerySetMinVersion ( XnNodeQuery pQuery,
const XnVersion pMinVersion 
)

Sets the minimum required version.

Parameters:
pQuery[in] Query object.
pMinVersion[in] Min Version.
XN_C_API XnStatus xnNodeQuerySetName ( XnNodeQuery pQuery,
const XnChar *  strName 
)

Sets the requested name.

Parameters:
pQuery[in] Query object.
strName[in] Product Name.
XN_C_API XnStatus xnNodeQuerySetSupportedMinUserPositions ( XnNodeQuery pQuery,
const XnUInt32  nCount 
)

Sets the minimum required user positions this node supports. Note that for checking if a capability is supported, the node must be created (if it's not an existing one). This operation might take a bit longer...

Parameters:
pQuery[in] Query object.
nCount[in] The number of required positions.
XN_C_API XnStatus xnNodeQuerySetVendor ( XnNodeQuery pQuery,
const XnChar *  strVendor 
)

Sets the requested vendor.

Parameters:
pQuery[in] Query object.
strVendor[in] Vendor Name.