#pragma once #include #include "string.h" #include "windows.h" #define ROOT_PATH "D:\\Config\\" typedef int INT; typedef unsigned int UINT; typedef char CHAR; typedef unsigned char UCHAR; typedef short SHORT; typedef unsigned short USHORT; typedef long LONG; typedef unsigned long ULONG; typedef float FLOAT; typedef double DOUBLE; typedef long double LDOUBLE; #ifdef __SUPPORT_LLONG__ typedef long long LLONG; typedef unsigned long long ULLONG; typedef unsigned long long QWORD; #endif /*__SUPPORT_LLONG__*/ #ifndef FALSE #define FALSE false #endif #ifndef TRUE #define TRUE true #endif #ifndef OK #define OK 0 #endif #ifndef SUCCESS #define SUCCESS 0 #endif #ifndef FAIL #define FAIL (-1) #endif #ifndef STOP #define STOP 2 #endif // Define NULL pointer value #ifndef NULL # ifdef __cplusplus # define NULL 0 # else # define NULL ((void *)0) # endif #endif // NULL typedef struct _XY_LONG_STRUCT { LONG x; LONG y; _XY_LONG_STRUCT() { x = 0; y = 0; }; _XY_LONG_STRUCT(LONG _x, LONG _y) { x = _x; y = _y; }; _XY_LONG_STRUCT operator=(const LONG& a) { _XY_LONG_STRUCT b; b.x = a; b.y = a; return b; }; _XY_LONG_STRUCT operator+(const _XY_LONG_STRUCT& a) { _XY_LONG_STRUCT b; b.x = this->x + a.x; b.y = this->y + a.y; return b; }; _XY_LONG_STRUCT operator-(const _XY_LONG_STRUCT& a) { _XY_LONG_STRUCT b; b.x = this->x - a.x; b.y = this->y - a.y; return b; }; }XY_LONG_STRUCT; //X,Y组合位置 typedef struct _XY_DOUBLE_STRUCT { double x; double y; _XY_DOUBLE_STRUCT() { x = 0.0; y = 0.0; }; _XY_DOUBLE_STRUCT(double _x, double _y) { x = _x; y = _y; }; _XY_DOUBLE_STRUCT operator=(const double& a) { _XY_DOUBLE_STRUCT b; b.x = a; b.y = a; return b; }; _XY_DOUBLE_STRUCT operator+(const _XY_DOUBLE_STRUCT& a) { _XY_DOUBLE_STRUCT b; b.x = this->x + a.x; b.y = this->y + a.y; return b; }; _XY_DOUBLE_STRUCT operator-(const _XY_DOUBLE_STRUCT& a) { _XY_DOUBLE_STRUCT b; b.x = this->x - a.x; b.y = this->y - a.y; return b; }; _XY_DOUBLE_STRUCT operator+(const _XY_LONG_STRUCT& a) { _XY_DOUBLE_STRUCT b; b.x = this->x + a.x; b.y = this->y + a.y; return b; }; _XY_DOUBLE_STRUCT operator-(const _XY_LONG_STRUCT& a) { _XY_DOUBLE_STRUCT b; b.x = this->x - a.x; b.y = this->y - a.y; return b; }; }XY_DOUBLE_STRUCT; //X,Y组合位置 typedef struct _X_Y_ANGLE_STRUCT { double x; double y; double a; //角度 _X_Y_ANGLE_STRUCT() { x = 0.0; y = 0.0; a = 0.0; }; _X_Y_ANGLE_STRUCT(double _x, double _y, double _a) { x = _x; y = _y; a = _a; }; }X_Y_ANGLE_STRUCT; struct X_Y_Z_R_STRUCT { DOUBLE x; DOUBLE y; DOUBLE z; DOUBLE r; X_Y_Z_R_STRUCT() { x = 0; y = 0; z = 0; r = 0; } X_Y_Z_R_STRUCT(DOUBLE dx, DOUBLE dy, DOUBLE dz, DOUBLE dr) { x = dx; y = dy; z = dz; r = dr; } }; struct X_Y_Z_STRUCT { DOUBLE x; DOUBLE y; DOUBLE z; X_Y_Z_STRUCT() { x = 0; y = 0; z = 0; } X_Y_Z_STRUCT(DOUBLE dx, DOUBLE dy, DOUBLE dz) { x = dx; y = dy; z = dz; } }; struct X_Y_R_STRUCT { DOUBLE x; DOUBLE y; DOUBLE r; X_Y_R_STRUCT() { x = 0; y = 0; r = 0; } X_Y_R_STRUCT(DOUBLE dx, DOUBLE dy, DOUBLE dr) { x = dx; y = dy; r = dr; } }; #define DP(fmt,...) printf("%s(%d):"##fmt" \n", __FILE__, __LINE__, ##__VA_ARGS__)