You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
7.5 KiB
C++

#pragma once
#include "GeoMapBase.h"
#include "GeoMapSymbolLib.h"
#include <map>
#include <list>
typedef unsigned char BYTE;
typedef unsigned short WORD;
namespace NFormatReader
{
namespace NGeoMapReader
{
class GdbEleCollection;
class CGeoMapGdbWriter : public CGeoMapBase
{
public:
CGeoMapGdbWriter(void);
~CGeoMapGdbWriter(void);
public:
FILE * m_writefile;
CFile *m_cfile;
public:
list<GdbEleCollection> eleList;
public:
int OpenFile(const char * fname); // 保存文件
int CloseFile(); // 关闭文件
int Write(const void * buff,int size,int count,FILE * file); // 写数据
int WriteFileHead(GMFileHead * head); // 文件头
int WriteLayer(GMLayerHead * layer); // 层头
int WriteElement(GMLayerTotal * total); // 图元
int WriteElementMap(map<int,list<GdbEleCollection> > map,GMLayerHead *headLayer); // 多层回写
int WritePolygon(GMPolygon * polygon,IPoint* pt); // 多边形
int WritePolyline(GMPolyline * polyline,IPoint * pt); // 折线
int WriteSymbol(GMSymbol * symbol); // 符号
int WriteRichText(GMRichText * richText); // 文本
int WriteTextStr(GMRichTextStr textstr,int isTrue); // 文本串
int WriteLegend(GMLegend * legend); // 图例框
int WriteScale(GMScale * scale); // 比例尺
int WriteAxis(GMAxis * axis); // 坐标
int WriteCompass(GMCompass * compass); // 方向标
int WriteWell(GMWell * well); // 井位
int WriteReside(GMReside * reside); // 地名
int WriteFrame(GMMapFrame * frame); // 图框
int WriteGrid(GMGrid * grid); // 直角网格
int WriteRectangle(GMRectangle * retangle); // 矩形
int WritePie(GMPie * pie); // 饼/椭圆
int WriteIsoline(GMIsoline * isoline,IPoint * pt); // 等值线
int WriteFault(GMFault * fault,IPoint * pt); // 断层
int WriteSeisLine(GMSeisLine * seisline,DPoint * dPoints); // 地震测线
int WriteSeisSection(GMSeisSection * section); // 地震剖面
int WriteSeisArea(GMSeisArea * seisarea,IPoint * pt); // 地震工区
int WriteLithology(GMLithSection * lithology); // 岩性剖面
int WriteLog(GMLog * log); // 测井曲线
int WriteWellText(GMWellText * welltext); // 井旁文字
int WriteWellLog(GMWellLog * welllog); // 井旁曲线
int WriteWellMarker(GMWellMarker * wellmarker); // 井旁标记
int WriteCompound(GMBase * base); // 图元基本数据结构
int WriteCustom(GMCustom * custom); // 自定义图元
int WriterGraphy(GMGraphy * graphy); // 统计图
int WriteTriagonal(GMTriangle * triangle); // 三角图
int WriteBmp(GMBmp * bmp); // 位图
int WriteMetafile(GMMetafile * metafile); // WMF/EMF元文件
int WriteOiWaterCol(GMOilWaterCol * oilwatercol); // 油水柱子
int WriteDataCross(GMDataCross * datacross); // 数据十字
int WriteString(GMText * text); // 文本
int WriteIRect(IRect rect); // 矩形框
int WriteRichTextLine(GMRichTextLine textline); // 多行文本
//回写符号元素
int WriteSymbolLib(GMSymbolLib * symbolLib); // 符号库
int WriteShapeSymbol(GMShapeSymbol * symbol); // 符号
int WriteSymbolElement(GMShapeSymElement *elems, int nElem); // 符号元素
int WriteShapeSymText(GMShapeSymText * shapeSymText);
int WriteShapeSymPoly(GMShapeSymPoly * symSoly);
int WriteShapeSymArc(GMShapeSymArc * symArc);
int WriteShapeSymRext(GMShapeSymRect * symRect);
int WriteShapeSymGroup(GMShapeSymGroup * shapeSymGroup);
int WriteShapeSymElement(GMShapeSymElement * symElement);
int WriteIntElem(int elem,int i); // 写INT
int WriteDoubleElem(double elem,int i); // 写DOUBLE
int WriteChar(char * buf,int i); // 写CHAR
int WriteIPoint(IPoint * pt,int i); // 写点数据
int WriteWord(WORD s,int i); // 写WORD
//int AddFileHead(GMFileHead * head); // 填充文件头
int AddPolygonElement(GMPolygon * polygon,IPoint *praPt); // 填充多边形
int AddPolyLineElement(GMPolyline * polyline,IPoint *praPt); // 填充折线
int AddLegendElement(GMLegend * legend); // 填充图例
int AddScaleElement(GMScale * scale); // 填充比例尺
int AddAxisElement(GMAxis * axis); // 填充坐标
int AddCompassElement(GMCompass * compass); // 填充方向标
int AddWellElement(GMWell * well); // 填充井位
int AddResideElement(GMReside * reside); // 填充地名
int AddFrameElement(GMMapFrame * frame); // 填充图框
int AddGridElement(GMGrid * grid); // 填充直角网格
int AddRectangleElement(GMRectangle * retangle); // 填充矩形
int AddPieElement(GMPie * pie); // 填充饼/椭圆
int AddIsolineElement(GMIsoline * isoline,IPoint * pt); // 填充等值线
int AddFaultElement(GMFault * fault,IPoint * pt); // 填充断层
int AddSeisLineElement(GMSeisLine * seisline,DPoint * dPoints); // 填充地震测线
int AddSeisSectionElement(GMSeisSection * section); // 填充地震剖面
int AddSeisAreaElement(GMSeisArea * seisarea,IPoint * pt); // 填充地震工区
int AddLithSectionElement(GMLithSection * lithology); // 填充岩性剖面
int AddWellLogElement(GMWellLog * welllog,DPoint * dPoint); // 填充井旁曲线
int AddLogElement(GMLog * log); // 填充测井曲线
int AddWellTextElement(GMWellText * welltext); // 填充井旁文字
int AddWellMarkerElement(GMWellMarker * wellmarker); // 填充井旁标记
//int AddBaseElement(GMBase * base); // 填充图元基本结构
int AddCustomElement(GMCustom * custom); // 填充自定义格式
int AddGraphyElement(GMGraphy * graphy); // 填充统计图
int AddTriangleElement(GMTriangle * triangle); // 填充三角形
int AddOilWaterElement(GMOilWaterCol * oilwatercol); // 填充油水柱子
int AddDataCrossElement(GMDataCross * datacross); // 填充数据十字
//int AddIRectElement(IRect * rect); // 填充矩形框
int AddRichTextElement(GMRichText * richtext); // 填充文本
int AddStringElement(GMText * text); // 填充文字
int AddSymbolElement(GMSymbol * symbol); // 填充符号
int AddBmpElement(GMBmp * bmp); // 填充BMP
int AddMetafileElement(GMMetafile * metafile); // 填充元文件
};
// 图元属性 + 图元数据 + 附加数据
class GdbEleCollection
{
public:
int type = 0; // 图元类型
int length = 0; // 图元长度
void * pEleBody = nullptr; // 图元属性体
IPoint * pt = nullptr; // 图元数据体
DPoint * dt = nullptr;
double * labelData = nullptr; // 图元标注点数据
};
}
}