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.
70 lines
1.9 KiB
C++
70 lines
1.9 KiB
C++
#pragma once
|
|
#include "item.h"
|
|
|
|
namespace NItem
|
|
{
|
|
class CItemPointAdd :
|
|
public CItem
|
|
{
|
|
public:
|
|
enum POINT_MODE
|
|
{
|
|
POINT_MODE_SINGLE = 0,
|
|
POINT_MODE_CONTINUE
|
|
};
|
|
|
|
enum POINT_TYPE //要添加的点的类型
|
|
{
|
|
POINT_TYPE_COMMON = 0, //普通点
|
|
POINT_TYPE_FRACTIOIN = 1 //分数点
|
|
};
|
|
public:
|
|
CItemPointAdd(CSigmaDoc * ppDoc);
|
|
virtual ~CItemPointAdd(void);
|
|
|
|
void OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point, int vk) override;
|
|
void OnDraw(CXyDC* pDC) override;
|
|
virtual void ClearDisplayPoint(void);
|
|
bool GetPoint(double * xOut, double * yOut, double* zOut);
|
|
void SetMode(POINT_MODE mode);
|
|
void SetPointName(CDC* pDC, LPCTSTR pointName);
|
|
void SetPointDefaultName(LPCTSTR pointName);
|
|
void SetPointDefaultZ(double pointZ);
|
|
void SetPointAngle(CDC* pDC, double angle);
|
|
void SetPointX(CDC* pDC, double angle);
|
|
void SetPointY(CDC* pDC, double angle);
|
|
void SetPointZ(CDC* pDC, double z);
|
|
void ChangeAngle(double angle);
|
|
|
|
void SetPointType(POINT_TYPE type);
|
|
void SetNumeratorString(CDC* pDC, LPCTSTR numeratorStr); //分子
|
|
void SetDenominatorString(CDC* pDC, LPCTSTR denominatorStr); //分母
|
|
|
|
void UpdateDraw();
|
|
virtual void UpdateOne(COne* pOne);
|
|
void DrawAssistant(CDC * pDC, int mouseX, int mouseY) override;
|
|
|
|
private:
|
|
COne * CreateOne(double x, double y, double z);
|
|
virtual COne* CreateOne();
|
|
void DrawSinglePoint(CPoint3D & pt);
|
|
virtual void AddPoint(CPoint3D & pt);
|
|
void SetPoint(CPoint3D pt);
|
|
void ChangeAngleOrNameOfCOne();
|
|
|
|
bool CreateMemDC(CMemoryDC* pMemDC, CRect rect, CDC* pDC);
|
|
void FillBackGround(CDC* pDes, CDC* pSrc, CRect rect);
|
|
CPointTwoName * GetFractionPoint(void);
|
|
protected:
|
|
COne * m_pCurOne; //相当于临时显示图元
|
|
CPoint3D m_pt; //点的坐标
|
|
POINT_MODE m_mode;
|
|
CString m_pointName;
|
|
CString m_numeratorString; //分子
|
|
CString m_denominatorString; //分母
|
|
double m_z; // z
|
|
double m_angle; //值文本的倾斜角度
|
|
POINT_TYPE m_type = POINT_TYPE_COMMON; //0--普通点 1--
|
|
};
|
|
}
|