Ejemplo n.º 1
0
XnStatus MockGenerator::SetNextData(const void *pData, XnUInt32 nSize)
{
	XnStatus nRetVal = XN_STATUS_OK;

	//Make sure the node is in Generating state so it would be recorded properly
	SetGenerating(TRUE);

	DataInfo& nextData = m_data[m_nNextDataIdx];

	if (!m_bAggregateData)
	{
		nextData.nDataSize = 0;
	}

	nRetVal = ResizeBuffer(m_nNextDataIdx, nextData.nDataSize + nSize);
	XN_IS_STATUS_OK(nRetVal);

	xnOSMemCopy((XnUChar*)nextData.pData + nextData.nDataSize, pData, nSize);
	nextData.nDataSize += nSize;

	nRetVal = SetNewDataAvailable();
	XN_IS_STATUS_OK(nRetVal);

	return XN_STATUS_OK;
}
Ejemplo n.º 2
0
XnStatus MockGenerator::SetIntProperty(const XnChar* strName, XnUInt64 nValue)
{
	XnStatus nRetVal = XN_STATUS_OK;

	if (strcmp(strName, XN_PROP_IS_GENERATING) == 0)
	{
		SetGenerating((XnBool)nValue);
	}
	else if (strcmp(strName, XN_PROP_TIMESTAMP) == 0)
	{
		m_data[m_nNextDataIdx].nTimeStamp = nValue;
	}
	else if (strcmp(strName, XN_PROP_FRAME_ID) == 0)
	{
		m_data[m_nNextDataIdx].nFrameID = (XnUInt32)nValue;
	}
	else if (strcmp(strName, XN_CAPABILITY_MIRROR) == 0)
	{
		m_bMirrorCap = (XnBool)nValue;
	}
	else if (strcmp(strName, XN_PROP_MIRROR) == 0)
	{
		nRetVal = SetMirror((XnBool)nValue);
		XN_IS_STATUS_OK(nRetVal);
	}
	//TODO: Check for alternative view point cap, framesync cap	
	else
	{
		return MockProductionNode::SetIntProperty(strName, nValue);
	}

	return XN_STATUS_OK;
}
Ejemplo n.º 3
0
void MockGenerator::StopGenerating()
{
	SetGenerating(FALSE);
}
Ejemplo n.º 4
0
XnStatus MockGenerator::StartGenerating()
{
	SetGenerating(TRUE);
	return XN_STATUS_OK;
}