#pragma once

#ifndef BASECONSTVARIABLE_H
#define BASECONSTVARIABLE_H
#define EIGEN_USE_MKL_ALL
//#define EIGEN_NO_DEBUG 

 
#define EIGEN_USE_BLAS
#define EIGEN_USE_LAPACK
#define EIGEN_VECTORIZE_SSE2

//#define DEBUGSHOWDIALOG

#define __CUDANVCC___ // 定义CUDA函数

//#define __PRFDEBUG__

#define __TBPIMAGE__

//#include <mkl.h>
#include <complex>
#include <math.h>
#include <complex>


#define MATPLOTDRAWIMAGE


#define r2d 180/3.141592653589793238462643383279
#define d2r 3.141592653589793238462643383279/180
#define LIGHTSPEED 299792458
#define PRECISIONTOLERANCE 1e-6
#define Radians2Degrees(Radians) Radians*PI_180
#define Degrees2Radians(Degrees) Degrees*T180_PI
#define EARTHWE 0.000072292115
#define PI 3.141592653589793238462643383279
 


#define earthRoute 0.000072292115
#define Memory1GB 1073741824
#define Memory1MB 1048576
#define Memory1KB 1024

const std::complex<double> imagI(0, 1);

 
const double epsilon = 0.000000000000001;
const double pi = 3.14159265358979323846;
 

const double a = 6378137.0;		//椭球长半轴
const double ae = 6378137.0;		//椭球长半轴
const double ee = 0.0818191910428;// 第一偏心率
const double f_inverse = 298.257223563;			//扁率倒数
const double b = a - a / f_inverse;
const double eSquare = (a * a - b * b) / (a * a);
const double e = sqrt(eSquare);
const double earth_Re = 6378136.49;
const double earth_Rp = (1 - 1 / f_inverse) * earth_Re;
const double earth_We = 0.000072292115;

/*********************************************** openMap参数 ********************************************************************/
static long Paral_num_thread = 14;


/*********************************************** 基础枚举 ********************************************************************/

enum POLARTYPEENUM { // 极化类型
	POLARHH,
	POLARHV,
	POLARVH,
	POLARVV,
	POLARUNKOWN
};


/*********************************************** 基础结构体区域 ********************************************************************/

/// <summary>
/// 地理坐标点
/// </summary>
struct Landpoint //  点   SAR影像的像素坐标；
{
	double lon; // 经度x lon pixel_col
	double lat; // 纬度y lat pixel_row
	double ati; // 高程z ati pixel_time
};

struct Point2 {
	double x = 0;
	double y = 0;
};


struct Point3 {
	double x = 0;
	double y = 0;
	double z = 0;
};

struct DemBox {
	double min_lon;
	double max_lon;
	double min_lat;
	double max_lat;
};


/*********************************************** FEKO仿真参数 ********************************************************************/
struct SatellitePos {
	double time;
	double Px;
	double Py;
	double Pz;
	double Vx;
	double Vy;
	double Vz;
};


struct SatelliteAntPos {
	double time; // 0
	double Px;
	double Py;
	double Pz;
	double Vx;
	double Vy;
	double Vz; //7
	double AntDirectX;
	double AntDirectY;
	double AntDirectZ;
	double AVx;
	double AVy;
	double AVz;//13
	double ZeroAntDiectX;
	double ZeroAntDiectY;
	double ZeroAntDiectZ;
	double lon;
	double lat;
	double ati; // 19
};




/*********************************************** 指针回收区域 ********************************************************************/

inline void delArrPtr(void* p)
{
	delete[] p;
	p = nullptr;
}

inline void delPointer(void* p)
{
	delete p;
	p = nullptr;
}
  

#endif