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.

103 lines
3.8 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.

/**************************************************************************************
文 件 名ItemBend.h
操作各类多井剖面中元素或完成一定的功能
主要函数列表:
1 virtual BOOL InitPropertyGrid(CXTPPropertyGrid& grid); 初始化属性窗口
2 virtual void OnLButtonDown(UINT nFlags, CPoint point); 鼠标操作
3 virtual void OnLButtonUp(UINT nFlags, CPoint point);
4 virtual void OnMouseMove(UINT nFlags, CPoint point);
5 virtual void OnDraw(CXyDC* pXyDC); 绘制辅助手柄
6 virtual BOOL OnGridItemChangeValue(CXTPPropertyGridItem* pItem); 响应属性框改变消息的函数
修改历史:
1 virtual void SetSelectMode(CPoint2D pt); 根据点位置判断选中连层的那个部分(上层位线、下层位线、岩性尖灭线、连层本身)
2 virtual void AddControlPoints(); 添加上下层位或者岩性尖灭线控制点
3 virtual void ComputeControls(CPointArr &ptArr,double fSlope);计算添加控制点后新控制点数组各控制点的坐标
**************************************************************************************/
#pragma once
#include "item.h"
#include "../ItemWellBase.h"
#include "ItemWellSection.h"
#include "MultiWellSectionLib\BendObj.h"
namespace NItem
{
class CItemBend :
public CItemWellBase
{
public:
CItemBend(CSigmaDoc* pDoc);
~CItemBend(void);
enum CurveType
{
CurveTopLine, //上层位线
CurveBotLine, //下层位线
CurveBreakLithoLine, //岩性尖灭线
CurveBend, //连层
CurveNone
};
CurveType m_SelectCurveMode;////当前选中的对象(上、下层位线,岩性尖灭折线)
virtual void OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point, int vk);
virtual void OnLButtonUp(CDC *pDC, UINT nFlags, CPoint point, int vk = 0);
virtual int OnMouseMove(CDC *pDC, UINT nFlags, CPoint point);
//virtual void OnRButtonDown(UINT nFlags, CPoint point);
virtual void OnLButtonDblClk(UINT nFlags, CPoint point);
virtual BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
virtual BOOL OnSetCursor(CPoint pt, int& handle);
virtual int GetSubMenu();
/** @brief 绘制辅助手柄 */
virtual void OnDraw(CXyDC* pXyDC);
virtual void OnDraw(CXyDC* pXyDC,CDC *pDC);
void SetSelectCurveMode(CurveType type) { m_SelectCurveMode = type; };
//得到剖面对象
CBendObj *GetBendObject();
//void SetBendObject(CBendObj* pBend);
virtual void SetDrawObj(CWellBaseObj* pObj) { m_pBend = (CBendObj*)pObj; }//= 0;
//virtual void SetItemWell(CItem* pItem) {}//= 0;
//剖面Item赋值
virtual void SetItemSection(CItem* pItem) {m_pItemWellSection = (CItemWellSection*)pItem;}//= 0;
virtual CWellBaseObj* GetDrawObj() { return m_pBend; }
virtual int DeleteSelection(void);
///// 根据点位置判断选中连层的那个部分(上层位线、下层位线、岩性尖灭线、连层本身)
virtual int HitTestMode(CPoint2D pt );
virtual int HitTestMode_Resform(CPoint2D pt);
//添加上下层位或者岩性尖灭线控制点
virtual void AddControlPoints();
//计算添加控制点后新控制点数组各控制点的坐标
virtual void ComputeControls(CPointArr &ptArr,double fSlope);
//添加单个控制点
virtual void AddControlPoint(dfPoint dp);
//改变尖灭样式
virtual void SetBendBreakStyle(CString strBreak);
void AddBendLayerPoint();
void DeleteBendLayerPoint();
void OnLButtonDownAfterHitTest(UINT nFlags, CPoint point, int tnDragHandle,CDC* pDC);
protected:
CBendObj* m_pBend; //当前交换的bend
CItemWellSection* m_pItemWellSection;//剖面Item
BOOL m_bChangeAll; //改变层位线画笔开关变量
BOOL m_bOnLine; //鼠标在连层线上
void OnDraw_DFPCG(CXyDC* pXyDC,CBendObj* pBend,CDC *pDC);
void OnDraw_Resform(CXyDC* pXyDC, CBendObj* pBend , CDC *pDC);
void DrawLayerLine(CXyDC* pXyDC, CPointArr& linePtArr, int nHandleSize, CDC *pDC);
void DrawDragLayerLinePt(CXyDC* pXyDC, CPointArr& linePtArr, int nHandleSize, int nHandle, CPoint ptNow, CDC *pDC);
void DrawLayerLineSelectHandle(CXyDC* pXyDC, CurveType selectType, int nHandleSize, CDC* pDC);
int m_SelectHandle; //记录上下层边线被选中的handle
protected:
void HitTestBend(CPoint2D pt);
};
};