Skip to content

Commit

Permalink
fix from avin2#5
Browse files Browse the repository at this point in the history
  • Loading branch information
Avnerus committed Oct 27, 2015
1 parent 7a3cbe8 commit c916874
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
19 changes: 12 additions & 7 deletions Source/XnDeviceSensorV2/XnSensorDepthGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <XnOpenNI.h>
#include <XnOS.h>
#include <XnPsVersion.h>
#include <XnCommon/XnCommon.h>
#include <XnCommon.h>
#include <math.h>

//---------------------------------------------------------------------------
Expand All @@ -50,11 +50,11 @@ XnSensorDepthGenerator::~XnSensorDepthGenerator()
XnStatus XnSensorDepthGenerator::Init()
{
XnStatus nRetVal = XN_STATUS_OK;

nRetVal = XnSensorMapGenerator::Init();
XN_IS_STATUS_OK(nRetVal);

const XnChar* aProps[] =
const XnChar* aProps[] =
{
XN_STREAM_PROPERTY_ZERO_PLANE_DISTANCE,
XN_STREAM_PROPERTY_ZERO_PLANE_PIXEL_SIZE,
Expand Down Expand Up @@ -103,7 +103,7 @@ void XnSensorDepthGenerator::GetFieldOfView(XnFieldOfView& FOV)

XnStatus XnSensorDepthGenerator::RegisterToFieldOfViewChange(XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
{
return m_fovChangedEvent.Register(handler, pCookie, &hCallback);
return m_fovChangedEvent.Register(handler, pCookie, hCallback);
}

void XnSensorDepthGenerator::UnregisterFromFieldOfViewChange(XnCallbackHandle hCallback)
Expand Down Expand Up @@ -180,7 +180,7 @@ XnStatus XnSensorDepthGenerator::GetUserPosition(XnUInt32 nIndex, XnBoundingBox3

XnStatus XnSensorDepthGenerator::RegisterToUserPositionChange(XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
{
const XnChar* aProps[] =
const XnChar* aProps[] =
{
XN_STREAM_PROPERTY_AGC_BIN,
NULL
Expand Down Expand Up @@ -244,6 +244,11 @@ XnStatus XnSensorDepthGenerator::SetViewPoint(xn::ProductionNode& OtherNode)
}
}

XnStatus XnSensorDepthGenerator::GetPixelCoordinatesInViewPoint(xn::ProductionNode& other, XnUInt32 x, XnUInt32 y, XnUInt32& altX, XnUInt32& altY)
{
return 0;
}

XnStatus XnSensorDepthGenerator::ResetViewPoint()
{
return SetIntProperty(XN_STREAM_PROPERTY_REGISTRATION, FALSE);
Expand All @@ -259,7 +264,7 @@ XnBool XnSensorDepthGenerator::IsViewPointAs(xn::ProductionNode& OtherNode)

XnStatus XnSensorDepthGenerator::RegisterToViewPointChange(XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
{
const XnChar* aProps[] =
const XnChar* aProps[] =
{
XN_STREAM_PROPERTY_REGISTRATION,
NULL
Expand Down Expand Up @@ -306,7 +311,7 @@ XnBool XnSensorDepthGenerator::IsFrameSyncedWith(xn::ProductionNode& OtherNode)

XnStatus XnSensorDepthGenerator::RegisterToFrameSyncChange(XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
{
const XnChar* aProps[] =
const XnChar* aProps[] =
{
XN_MODULE_PROPERTY_FRAME_SYNC,
NULL
Expand Down
13 changes: 7 additions & 6 deletions Source/XnDeviceSensorV2/XnSensorDepthGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
//---------------------------------------------------------------------------
#include "XnSensorMapGenerator.h"
#include "XnExportedSensorGenerator.h"
#include <XnEventT.h>

//---------------------------------------------------------------------------
// Types
Expand All @@ -35,8 +36,8 @@
#pragma warning (push)
#pragma warning (disable: 4250)

class XnSensorDepthGenerator :
public XnSensorMapGenerator,
class XnSensorDepthGenerator :
public XnSensorMapGenerator,
virtual public xn::ModuleDepthGenerator,
virtual public xn::ModuleUserPositionInterface,
virtual public xn::ModuleAlternativeViewPointInterface,
Expand Down Expand Up @@ -67,6 +68,7 @@ class XnSensorDepthGenerator :
xn::ModuleAlternativeViewPointInterface* GetAlternativeViewPointInterface() { return this; }
XnBool IsViewPointSupported(xn::ProductionNode& OtherNode);
XnStatus SetViewPoint(xn::ProductionNode& OtherNode);
XnStatus GetPixelCoordinatesInViewPoint(xn::ProductionNode& other, XnUInt32 x, XnUInt32 y, XnUInt32& altX, XnUInt32& altY);
XnStatus ResetViewPoint();
XnBool IsViewPointAs(xn::ProductionNode& OtherNode);
XnStatus RegisterToViewPointChange(XnModuleStateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback);
Expand All @@ -82,15 +84,14 @@ class XnSensorDepthGenerator :

protected:
virtual void FilterProperties(XnActualPropertiesHash* pHash);

private:
XnStatus UpdateRealWorldTranslationData();
XnBool IsSensorImageNode(xn::ProductionNode& Other);

static void XN_CALLBACK_TYPE RealWorldTranslationPropChanged(void* pCookie);

XN_DECLARE_EVENT_0ARG(PropChangeEvent, PropChangeEventInterface);
PropChangeEvent m_fovChangedEvent;
XnEventNoArgs m_fovChangedEvent;

XnCallbackHandle m_hRWPropCallback;

Expand All @@ -106,4 +107,4 @@ class XnExportedSensorDepthGenerator : public XnExportedSensorGenerator

#pragma warning (pop)

#endif // __XN_SENSOR_DEPTH_GENERATOR_H__
#endif // __XN_SENSOR_DEPTH_GENERATOR_H__

0 comments on commit c916874

Please sign in to comment.