OpenNI/OpenNI — Issue #51: Recommend: Could use some STL in C++ wrapper?
Author: KHeresy
Created: 2011-12-23 01:59:24+00:00
State: open

In current C++ wrapper, there are many functionality require 2, or more pass to get data from OpenNI.
Such as

xn::MapGenerator.GetSupportedMapOutputModes()

Now, developer need to get the number of supported mode, and then allocate memory space for GetSupportedMapOutputModes() to write data.
But if OpenNI can provide a function like:

std::vector GetSupportedMapOutputModes() const
{
XnUInt32 uCount = xnGetSupportedMapOutputModesCount(GetHandle());
std::vector vSupportedMode;
if( uCount > 0 )
{
vSupportedMode.resize( uCount );
xnGetSupportedMapOutputModes( GetHandle(), &(vSupportedMode[0]), &uCount );
}
return vSupportedMode;
}

It should be better to use.