Esempio n. 1
0
XnVBuiltInGesture::XnVBuiltInGesture(xn::GestureGenerator gestureGenerator, const XnChar* strGestures) :
	XnVGesture("Built-In Gesture"),
	m_GestureGenerator(gestureGenerator),
	m_bActive(false)
{
	m_strGesturesList = xnOSStrDup(strGestures);
	XnChar* strCurrentGesture = m_strGesturesList;
	XnBool bLast = false;
	while (*strCurrentGesture != '\0')
	{
		// Replace first comma with NULL
		int nComma = 0;
		for (nComma = 0; strCurrentGesture[nComma] != '\0' && strCurrentGesture[nComma] != ','; ++nComma)
			;
		if (strCurrentGesture[nComma] == '\0')
			bLast = true;
		else
			strCurrentGesture[nComma] = '\0';

		// add current gesture
		m_AvailableGestures.Set(strCurrentGesture, NULL);
		// current gesture is next space (if exists)
		if (bLast)
			break;

		strCurrentGesture += nComma + 1;
	}

	m_GestureGenerator.RegisterGestureCallbacks(GestureRecognized, GestureProgress, this, m_hCallbacks);
//	StartGesture(NULL);
} // XnVBuiltInGesture::XnVBuiltInGesture
Esempio n. 2
0
XN_C_API XnStatus xnNodeQueryAddNeededNode(XnNodeQuery* pQuery, const XnChar* strInstanceName)
{
	XN_VALIDATE_INPUT_PTR(pQuery);
	XN_VALIDATE_INPUT_PTR(strInstanceName);
	pQuery->astrNeededNodes[pQuery->nNeededNodes++] = xnOSStrDup(strInstanceName);
	return (XN_STATUS_OK);
}
Esempio n. 3
0
XN_C_API XnStatus xnNodeQueryAddSupportedCapability(XnNodeQuery* pQuery, const XnChar* strNeededCapability)
{
	XN_VALIDATE_INPUT_PTR(pQuery);
	XN_VALIDATE_INPUT_PTR(strNeededCapability);
	pQuery->astrSupportedCapabilities[pQuery->nSupportedCapabilities++] = xnOSStrDup(strNeededCapability);
	return (XN_STATUS_OK);
}
Esempio n. 4
0
XnStatus MockProductionNode::SetStringProperty(const XnChar* strName, const XnChar* strValue)
{
	const XnChar* strOldVal = NULL;
	if (m_stringProps.Get(strName, strOldVal) == XN_STATUS_OK)
	{
		xnOSFree(strOldVal);
	}

	XnStatus nRetVal = m_stringProps.Set(strName, xnOSStrDup(strValue));
	XN_IS_STATUS_OK(nRetVal);

	if (m_pNotifications != NULL)
	{
		nRetVal = m_pNotifications->OnNodeStringPropChanged(m_pNotificationsCookie, m_strName, strName, strValue);
		XN_IS_STATUS_OK(nRetVal);
	}

	return (XN_STATUS_OK);
}