23 #ifndef __PLUGINS_OPENNI_UTILS_SETUP_H_
24 #define __PLUGINS_OPENNI_UTILS_SETUP_H_
26 #include <core/exception.h>
27 #include <core/utils/lockptr.h>
29 #include <XnCppWrapper.h>
42 unsigned int &width,
unsigned int &height);
44 void setup_map_generator(xn::MapGenerator &generator,
47 void setup_alternate_viewpoint(xn::Generator &gen, xn::Generator &target);
48 void setup_synchronization(xn::Generator &gen, xn::Generator &target);
61 template<
class ProdNodeClass>
63 XnProductionNodeType type, ProdNodeClass *node)
66 if ((st = openni->FindExistingNode(type, *node)) != XN_STATUS_OK) {
67 xn::EnumerationErrors errors;
68 if (node->Create(*(openni.operator->()), 0, &errors) != XN_STATUS_OK) {
70 xnGetStatusString(st));
71 for (xn::EnumerationErrors::Iterator i = errors.Begin();
72 i != errors.End(); ++i)
74 XnProductionNodeDescription d = i.Description();
75 e.append(
"%s: %s/%s/%u.%u.%u.%u: %s",
76 xnProductionNodeTypeToString(d.Type),
77 d.strVendor, d.strName, d.Version.nMajor, d.Version.nMinor,
78 d.Version.nMaintenance, d.Version.nBuild,
79 xnGetStatusString(i.Error()));