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.

171 lines
6.1 KiB
C

1 month ago
#pragma once
#include "../SigmaView.h"
#include "CPlusCallBack.h"
//#include "DrawView.h"
// WellPoleView 视图
/* 接口函数对应CView函数
SetViewRect() -> CWnd::OnSize()
DrawImg() -> CView::OnDraw();
CSigmaView::SetScrollBar(); //C#窗口变化时引发的这个操作
CSigmaView::Scroll(int orientation, double offset) //滚动条拖动引发
*/
class CWellPole;
class CWellPoleView : public CSigmaView
{
public:
CWellPoleView(); // 动态创建所使用的受保护的构造函数
virtual ~CWellPoleView();
CWellPoleView(CXy* pXy);
void Initialize();
public:
//virtual void OnDraw(CDC* pDC); // 重写以绘制该视图
//#ifdef _DEBUG
// virtual void AssertValid() const;
//#ifndef _WIN32_WCE
// virtual void Dump(CDumpContext& dc) const;
//#endif
//#endif
//
//public:
// virtual void OnInitialUpdate();
virtual void SetLastRightButtonPoint(const CPoint& point);
public:
CWellPoleDoc* GetDocument() const;
public:
void OnSize(UINT nType, int cx, int cy);
// int OnCreate(LPCREATESTRUCT lpCreateStruct);
// void OnSetFocus(CWnd* pOldWnd);
//virtual void OnLButtonDblClkOther(UINT nFlags, CPoint point);
virtual void OnLButtonDownOther(int mouseX, int mouseY, HDC hdc, int vk);
//virtual void OnLButtonUpOther(UINT nFlags, CPoint point);
//virtual void OnRButtonDblClkOther(UINT nFlags, CPoint point);
//virtual void OnRButtonDownOther(UINT nFlags, CPoint point);
//virtual void OnRButtonUpOther(UINT nFlags, CPoint point);
//virtual void OnMouseMoveOther(UINT nFlags, CPoint point);
virtual void OnMouseWheelOther(UINT nFlags, short zDelta, CPoint pt);
virtual void OnLButtonDown(int mouseX, int mouseY, HDC hdc, int vk);
virtual int OnMouseMove(HDC hMemDC, int mouseX, int mouseY, int buttonStatus);
//void OnContextMenu(CWnd* pWnd, CPoint point);
void OnAddWellTrack();
// void OnUpdateAddWellTrack(CCmdUI *pCmdUI);
void OnEditDelete();
//void OnUpdateEditDelete(CCmdUI *pCmdUI);
void OnTrackLeftGroup();
void OnTrackRightGroup();
//void OnUpdateSelectedTrack(CCmdUI *pCmdUI);
////在选中的道后面添加图道
void OnAddTrackAfterSelected();
void OnViewTrackData();
void OnViewExtend();
void OnViewExtendCenter();
void OnViewExtendHeight();
void OnViewExtendWidth();
//void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
void OnViewPan();
// void OnUpdateViewPan(CCmdUI *pCmdUI);
void OnLockWellHead();
void OnUpdateLockWellHead(CCmdUI* pCmdUI);
void OnViewEnlarge();
void OnViewReduce();
//void OnRButtonDown(UINT nFlags, CPoint point);
void OnMouseLeave();
virtual void SetClient(int l, int t, int r, int b); //用来代替 OnSize()函数
virtual void Scroll(int orientation, double offset);
BOOL IsViewState();
void InitWellPosition(int lrEdge); //初始化井的位置,参数是左右边距(以屏幕像素计算)。
void SetLockWellHead(bool block);
public:
//void OnDrawAllBefore(CXyDC& dc);
void OnDrawAllAfter(CXyDC& dc);
void WriteCusorPos(CPoint2D& point);
CMenu* ExtendPopupMenu(CItem* pItem, CMenu* pMenu);
CPositionList* GetSelection(void);
int FindMenuItem(CMenu* Menu, LPCTSTR MenuString);
int FindMenuItem(CMenu* Menu, UINT nID);
CWellPole *m_pWell;
void MoveWellToHorizCenter();
void ExtendViewForNewWell(CWellPole* pWell);
virtual void SetScrollBarRange(void);
void SetScrollBarRangeLockHead();
BOOL MouseWheelH(UINT nFlags, short zDelta, CPoint pt);
BOOL MouseWheelV(UINT nFlags, short zDelta, CPoint pt);
virtual BOOL MouseWheel(UINT nFlags, short zDelta, CPoint pt);
typedef struct _LockWellHead {
//double screenRealWellHeight; //屏幕上井柱体空间能包含的井柱长度,逻辑单位
double screenDepth; //屏幕上井柱体空间能包含的井柱长度,深度单位
double screenHeight; //屏幕上井柱体空间的逻辑单位
double screenWellBodyLength; //井柱顶底深所对应的逻辑单位
} LOCKWELLHEAD;
BOOL m_bLockWellHead;
LOCKWELLHEAD m_LockWellHeadStruct;
void LockWellHead();
void UnlockWellHead();
BOOL MouseWheelVLockHead(UINT nFlags, short zDelta, CPoint pt);
void ReComputeLockWellHead();
void ViewExtendCenter();
void ViewExtendWidth();
int ViewSetItemForSelectedElement(int mouseX, int mouseY);
void SetWellPoleViewPan();
void SetViewPanInvalidate();
void ScrollVForLockWellHead(int nFlags, int scrollValue, int pageSize, int lineSize, int scrollMin, int scrollMax);
void SetScrollBarVRangeForLockWellHead(int& vrange,int & page, int &value);
BOOL GetSelectWellObject(int& type, int& ttype, ULONGLONG& objHandle);
BOOL AddTrackAfterSelectedWellObject(int trackType[], int trackNum);
BOOL DeleteSelectedWellObject();
BOOL CombineLeftTrack();
BOOL CombineRightTrack();
BOOL GetSelectedWell( ULONGLONG& objHandle);
BOOL GetWellTrackDataJson(ULONGLONG& objHandle, CString& strJson);
BOOL SetWellTrackDataJson(ULONGLONG& objHandle, LPCTSTR strJson);
BOOL SetPictureInWellTrack(ULONGLONG pictureObjHandle, LPCSTR filePath);
protected:
void ComputeLockWellHeadInfo(LOCKWELLHEAD& LockWellHeadStruct);
void VScrollLockWellHead(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
protected:
CBitmap m_SelectBmp, *m_pSelectBmp;
BOOL m_bSelectCreateDC;
int m_ViewSelW;
int m_ViewSelH;
CDC m_SelectDC; //用于当有井对象被选中时绘制各种选中状态
void InitSelectBmpDC();
void CreateSelectBmpDC(int ww, int hh);
void DeleteSelectBmpDC();
BOOL m_bTracking;//监测鼠标是否离开本窗体
BOOL m_bFirstSize;
public:
void BeginSelectBmpDC();
void EndSelectBmpDC(CDC *pDC);
CDC& GetSelectDC() { return m_SelectDC; }
virtual void EndItemSelectBmpDC(CDC *pDC = NULL); //最后将在井类别item中绘制的内容贴到最终dc上
virtual void DrawCrossLine(CDC* pDC, CPoint point);
void DrawOneCrossLine(CPoint currentPoint); //绘制一次
CPoint m_PrevPointXY;
InvalidateWndCallback m_pWndCallBack;
};
extern void WellExtentObjMoveToPoint(CXyDC* pDC, double ptx, double pty, std::vector<COne*>& wellExtendObjs);