00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00039 #include <iostream>
00040
00041 #ifndef PCL_MACROS_H_
00042 #define PCL_MACROS_H_
00043
00044 #ifndef DEG2RAD
00045 #define DEG2RAD(x) ((x)*0.017453293)
00046 #endif
00047
00048 #ifndef RAD2DEG
00049 #define RAD2DEG(x) ((x)*57.29578)
00050 #endif
00051
00052 #ifndef PVAR
00053 #define PVAR(s) \
00054 #s << " = " << (s) << std::flush
00055 #endif
00056 #ifndef PVARN
00057 #define PVARN(s) \
00058 #s << " = " << (s) << "\n"
00059 #endif
00060 #ifndef PVARC
00061 #define PVARC(s) \
00062 #s << " = " << (s) << ", " << std::flush
00063 #endif
00064 #ifndef PVARS
00065 #define PVARS(s) \
00066 #s << " = " << (s) << " " << std::flush
00067 #endif
00068 #ifndef PVARA
00069 #define PVARA(s) \
00070 #s << " = " << RAD2DEG(s) << "deg" << std::flush
00071 #endif
00072 #ifndef PVARAN
00073 #define PVARAN(s) \
00074 #s << " = " << RAD2DEG(s) << "deg\n"
00075 #endif
00076 #ifndef PVARAC
00077 #define PVARAC(s) \
00078 #s << " = " << RAD2DEG(s) << "deg, " << std::flush
00079 #endif
00080 #ifndef PVARAS
00081 #define PVARAS(s) \
00082 #s << " = " << RAD2DEG(s) << "deg " << std::flush
00083 #endif
00084
00085 #define FIXED(s) \
00086 std::fixed << s << std::resetiosflags(std::ios_base::fixed)
00087
00088 #ifndef ERASE_STRUCT
00089 #define ERASE_STRUCT(var) memset(&var, 0, sizeof(var))
00090 #endif
00091
00092 #ifndef ERASE_ARRAY
00093 #define ERASE_ARRAY(var, size) memset(var, 0, size*sizeof(*var))
00094 #endif
00095
00096 #ifndef SET_ARRAY
00097 #define SET_ARRAY(var, value, size) {for (int i=0; i<(int)size; ++i) var[i]=value;}
00098 #endif
00099
00100
00101 #endif //#ifndef PCL_MACROS_H_