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.
116 lines
2.7 KiB
C++
116 lines
2.7 KiB
C++
#pragma once
|
|
#include "FormatDC.h"
|
|
|
|
#include "..\GdbxDefine.h"
|
|
#include "GeoMapGdbxWriter.h"
|
|
|
|
namespace NFormatWriter
|
|
{
|
|
class CGdbxDC : public CFormatDC
|
|
{
|
|
public:
|
|
CGdbxDC(void);
|
|
~CGdbxDC(void);
|
|
virtual void Initial(void);
|
|
virtual int OutFront(void);
|
|
virtual int OutEnd(void);
|
|
virtual void PolyLine(CPointList& dp);
|
|
void Draw(CText& text, CCurveEx& curve) override;
|
|
|
|
void SetPixel(double x, double y, COLORREF col);
|
|
void Ellipse(double x1, double y1, double x2, double y2);
|
|
void PaintRgn(CCurveEx& curve);
|
|
void PaintRgn(LPPOINT sp, int count);
|
|
void Draw(CSection& section, CRect8* rect = NULL);
|
|
void Draw(CImageInsert& image);
|
|
void FillSolidRect(CRect8& rect, COLORREF color);
|
|
void Draw(CInsertDraw& m_insert);
|
|
void Draw(CInsertOld& m_insert);
|
|
|
|
BOOL OpenWrite(CString lpszPathName, bool bBinary = true); //打开写文件
|
|
BOOL OpenWrite(CFile *pFile, CXy *xy); //打开写文件
|
|
void SetPictureRect(CRect8 rect);
|
|
CRect8 GetPictureRect(void);
|
|
void SetScaleFactor(double scaleFactor);
|
|
double GetScaleFactor(void);
|
|
|
|
|
|
void SetUnit(CSize unit);
|
|
CSize GetUnit(void);
|
|
virtual void SetMapSize(CSize sz) {}
|
|
int BuildFileHead(void);
|
|
int BuildSymLib(void);
|
|
int BuildLayerHead(void);
|
|
int BuildPline(int size, xPoint *ip);
|
|
int BuildImage(long w,long h,CRect8 rect);
|
|
int BuildPolygon(int size, xPoint *ip);
|
|
int BuildSeismacSection(CSection& section);
|
|
int BuildElement();
|
|
int Amplify10(double num);
|
|
void DeleteObj(void);
|
|
|
|
|
|
private:
|
|
/**
|
|
* libarchive 压缩文件
|
|
*
|
|
* \param gdbxPath gdbx全路径
|
|
* \param outPath 输出压缩文件全路径
|
|
* \return
|
|
*/
|
|
int CompressGdbxDirectory(const CString& gdbxPath, const CString& outPath);
|
|
|
|
/**
|
|
* gb2312转utf-8
|
|
*
|
|
* \param gdbxPath gdbx全路径
|
|
* \param outPath 输出压缩文件全路径
|
|
* \return
|
|
*/
|
|
CString GB2312ToUTF8(const CString& gb2312Str);
|
|
|
|
CString getLayersName(); //获取当前所有层级名称
|
|
|
|
public:
|
|
CGeoMapGdbxWriter* p_gdbx;
|
|
public:
|
|
CRect8 m_rect;
|
|
CSize m_unit;
|
|
double m_scaleFactor;
|
|
int m_headSize;
|
|
int m_symbolSize;
|
|
int m_polylineSize;
|
|
int m_textSize;
|
|
int m_polygonSize;
|
|
int m_multTextySize;
|
|
xPoint m_xyData;
|
|
list<xPoint> m_xyList;
|
|
|
|
int m_DataLength;
|
|
BYTE *m_imageData;
|
|
int m_imageSize;
|
|
int m_seismacSize;
|
|
|
|
int m_xScale;//地震剖面x方向刻度
|
|
int m_yScale;//地震剖面y方向刻度
|
|
int m_scale;//刻度比例 要求整数
|
|
int m_x1,m_y1,m_x2,m_y2;//图形计算边界 不通图件设置不同值
|
|
double m_w,m_h;//x2-x1 y2-y1实际宽高便于计算
|
|
int m_left,m_top,m_rignt,m_bottom;//图件边距mm
|
|
int m_paperW,m_paperH;//图纸宽高mm
|
|
|
|
|
|
pugi::xml_document m_doc;
|
|
pugi::xml_node m_mapNode;
|
|
|
|
pugi::xml_node m_layersNode;
|
|
pugi::xml_node m_layerNode;
|
|
pugi::xml_node m_shapesNode;
|
|
|
|
|
|
CXy* p_xy;
|
|
};
|
|
|
|
}//namespace
|
|
|