123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- #pragma once
- #include<cstdio>
- #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__)
|