|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//<2F>ļ<EFBFBD>: Gxf<78><66>ʽ<EFBFBD><CABD>д<EFBFBD><D0B4>
|
|
|
|
|
|
//<2F><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>:
|
|
|
|
|
|
// ת<><D7AA>GeoMap Gxf<78><66><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
#include ".\geomapbase.h"
|
|
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
|
|
|
|
namespace NFormatReader
|
|
|
|
|
|
{
|
|
|
|
|
|
namespace NGeoMapReader
|
|
|
|
|
|
{
|
|
|
|
|
|
class GXFElementCollection;
|
|
|
|
|
|
class CGeoMapGxfWriter : public CGeoMapBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CGeoMapGxfWriter(void);
|
|
|
|
|
|
virtual ~CGeoMapGxfWriter(void);
|
|
|
|
|
|
public:
|
|
|
|
|
|
list<GXFElementCollection> elementList;
|
|
|
|
|
|
public:
|
|
|
|
|
|
BOOL WriteGxf(const char * const outFilePath); // <20>ļ<EFBFBD>·<EFBFBD><C2B7>
|
|
|
|
|
|
int WritePaper(GxfMap * paper); // ֽ<>Ŵ<EFBFBD>С
|
|
|
|
|
|
int WriteMap(GxfMap * map); // ӳ<><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WriteProjection(GMProjection * projection); // ͶӰ<CDB6><D3B0><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WriteTransform(GxfTransform * transform); // <20><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>
|
|
|
|
|
|
int WriteLayer(GxfLayer * layer); // <20><>
|
|
|
|
|
|
int WriteText(GxfText * text); // <20>ı<EFBFBD>/<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WriteSymbol(GxfSymbol * symbol); // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WriteRect(GxfRect * rect); // <20><><EFBFBD>ο<EFBFBD>
|
|
|
|
|
|
int WriteBmp(GxfBmp * bmp, BYTE* pBmpBuffer); // λͼ
|
|
|
|
|
|
int WriteMeta(GxfMeta * bmp, BYTE* pBmpBuffer); // Դ<>ļ<EFBFBD>
|
|
|
|
|
|
int WriteLog(GxfLog * log, BYTE* pBmpBuffer); // <20>⾮<EFBFBD><E2BEAE><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WriteSeissection(GxfSeisSection * section,BYTE * pBmpBuffer);// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WritePolygon(GxfPolygon * polygon, DPoint* pt); // <20><>
|
|
|
|
|
|
int WritePolyline(GMPolyline * polyline, DPoint * pt); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WriteContour(GxfIsoline * contour, DPoint * pt); // <20><>ֵ<EFBFBD><D6B5>
|
|
|
|
|
|
int WriteFault(GMFault * fault, DPoint * pt); // <20>ϲ<EFBFBD>
|
|
|
|
|
|
int WriteRoundRect(GxfRect* rectangle); // Բ<>Ǿ<EFBFBD><C7BE><EFBFBD>
|
|
|
|
|
|
int WritePie(GxfPie * pie); // <20><><EFBFBD><EFBFBD>ͼ
|
|
|
|
|
|
int WriteEllipse(GxfPie * ellipse); // <20><>Բ
|
|
|
|
|
|
int WriteSeisLine(GxfSeisLine * seisline, DPoint3 * dt); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WriteFrame(GxfFrame * frame); // ͼ<><CDBC>
|
|
|
|
|
|
int WriteLegend(GxfLegend* legend); // ͼ<><CDBC>
|
|
|
|
|
|
int WriteTown(GxfReside * town); // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WriteScale(GxfScale * scale); // <20>̶<EFBFBD>
|
|
|
|
|
|
int WriteWell(GxfWell * well); // <20><>λ
|
|
|
|
|
|
int WriteElement(); // <20><>дͼԪ<CDBC><D4AA><EFBFBD><EFBFBD>
|
|
|
|
|
|
public:
|
|
|
|
|
|
int AddPaperElement(GxfMap * paper); // <20><><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD>
|
|
|
|
|
|
int AddMapElement(GxfMap * map); // <20><><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
|
int AddProjectionElement(GMProjection * projection); // <20><><EFBFBD><EFBFBD>ͶӰ
|
|
|
|
|
|
int AddTransformElement(GxfTransform * transform); // <20><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>
|
|
|
|
|
|
int AddLayerElement(GxfLayer * layer); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int AddTextElement(GxfText * text); // <20><><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
|
|
|
|
|
|
int AddSymbolElement(GxfSymbol * symbol); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int AddRectElement(GxfRect * rect); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int AddBmpElement(GxfBmp * bmp,BYTE * pBmpBuffer); // <20><><EFBFBD><EFBFBD>λͼ
|
|
|
|
|
|
int AddMetaElement(GxfMeta * meta,BYTE * pMetaBuffer); // <20><><EFBFBD><EFBFBD>Ԫ<EFBFBD>ļ<EFBFBD>
|
|
|
|
|
|
int AddLogElement(GxfLog * log,BYTE * pLogBuffer); // <20><><EFBFBD><EFBFBD><EFBFBD>⾮<EFBFBD><E2BEAE><EFBFBD><EFBFBD>
|
|
|
|
|
|
int AddSeissectionElement(GxfSeisSection * section,BYTE * pSectionBuffer);// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int AddPolygonElement(GxfPolygon * polygon,DPoint * pDt); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int AddPolylineElement(GMPolyline * polyline,DPoint * pDt); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int AddContourElement(GxfIsoline * contour,DPoint * pDt); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>
|
|
|
|
|
|
int AddFaultElement(GMFault * fault,DPoint * pDt); // <20><><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD>
|
|
|
|
|
|
int AddRoundRectElement(GxfRect * roundRect); // <20><><EFBFBD><EFBFBD>Բ<EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD>
|
|
|
|
|
|
int AddPieElement(GxfPie * pie); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ
|
|
|
|
|
|
int AddEllipseElement(GxfPie * ellipse); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ
|
|
|
|
|
|
int AddSeisLineElement(GxfSeisLine * seisline,DPoint3 * pDp3); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int AddFrameElement(GxfFrame * frame); // <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
|
|
|
|
|
int AddLegendElement(GxfLegend * legend); // <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>
|
|
|
|
|
|
int AddTownElement(GxfReside * town); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int AddScaleElement(GxfScale * scale); // <20><><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD>
|
|
|
|
|
|
int AddWellElement(GxfWell * well); // <20><><EFBFBD>侮λ
|
|
|
|
|
|
protected:
|
|
|
|
|
|
char floatStr[1024]{};
|
|
|
|
|
|
char * ConvertColorToHex(GColor clor,char * buf); // <20><>ɫתʮ<D7AA><CAAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
char * IntToFloat(int i); // Int ת Float
|
|
|
|
|
|
char * FTS(double &v); // Float ת string
|
|
|
|
|
|
char * IntToString(int i); // Int ת string
|
|
|
|
|
|
int WriteStringElem(const char * str, int isMar = 1); // stringд
|
|
|
|
|
|
int WriteName(const char* str, int isMar = 0); // д<><D0B4><EFBFBD><EFBFBD>
|
|
|
|
|
|
int WriteSymbolID(int nID, int isMar = 0); // д<><D0B4><EFBFBD><EFBFBD>ID
|
|
|
|
|
|
|
|
|
|
|
|
FILE *m_file = nullptr;
|
|
|
|
|
|
};
|
|
|
|
|
|
class GXFElementCollection
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
char *elementName = nullptr; // ͼԪ<CDBC><D4AA><EFBFBD><EFBFBD>
|
|
|
|
|
|
void * pEleBody = nullptr; // ͼԪ<CDBC><D4AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
IPoint * pt = nullptr; // ͼԪ<CDBC><D4AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
DPoint * dt = nullptr; // ͼԪ<CDBC><D4AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
DPoint3 * dp3 = nullptr; // ͼԪ<CDBC><D4AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
double * labelData = nullptr; // ͼԪ<CDBC><D4AA>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
BYTE* pBmpBuffer = nullptr; // ͼԪ<CDBC><D4AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
using namespace NGeoMapReader;
|