Beispiel #1
0
void toggleCloseRange(int )
{
	bool bCloseRange;
	g_depthStream.getProperty(XN_STREAM_PROPERTY_CLOSE_RANGE, &bCloseRange);

	bCloseRange = !bCloseRange;

	g_depthStream.setProperty(XN_STREAM_PROPERTY_CLOSE_RANGE, bCloseRange);

	displayMessage ("Close range: %s", bCloseRange?"On":"Off");	
}
Beispiel #2
0
void toggleCloseRange(int )
{
    static OniBool bCloseRange = FALSE;

    if (g_depthStream.getProperty(XN_STREAM_PROPERTY_CLOSE_RANGE, &bCloseRange) != XN_STATUS_OK &&
            g_depthStream.getProperty(KINECT_DEPTH_PROPERTY_CLOSE_RANGE, &bCloseRange) != XN_STATUS_OK)
    {
        // Continue with the latest value even in case of error
    }

    bCloseRange = !bCloseRange;

    if (g_depthStream.setProperty(XN_STREAM_PROPERTY_CLOSE_RANGE, bCloseRange) != XN_STATUS_OK &&
            g_depthStream.setProperty(KINECT_DEPTH_PROPERTY_CLOSE_RANGE, bCloseRange) != XN_STATUS_OK)
    {
        displayError("Couldn't set the close range");
        return;
    }

    displayMessage ("Close range: %s", bCloseRange?"On":"Off");
}