|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
//文件 ScaleRuler.h
|
|
|
//主要功能:
|
|
|
// 实现刻度标尺的功能及坐标轴的功能
|
|
|
//
|
|
|
//程序编写: 2008-10-28
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
#include ".\GroupBase.h"
|
|
|
#include "GDFLOGFONT.h"
|
|
|
|
|
|
#define AXIS_VIEW_ARROW 0x0001 //显示箭头
|
|
|
#define AXIS_TEXT_TOP 0x0002 //标注在上方
|
|
|
#define AXIS_TEXT_BOTTOM 0x0004 //标注在下方
|
|
|
#define AXIS_AUTO_UPDATE 0x0008 //根据实际坐标自动更新刻度值
|
|
|
#define AXIS_DIRECTION_H 0x0010 //水平方向,自动更新刻度值时使用坐标X值
|
|
|
#define AXIS_DIRECTION_V 0x0020 //垂直方向,自动更新刻度值时使用坐标Y值
|
|
|
#define AXIS_TEXT_LEFT AXIS_TEXT_TOP //标注在左边
|
|
|
#define AXIS_TEXT_RIGHT AXIS_TEXT_BOTTOM //标注在右边
|
|
|
#define AXIS_TEXT_V 0x0040 //当为垂直方向时,文本也按照垂直显示
|
|
|
#define AXIS_VIEW_SMALL_SCALE 0x0080 //显示小刻度
|
|
|
#define AXIS_TITLE_POS_TOP 0x0100
|
|
|
#define AXIS_TITLE_POS_BOTTOM 0x0200
|
|
|
#define AXIS_TITLE_POS_LEFT 0x0400
|
|
|
#define AXIS_TITLE_POS_RIGHT 0x0800
|
|
|
#define AXIS_TITLE_SHOW 0x1000 //显示标题
|
|
|
#define AXIS_TITLE_ABSOLUTESCALE 0x2000 // 标尺在多井剖中使用时,其标尺的起始结束深度是由剖面决定,但其起始结束值是与剖面的位置对应的。
|
|
|
|
|
|
class AFX_EXT_CLASS CScaleRuler : public CGroupBase
|
|
|
{
|
|
|
public:
|
|
|
CScaleRuler(void);
|
|
|
virtual ~CScaleRuler(void);
|
|
|
|
|
|
void Serialize(CArchive& ar, const short &ver) override;
|
|
|
virtual void Write(CFile &fw, const short& ver);
|
|
|
virtual int Read(CFile &fr, const short& ver);
|
|
|
virtual bool GetRange(CRect8& range);
|
|
|
virtual int IsInRange(CRect8& range);
|
|
|
virtual void WriteDML(CFile& fw, const short& ver, int nBaseTabNum);
|
|
|
virtual int ReadDML(CFile &fr, const short &ver);
|
|
|
|
|
|
virtual void WritePCG(CFile& fw, const short& ver, int nBaseTabNum);
|
|
|
virtual int ReadPCG(CFile &fr, const short &ver);
|
|
|
|
|
|
int ReadPCG2(CFile &fr, const short &ver);
|
|
|
|
|
|
virtual void ScaleProperty(double sx, double sy);
|
|
|
|
|
|
void operator=(CScaleRuler& sr);
|
|
|
|
|
|
void Draw(void* pDC, COLORREF color, void* pxy=NULL);
|
|
|
|
|
|
void EnableAutoUpdate(BOOL bEnable);
|
|
|
BOOL IsAutoUpdate(void);
|
|
|
void EnableDirectionH(BOOL bEnable);
|
|
|
BOOL IsDirectionH(void);
|
|
|
void EnableDirectionV(BOOL bEnable);
|
|
|
BOOL IsDirectionV(void);
|
|
|
|
|
|
void EnableTextTop(BOOL bEnable);
|
|
|
BOOL IsTextTop(void);
|
|
|
void EnableTextLeft(BOOL bEnable);
|
|
|
BOOL IsTextLeft(void);//实际情况是刻度线在左侧. 刻度文本在右侧,与IsTextTop共用一个标志位
|
|
|
void EnableArrow(BOOL bEnable);
|
|
|
BOOL IsShowArrow(void);
|
|
|
void EnableSmallScale(BOOL bEnable);
|
|
|
BOOL IsShowSmallScale(void);
|
|
|
|
|
|
BOOL IsTitleOnTop();
|
|
|
void EnableTitleOnTop(BOOL bEnable =TRUE);
|
|
|
BOOL IsTitleOnBottom();
|
|
|
void EnableTitleOnBottom(BOOL bEnable = TRUE);
|
|
|
BOOL IsTitleOnLeft();
|
|
|
void EnableTitleOnLeft(BOOL bEnable = TRUE);
|
|
|
BOOL IsTitleOnRight();
|
|
|
void EnableTitleOnRight(BOOL bEnable = TRUE);
|
|
|
BOOL IsShowTitle();
|
|
|
void EnableTitleShow(BOOL bEnable = TRUE);
|
|
|
BOOL IsAbsoulteScale();
|
|
|
void EnableAbsoulteScale(BOOL bEnable);
|
|
|
|
|
|
void ReCaculateStartAndEnd(CRect8 OldRect);
|
|
|
|
|
|
DWORD m_nFlags; //风格,便于扩展
|
|
|
double m_dScaleStep; //刻度步长,每个位置标注一个刻度值,每个步长中按10个小刻度划分
|
|
|
double m_dScaleMin; //刻度开始值
|
|
|
double m_dScaleMax; //刻度结束值
|
|
|
double m_dAxisWidth; //轴线宽度
|
|
|
double m_dTextHeight; //文字高度
|
|
|
double m_dTextScale; //文本系数
|
|
|
int m_SGradSegment; //每步主刻度上副刻度的个数
|
|
|
COLORREF color;
|
|
|
//BOOL m_bAbsolutePos; // 标尺在多井剖中使用时,其标尺的起始结束深度是由剖面决定,但其起始结束值是与剖面的位置对应的。
|
|
|
|
|
|
CString m_strTitle;
|
|
|
CString m_strUnit;
|
|
|
GDFLOGFONT m_TitleFont;
|
|
|
GDFLOGFONT m_GradFont;
|
|
|
protected:
|
|
|
void DrawAxis(void* pDC, CRect8& rect, BOOL IsH, int nMode, void* pxy);
|
|
|
void DrawText(void* pDC, CRect8& rect, BOOL IsH, int nMode, void* pxy);
|
|
|
void DrawTitle(CXyDC& dc ,CRect8& rect);
|
|
|
//void OffSetRectForTitle(CRect8& rect);
|
|
|
|
|
|
int PCG_ReadProperty(CXmlParse &xp);
|
|
|
int PCG_ReadFont(CXmlParse &xp, GDFLOGFONT& logfont);
|
|
|
void PCG_WriteFont(CFile &fw, const short& ver, int nBaseTabNum, GDFLOGFONT &logFont);
|
|
|
|
|
|
public:
|
|
|
virtual int ReadPCG(void *pxp, const short &ver);
|
|
|
int ReadPCG2(void *pxp, const short &ver);
|
|
|
protected:
|
|
|
int PCG_ReadProperty(void *pxp);
|
|
|
int PCG_ReadFont(void *pxp, GDFLOGFONT& logfont);
|
|
|
void PCG_WriteFont(void *pxp, const short& ver, int nBaseTabNum, GDFLOGFONT &logFont);
|
|
|
|
|
|
};
|
|
|
|