#pragma once #include "EmbellishBaseLib.h" #include "GeoMap.h" #include "ProjectionLib/Projection.h" #include "EmbellishBaseLib.h" #include "CoordinateConvertor.h" namespace NFormatReader { namespace NGeoMapReader { class CGeoMapBase : public CEmbellishBaseLib { public: CGeoMapBase(void); virtual ~CGeoMapBase(void); bool m_bScreenXY; //是否进行坐标转换,GDB中进行,GXF不进行 CScreenXY sxy; //图纸坐标与实际坐标转换 CProjection xyz; //为了投影转换 int InitProjection(GMProjection& pro); CString m_strProjection; //投影参数 void AddZone(double& x); //增加带号 int m_zone; //带号 void SetMapInfo(GMFileHead* pv); void SetMapInfo(GMLayerHead* pv); int SetMapUnit(int gm_unit); void SetScale(double xScale, double yScale); CString m_strRootLayer; //根目录 CString m_strSubLayer; void FormatSetLayer(LPCTSTR lpszLayerName=NULL); void FormatSetLayer(COLORREF color); CRect8 GetUserRect(GMMapInfo& mapInfo); CRect8 GetRealRect8(IRect rt); //获得实际坐标 CRect8 GetRealRect8(DRect rt); //获得实际坐标 COLORREF GetColor(GColor& cl); //获得颜色 double GetWidth(double w); //获得宽度,参数单位为“毫米” double GetWidth(int w); //获得宽度,参数单位为? UINT GetCurveSmoothState(int nIndex); //根据平滑状态获得双狐类型 CString ToDF_Text(CString cmd, int& bScript); //转换为双狐串 virtual void ChangeCoordinate(double& x, double& y); virtual void ScaleCoordinate(double& x, double& y); void LayerToMapCoord(int &x, int &y); //层位坐标转换为图件坐标 double GetPaperWidth(double width); double GetUserHeight(double height); double GetUserWidth(double width); CCoordinateConvertor *m_pMapConvertor; // 坐标转换工具 CCoordinateConvertor *m_pLayerConvertor; // 坐标转换工具 protected: CSize8 m_szScale; //图件坐标比例 double m_dScale; //文字及曲线宽度缩放比例 public: //与GeoMap对应的符号库、修饰库,为了读取文件时从该库中按照层名搜索修饰:Layer:\CurveType\曲线类型索引号 void InitLib(void); CString GetSymbolName(int nSymbolID); void* FindToAddSymbol(int nSymbolID, COLORREF symbolColor); public: //for gdb format POSITION AddPolyline(GMPolyline* pPolyline, IPoint* pt); POSITION AddIsoLine(GMIsoline* pIsoLine, IPoint* pt); POSITION AddFault(GMFault* pFault, IPoint* pt); POSITION AddPolygon(GMPolygon* pPolygon, IPoint* pt); POSITION AddRectangle(GMRectangle* pv); POSITION AddText(GMText* pv); POSITION AddPie(GMPie* pv); POSITION AddWell(GMWell* pv); POSITION AddOilWaterCol(GMOilWaterCol * waterCol); POSITION AddDataCross(GMDataCross* pv); POSITION AddSeisLine(GMSeisLine* pv); POSITION AddSeisArea(GMSeisArea* pv, IPoint* pt); POSITION AddSeisSection(GMSeisSection* pv, float *pData); POSITION AddFrame(GMMapFrame* pv); POSITION AddGrid(GMGrid* pv); POSITION AddMetaFile(GMMetafile* pv, BYTE* pFileBuffer); POSITION AddBmp(GMBmp* pv, BYTE* pFileBuffer); POSITION AddScale(GMScale* pv); POSITION AddSymbol(GMSymbol* pv); POSITION AddWellText(GMWellText* pv);//, GMText* pt); POSITION AddReside(GMReside* pv); POSITION AddAxis(GMAxis* pv); POSITION AddLegendFrame(GMLegend* pv); POSITION AddCompass(GMCompass* pv); POSITION AddCustom(GMCustom* pv); POSITION AddRichText(GMRichText* pv, CString text); POSITION AddWellMarker(GMWellMarker *pv); //后添加 POSITION AddLog(GMLog *log); //测井曲线 POSITION AddWellLog(GMWellLog * wellLog); //井旁曲线 POSITION AddGraphy(GMGraphy * graphy); //统计图 POSITION AddTriagonal(GMTriangle * triangle); //三角图 // for gxf format POSITION AddText(GxfText* pv); POSITION AddPolyline(GMPolyline* pPolyline, DPoint* pt); POSITION AddIsoLine(GxfIsoline* pIsoLine, DPoint* pt); POSITION AddFault(GMFault* pFault, DPoint* pt); POSITION AddPolygon(GxfPolygon* pPolygon, DPoint* pt); POSITION AddRectangle(GxfRect* pv); POSITION AddWell(GxfWell* pv); POSITION AddFrame(GxfFrame* pv); POSITION AddSeisLine(GxfSeisLine* pv, DPoint3* dp); POSITION AddLegendFrame(GxfLegend* pv); POSITION AddReside(GxfReside* pv); POSITION AddSymbol(GxfSymbol* pv); POSITION AddScale(GxfScale* pv); POSITION AddPie(GxfPie* pv); POSITION AddBmp(GxfBmp* pv, BYTE* pBmpBuffer); POSITION AddMetaFile(GxfMeta* pv, BYTE* pFileBuffer); }; }; };