File: Tutorial.Enumerating.txt

package info (click to toggle)
openni 1.5.4.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 44,844 kB
  • sloc: cpp: 116,706; ansic: 58,777; sh: 10,287; cs: 7,698; java: 7,402; python: 1,541; makefile: 492; xml: 167
file content (35 lines) | stat: -rw-r--r-- 1,053 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
@page tut_enum Enumerating possible production chains

The following code shows how to fine control the enumeration process. It enumerates Production Chains
for producing User output, reducing the options using a basic query, and then chooses the first one
from all possibilities.
@code
// Build a query object
xn::Query query;
nRetVal = query.SetVendor("MyVendor");
// TODO: check error code

query.AddSupportedCapability(XN_CAPABILITY_SKELETON);
// TODO: check error code

// Enumerate
xn::NodeInfoList possibleChains;
nRetVal = context.EnumerateProductionTrees(XN_NODE_TYPE_USER, &query, possibleChains, NULL);
// TODO: check error code

// No errors so far. This means list has at least one item. Take the first one
xn::NodeInfo selected = *possibleChains.Begin();

// Create it
nRetVal = context.CreateProductionTree(selected);
// TODO: check error code

// Take the node
xn::UserGenerator userGen;
nRetVal = selected.GetInstance(userGen);
// TODO: check error code

// Now we can start to use it
@endcode
*/