forked from eighteight/CinderKinectHandEclipse
/
XnVDirection.h
88 lines (80 loc) · 1.71 KB
/
XnVDirection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*******************************************************************************
* *
* PrimeSense NITE 1.3 *
* Copyright (C) 2010 PrimeSense Ltd. *
* *
*******************************************************************************/
#ifndef _XNV_DIRECTION_H_
#define _XNV_DIRECTION_H_
/**
* Type for axis-aligned directions
*/
typedef enum XnVDirection
{
DIRECTION_LEFT,
DIRECTION_RIGHT,
DIRECTION_UP,
DIRECTION_DOWN,
DIRECTION_BACKWARD,
DIRECTION_FORWARD,
DIRECTION_ILLEGAL
} XnVDirection;
/**
* The available axes
*/
typedef enum XnVAxis
{
AXIS_X,
AXIS_Y,
AXIS_Z,
AXIS_ILLEGAL
} XnVAxis;
#if __cplusplus
#define INLINE_FUNC inline
#else
#define INLINE_FUNC
#endif
/**
* Translate from a direction to the axis it follows
*/
INLINE_FUNC XnVAxis XnVDirectionAsAxis(XnVDirection eDir)
{
switch (eDir)
{
case DIRECTION_LEFT:
case DIRECTION_RIGHT:
return AXIS_X;
case DIRECTION_UP:
case DIRECTION_DOWN:
return AXIS_Y;
case DIRECTION_BACKWARD:
case DIRECTION_FORWARD:
return AXIS_Z;
default:
return AXIS_ILLEGAL;
}
}
/**
* Translate from a direction to its name
*/
INLINE_FUNC const XnChar* XnVDirectionAsString(XnVDirection eDir)
{
switch (eDir)
{
case DIRECTION_LEFT:
return "Left";
case DIRECTION_RIGHT:
return "Right";
case DIRECTION_UP:
return "Up";
case DIRECTION_DOWN:
return "Down";
case DIRECTION_BACKWARD:
return "Backward";
case DIRECTION_FORWARD:
return "Forward";
default:
return "Unknown";
}
}
#endif // _XNV_DIRECTION_H_