|
|
#pragma once
|
|
|
#include "formatdc.h"
|
|
|
#include "mapgisfile.h"
|
|
|
|
|
|
namespace NFormatWriter
|
|
|
{
|
|
|
|
|
|
class CMapGisDC :
|
|
|
public CFormatDC
|
|
|
{
|
|
|
public:
|
|
|
CMapGisDC(void);
|
|
|
virtual ~CMapGisDC(void);
|
|
|
|
|
|
virtual void SetPixel(double x, double y, COLORREF col);
|
|
|
virtual void Draw(CText& text, CCurveEx& curve);
|
|
|
virtual void PaintRgn(CCurveEx& curve);
|
|
|
virtual void Draw(CMesh &mesh);
|
|
|
virtual void Draw(CImageInsert& image);
|
|
|
virtual void FillSolidRect(CRect8& rect, COLORREF color);
|
|
|
virtual void PolyLine(CPointList& dp);
|
|
|
virtual void Draw(CInsertDraw& m_insert);
|
|
|
virtual void Draw(CInsertOld& m_insert);
|
|
|
|
|
|
void OutLine(CFile& fw, CPointList& dp, long nID);
|
|
|
void ReadMapGisColorIndex(void);
|
|
|
|
|
|
virtual void SetFile(CFile* pFile);
|
|
|
virtual void Initial(void);
|
|
|
virtual int OutFront(void);
|
|
|
virtual int OutEnd(void);
|
|
|
|
|
|
void operator=(CMapGisDC& dc);
|
|
|
void SetFileName(CString strFileName);
|
|
|
|
|
|
void OutColorLib(void);
|
|
|
void Clear(void);
|
|
|
|
|
|
public:
|
|
|
CString m_strFileName; //导出的文件名称,导出后会形成三个文件*.wat(点)、*.wal(线)、*.wap(面)
|
|
|
CFile* m_pFileWat; //点
|
|
|
CFile* m_pFileWal; //线
|
|
|
CFile* m_pFileWap; //面
|
|
|
int m_nFileCreateMode; //0=wat, 1=wal, 2=wap, -1=全部为重新生成
|
|
|
|
|
|
protected:
|
|
|
CFile* CreateFile(CString strFileName);
|
|
|
long m_nTotalCurveCount;
|
|
|
long m_nTotalPolygonCount;
|
|
|
long m_nTotalPointCount;
|
|
|
static int _compare_MapGis_ArrayColor(const void *d1,const void *d2);
|
|
|
|
|
|
int GetColorIndex(COLORREF col);
|
|
|
int WritePColor(LPCTSTR lpszColorFile);
|
|
|
void WriteLine(CFile &fw, CString str);
|
|
|
void WriteReturn(CFile &fw);
|
|
|
|
|
|
CMap<DWORD, DWORD, int, int> m_arrColorWrite; //为了写PColor.lib文件
|
|
|
CMGColorLib m_mgColorLib;
|
|
|
|
|
|
class CPolyItem
|
|
|
{
|
|
|
public:
|
|
|
CPolyItem(){nID=0; area=0; length=0; nColIndex=1;}
|
|
|
long nID;
|
|
|
double area;
|
|
|
double length;
|
|
|
int nColIndex;
|
|
|
};
|
|
|
CArray<CPolyItem, CPolyItem> m_arrPoly;
|
|
|
};
|
|
|
|
|
|
};
|