#pragma once
#include "stdafx.h"
#include <vector>
#include <string.h>
#include <Mstn\MdlApi\MdlApi.h>
#include <DgnPlatform\DgnPlatformApi.h>

using namespace std;

struct ShuLiangJY
{
	ACHAR sjst[STR_NORMAL];//时态
	ACHAR type[STR_NORMAL];//类型
	ACHAR guige[STR_NORMAL];//规格
	double shuliang;
	double shuliang_XZ;//新建
	double shuliang_CC;//既有拆除
	double shuliang_CP;//既有拆铺
	double shuliang_ZJ;//在建
	// 添加预留数量
	double shuliang_JQYL;//近期预留
	double shuliang_YQYL;//远期预留
	double shuliang_YJYL;//远景预留
	double shuliang_Addition;//多余
	ACHAR tuhao[STR_EXTEND];
	int IsGaiyi;
	int IsChaiChu;
	ACHAR Note[STR_EXTEND];//附注

	ShuLiangJY() {
		_tcscpy(sjst, L"");
		_tcscpy(type, L"");
		_tcscpy(guige, L"");
		shuliang = 0;
		shuliang_XZ = 0;
		shuliang_CC = 0;
		shuliang_CP = 0;
		shuliang_ZJ = 0;
		shuliang_JQYL = 0.0;
		shuliang_YQYL = 0.0;
		shuliang_YJYL = 0.0;
		shuliang_Addition = 0;
		_tcscpy(tuhao, L"");
		IsGaiyi = 0;
		IsChaiChu = 0;
		_tcscpy(Note, L"");
	}
	~ShuLiangJY() {
		_tcscpy(sjst, L"");
		_tcscpy(type, L"");
		_tcscpy(guige, L"");
		shuliang = 0;
		shuliang_XZ = 0;
		shuliang_CC = 0;
		shuliang_CP = 0;
		shuliang_ZJ = 0;
		shuliang_JQYL = 0.0;
		shuliang_YQYL = 0.0;
		shuliang_YJYL = 0.0;
		shuliang_Addition = 0;
		_tcscpy(tuhao, L"");
		IsGaiyi = 0;
		IsChaiChu = 0;
		_tcscpy(Note, L"");
	}
};

// 适应ACHAR和CString的字符查找，暂用于预留时态替换为的近期远期远景三种
struct QXJD
{
	double DistToJX;
	ACHAR   JDCKml[STR_EXTEND];
};
//求道岔接出点位置  isDaoChaNum4为1时，表示当前是四个道岔的渡线
struct YXCTAB//有效长表
{
	double SX_QDcml;
	double SX_ZDcml;
	double XX_QDcml;
	double XX_ZDcml;
	double SX_QDcml_YL;
	double SX_ZDcml_YL;
	double XX_QDcml_YL;
	double XX_ZDcml_YL;

	ACHAR GTZXQDID[STR_NORMAL];//起点设备ID
	ACHAR GTZXZDID[STR_NORMAL];//终点设备ID
	int GTZXQDType;//1-道岔  2-车挡  
	int GTZXZDType;//1-道岔  2-车挡  

	ACHAR SXYXCQDID[STR_NORMAL];
	ACHAR SXYXCZDID[STR_NORMAL];
	ACHAR XXYXCQDID[STR_NORMAL];
	ACHAR XXYXCZDID[STR_NORMAL];

	int SXYXCQDType;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int SXYXCZDType;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int XXYXCQDType;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int XXYXCZDType;//1-信号机  2-警冲标 3-道岔a端 4-车挡  

	ACHAR SXYXCQDID_YL[STR_NORMAL];
	ACHAR SXYXCZDID_YL[STR_NORMAL];
	ACHAR XXYXCQDID_YL[STR_NORMAL];
	ACHAR XXYXCZDID_YL[STR_NORMAL];

	int SXYXCQDType_YL;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int SXYXCZDType_YL;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int XXYXCQDType_YL;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int XXYXCZDType_YL;//1-信号机  2-警冲标 3-道岔a端 4-车挡  

	ACHAR BianHao[STR_SHORT];

	double  UpValidL;		    //上行方向股道有效长
	double  DownValidL;		 //下行方向股道有效长
	double  UpValidL_YL;		    //上行方向股道有效长
	double  DownValidL_YL;		 //下行方向股道有效长

	DPoint2d SX_Spt, SX_Ept;
	DPoint2d XX_Spt, XX_Ept;
};

struct  HDMDMX//横断面地面线结构
{
	CString  BianHao;
	CString CKML;
	double EarH;
	CString  LorR;
	int zjgc;//支距0 高差1 属性2
	int ceng;//层号
	int Ndmpt;
	vector<double> hdmdata; //支距 高差  地面线点的类型 1是轨面 0不是轨面
	CString GDDNAME;//过渡段名称
	int DataBaseID; // 单断面提取地面线数据时，为防止ID顺序混乱，将重新提取的断面加到最后

	~HDMDMX() {
		BianHao = L"";
		CKML = L"";
		LorR = L"";
		GDDNAME = L"";
		zjgc = 0;
		ceng = 0;
		Ndmpt = 0;
		EarH = 0;
		hdmdata.clear();
		DataBaseID = 0;
	}
	HDMDMX() {
		BianHao = L"";
		CKML = L"";
		LorR = L"";
		GDDNAME = L"";
		zjgc = 0;
		ceng = 0;
		Ndmpt = 0;
		EarH = 0;
		hdmdata.clear();
		DataBaseID = 0;
	}
};

struct JDdata
{
	double x, y;
	double R, l1, l2;
	double dist;
	ACHAR JXLC[STR_NORMAL];
	double lc;
	CString JDtype;
	double gc;
	double kuandu;
	double kuandu_right;
	double kuandu_left;
	double shunjieAngle;//顺接角度
	ACHAR BIANHAO[STR_NORMAL];
	bool isShowR; // 是否显示半径

	DPoint3d Label4RPt;          // 半径标注点（屏幕坐标）
	double Angle4Lable;            // 标注旋转角
	int isDLJD;          //是否是两条路的相交点 0表示不是，1表示是
	~JDdata() {
		x = 0;
		y = 0;
		R = 0;
		l1 = 0;
		l2 = 0;
		dist = 0;
		_tcscpy(JXLC, L"");
		lc = 0;
		JDtype = L"";
		gc = 0;
		kuandu = 0;
		kuandu_right = 0;
		kuandu_left = 0;
		shunjieAngle = 0;
		_tcscpy(BIANHAO, L"");
		isShowR = true; // 是否显示半径
		Label4RPt.Init(0.0, 0.0, 0.0);
		Angle4Lable = 0.0;
		isDLJD = 0;
	}
	JDdata() {
		x = 0;
		y = 0;
		R = 0;
		l1 = 0;
		l2 = 0;
		dist = 0;
		_tcscpy(JXLC, L"");
		lc = 0;
		JDtype = L"";
		gc = 0;
		kuandu = 0;
		kuandu_right = 0;
		kuandu_left = 0;
		shunjieAngle = 0;
		_tcscpy(BIANHAO, L"");
		isShowR = true; // 是否显示半径
		Label4RPt.Init(0.0, 0.0, 0.0);
		Angle4Lable = 0.0;
		isDLJD = 0;
	}
};

struct mllk
{
	double ml;
	double kuan_left;
	double kuan_right;
	double podu_left;
	double podu_right;
	double lujian;
	double ptk;
	CString TL;
	CString DLBH;
	~mllk() {
		ml = 0;
		kuan_left = 0;
		kuan_right = 0;
		podu_left = 0;
		podu_right = 0;
		lujian = 0;
		ptk = 1.0;
		TL = L"C组填料";
		DLBH =  L"";
	}
	mllk() {
		ml = 0;
		kuan_left = 0;
		kuan_right = 0;
		podu_left = 0;
		podu_right = 0;
		ptk = 1.0;
		TL = L"C组填料";
		DLBH = L"";
		lujian = 0;
	}
};

struct DLBPD
{
	double lc;
	double gc;
	double pd;
	double R;
	double BZLength;
	double lengthOfRoot;
	double LengthOfMiddleLine;
	double lengthOfMileageLabel;
	bool isCon2ExistRoads;


	~DLBPD() {
		lc = 0;
		gc = 0;
		pd = 0;
		R = 0;
		BZLength = 100;
		lengthOfRoot = 30;
		LengthOfMiddleLine = 0;
		lengthOfMileageLabel = 10;
		isCon2ExistRoads = false;
	}
	DLBPD() {
		lc = 0;
		gc = 0;
		pd = 0;
		R = 0;
		BZLength = 100;
		lengthOfRoot = 30;
		LengthOfMiddleLine = 0;
		lengthOfMileageLabel = 10;
		isCon2ExistRoads = false;
	}
};

struct ConnectRoad
{
	ACHAR MyBiaoHao[STR_NORMAL];
	ACHAR DLBiaoHao[STR_NORMAL];
	int JIAOxuhao;
	int RDcankao;
	int ConnectStyle;
	JDdata ConJD;

	~ConnectRoad() {
		_tcscpy(MyBiaoHao, L"");
		_tcscpy(DLBiaoHao, L"");
		JIAOxuhao = 0;
		RDcankao = 0;
		ConnectStyle = 0;
	}
	ConnectRoad() {
		_tcscpy(MyBiaoHao, L"");
		_tcscpy(DLBiaoHao, L"");
		JIAOxuhao = 0;
		RDcankao = 0;
		ConnectStyle = 0;
	}
};

struct DLHDM
{
	CString BIANHAO;
	int fenduan;
	double sml;
	double eml;
	int Ncrs;
	vector <double> ZhuangHao;

	~DLHDM() {
		BIANHAO = L"";
		fenduan = 0;
		sml = 0;
		eml = 0;
		Ncrs = 0;
		ZhuangHao.clear();
	}
	DLHDM() {
		BIANHAO = L"";
		fenduan = 0;
		sml = 0;
		eml = 0;
		Ncrs = 0;
		ZhuangHao.clear();
	}
};

struct lumianinf
{
	CString style;
	double hd;

	~lumianinf() {
		style = L"";
		hd = 0;
	}
	lumianinf() {
		style = L"";
		hd = 0;
	}
};

struct DLDrawFD
{
	double StartCml;
	double EndCml;
	int type;//0未拆除 1拆除 2拆除后重新添加新建（颜色改变）

	~DLDrawFD() {
		StartCml = 0;
		EndCml = 0;
		type = 0;
	}
	DLDrawFD() {
		StartCml = 0;
		EndCml = 0;
		type = 0;
	}
};

struct DLBPDdata
{
	CString DLBH;
	double lc, gc; // 里程高程
	double downpd, downlength; // 坡度， 坡长
	double R;
	double PDBlen; // 标注总长
	double lengthOfRoot; // 根端长
	double LengthOfMiddleLine; // 中间横线长
	double lengthOfMileageLabel; // 里程
	bool isCon2ExistRoads;

	~DLBPDdata() {
		DLBH  = L"";
		lc = 0;
		gc = 0;
		downpd = 0;
		downlength = 0;
		R = 0;
		PDBlen = 50;
		lengthOfRoot = 30;
		LengthOfMiddleLine = 0;
		lengthOfMileageLabel = 10;
		isCon2ExistRoads = 1;
	}
	DLBPDdata() {
		DLBH = L"";
		lc = 0;
		gc = 0;
		downpd = 0;
		downlength = 0;
		R = 0;
		PDBlen = 50;
		lengthOfRoot = 30;
		LengthOfMiddleLine = 0;
		lengthOfMileageLabel = 10;
		isCon2ExistRoads = 1;
	}
};

struct  Roadccinf
{
	double StartFDCml;
	double EndFDCml;
	vector<DPoint3d> CCPTArray;//拆除点数组
	ACHAR  BianHao[STR_NORMAL];

	~Roadccinf() {
		StartFDCml = 0;
		EndFDCml = 0;
		CCPTArray.clear();//拆除点数组
		_tcscpy(BianHao, L"");
	}
	Roadccinf() {
		StartFDCml = 0;
		EndFDCml = 0;
		CCPTArray.clear();//拆除点数组
		_tcscpy(BianHao, L"");
	}
};
typedef	vector<Roadccinf> RoadChaiChuArray;//道路拆除段


struct DLBJ //道路边线数据库记录结构体
{
	CString CZJXStrArray;//参照基线编号
	CString BH;//路网编号
	CString BJBH;//路边界编号
	DPoint3d ConRD;
	CString SX;//属性 路交点 交叉口点
	int isDrawPDB;//路网是否绘制坡度标
	~DLBJ() {
		CZJXStrArray =  L"";
		BH = L"";
		BJBH = L"";
		SX = L"";
		ConRD.Init(0, 0, 0);
		isDrawPDB = 1;
	}
	DLBJ() {
		CZJXStrArray = L"";
		BH = L"";
		BJBH = L"";
		SX = L"";
		ConRD.Init(0, 0, 0);
		isDrawPDB = 1;
	}
};

struct Rd_BX //道路边线结构体
{
	ACHAR LWBH[STR_NORMAL];//路网编号
	ACHAR BJBH[STR_NORMAL];//路边界编号
	vector<JDdata> JDARRAY;//交点数据信息
	RoadChaiChuArray m_ChaiChuArray;//边线拆除段
	double startMileage;
	vector<DLBPD> m_BPDArray;

	~Rd_BX() {
		_tcscpy(LWBH, L"");
		_tcscpy(BJBH, L"");
		JDARRAY.clear();
		startMileage = 0;
		m_BPDArray.clear();
	}
	Rd_BX() {
		_tcscpy(LWBH, L"");
		_tcscpy(BJBH, L"");
		JDARRAY.clear();
		startMileage = 0;
		m_BPDArray.clear();
	}
};

struct Road_BX
{
	ACHAR  SJShiTai[STR_NORMAL];             //设计时态：既有/新建/预留/在建
	double minR; //最小半径
	int M_num;
	vector<JDdata> JDARRAY;//交点数据信息
	vector<ConnectRoad> ConRD;
	double  RoadL;
	RoadChaiChuArray m_ChaiChuArray;//边线拆除段
	vector<DLDrawFD>DrawFDArray;
	double startMileage;
	vector<DLBPD> m_BPDArray;

	~Road_BX() {
		_tcscpy(SJShiTai, L"");
		minR = 0; //最小半径
		M_num = 0;
		JDARRAY.clear();//交点数据信息
		ConRD.clear();
		RoadL = 0;
		DrawFDArray.clear();
		m_BPDArray.clear();
	}
	Road_BX() {
		_tcscpy(SJShiTai, L"");
		minR = 0; //最小半径
		M_num = 0;
		JDARRAY.clear();//交点数据信息
		ConRD.clear();
		RoadL = 0;
		DrawFDArray.clear();
		m_BPDArray.clear();
	}
};

struct DLHDM_read
{
	CString BIANHAO;
	int fenduan;
	double lc;

	~DLHDM_read() {
		BIANHAO = L"";
		fenduan = 0;
		lc = 0;
	}
	DLHDM_read() {
		BIANHAO = L"";
		fenduan = 0;
		lc = 0;
	}
};

//基线属性

struct CoorInfo
{
	double NOffset;//大地到局部坐标的N平移量
	double EOffset;//大地到局部坐标的E平移量
	double Rotate;//大地到局部坐标的旋转量
	double NInsert;//大地基点N坐标// 站场局部坐标系下的旋转基点
	double EInsert;//大地基点E坐标// 站场局部坐标系下的旋转基点

	CoorInfo() {
		NOffset = 0;
		EOffset = 0;
		Rotate = 0;
		NInsert = 0;
		EInsert = 0;
	}
};

struct DLBZ  //冠号改变点、断链点、起、终点的冠号、里程表
{
	ACHAR   BianHao[STR_NORMAL];
	//ACHAR   DesignBianHao[STR_NORMAL];
	double BLC, DL;  //  断链的断前里程和断链值(+值为长链;-为断链)
	ACHAR   BGH[STR_MIN];
	ACHAR  EGH[STR_MIN]; //  断链的断前里程冠号和断后里程冠号
	double TYLC, ELC;
	DLBZ()
	{
		_tcscpy(BianHao, L"");
		BLC = 0.0;
		DL = 0.0;
		_tcscpy(BGH, L"");
		_tcscpy(EGH, L"");
		TYLC = 0.0;
		ELC = 0.0;
	}
	~DLBZ()
	{
		_tcscpy(BianHao, L"");
		BLC = 0.0;
		DL = 0.0;
		_tcscpy(BGH, L"");
		_tcscpy(EGH, L"");
		TYLC = 0.0;
		ELC = 0.0;
	}
};

struct xlpoint
{
	double x, y, a, r, lc;
	xlpoint()
	{
		x = 0.0;
		y = 0.0;
		a = 0.0;
		r = 0.0;
		lc = 0.0;
	}
	~xlpoint()
	{
		x = 0.0;
		y = 0.0;
		a = 0.0;
		r = 0.0;
		lc = 0.0;
	}
};//此处的x、y与CAD中的X、Y相反

struct LCBDATA//里程标表
{
	int lcflag;//里程类型，-1（公里标）,1-9百米标，0-断链标
	double lc;//统一里程
	ACHAR flag[STR_MIN];
	int BTSxz;//桥隧性质 0 非桥非隧非站台 1 桥头 2 隧头  3 站台头 4 站台突变头 -1 桥尾  ,-2 隧尾 ,-3 站台尾
	// -4 站台突变尾
	//		double x,y;//平面坐标
	//		ACHAR bz[STR_EXTEND];
	LCBDATA()
	{
		lcflag = 0;
		lc = 0;
		_tcscpy(flag, L"");
		BTSxz = 0;
	}
	~LCBDATA()
	{
		lcflag = 0;
		lc = 0;
		_tcscpy(flag, L"");
		BTSxz = 0;
	}
};

struct Road
{
	ACHAR CZJXStrArray[STR_NORMAL];//参照基线编号
	ACHAR GH[STR_MIN];
	ACHAR BianHaoIn[STR_NORMAL];//路网编号
	ACHAR TuHao[STR_NORMAL];
	ACHAR DLBiaoHao[STR_NORMAL];             //单条道路编号
	ACHAR DLGrate[STR_MIN];              //道路等级：I/ II /III /IV
	ACHAR  SJShiTai[STR_NORMAL];             //设计时态：既有/新建/预留/在建
	double  DLKuan;		           //3.5 /4 7 /10.5 /14 
	double minR; //最小半径

	Road_BX Road_BX_Left;
	Road_BX Road_BX_Right;

	int isZongduanmian; //0   1独立设计纵断面 
	int isHengduanmian; //0   1独立设计横断面 
	double  RoadL;			          //道路总长
	int M_num;
	vector<JDdata> JDARRAY;//交点数据信息
	int tarray;  //平面线元数
	double array[50][10]; //平面线元
	double JDarray[40][7];  // 1->N,2->E,7.超高
	double BPD_array[40][5];
	//double m_CM[80];
	vector<double>m_CM;
	int m_NCM;
	int bpd_num;
	vector<DLBPD> m_BPDArray;
	vector<DLBPD> m_BPD_yueshu;
	vector<ConnectRoad> ConRD;
	int ConRD_num;
	vector<DLHDM> DLHdmObject;
	vector <lumianinf>lumian;
	vector <JDdata>JDFor3d;
	vector<LCBDATA> pLCB;
	int NLCB;//桩数
	RoadChaiChuArray m_ChaiChuArray;//拆除段
	vector<DLDrawFD>DrawFDArray;
	int isshowBJ;//是否显示半径
	int isshowZX;//是否显示中线
	int isYLDoHDM;
	int isDisplayMileageInf;
	double startMileage;
	int NDL;
	DLBZ DLB[MAXDLNUM];  // 含起点
	double QXB[MAXJDNUM][9];
	~Road() {
		_tcscpy(CZJXStrArray, L"");
		_tcscpy(GH, L"");
		_tcscpy(BianHaoIn, L"");
		_tcscpy(TuHao, L"");
		_tcscpy(DLBiaoHao, L"");
		_tcscpy(DLGrate, L"");
		_tcscpy(SJShiTai, L"");
		DLKuan = 0;		           //3.5 /4 7 /10.5 /14 
		minR = 0; //最小半径

		isZongduanmian = 0; //0   1独立设计纵断面 
		isHengduanmian = 0; //0   1独立设计横断面 
		RoadL = 0;			          //道路总长
		M_num = 0;
		JDARRAY.clear();
		tarray = 0;
		for (int i = 0; i < 50; i++)
			for (int j = 0; j < 10; j++)
				array[i][j] = 0;
		for (int i = 0; i < 40; i++)
			for (int j = 0; j < 7; j++)
				JDarray[i][j] = 0;
		for (int i = 0; i < 40; i++)
			for (int j = 0; j < 5; j++)
				BPD_array[i][j] = 0;

		m_CM.clear();
		m_NCM = 0;
		bpd_num = 0;
		m_BPDArray.clear();
		m_BPD_yueshu.clear();
		ConRD.clear();
		ConRD_num = 0;
		DLHdmObject.clear();
		lumian.clear();
		JDFor3d.clear();
		DrawFDArray.clear(); 
		pLCB.clear();
		NLCB = 0;
		isshowBJ = 1;
		isshowZX = 0;
		isYLDoHDM = 0;
		isDisplayMileageInf = 1;
		startMileage = 0;
	}
	Road() {
		_tcscpy(CZJXStrArray, L"");
		_tcscpy(GH, L"");
		_tcscpy(BianHaoIn, L"");
		_tcscpy(TuHao, L"");
		_tcscpy(DLBiaoHao, L"");
		_tcscpy(DLGrate, L"");
		_tcscpy(SJShiTai, L"");
		DLKuan = 0;		           //3.5 /4 7 /10.5 /14 
		minR = 0; //最小半径

		isZongduanmian = 0; //0   1独立设计纵断面 
		isHengduanmian = 0; //0   1独立设计横断面 
		RoadL = 0;			          //道路总长
		M_num = 0;
		JDARRAY.clear();
		tarray = 0;
		for (int i = 0; i < 50; i++)
			for (int j = 0; j < 10; j++)
				array[i][j] = 0;
		for (int i = 0; i < 40; i++)
			for (int j = 0; j < 7; j++)
				JDarray[i][j] = 0;
		for (int i = 0; i < 40; i++)
			for (int j = 0; j < 5; j++)
				BPD_array[i][j] = 0;

		m_CM.clear();
		m_NCM = 0;
		bpd_num = 0;
		m_BPDArray.clear();
		m_BPD_yueshu.clear();
		ConRD.clear();
		ConRD_num = 0;
		DLHdmObject.clear();
		lumian.clear();
		JDFor3d.clear();
		DrawFDArray.clear();
		pLCB.clear();
		NLCB = 0;
		isshowBJ = 1;
		isshowZX = 0;
		isYLDoHDM = 0;
		isDisplayMileageInf = 1;
		startMileage = 0;
	}
};

	//范围表
struct FWTAB
{
	ACHAR BianHao[STR_NORMAL];  //编号
	ACHAR DesignBianHao[STR_NORMAL];  //外部编号
	double cml, dist;
};


struct QiuJiao_inf
{
	double kuandu; // 道路宽
	double x;      // 交点坐标
	double y;
	int RDcankao;  // 交点所属道路的交点序号
	int JIAOxuhao; // 交点与另一条相交道路的交点序号
	double R;      // 半径
	double f;      // 转角

	~QiuJiao_inf() {
		kuandu = 0;
		x = 0;
		y = 0;
		RDcankao = 0;
		JIAOxuhao = 0;
		R = 0;
		f = 0;
	}
	QiuJiao_inf() {
		kuandu = 0;
		x = 0;
		y = 0;
		RDcankao = 0;
		JIAOxuhao = 0;
		R = 0;
		f = 0;
	}
};

//设备高程
struct SBLevel
{
	ACHAR BianHao[STR_NORMAL];
	double x;
	double y;
	double z;
	double SBindex1; //属性1 用于判别相同的边线 为道路时，指代半径
	double SBindex2;//属性2 为道路时，指代路宽
	double SBindex3;//属性3 为道路时，指代路宽
	ACHAR SBtype[STR_SHORT];//设备类型

	~SBLevel()
	{
		_tcscpy(BianHao, L"");
		x = 0;
		y = 0;
		z = 0;
		SBindex1 = 0;
		SBindex2 = 0;
		SBindex3 = 0;
		_tcscpy(SBtype, L"");
	}
	SBLevel()
	{
		_tcscpy(BianHao, L"");
		x = 0;
		y = 0;
		z = 0;
		SBindex1 = 0;
		SBindex2 = 0;
		SBindex3 = 0;
		_tcscpy(SBtype, L"");
	}
};

struct DLXJDInD
{
	int Index;
	int BTSxz;
	DLXJDInD()
	{
		Index = 0;
		BTSxz = 0;
	}
	~DLXJDInD()
	{
		Index = 0;
		BTSxz = 0;
	}
};
struct  Dxshuju
{
	double m_R1;
	double m_CHJZXL1;
	double m_JZXL;
	double m_R2;
	double m_CHJZXL2;
	double m_XJJ;
	double m_L01;//缓长
	double m_L02;

	~Dxshuju() {
		m_R1 = 0;
		m_CHJZXL1 = 0;
		m_JZXL = 0;
		m_R2 = 0;
		m_CHJZXL2 = 0;
		m_XJJ = 0;
		m_L01 = 0;
		m_L02 = 0;
	}
	Dxshuju() {
		m_R1 = 0;
		m_CHJZXL1 = 0;
		m_JZXL = 0;
		m_R2 = 0;
		m_CHJZXL2 = 0;
		m_XJJ = 0;
		m_L01 = 0;
		m_L02 = 0;
	}
};
struct  Switch
{
	ACHAR CZJXStrArray[STR_NORMAL];//参照基线编号
	ACHAR  BianHao[STR_NORMAL];             //道岔内部编号
	ACHAR  SuoshuDXBianHao[STR_NORMAL];             //所属渡线编号
	ACHAR  DXGDBH[STR_NORMAL];//渡线股道编号  
	int  SwitchNum;        //道岔号数
	int  SwitchType;        //道岔类型1.普通单开2.对称双开3.对称三开4.交分5.菱形交叉
	ACHAR  InTrackNo[STR_NORMAL];         //a端所在股道(基线)编号
	ACHAR  InTrackNo_b[STR_NORMAL];         //b端所在股道(基线)编号
	ACHAR OutTrackNo[4][STR_NORMAL];

	ACHAR  TrackType[STR_NORMAL];      //钢轨类型：43、50、60、75kg
	ACHAR  CZType[STR_NORMAL];             //岔枕类型：混凝土枕和木枕
	ACHAR  TH[STR_NORMAL];                    //图号
	ACHAR  SJST[STR_NORMAL];                //设计时态：既有/新建/预留/在建
	ACHAR  BianHaoZT[STR_NORMAL];       //编号字头
	int  BZBianHao;             //道岔标注编号
	int  JYBZBianHao;             //道岔标注编号
	CString  BZStyle;               //标注类型 ：0编号 1编号 4编号
	double    XYArray[7];             //道岔线元数组 0-道岔类型 1-辙叉角(弧度) 2-左右开 3-Fwj 4-顺逆向 5-N  6-E
	double chaxinLc;
	int duxiantype;
	double   XYArraysddx[40][10];        //与GTZX线元结构一致
	int XYNum;//线元数
	int isduxian;//是否渡线
	Dxshuju SdDxCanshu;
	double a;
	double b;
	double DaoquxianR;
	//ACHAR CZTYPE[STR_NORMAL];//岔枕类型
	double m_Vz;//直向速度
	double m_VC;//侧向速度
	double m_Lq; //道岔全长
	double L1;//跟端至末根岔枕距离 
	double MaiRuVperDaoCha;//每组道岔埋入体积
	double q;
	double dist;
	ACHAR Ckml[STR_NORMAL];
	double Cml;//里程txxh
	DPoint2d DCBHBZpt;//道岔编号标注点（屏幕坐标）
	//double JDarray[10][7];  // 1->N,2->E,7.超高
	int m_IsChaiChu;
	int m_IsJYGaiYi;
	int m_ischeck;//是否检测0不检测 1检测
	int m_isdrawJYBH;//是否绘制既有编号0不画 1画
	int m_isdrawSJBH;//是否绘制设计编号0不画 1画
	int m_LianSuo;//是否连锁 0否1
	int m_isShowCheChaNum;//是否显示辙叉号数 0-不显示， 1-显示，默认1显示
	int m_isJiOuBianHao;//是否奇偶编号 0-连续编号， 1-奇偶编号，默认1奇偶编号
	double qiandist, houdist;
	double qianGFdist, houGFdist;
	double cedist, ceGFdist;
	double Angle4Lable;//旋转角
	double m_JYGDChaichuLen;//既有道岔若要拆除则，道岔前后的股道延伸拆除段长 puhao20200324
	DPoint3d Label4RatationPt;//标注旋转夹点
	ACHAR PurposeDCBH[STR_NORMAL]; //目标道岔内部编号
	ACHAR PurposeDCDesBH[STR_NORMAL];//目标道岔外部编号
	DPoint3d StaPt, End1, End2, End3;
	Int16 BuLing;//补零的变量，1表示在小于10的前面补0；2表示在小于10的前面补00，小于100的前面补0
	//20200503 puhao 组合道岔时，增加本道岔是否为 与交叉渡线 要合并的道岔，若是1，则subworlddraw中不需要绘图，不编号，不计算数量，因为已在交叉渡线中绘了
	int m_IsHebinInZhDC;//0-不是（默认），1-是

	~Switch() {
		_tcscpy(CZJXStrArray, L"");
		_tcscpy(BianHao, L"");
		_tcscpy(SuoshuDXBianHao, L"");
		_tcscpy(DXGDBH, L"");
		SwitchNum = 0;
		SwitchType = 0;
		_tcscpy(InTrackNo, L"");
		_tcscpy(InTrackNo_b, L"");

		for (int i = 0; i < 4; i++)
			_tcscpy(OutTrackNo[i], L"");
		_tcscpy(TrackType, L"");
		_tcscpy(CZType, L"");
		_tcscpy(TH, L"");
		_tcscpy(SJST, L"");
		_tcscpy(BianHaoZT, L"");
		BZBianHao = 0;             //道岔标注编号
		JYBZBianHao = 0;             //道岔标注编号
		BZStyle = L"";
		for (int i = 0; i < 7; i++)
			XYArray[i] = 0;
		chaxinLc = 0;
		duxiantype = 0;
		XYNum = 0;
		isduxian = 0;
		a = 0;
		b = 0;
		DaoquxianR = 0;
		m_Vz = 0;
		m_VC = 0;
		m_Lq = 0;
		L1 = 0;
		MaiRuVperDaoCha = 0;
		q = 0;
		dist = 0;
		_tcscpy(Ckml, L"");
		DCBHBZpt.Init(0, 0);
		m_IsChaiChu = 0;
		m_IsJYGaiYi = 0;
		m_ischeck = 0;
		m_isdrawJYBH = 0;
		m_isdrawSJBH = 0;
		m_LianSuo = 0;
		_tcscpy(PurposeDCBH, L"");
		_tcscpy(PurposeDCDesBH, L"");
		qiandist = 0;
		houdist = 0;
		qianGFdist = 0;
		houGFdist = 0;
		StaPt.Init(0, 0, 0);
		End1.Init(0, 0, 0);
		End2.Init(0, 0, 0);
		End3.Init(0, 0, 0);
		BuLing = 0;
		m_JYGDChaichuLen = 12.5;
		Angle4Lable = 0.0;
		Label4RatationPt.Init(0.0, 0.0, 0.0);
		m_isShowCheChaNum = 1;//是否显示辙叉号数 0-不显示， 1-显示，默认1显示
		m_isJiOuBianHao = 1;//是否奇偶编号 0-连续编号， 1-奇偶编号，默认1奇偶编号，用于复式交分给出4连号
		m_IsHebinInZhDC = 0;//是否为 与交叉渡线 要合并的道岔，若是1，则subworlddraw中不需要绘图，不编号，不计算数量，因为已在交叉渡线中绘了,0-不是
	}
	Switch() {
		_tcscpy(CZJXStrArray, L"");
		_tcscpy(BianHao, L"");
		_tcscpy(SuoshuDXBianHao, L"");
		_tcscpy(DXGDBH, L"");
		SwitchNum = 0;
		SwitchType = 0;
		_tcscpy(InTrackNo, L"");
		_tcscpy(InTrackNo_b, L"");

		for (int i = 0; i < 4; i++)
			_tcscpy(OutTrackNo[i], L"");
		_tcscpy(TrackType, L"");
		_tcscpy(CZType, L"");
		_tcscpy(TH, L"");
		_tcscpy(SJST, L"");
		_tcscpy(BianHaoZT, L"");
		BZBianHao = 0;             //道岔标注编号
		JYBZBianHao = 0;             //道岔标注编号
		BZStyle = L"";
		for (int i = 0; i < 7; i++)
			XYArray[i] = 0;
		chaxinLc = 0;
		duxiantype = 0;
		XYNum = 0;
		isduxian = 0;
		a = 0;
		b = 0;
		DaoquxianR = 0;
		m_Vz = 0;
		m_VC = 0;
		m_Lq = 0;
		L1 = 0;
		MaiRuVperDaoCha = 0;
		q = 0;
		dist = 0;
		_tcscpy(Ckml, L"");
		DCBHBZpt.Init(0, 0);
		m_IsChaiChu = 0;
		m_IsJYGaiYi = 0;
		m_ischeck = 0;
		m_isdrawJYBH = 0;
		m_isdrawSJBH = 0;
		m_LianSuo = 0;
		_tcscpy(PurposeDCBH, L"");
		_tcscpy(PurposeDCDesBH, L"");
		qiandist = 0;
		houdist = 0;
		qianGFdist = 0;
		houGFdist = 0;

		StaPt.Init(0, 0, 0);
		End1.Init(0, 0, 0);
		End2.Init(0, 0, 0);
		End3.Init(0, 0, 0);
		BuLing = 0;
		m_JYGDChaichuLen = 12.5;
		Angle4Lable = 0.0;
		Label4RatationPt.Init(0.0, 0.0, 0.0);
		m_isShowCheChaNum = 0;//是否显示辙叉号数 0-不显示， 1-显示，默认1显示
		m_isJiOuBianHao = 1;
		m_IsHebinInZhDC = 0;
	}
};


//基线属性
struct  Track
{
	CString  BianHao;         //内部编号
	CString  CZXBianHao;         //基线编号
	CString  DesignBianHao;         //设计编号
	CString  DesignJYBianHao;         //既有编号
	CString  DesignCZXBianHao;         //基线编号
	CString  TrackType;       //钢轨类型：43、50、60、75kg
	CString  GZType;        //轨枕类型：、木枕
	CString  JLType;          //进路类型：客货/客/货
	CString  JLDirection;      //进路方向：双向/从左到右/从右到左
	double  UpValidL;		    //上行方向股道有效长
	double  DownValidL;		 //下行方向股道有效长
	double  UpValidL_YL;		    //上行方向股道有效长
	double  DownValidL_YL;		 //下行方向股道有效长
	double  Span;			    //股道全长
	double  TracklayingL;	    //股道铺轨长
	CString  SJST;              //设计时态：既有/新建/预留/在建
	CString LCGH;//里程冠号
	double startMileage;//起始里程
	int ISDH;                       //是否电化：1:是；0否
	int ISHWCX;                //是否货物超限：1:是；0否
	int IfHasGF;
	double len;//基线长
	int JDNum;//交点数
	double detN;
	double detE;
	double detA;
	int  XLType;//线别（正线=1，到发线=2 其他站线=3 次要站线=4）
	int isDXGD;			//是否是渡线
	int ZMSLPerKm;  //每公里枕木数量
	double BZBHCml;
	double BZYXCCml;
	double BZDHCml;
	double BZJLCml;
	vector<DPoint3d> QXBZPt;

	CString WBianHaoZiTou;
	CString SXYXCQDID;
	CString SXYXCZDID;
	CString XXYXCQDID;
	CString XXYXCZDID;

	int SXYXCQDType;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int SXYXCZDType;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int XXYXCQDType;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int XXYXCZDType;//1-信号机  2-警冲标 3-道岔a端 4-车挡  

	CString SXYXCQDID_YL;
	CString SXYXCZDID_YL;
	CString XXYXCQDID_YL;
	CString XXYXCZDID_YL;

	int SXYXCQDType_YL;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int SXYXCZDType_YL;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int XXYXCQDType_YL;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
	int XXYXCZDType_YL;//1-信号机  2-警冲标 3-道岔a端 4-车挡  


	CString GTZXQDID;//起点设备ID
	CString GTZXZDID;//终点设备ID
	int GTZXQDType;//1-道岔  2-车挡  
	int GTZXZDType;//1-道岔  2-车挡  
	int isuserQZD;
	vector<CString> JYDC;
	double LengthBeforeBZ, LengthAfterBZ;//纵坡变坡点两端坡长，用于标注

	int isYanShen;//是否延伸
	double YanShenLength;//长度
	int LCcanzhao;
	int BPDLCdir;
	int TjIndex;

	int isYLDoHdm;//是否预留绘制横断面
	int IsJiSuanJiZhunXian;//计算基准

	Track() {
		BianHao = L"";
		CZXBianHao = L"";
		DesignBianHao = L"";
		DesignJYBianHao = L"";
		DesignCZXBianHao = L"";
		TrackType = L"";
		GZType = L"";
		JLType = L"";
		JLDirection = L"";
		UpValidL = 0;
		DownValidL = 0;
		UpValidL_YL = 0;
		DownValidL_YL = 0;
		Span = 0;
		TracklayingL = 0;
		SJST = L"";
		LCGH = L"";
		startMileage = 0;//起始里程
		ISDH = 0;                      //是否电化：1:是；0否
		ISHWCX = 0;               //是否货物超限：1:是；0否
		IfHasGF = 0;
		len = 0;
		JDNum = 0;
		detN = 0;
		detE = 0;
		detA = 0;
		XLType = 0;//线别（正线=1，到发线=2 其他站线=3 次要站线=4）
		isDXGD = 0;			//是否是渡线
		ZMSLPerKm = 0;  //每公里枕木数量
		BZBHCml = 0;
		BZYXCCml = 0;
		BZDHCml = 0;
		BZJLCml = 0;
		QXBZPt.clear();

		WBianHaoZiTou = L"";
		SXYXCQDID = L"";
		SXYXCZDID = L"";
		XXYXCQDID = L"";
		XXYXCZDID = L"";

		SXYXCQDType = 0;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
		SXYXCZDType = 0;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
		XXYXCQDType = 0;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
		XXYXCZDType = 0;//1-信号机  2-警冲标 3-道岔a端 4-车挡  

		SXYXCQDID_YL = L"";
		SXYXCZDID_YL = L"";
		XXYXCQDID_YL = L"";
		XXYXCZDID_YL = L"";

		SXYXCQDType_YL = 0;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
		SXYXCZDType_YL = 0;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
		XXYXCQDType_YL = 0;//1-信号机  2-警冲标 3-道岔a端 4-车挡  
		XXYXCZDType_YL = 0;//1-信号机  2-警冲标 3-道岔a端 4-车挡  


		GTZXQDID = L"";
		GTZXZDID = L"";
		GTZXQDType = 0;//1-道岔  2-车挡  
		GTZXZDType = 0;//1-道岔  2-车挡  

		isuserQZD = 0;
		JYDC.clear();
		LengthBeforeBZ = 0;
		LengthAfterBZ = 0;//纵坡变坡点两端坡长，用于标注

		isYanShen = 0;//是否延伸
		YanShenLength = 0;//长度
		LCcanzhao = 0;
		BPDLCdir = 0;
		TjIndex = 1;

		isYLDoHdm = 0;
		IsJiSuanJiZhunXian = 0;
	}
};
struct DCAndQX
{
	ACHAR ZT[STR_NORMAL];//字头
	int BianHao;
	double PtN;//N坐标
	double PtE;//E坐标
	double Projml;//投影里程
	CString Leibie;

	~DCAndQX() {
		_tcscpy(ZT, L"");//字头
		BianHao = 0;
		PtN = 0;//N坐标
		PtE = 0;//E坐标
		Projml = 0;//投影里程
		Leibie = L"";
	}
	DCAndQX() {
		_tcscpy(ZT, L"");//字头
		BianHao = 0;
		PtN = 0;//N坐标
		PtE = 0;//E坐标
		Projml = 0;//投影里程
		Leibie = L"";
	}
};
//股道表
struct GDB
{
	ACHAR BH[STR_NORMAL];//编号
	ACHAR Name[STR_NORMAL];//名称
	ACHAR GX[STR_NORMAL];//轨型
	ACHAR StartDCZT[STR_NORMAL];
	ACHAR StartDCBH[STR_NORMAL];//起道岔
	vector<CString> DCNoArray;
	ACHAR EndDCBH[STR_NORMAL];//终道岔
	ACHAR EndDCZT[STR_NORMAL];//终道岔
	ACHAR QuanChang[STR_NORMAL];//全长
	ACHAR YouXiaoChang[STR_NORMAL];//有效长
	ACHAR PuGuiChang[STR_NORMAL];//铺轨长
	ACHAR Note[STR_NORMAL];

	~GDB() {
		_tcscpy(BH, L"");//编号
		_tcscpy(Name, L"");//名称
		_tcscpy(GX, L"");//轨型
		_tcscpy(StartDCZT, L"");
		_tcscpy(StartDCBH, L"");//起道岔
		DCNoArray.clear();
		_tcscpy(EndDCBH, L"");//终道岔
		_tcscpy(EndDCZT, L"");//终道岔
		_tcscpy(QuanChang, L"");//全长
		_tcscpy(YouXiaoChang, L"");//有效长
		_tcscpy(PuGuiChang, L"");//铺轨长
		_tcscpy(Note, L"");
	}
	GDB() {
		_tcscpy(BH, L"");//编号
		_tcscpy(Name, L"");//名称
		_tcscpy(GX, L"");//轨型
		_tcscpy(StartDCZT, L"");
		_tcscpy(StartDCBH, L"");//起道岔
		DCNoArray.clear();
		_tcscpy(EndDCBH, L"");//终道岔
		_tcscpy(EndDCZT, L"");//终道岔
		_tcscpy(QuanChang, L"");//全长
		_tcscpy(YouXiaoChang, L"");//有效长
		_tcscpy(PuGuiChang, L"");//铺轨长
		_tcscpy(Note, L"");
	}
};

//车挡
struct  CD
{
	ACHAR CZJXStrArray[STR_NORMAL];//参照基线编号
	ACHAR Type[STR_NORMAL];//车挡形式 弯轨式、土堆式、浆砌片石式、钢轨架车挡
	ACHAR  BianHao[STR_NORMAL];//车挡编号
	ACHAR  TH[STR_NORMAL];   //图号
	ACHAR  TrackNo[STR_NORMAL];  //所属股道(基线)编号
	double fwj;//方位角
	double  E;
	double  N; //车挡坐标
	int  IsAddDCQ;//是否增加挡车器
	double Dist_DCQToCD;//挡车器距车档的距离
	ACHAR  CDTH[STR_NORMAL];   //挡车器图号  车挡图号为TH
	//ACHAR  DCQTH[STR_NORMAL];   //图号
	ACHAR CDType[STR_NORMAL];//挡车器形式
	ACHAR DCQType[STR_NORMAL];
	ACHAR SheJiShiTai[STR_NORMAL];//设计时态
	int NoteBianhao;//标注编号
	int LorR;
	ACHAR  Ckml[STR_NORMAL]; //坐标对应的里程
	double DistToJX; //偏距
	ACHAR WBianHaoZiTou[STR_NORMAL];
	DPoint3d m_CDBHPT;
	int m_IsChaiChu;
	// 20190325 针对车档标注记录绝对坐标问题，为兼容老版本数据库
	double CDBianhaoE; // 标注参照基线里程
	double CDBianhaoN; // 标注参照基线支距

	//通信信号出图.王许生
	double kmlForCS;//不带里程的冠号
	ACHAR GH[STR_SHORT];//分离出的冠号

	double Angle4Lable;//旋转角
	DPoint3d Label4RatationPt;//标注旋转夹点


	~CD() {
		_tcscpy(CZJXStrArray, L"");
		_tcscpy(Type, L"");
		_tcscpy(BianHao, L"");
		_tcscpy(TH, L"");
		_tcscpy(TrackNo, L"");
		fwj = 0;//方位角
		E = 0;
		N = 0; //车挡坐标
		IsAddDCQ = 0;//是否增加挡车器
		Dist_DCQToCD = 0;//挡车器距车档的距离
		_tcscpy(CDTH, L"");
		_tcscpy(CDType, L"");
		_tcscpy(DCQType, L"");
		_tcscpy(SheJiShiTai, L"");
		NoteBianhao = 0;
		LorR = 0;
		_tcscpy(Ckml, L"");
		DistToJX = 0; //偏距
		_tcscpy(WBianHaoZiTou, L"");
		m_CDBHPT.Init(0, 0, 0);
		m_IsChaiChu = 0;
		kmlForCS = 0;
		_tcscpy(GH, L"");
		CDBianhaoE = -999.0;
		CDBianhaoN = -999.0;
		Angle4Lable = 0.0;
		Label4RatationPt.Init(0.0, 0.0, 0.0);
	}
	CD() {
		_tcscpy(CZJXStrArray, L"");
		_tcscpy(Type, L"");
		_tcscpy(BianHao, L"");
		_tcscpy(TH, L"");
		_tcscpy(TrackNo, L"");
		fwj = 0;//方位角
		E = 0;
		N = 0; //车挡坐标
		IsAddDCQ = 0;//是否增加挡车器
		Dist_DCQToCD = 0;//挡车器距车档的距离
		_tcscpy(CDTH, L"");
		_tcscpy(CDType, L"");
		_tcscpy(DCQType, L"");
		_tcscpy(SheJiShiTai, L"");
		NoteBianhao = 0;
		LorR = 0;
		_tcscpy(Ckml, L"");
		DistToJX = 0; //偏距
		_tcscpy(WBianHaoZiTou, L"");
		m_CDBHPT.Init(0, 0, 0);
		m_IsChaiChu = 0;
		kmlForCS = 0;
		_tcscpy(GH, L"");
		CDBianhaoE = -999.0;
		CDBianhaoN = -999.0;
	}
};
struct PDTAB//变坡点表
{
	ACHAR BianHao[STR_NORMAL];
	ACHAR DesignBianHao[STR_NORMAL];
	ACHAR GH[STR_MIN];//变坡点冠号
	double  ml;//变坡点里程
	double  Level;//设计高程
	double  JXcml;
	double Rshu, RLen;//竖曲线半径,长度
	double degree, length;//坡度，坡长
	ACHAR Notes[STR_NORMAL];//附注
	ACHAR CKml[STR_NORMAL];
	double cml;//统一里程
	double PdbSYXLength1;//坡度标示意线长1
	double PdbSYXLength2;//坡度标示意线长2
	double PdbHXLength;//坡度横线示意线长
	double LCBLength;//里程标示意线长
	int IsJiSuanJiZhunXian;
	double LuMianH;//正线：轨面高程，其他：路面高程
	CString BiaoZhuLC;//标注里程
	int isShow;//是否绘制该坡度标 0不显示 1空 2 顺接 
	int isDrawXX;//是否绘制XX符 0不绘 1绘

	~PDTAB() {
		_tcscpy(BianHao, L"");
		_tcscpy(DesignBianHao, L"");
		_tcscpy(GH, L"");
		ml = 0;
		JXcml = 0;
		Level = 0;
		Rshu = 0;
		RLen = 0;
		degree = 0;
		length = 0;
		_tcscpy(Notes, L"");
		_tcscpy(CKml, L"");
		cml = 0;
		PdbSYXLength1 = 0;
		PdbSYXLength2 = 0;
		PdbHXLength = 0;
		LCBLength = 0;
		IsJiSuanJiZhunXian = 0;
		LuMianH = 0;
		BiaoZhuLC = L"";//标注里程
		isShow = 0;
		isDrawXX = 0;
	}
	PDTAB() {
		_tcscpy(BianHao, L"");
		_tcscpy(DesignBianHao, L"");
		_tcscpy(GH, L"");
		ml = 0;
		JXcml = 0;
		Level = 0;
		Rshu = 0;
		RLen = 0;
		degree = 0;
		length = 0;
		_tcscpy(Notes, L"");
		_tcscpy(CKml, L"");
		cml = 0;
		PdbSYXLength1 = 0;
		PdbSYXLength2 = 0;
		PdbHXLength = 0;
		LCBLength = 0;
		IsJiSuanJiZhunXian = 0;
		LuMianH = 0;
		BiaoZhuLC = L"";//标注里程
		isShow = 0;
		isDrawXX = 0;
	}
};
struct GCSL_Sta
{
	double ZYLand;//征用土地
	double CaiQian;//拆迁
	double TTF;//添土方
	double Tglt;//添改良土方
	double WF[6];//挖1-6
	double Gll;//隔离栏
	double QJBT;//清基表土
	double AGrass;//植草
	double Fswg;//附属污工 由水沟浆砌面积算
	double Jgfhwg;//加固防护污工 由护肩面积算
	double Dtq;//挡土墙
	double PGLen_WZ;//无砟铺轨长
	double PGLen_YZ;//有砟铺轨长
	int Switch_DK_Over18;//18号以上单开道岔数目
	int Switch_DK_Blew18;//18号以下单开道岔数目
	int Switch_TS;//特种道岔组数

	GCSL_Sta()
	{
		ZYLand = 0;
		CaiQian = 0;
		TTF = 0;
		Tglt = 0;
		for (int i = 0; i < 6; i++)
			WF[i] = 0;
		Gll = 0;
		QJBT = 0;
		AGrass = 0;
		Fswg = 0;
		Jgfhwg = 0;
		Dtq = 0;
		PGLen_WZ = 0;
		PGLen_YZ = 0;
		Switch_DK_Over18 = 0;
		Switch_DK_Blew18 = 0;
		Switch_TS = 0;
	}
};
//剩余数量
struct LeftShuLinag
{
	double shuliang;
	CString GGLX;//钢轨类型
	CString GZLX;//轨枕类型
	int GENnum;
	~LeftShuLinag() {
		shuliang = 0;
		GGLX = L"";//钢轨类型
		GZLX = L"";
		GENnum = 0;
	}
	LeftShuLinag() {
		shuliang = 0;
		GGLX = L"";//钢轨类型
		GZLX = L"";
		GENnum = 0;
	}
};
struct onetrack//一根股道
{
	DPoint3d pTrackpoint[4];
	int Trackpointnum;

	onetrack()
	{
		Trackpointnum = 0;
		for (int i = 0; i < 4; i++)
			pTrackpoint[i].Init(0, 0, 0);
	}
};
struct LMD
{
	ACHAR CZJXStrArray[STR_NORMAL];//参照基线编号
	ACHAR sjst[STR_NORMAL];
	ACHAR BiaoHao[STR_NORMAL];
	ACHAR in_gudaoBiaoHao[STR_NORMAL];
	ACHAR out_gudaoBiaoHao[STR_NORMAL];
	ACHAR lmdtype[STR_NORMAL];
	double xuanbi;
	double kuadu_you;
	double kuadu_zuo;
	double changdu;
	ACHAR LC_begin[STR_NORMAL];
	ACHAR LC_end[STR_NORMAL];
	ACHAR LC_center[STR_NORMAL];
	DPoint3d PTCenter;
	double tQ;//额定起重量
	int numT;//台数
	int guixing;//轨型
	DPoint3d pt1, pt2, pt3, pt4;

	~LMD() {
		_tcscpy(CZJXStrArray, L"");
		_tcscpy(sjst, L"");
		_tcscpy(BiaoHao, L"");
		_tcscpy(in_gudaoBiaoHao, L"");
		_tcscpy(out_gudaoBiaoHao, L"");
		_tcscpy(lmdtype, L"");
		xuanbi = 0;
		kuadu_you = 0;
		kuadu_zuo = 0;
		changdu = 0;
		_tcscpy(LC_begin, L"");
		_tcscpy(LC_end, L"");
		_tcscpy(LC_center, L"");
		PTCenter.Init(0, 0, 0);
		tQ = 0;
		numT = 0;
		guixing = 0;
		pt1.Init(0, 0, 0);
		pt2.Init(0, 0, 0);
		pt3.Init(0, 0, 0);
		pt4.Init(0, 0, 0);
	}
	LMD() {
		_tcscpy(CZJXStrArray, L"");
		_tcscpy(sjst, L"");
		_tcscpy(BiaoHao, L"");
		_tcscpy(in_gudaoBiaoHao, L"");
		_tcscpy(out_gudaoBiaoHao, L"");
		_tcscpy(lmdtype, L"");
		xuanbi = 0;
		kuadu_you = 0;
		kuadu_zuo = 0;
		changdu = 0;
		_tcscpy(LC_begin, L"");
		_tcscpy(LC_end, L"");
		_tcscpy(LC_center, L"");
		PTCenter.Init(0, 0, 0);
		tQ = 0;
		numT = 0;
		guixing = 0;
		pt1.Init(0, 0, 0);
		pt2.Init(0, 0, 0);
		pt3.Init(0, 0, 0);
		pt4.Init(0, 0, 0);
	}
};


struct  gglxinf
{
	int YXGFlag;//异型轨标示 0-没有异型轨 1-向大里程方向加异型轨 -1小里程方向加异型轨  
	ACHAR GGLX[STR_SHORT];//钢轨类型
	double FDCML;//分段里程
	ACHAR  BianHao[STR_NORMAL];//股道编号
	double YXGEndCml;//异形轨终点里程
	double E;
	double N;
	ACHAR  DesignBianHao[STR_NORMAL];//股道设计编号
	int IsDC;
};
struct  gzlcinf //轨枕范围
{
	double dml;
	ACHAR GZTYPE[STR_SHORT];
	int zmsl;
	double FDCML;
	ACHAR  BianHao[STR_NORMAL];
	double E;
	double N;
	ACHAR DesignBianHao[STR_NORMAL];

	gzlcinf() {
		dml = 0;
		_tcscpy(GZTYPE, L"");
		zmsl = 0;
		FDCML = 0;
		_tcscpy(BianHao, L"");
		E = 0;
		N = 0;
		_tcscpy(DesignBianHao, L"");
	}
};
struct  hlglxinf
{
	//	ACHAR StartFDLC[STR_SHORT];//起始里程
	//	ACHAR EndFDLC[STR_SHORT];//终点里程
	double StartFDCml;
	double EndFDCml;
	ACHAR  BianHao[STR_NORMAL];//所属股道内部编号
	ACHAR DesignBianHao[STR_NORMAL]; //所属股道外部编号
	int BianCe;//0为单侧 1为双侧 
	DPoint2d StaPt;
	DPoint2d EndPt;
	ACHAR GGLX[STR_SHORT];
};
typedef	vector<gzlcinf> GZLCArray;
typedef	vector<hlglxinf> HLGLXArray;//护轮轨
typedef	vector<gglxinf> GGLXArray;
struct BZTAB//标注表
{
	double BZBHCml;
	double JYBHCml;
	double BZYXCCml;
	double BZDHCml;
	double BZJLCml;
	vector<DPoint3d> QXBZPt;
	vector<DPoint3d> YSBZPt;
	int ISDrawYXC;
	int ISDrawJLF;
	int ISDrawDH;
	int ISDrawQXBH;
	int ISDrawGDBH;
	int ISDrawJYBH;
	int ISDrawLCB;
	int ISDrawPDB;
	int ISDrawJDBZ;
	int ISDrawPeiGui;
	int ISDrawPDBGM;//是否画坡度标轨面
	int ISDrawPDBML;//是否画坡度标里程

	double BZSml;
	double BZEml;//标注段起终里程

	ACHAR BianHao[STR_NORMAL];
	vector<double> Angle4Lable;//旋转角
	//vector<AcGePoint3d> Label4RatationPt;//标注旋转夹点

};
struct QXTAB//曲线表
{
	int jdno;//交点号
	double x, y, zj, R, l1, l2, T1, T2, L, jzxl, ChaoGao;
	CString BGH, EGH;//ZH,HZ桩冠号
	double Bml, Eml;//起终里程
	double InDL;//		内业断链
	ACHAR BianHao[STR_NORMAL];  //编号
	ACHAR DesignBianHao[STR_NORMAL];  //外部编号
	ACHAR  JDCKml[STR_NORMAL];
	double DistToJX;
};
struct  dzlcinf //道砟里程分段范围
{
	double FDCML;
	ACHAR  BianHao[STR_NORMAL];
	ACHAR DesignBianHao[STR_NORMAL];
	ACHAR DZTYPE[STR_SHORT];// 无砟 有砟
	double UpBottomkuan; //无砟 道床底宽 有砟 道床顶宽（既有）
	double GDgaodu_DZhoudu;//无砟 轨道高度 有砟 道砟厚度
	double polv;//既有时态时 股道边坡坡率
	DPoint2d FenDuanPT;

	dzlcinf() {
		FDCML = 0;
		_tcscpy(BianHao, L"");
		_tcscpy(DesignBianHao, L"");
		_tcscpy(DZTYPE, L"");
		UpBottomkuan = 0; //无砟 道床底宽 有砟 道床顶宽（既有）
		GDgaodu_DZhoudu = 0;//无砟 轨道高度 有砟 道砟厚度
		polv = 0;//既有时态时 股道边坡坡率
		FenDuanPT.Init(0, 0);
	}
};
typedef	vector<dzlcinf> DZLCArray;
struct  dhinf //电化信息
{
	int isDH;//0不电化 1电化
	double FDCML;
	ACHAR  BianHao[STR_NORMAL];
	ACHAR DesignBianHao[STR_NORMAL];
	DPoint2d FenDuanPT;
	double DHFLength;
	dhinf() {
		isDH = 0;//0不电化 1电化
		FDCML = 0;
		_tcscpy(BianHao, L"");
		_tcscpy(DesignBianHao, L"");
		FenDuanPT.Init(0, 0);
		DHFLength = 5;
	}
};
typedef	vector<dhinf> DHArray;
struct  dcdkinf //道床顶宽
{
	double dml;
	double DCDK;
	double FDCML;//统一里程
	ACHAR  BianHao[STR_NORMAL];
	ACHAR DesignBianHao[STR_NORMAL];

	dcdkinf() {
		dml = 0;
		DCDK = 0;
		FDCML = 0;//统一里程
		_tcscpy(BianHao, L"");
		_tcscpy(DesignBianHao, L"");
	}
};
typedef	vector<dcdkinf> DCDKArray;
struct PGB//配轨表
{
	double PeiGuiLength;
	ACHAR BianHao[STR_NORMAL];
};

struct  ccinf
{
	double StartFDCml;
	double EndFDCml;

	DPoint2d StaPt;//反向时候用
	DPoint2d EndPt;

	ACHAR  BianHao[STR_NORMAL];
	int isdraw;//是否绘制XX 
	int cctype;//拆除类型 0拆线上、线下 1只拆线上
};
typedef	vector<ccinf> ChaiChuArray;//拆除段
struct  lydinf
{
	double StartFDCml;
	double EndFDCml;
	ACHAR  GDBianHao[STR_NORMAL]; // 股道编号
	ACHAR  LYGDBianHao[STR_NORMAL];//（被）利用的股道内部编号
	ACHAR  LYGDDesignBianHao[STR_NORMAL];//（被）利用的股道编号

	DPoint2d StaPt;//反向时候用
	DPoint2d EndPt;
	int lydtype;//利用段类型 0全利用 1拨道 

	lydinf()
	{
		StartFDCml = 0;
		EndFDCml = 0;
		_tcscpy(GDBianHao, L"");
		_tcscpy(LYGDBianHao, L"");
		_tcscpy(LYGDDesignBianHao, L"");

		StaPt.Init(0, 0);//反向时候用
		EndPt.Init(0, 0);
		lydtype = 0;
	}
	~lydinf()
	{
		StartFDCml = 0;
		EndFDCml = 0;
		_tcscpy(GDBianHao, L"");
		_tcscpy(LYGDBianHao, L"");
		_tcscpy(LYGDDesignBianHao, L"");

		StaPt.Init(0, 0);//反向时候用
		EndPt.Init(0, 0);
		lydtype = 0;
	}
};
typedef	vector<lydinf> LYDArray;//利用段