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.

82 lines
2.4 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "xyinsertdc.h"
#include "Text.h"
#include "MetaFile.h"
#include "Circle.h"
//为了方便导出其它格式文件及扩展DC应用而写
class AFX_EXT_CLASS CXyDCExport : public CXyInsertDC
{
public:
CXyDCExport(void);
virtual ~CXyDCExport(void);
///////////////////////////////////////////////////////////////////////////
//需要在派生类中重写的函数
//begin
//曲线
//为了输出连续曲线,必须在派生类中重写
//该函数可以将MoveTo、LineTo、PolyLine(CCurveEx)全部处理
virtual void PolyLine(CPointList& dp) = 0;
//文字
virtual void Draw(CText& text, CCurveEx& curve);
//充填
//virtual void PaintRgn(CCurveEx& curve);
//图像
//virtual void Draw(CImageInsert& image);
//需要特殊处理时重写,不需要时将最终调用图像显示函数
//virtual void Draw(CMesh &mesh);
//像素点
//virtual void SetPixel(double x, double y, COLORREF col);
//单剖面
//virtual void Draw(CSection& section,CRect8* rect=NULL);
//End
///////////////////////////////////////////////////////////////////////////
virtual void PolyLine(CCurveEx& curve, bool bDirectOut=false);
virtual void MoveTo(double x, double y);
virtual void LineTo(double x, double y);
virtual void LineToEnd(); //仅是为了导出其它图件格式时能使MoveTo、LineTo形成一条连续的曲线
virtual void Draw(CMetaFile& mf);
virtual void Draw(CText& text, CCurveEx* pCurveRect = NULL);
virtual void Draw(CCircle &circle,COLORREF Color);
virtual void Draw(CEllipse &elp,COLORREF Color);
virtual void Ellipse(double x1, double y1, double x2, double y2);
virtual CPoint GetScreen(double x, double y);
virtual CPoint2D GetScreen8(double x, double y);
virtual double GetScreenWidth8(double v);
virtual double GetScreenHeight8(double v);
virtual long GetScreenWidth(double v);
virtual long GetScreenHeight(double v);
virtual CSize8 GetFontSize(CSize8 sz);
virtual void SetCurrentPenWidth(double penWidth);
virtual void SetCurrentLayer(LPCTSTR strLayer);
virtual void SetCurrentColor(COLORREF colValue);
virtual COLORREF GetCurrentColor(void);
void PixelToMillimetres(CPoint2D& point); //像素转换为毫米
void PixelToMillimetres(double& x, double& y); //像素转换为毫米
void EnableXyDC(BOOL bEnable);
CPoint FloatToLong(CPoint2D& pt);
COLORREF m_curColor;
double m_curPenWidth;
protected:
BOOL m_bIsXyDC; //是使用CXyDC还是使用CXyInsertDC
CString m_strCurrentLayer;
CPointList m_pointListLine; //由MoveTo、LineTo填充为了输出连续的曲线
//第一个点是由MoveTo设置
};