NITE 1.5.1 - API Reference

XnVDirection.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 *                                                                              *
00003 *   PrimeSense NITE 1.3                                                        *
00004 *   Copyright (C) 2010 PrimeSense Ltd.                                         *
00005 *                                                                              *
00006 *******************************************************************************/
00007 
00008 
00009 #ifndef _XNV_DIRECTION_H_
00010 #define _XNV_DIRECTION_H_
00011 
00015 typedef enum XnVDirection
00016 {
00017     DIRECTION_LEFT,
00018     DIRECTION_RIGHT,
00019     DIRECTION_UP,
00020     DIRECTION_DOWN,
00021     DIRECTION_BACKWARD,
00022     DIRECTION_FORWARD,
00023     DIRECTION_ILLEGAL
00024 } XnVDirection;
00025 
00029 typedef enum XnVAxis
00030 {
00031     AXIS_X,
00032     AXIS_Y,
00033     AXIS_Z,
00034     AXIS_ILLEGAL
00035 } XnVAxis;
00036 
00037 #if __cplusplus
00038 #define INLINE_FUNC inline
00039 #else
00040 #define INLINE_FUNC
00041 #endif
00042 
00046 INLINE_FUNC XnVAxis XnVDirectionAsAxis(XnVDirection eDir)
00047 {
00048     switch (eDir)
00049     {
00050     case DIRECTION_LEFT:
00051     case DIRECTION_RIGHT:
00052         return AXIS_X;
00053     case DIRECTION_UP:
00054     case DIRECTION_DOWN:
00055         return AXIS_Y;
00056     case DIRECTION_BACKWARD:
00057     case DIRECTION_FORWARD:
00058         return AXIS_Z;
00059     default:
00060         return AXIS_ILLEGAL;
00061     }
00062 }
00063 
00067 INLINE_FUNC const XnChar* XnVDirectionAsString(XnVDirection eDir)
00068 {
00069     switch (eDir)
00070     {
00071     case DIRECTION_LEFT:
00072         return "Left";
00073     case DIRECTION_RIGHT:
00074         return "Right";
00075     case DIRECTION_UP:
00076         return "Up";
00077     case DIRECTION_DOWN:
00078         return "Down";
00079     case DIRECTION_BACKWARD:
00080         return "Backward";
00081     case DIRECTION_FORWARD:
00082         return "Forward";
00083     default:
00084         return "Unknown";
00085     }
00086 }
00087 
00088 #endif // _XNV_DIRECTION_H_