////////////////////////////////////////////////////////////////////////////// //文件: CItem类扩展 //主要功能: // 操作各类多井剖面中元素或完成一定的功能 // ///////////////////////////////////////////////////////////////////////////// #pragma once #include #include "item.h" #include "ItemWcsSingleWell.h" class CSectionWellObj; class CFaultObj; class CWellSection; typedef std::vector FAULTVECTOR; namespace NItem { class CItemWellSection :public CItemWcsSingleWell { public: CItemWellSection(CSigmaDoc* pDoc); ~CItemWellSection(void); virtual CItem* GetItem();// { return m_pItemSelected; } virtual void OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point, int vk) override; virtual void OnLButtonUp(CDC *pDC, UINT nFlags, CPoint point, int vk = 0) override; virtual int OnMouseMove(CDC *pDC, UINT nFlags, CPoint point) override; virtual void OnLButtonDblClk(UINT nFlags, CPoint point); // virtual BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); virtual BOOL OnSetCursor(CPoint pt, int& handle); virtual void DoLButtonUp(CDC *pDC); virtual int GetSubMenu(); /** @brief 绘制辅助手柄 */ virtual void OnDraw(CXyDC* pXyDC); virtual void OnDraw(CXyDC* pXyDC, CDC* pDC) override; //得到剖面对象 CWellSection *GetWellSection(); //根据图元创建操作Item virtual CItemWellBase* CreateItem(CWellBaseObj* pObj); //删除井 void RemoveWell(CWellPole* pWellObj); //清空选择对象 virtual void Clear(); void SetState(BOOL bAdd) { m_bUseAddItem = bAdd; } virtual void DeleteItem(); virtual int DeleteSelection(void); ///// //////层按左右名称添加连层; pDrawObj按名称添加连层的层;nInt添加连层的方式( 1=Left、2=Right) void ConnectOnName(CWellBaseObj* pDrawObj,int nInt, std::vector& linkbends); //////层中连层链表的重新排序;BendList连层链表; 按照连层nInt(1=左或者2=右)边的层由高到底排序 void ReOrederList(WELLOBJLIST& BendList,int nInt); //////根据层中连层的链表重新生成连层; //void ComputeBendPosition(CBendObj* pBend,double &valueLeft,double &valueRight); /// 应用井模板 void ApplingWellTemplate(BOOL bAll = FALSE); void ApplingWellDbTemplate(BOOL bAll = FALSE); void ApplingTemplateFile(CFile &fr,BOOL bAll); //// virtual void SetDrawObj(CWellBaseObj* pObj) { m_pWellSection = (CWellSection*)pObj;}//= 0; virtual CWellBaseObj* GetDrawObj(); ////////////////////////////////////////////////////////////////////////// //// 生成图例时从井中获取可用于生成图例的对象 virtual void GetLegendObject(const CStringArray &StyleList,CRect8 rt); ////////////////////////////////////////////////////////////////////////// ////// 新建剖面图时自动按名称连接生成新连层 virtual void CreateLayers(); virtual void BreakLayers(); void CreateLayers(std::vectorlayersTrackType); void MakeFaultFromFaultPoint() ;//由断点数据生成断层 void SetAllWellColumnLineShape();//设置所有的井都变为一根线的状态 void DeleteAllFaults(); void DoFaultsIntersect(CFaultObj *pBeCutFault,CUIntArray &PtIdArr,CPointArr &SectPointArr,FAULTVECTOR &CutFaultVec,CUIntArray &CutPtIdArr,FAULTVECTOR &newFaultVec);//处理断层的交错问题(一个断层可能被多个断层切割):参数被切断层,切割断层,切割点所交错的断层点ID,切断点,切断后形成的新断层 void GetIntersectFaults(FAULTVECTOR &faultVec1,FAULTVECTOR &faultVec2,CPointArr &retPtArr,CUIntArray &f1idArr,CUIntArray &f2idArr); //得到剖面中相交的断层,两个数组的断层对应相交,retPtArr交点数组,f1idArr是fautl1的相交断层点id号 /*SetFaultsHorz 图的横坐标变化时,计算断层的位置, 横坐标的变化主要是根据井柱之间的位置计算的,因此计算断层的位置是按照每两口井来计算的 */ //void SetFaultsHorz(double oldRatio,double newRatio,CSectionWellObj *pRightWell,CRect8 rOldWellRect,CSectionWellObj *pLWell,CRect8 lOldWellRect);// protected: BOOL m_bUseAddItem; ////通过外部工具添加子对象 CWellSection* m_pWellSection;////剖面对象 public: CItem* m_pItemOilWaterBoundary; BOOL IsAddBendLayerPoint(); BOOL IsAddFaultPoint(); void AddBendLayerPoint(); void DeleteBendLayerPoint(); //BOOL m_bDeleteControls; //是否删除连层上下或者岩性尖灭控制点 virtual void SetPos(POSITION pos); protected: void ConnectLayer(CSectionWellObj* pWell, int TrackType, int layerType); public: BOOL ApplyingTemplateFileForWell(CString filePath, ULONGLONG wellHandle = 0); BOOL ApplyingWellTemplateForSection(ULONGLONG wellHandle); protected: BOOL ApplingTemplate(CKXmlParse& xp, CSectionWellObj* pWellObj = NULL); }; };