|
|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
|
#include "ItemWellSection.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "WellPoleLib/WellCommonDef.h"
|
|
|
|
|
|
#include "WellPoleLib/WellBaseObj.h"
|
|
|
|
|
|
#include "WellPoleLib/WellClassObjGroup.h"
|
|
|
|
|
|
#include "WellPoleLib/InTrackDepthSegment.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "WellPoleLib\InTrackResult.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackLayerGroup.h"
|
|
|
|
|
|
#include "WellPoleLib/WellPole.h"
|
|
|
|
|
|
#include "MultiWellSectionLib/FaultObj.h"
|
|
|
|
|
|
#include "MultiWellSectionLib\BendObj.h"
|
|
|
|
|
|
#include "MultiWellSectionLib/SectionWellObj.h"
|
|
|
|
|
|
#include "MultiWellSectionLib\WellSection.h"
|
|
|
|
|
|
#include "MultiWellSectionLib\VirtualWellObj.h"
|
|
|
|
|
|
#include "MultiWellSectionLib\MWSectionScaleBox.h"
|
|
|
|
|
|
|
|
|
|
|
|
//#include "WellPoleLib\InTrackStandardLayer.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "../ItemWellBase.h"
|
|
|
|
|
|
#include "ItemBend.h"
|
|
|
|
|
|
#include "ItemFault.h"
|
|
|
|
|
|
#include "ItemAddFault.h"
|
|
|
|
|
|
#include "ItemVirtualWell.h"
|
|
|
|
|
|
#include "ItemSectionWell.h"
|
|
|
|
|
|
#include "ItemWcsTrackIn.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "MultiWellSectionDoc.h"
|
|
|
|
|
|
#include "MultiWellSectionlView.h"
|
|
|
|
|
|
|
|
|
|
|
|
//#include "GDataBinder/DataBindTemplate.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL GetLinesWithSegmentPt1(PointF &tp, PointF down, PointF local, PointF LinePt1, PointF LinePt2)
|
|
|
|
|
|
{
|
|
|
|
|
|
double x, y;
|
|
|
|
|
|
// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߶<EFBFBD><DFB6><EFBFBD>ռ<EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if (LinePt1.X == LinePt2.X&&local.X == down.X)
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
if (LinePt1.Y == LinePt2.Y&&local.Y == down.Y)
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
if (abs((local.X - down.X)*(LinePt1.Y - LinePt2.Y) - (local.Y - down.Y)*(LinePt1.X - LinePt2.X)) < 0.000001)
|
|
|
|
|
|
return FALSE; //<2F><><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1>ƽ<EFBFBD><C6BD>
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ijһ<C4B3><D2BB><EFBFBD>߶<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ˮƽ<CBAE>߶<EFBFBD>
|
|
|
|
|
|
//if (fabs(down.X-local.X)<0.001)
|
|
|
|
|
|
if (down.X == local.X)
|
|
|
|
|
|
{
|
|
|
|
|
|
//<2F><>ô<EFBFBD><C3B4><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><CDB8>߶<EFBFBD><DFB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ
|
|
|
|
|
|
tp.X = down.X;
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>Ĺ<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>Եó<D4B5><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD>ͼ
|
|
|
|
|
|
tp.Y = LinePt1.Y + (LinePt2.Y - LinePt1.Y)*(tp.X - LinePt1.X) / (LinePt2.X - LinePt1.X);
|
|
|
|
|
|
}
|
|
|
|
|
|
else//ͬ<><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>Ĺ<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD>ʽ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD>ͼ
|
|
|
|
|
|
{
|
|
|
|
|
|
x = ((local.Y - down.Y)*(LinePt2.X - LinePt1.X)*down.X - (LinePt2.Y - LinePt1.Y)*(local.X - down.X)*LinePt1.X
|
|
|
|
|
|
+ (LinePt1.Y - down.Y)*(local.X - down.X)*(LinePt2.X - LinePt1.X)) /
|
|
|
|
|
|
((local.Y - down.Y)*(LinePt2.X - LinePt1.X) - (local.X - down.X)*(LinePt2.Y - LinePt1.Y));
|
|
|
|
|
|
tp.X = x;//+0.000001;
|
|
|
|
|
|
|
|
|
|
|
|
//double k1,k2;
|
|
|
|
|
|
//k1 = (down.Y - local.Y)/(down.X - local.X); k2 = (LinePt1.Y - LinePt2.Y)/(LinePt1.X - LinePt2.X);
|
|
|
|
|
|
//double b1,b2;
|
|
|
|
|
|
//b1 = down.Y - k1*down.X; b2 = LinePt1.Y - k2*LinePt1.X;
|
|
|
|
|
|
|
|
|
|
|
|
//double xx = (b2-b1)/(k1-k2);
|
|
|
|
|
|
|
|
|
|
|
|
y = down.Y + (local.Y - down.Y)*(x - down.X) / (local.X - down.X);
|
|
|
|
|
|
tp.Y = y;//+0.000001;
|
|
|
|
|
|
|
|
|
|
|
|
if (LinePt1.Y == LinePt2.Y)
|
|
|
|
|
|
tp.Y = LinePt1.Y;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double maxx, minx, maxy, miny;
|
|
|
|
|
|
maxx = down.X > local.X ? down.X : local.X;
|
|
|
|
|
|
minx = down.X > local.X ? local.X : down.X;
|
|
|
|
|
|
maxy = down.Y > local.Y ? down.Y : local.Y;
|
|
|
|
|
|
miny = down.Y > local.Y ? local.Y : down.Y;
|
|
|
|
|
|
|
|
|
|
|
|
double lmaxx, lminx, lmaxy, lminy;
|
|
|
|
|
|
lmaxx = LinePt1.X > LinePt2.X ? LinePt1.X : LinePt2.X;
|
|
|
|
|
|
lminx = LinePt1.X > LinePt2.X ? LinePt2.X : LinePt1.X;
|
|
|
|
|
|
lmaxy = LinePt1.Y > LinePt2.Y ? LinePt1.Y : LinePt2.Y;
|
|
|
|
|
|
lminy = LinePt1.Y > LinePt2.Y ? LinePt2.Y : LinePt1.Y;
|
|
|
|
|
|
if (((minx - 0.000001) < tp.X && tp.X < (maxx + 0.000001))
|
|
|
|
|
|
&& (miny - 0.000001 < tp.Y && tp.Y < (maxy + 0.000001))
|
|
|
|
|
|
&& ((lminx - 0.000001) < tp.X && tp.X < (lmaxx + 0.000001))
|
|
|
|
|
|
&& (lminy - 0.000001 < tp.Y && tp.Y < (lmaxy + 0.000001)))
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
BOOL IsValidIntersect(PointF tp, int ptNum1, int l1id1, PointF down, int l1id2, PointF local, int ptNum2, int l2id1, PointF LinePt1, int l2id2, PointF LinePt2)
|
|
|
|
|
|
{
|
|
|
|
|
|
BOOL b = FALSE;
|
|
|
|
|
|
double dis = 1;
|
|
|
|
|
|
double tmp;
|
|
|
|
|
|
if (l1id1 == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
tmp = sqrt((tp.X - down.X)*(tp.X - down.X) + (tp.Y - down.Y)*(tp.Y - down.Y));
|
|
|
|
|
|
if (tmp < dis)
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (l1id2 == ptNum1 - 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
tmp = sqrt((tp.X - local.X)*(tp.X - local.X) + (tp.Y - local.Y)*(tp.Y - local.Y));
|
|
|
|
|
|
if (tmp < dis)
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (l2id1 == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
tmp = sqrt((tp.X - LinePt1.X)*(tp.X - LinePt1.X) + (tp.Y - LinePt1.Y)*(tp.Y - LinePt1.Y));
|
|
|
|
|
|
if (tmp < dis)
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (l2id2 == ptNum2 - 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
tmp = sqrt((tp.X - LinePt2.X)*(tp.X - LinePt2.X) + (tp.Y - LinePt2.Y)*(tp.Y - LinePt2.Y));
|
|
|
|
|
|
if (tmp < dis)
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
b = TRUE;
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace NItem
|
|
|
|
|
|
{
|
|
|
|
|
|
CItemWellSection::CItemWellSection(CSigmaDoc* pDoc)
|
|
|
|
|
|
: CItemWcsSingleWell(pDoc)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetType(ITEM_WELLSECTION);
|
|
|
|
|
|
m_bUseAddItem = FALSE;
|
|
|
|
|
|
m_pItemOilWaterBoundary = NULL;
|
|
|
|
|
|
m_pWellSection = NULL;
|
|
|
|
|
|
//m_bDeleteControls = TRUE;
|
|
|
|
|
|
//CMapSectionCtrl* pmf = (CMapSectionCtrl*)GetDoc()->GetActiveFrame()->GetMapCtrl();
|
|
|
|
|
|
//if(pmf)pmf->ShowToolBar(IDR_TOOLBAR_SECTIONWELL, TRUE);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CItemWellSection::~CItemWellSection(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_pItemOilWaterBoundary != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
delete m_pItemOilWaterBoundary;
|
|
|
|
|
|
m_pItemOilWaterBoundary = NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
//CMapSectionCtrl* pmf = (CMapSectionCtrl*)GetDoc()->GetActiveFrame()->GetMapCtrl();
|
|
|
|
|
|
//if(pmf)pmf->ShowToolBar(IDR_TOOLBAR_SECTIONWELL, FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CWellSection *CItemWellSection::GetWellSection()
|
|
|
|
|
|
{
|
|
|
|
|
|
return this->m_pWellSection; // (CWellSection *)GetDoc()->GetDraw()->GetAtValue(GetPos());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CItemWellBase* CItemWellSection::CreateItem(CWellBaseObj* pObj)
|
|
|
|
|
|
{
|
|
|
|
|
|
CItemWellBase* pItem = NULL;
|
|
|
|
|
|
if(pObj->GetType() == KEP_WELL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CItemSectionWell* pItemSectionWell = new CItemSectionWell(GetDoc());
|
|
|
|
|
|
pItem = pItemSectionWell;
|
|
|
|
|
|
pItem->SetPos(GetPos());
|
|
|
|
|
|
|
|
|
|
|
|
pItemSectionWell->SetDrawObj(pObj);
|
|
|
|
|
|
//pItemSectionWell->SetWellFrame(FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if(pObj->GetType() == KEP_SECTIONBEND)
|
|
|
|
|
|
{
|
|
|
|
|
|
pItem = new CItemBend(GetDoc());
|
|
|
|
|
|
pItem->SetPos(GetPos());
|
|
|
|
|
|
((CItemBend*)pItem)->SetDrawObj(pObj);
|
|
|
|
|
|
pItem->m_WellObjSelectlist.AddTail(pObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (pObj->GetType()==KEP_SECTIONFAULT)
|
|
|
|
|
|
{
|
|
|
|
|
|
pItem = new CItemFault(GetDoc());
|
|
|
|
|
|
pItem->SetPos(GetPos());
|
|
|
|
|
|
((CItemFault*)pItem)->SetDrawObj(pObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
//else if (pObj->GetType()==KEP_SECTIONRULER)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// pItem = new CItemRuler(GetWnd());
|
|
|
|
|
|
// pItem->SetPos(GetPos());
|
|
|
|
|
|
// ((CItemRuler*)pItem)->SetDrawObj((CRulerObj*)pObj);
|
|
|
|
|
|
//}
|
|
|
|
|
|
else if (pObj->GetType()==KEP_SECTIONVIRTUALWELL)
|
|
|
|
|
|
{
|
|
|
|
|
|
pItem = new CItemVirtualWell(GetDoc());
|
|
|
|
|
|
pItem->SetPos(GetPos());
|
|
|
|
|
|
((CItemVirtualWell*)pItem)->SetDrawObj((CVirtualWellObj*)pObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
//else if (pObj->GetType()==KEP_SECTIONSCALEBOX)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// pItem = new CItemScaleBox(GetWnd());
|
|
|
|
|
|
// pItem->SetPos(GetPos());
|
|
|
|
|
|
// ((CItemScaleBox*)pItem)->SetDrawObj(pObj);
|
|
|
|
|
|
//}
|
|
|
|
|
|
else if (pObj->GetType()==KEP_TEXTBOX)
|
|
|
|
|
|
{
|
|
|
|
|
|
//pItem = new CItemTextBox(GetWnd());
|
|
|
|
|
|
//pItem->SetPos(GetPos());
|
|
|
|
|
|
//((CItemTextBox*)pItem)->SetDrawObj(pObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (pObj->GetType()==KEP_MARK)
|
|
|
|
|
|
{
|
|
|
|
|
|
//pItem = new CItemWellMark(GetWnd());
|
|
|
|
|
|
//pItem->SetPos(GetPos());
|
|
|
|
|
|
//((CItemWellMark*)pItem)->SetDrawObj(pObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
//else if (pObj->GetType()==DOUBLEFOX_ELLIPSE)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// pItem = new CItemWellEllipse(GetWnd());
|
|
|
|
|
|
// pItem->SetPos(GetPos());
|
|
|
|
|
|
// ((CItemWellEllipse*)pItem)->SetDrawObj(pObj);
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else if (pObj->GetType()==DOUBLEFOX_ARC)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// pItem = new CItemWellArc(GetWnd());
|
|
|
|
|
|
// pItem->SetPos(GetPos());
|
|
|
|
|
|
// ((CItemWellArc*)pItem)->SetDrawObj(pObj);
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else if (pObj->GetType()==KEP_SECTIONLINE)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// pItem = new CItemWellEquilateral(GetWnd());
|
|
|
|
|
|
// pItem->SetPos(GetPos());
|
|
|
|
|
|
// ((CItemWellEquilateral*)pItem)->SetDrawObj(pObj);
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else if (pObj->GetType()==KEP_SECTIONLEGEND)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// pItem = new CItemLegend(GetWnd());
|
|
|
|
|
|
// pItem->SetPos(GetPos());
|
|
|
|
|
|
// ((CItemLegend*)pItem)->SetDrawObj(pObj);
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
if(pItem != NULL)
|
|
|
|
|
|
pItem->SetItemSection(this);
|
|
|
|
|
|
return pItem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point, int vk)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_bUseAddItem)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected->OnLButtonDown(pDC,nFlags,point,vk);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_bLDown = TRUE;
|
|
|
|
|
|
|
|
|
|
|
|
CPoint2D ptReal = GetDC()->GetReal(point);
|
|
|
|
|
|
m_downPoint = m_firstPoint = m_lastPoint = point;
|
|
|
|
|
|
|
|
|
|
|
|
selectMode = ESelectMode::selnone;
|
|
|
|
|
|
CWellSection *pWellSection = GetWellSection();
|
|
|
|
|
|
CWellBaseObj* pObj = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if (m_WellObjSelectlist.GetCount()==1)
|
|
|
|
|
|
{
|
|
|
|
|
|
pObj = m_WellObjSelectlist.GetHead();
|
|
|
|
|
|
|
|
|
|
|
|
int nHandleSize = HANDLESIZE;
|
|
|
|
|
|
double dHandleSize = GetDC()->GetRealSize(CSize(nHandleSize/2, nHandleSize/2)).cx;
|
|
|
|
|
|
nDragHandle = pObj->HitTest(ptReal,dHandleSize,TRUE);
|
|
|
|
|
|
if (nDragHandle!=0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
//m_pItemSelected->OnLButtonDown(pDC,nFlags, point,vk);
|
|
|
|
|
|
//return;
|
|
|
|
|
|
if (m_pItemSelected->GetType() != ITEM_BEND)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected->OnLButtonDown(pDC, nFlags, point, vk);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{//Bend <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3>ڲ<EFBFBD><DAB2>м<EFBFBD><D0BC><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD>б<EFBFBD><D0B1><EFBFBD>Hit<69>ĵ<EFBFBD><C4B5><EFBFBD>ǰ<EFBFBD><C7B0>ѡ<EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ЧDragHandle.
|
|
|
|
|
|
CItemBend* pItemBend = (CItemBend*)m_pItemSelected;
|
|
|
|
|
|
CBendObj* pBend = (CBendObj*)pObj;
|
|
|
|
|
|
if (pItemBend->m_SelectCurveMode == CItemBend::CurveBend && pBend->m_HitTestSelectId == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
pItemBend->OnLButtonDownAfterHitTest(nFlags, point, nDragHandle,pDC);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (pItemBend->m_SelectCurveMode == CItemBend::CurveTopLine && pBend->m_HitTestSelectId == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
pItemBend->OnLButtonDownAfterHitTest(nFlags, point, nDragHandle, pDC);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (pItemBend->m_SelectCurveMode == CItemBend::CurveBotLine && pBend->m_HitTestSelectId == 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
pItemBend->OnLButtonDownAfterHitTest(nFlags, point, nDragHandle, pDC);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
nDragHandle = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (nDragHandle != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
selectMode = ESelectMode::size;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (selectMode==CItemSelect::selnone)
|
|
|
|
|
|
{
|
|
|
|
|
|
int nHandleSize= HANDLESIZE;
|
|
|
|
|
|
double dHandleSize = GetDC()->GetRealSize(CSize(nHandleSize/2, nHandleSize/2)).cx;
|
|
|
|
|
|
CRect8 r(ptReal.x0,ptReal.y0,ptReal.x0,ptReal.y0);
|
|
|
|
|
|
CSize8 sz=GetDoc()->GetSelectSize();
|
|
|
|
|
|
double sx=GetDC()->GetRealWidth(sz.cx);
|
|
|
|
|
|
double sy=fabs(GetDC()->GetRealHeight(sz.cy));
|
|
|
|
|
|
r.InflateRect(sx,sy);
|
|
|
|
|
|
|
|
|
|
|
|
pObj = pWellSection->ObjectAt(r,dHandleSize);
|
|
|
|
|
|
|
|
|
|
|
|
BOOL bChange = FALSE;
|
|
|
|
|
|
if(!IsSelected(pObj))
|
|
|
|
|
|
{
|
|
|
|
|
|
bChange = TRUE;
|
|
|
|
|
|
//OnDraw(GetDC());
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>в<EFBFBD><D0B2><EFBFBD>ʹ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>Ʒ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>е<EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ͼƬ<CDBC>ϣ<EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>memdc<64>ϣ<EFBFBD><CFA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>Rop2<70><32>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>ʽ<EFBFBD><CABD>ҪЭ<D2AA><D0AD>һ<EFBFBD>¡<EFBFBD>
|
|
|
|
|
|
BOOL oldItemWell = m_pItemSelected->GetType() == ITEM_SECTIONWELL ? TRUE : FALSE;
|
|
|
|
|
|
if (!oldItemWell)
|
|
|
|
|
|
OnDraw(GetDC()); //<2F><>ѡ<EFBFBD>еIJ<D0B5><C4B2>Ǿ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>һ<EFBFBD>Σ<EFBFBD><CEA3><EFBFBD><EFBFBD><EFBFBD>ǰһ<C7B0><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB>ơ<EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
delete m_pItemSelected;
|
|
|
|
|
|
m_pItemSelected = NULL;
|
|
|
|
|
|
CMultiWellSectionView *pView = (CMultiWellSectionView*)GetView();
|
|
|
|
|
|
if (oldItemWell)
|
|
|
|
|
|
{//<2F><>ǰһ<C7B0><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>»<EFBFBD><C2BB><EFBFBD>һ<EFBFBD><D2BB>ѡ<EFBFBD><D1A1>bmpdc<64><63><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴξ<CFB4><CEBE>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD>졣
|
|
|
|
|
|
DrawHandle(GetDC());// (&xyDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pObj != NULL && pObj->GetType() == KEP_WELL)
|
|
|
|
|
|
GetDoc()->Invalidate();//<2F><><EFBFBD><EFBFBD><EFBFBD>ζ<EFBFBD><CEB6><EFBFBD>ѡ<EFBFBD>о<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ػ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>memdc,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>ѡ<EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD>졣
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//ѡ<><D1A1>
|
|
|
|
|
|
Select(pObj);
|
|
|
|
|
|
|
|
|
|
|
|
if(pObj!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
selectMode = ESelectMode::move;
|
|
|
|
|
|
|
|
|
|
|
|
if(m_pItemSelected == NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected = CreateItem((CWellBaseObj*)pObj);
|
|
|
|
|
|
//if(m_pItemSelected != NULL)
|
|
|
|
|
|
// OnDraw(GetDC());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bChange)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected->OnLButtonDown(pDC,nFlags, point,vk);
|
|
|
|
|
|
OnDraw(GetDC(),pDC);
|
|
|
|
|
|
return; //<2F><>Ҫ<EFBFBD><D2AA><EFBFBD>أ<EFBFBD><D8A3><EFBFBD>Ϊ<EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>item<65><6D><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_pItemSelected->GetType() != ITEM_WELL)//ͬһ<CDAC><D2BB>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>ѡ<EFBFBD><D1A1>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>˱仯<CBB1><E4BBAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>Ի<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴε<CFB4>Ӱ<EFBFBD>졣
|
|
|
|
|
|
{
|
|
|
|
|
|
//m_pItemSelected->OnDraw(GetDC(),pDC);
|
|
|
|
|
|
m_pItemSelected->OnLButtonDown(pDC,nFlags, point,vk);
|
|
|
|
|
|
//m_pItemSelected->OnDraw(GetDC(),pDC);
|
|
|
|
|
|
//OnDraw(GetDC());
|
|
|
|
|
|
return; //<2F><>Ҫ<EFBFBD><D2AA><EFBFBD>أ<EFBFBD><D8A3><EFBFBD>Ϊ<EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>item<65><6D><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
//GetView()->SetCapture();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
//m_WellObjSelectlist.RemoveAll();
|
|
|
|
|
|
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected->OnLButtonDown(pDC,nFlags, point,vk);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
c_down = ptReal;
|
|
|
|
|
|
c_last = ptReal;
|
|
|
|
|
|
selectMode = netSelect;
|
|
|
|
|
|
//GetView()->SetCapture();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(bChange)
|
|
|
|
|
|
OnDraw(GetDC(),pDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
//ˢ<><CBA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::OnLButtonUp(CDC *pDC, UINT nFlags, CPoint point, int vk)
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (m_pItemOilWaterBoundary!=NULL)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// ReleaseCapture();
|
|
|
|
|
|
// m_bDrag = FALSE;
|
|
|
|
|
|
// m_bLDown = FALSE;
|
|
|
|
|
|
// nDragHandle = 0;
|
|
|
|
|
|
|
|
|
|
|
|
// delete m_pItemOilWaterBoundary;
|
|
|
|
|
|
// m_pItemOilWaterBoundary=NULL;
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected->OnLButtonUp(pDC,nFlags, point,vk);
|
|
|
|
|
|
return ;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_firstPoint = m_lastPoint = point;
|
|
|
|
|
|
|
|
|
|
|
|
CPoint2D downPoint = GetDC()->GetReal(m_downPoint);
|
|
|
|
|
|
CPoint2D lastPoint = GetDC()->GetReal(m_lastPoint);
|
|
|
|
|
|
|
|
|
|
|
|
if((m_downPoint.x-m_lastPoint.x)!=0 || (m_downPoint.y-m_lastPoint.y)!=0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_WellObjSelectlist.GetCount() == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellBaseObj* pObj = (CWellBaseObj* )m_WellObjSelectlist.GetHead();
|
|
|
|
|
|
|
|
|
|
|
|
CRect rect = GetDC()->GetScreen(pObj->GetPos());
|
|
|
|
|
|
rect.InflateRect(10,10);
|
|
|
|
|
|
GetDoc()->Invalidate();
|
|
|
|
|
|
if (IsCaptureState())
|
|
|
|
|
|
{
|
|
|
|
|
|
SetReUnDoAction();
|
|
|
|
|
|
|
|
|
|
|
|
if(selectMode==CItemSelect::move)
|
|
|
|
|
|
{
|
|
|
|
|
|
CRect8 position = pObj->GetPos();
|
|
|
|
|
|
CPoint2D delta(lastPoint.x0-downPoint.x0,lastPoint.y0-downPoint.y0);
|
|
|
|
|
|
pObj->m_delta = delta;
|
|
|
|
|
|
position.OffsetRect(delta.x0, delta.y0);
|
|
|
|
|
|
pObj->MoveTo(position);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (selectMode==CItemSelect::size && nDragHandle!=0)
|
|
|
|
|
|
{
|
|
|
|
|
|
//<2F><><EFBFBD>ö<EFBFBD><C3B6><EFBFBD><F3BDBBBB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
pObj->m_delta = CPoint2D(0,0);
|
|
|
|
|
|
CRect8 oldRectReal = pObj->GetPos();
|
|
|
|
|
|
pObj->MoveHandleTo(nDragHandle, lastPoint);
|
|
|
|
|
|
CRect8 newRectReal = pObj->GetPos();
|
|
|
|
|
|
|
|
|
|
|
|
////<2F><><EFBFBD><EFBFBD><EFBFBD>任<EFBFBD><E4BBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><D4B2>ͼԪ<CDBC><D4AA>
|
|
|
|
|
|
//REAL elements[6]; memset(elements,0,sizeof(REAL)*6);
|
|
|
|
|
|
//elements[0] = newRectReal.Width()/oldRectReal.Width();
|
|
|
|
|
|
//elements[1] = 0.0;
|
|
|
|
|
|
//elements[2] = 0.0;
|
|
|
|
|
|
//elements[3] = newRectReal.Height()/oldRectReal.Height();
|
|
|
|
|
|
//elements[4] = (double)m_lastPoint.x - (double)m_downPoint.x*elements[0];
|
|
|
|
|
|
//elements[5] = (double)m_lastPoint.y - (double)m_downPoint.y*elements[3];
|
|
|
|
|
|
//pObj->Transform(GetDC(), elements);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>淶Χ
|
|
|
|
|
|
CWellSection* pWellSection = GetWellSection();
|
|
|
|
|
|
pWellSection->ReSetPosition();
|
|
|
|
|
|
//GetView()->SetScrollBarRange();
|
|
|
|
|
|
|
|
|
|
|
|
rect = GetDC()->GetScreen(pObj->GetPos());
|
|
|
|
|
|
rect.InflateRect(10,10);
|
|
|
|
|
|
GetDoc()->Invalidate();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
m_bDrag = FALSE;
|
|
|
|
|
|
m_bLDown = FALSE;
|
|
|
|
|
|
nDragHandle = 0;
|
|
|
|
|
|
CRect8 rect=GetRect();
|
|
|
|
|
|
DrawMode(pDC,&rect);
|
|
|
|
|
|
ReleaseCapture();
|
|
|
|
|
|
|
|
|
|
|
|
if(selectMode == netSelect)
|
|
|
|
|
|
DoLButtonUp(pDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::DoLButtonUp(CDC* pDC)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_WellObjSelectlist.GetCount() > 0)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
CRect8 rect=GetRect();
|
|
|
|
|
|
CWellSection* pWellSection = GetWellSection();
|
|
|
|
|
|
CBendObj* pBend = NULL;
|
|
|
|
|
|
POSITION pos = pWellSection->m_BendList.GetTailPosition();
|
|
|
|
|
|
while(pos != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend = (CBendObj *)pWellSection->m_BendList.GetPrev(pos);
|
|
|
|
|
|
if (pBend->IsInRange(rect))
|
|
|
|
|
|
{
|
|
|
|
|
|
m_WellObjSelectlist.AddTail(pBend);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_WellObjSelectlist.GetCount() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
CItemBend* pItemBend= new CItemBend(GetDoc());
|
|
|
|
|
|
SetItem(pItemBend);
|
|
|
|
|
|
|
|
|
|
|
|
pItemBend->SetItemSection(this);
|
|
|
|
|
|
pItemBend->SetSelectCurveMode(CItemBend::CurveBend);
|
|
|
|
|
|
pItemBend->SetPos(GetPos());
|
|
|
|
|
|
pos = m_WellObjSelectlist.GetHeadPosition();
|
|
|
|
|
|
while(pos != NULL)
|
|
|
|
|
|
pItemBend->m_WellObjSelectlist.AddTail(m_WellObjSelectlist.GetNext(pos));
|
|
|
|
|
|
//m_WellObjSelectlist.RemoveAll();
|
|
|
|
|
|
pItemBend->OnDraw(GetDC(), pDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int CItemWellSection::OnMouseMove(CDC *pDC, UINT nFlags, CPoint point)
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (m_pItemOilWaterBoundary!=NULL)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// m_pItemOilWaterBoundary->OnMouseMove(pDC, nFlags, point);
|
|
|
|
|
|
// return;
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected->OnMouseMove(pDC,nFlags, point);
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(m_WellObjSelectlist.GetCount() == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
CItemSelect::OnMouseMove(pDC,nFlags, point);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CPoint2D lastPoint = GetDC()->GetReal(point);
|
|
|
|
|
|
|
|
|
|
|
|
CWellBaseObj* pObjSelected = m_WellObjSelectlist.GetHead();
|
|
|
|
|
|
if(IsCaptureState() && m_bLDown)
|
|
|
|
|
|
{
|
|
|
|
|
|
//ˢ<><CBA2>
|
|
|
|
|
|
OnDraw(GetDC(), pDC);
|
|
|
|
|
|
|
|
|
|
|
|
m_bDrag = TRUE;
|
|
|
|
|
|
m_lastPoint = point;
|
|
|
|
|
|
|
|
|
|
|
|
if (selectMode==CItemSelect::move)// <20>ƶ<EFBFBD>ͼԪ<CDBC><D4AA><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7>
|
|
|
|
|
|
{
|
|
|
|
|
|
CPoint2D endPoint = GetDC()->GetReal(m_lastPoint);
|
|
|
|
|
|
CPoint2D startPoint = GetDC()->GetReal(m_firstPoint);
|
|
|
|
|
|
CPoint2D delta(endPoint.x0-startPoint.x0,endPoint.y0-startPoint.y0);
|
|
|
|
|
|
|
|
|
|
|
|
pObjSelected->SetDelta(delta);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//ˢ<><CBA2>
|
|
|
|
|
|
OnDraw(GetDC(), pDC);
|
|
|
|
|
|
|
|
|
|
|
|
m_firstPoint = m_lastPoint;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
m_lastPoint = point;
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CItemWellSection::OnSetCursor(CPoint pt, int& handle)
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (m_pItemOilWaterBoundary!=NULL)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return m_pItemOilWaterBoundary->OnSetCursor(pWnd, nHitTest, message);
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_pItemSelected->OnSetCursor( pt, handle);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_WellObjSelectlist.GetCount() == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
//SetCursor(AfxGetApp()->LoadStandardCursor(IDC_UPARROW));
|
|
|
|
|
|
handle = -1;
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CWellBaseObj* pObjSelected = m_WellObjSelectlist.GetHead();
|
|
|
|
|
|
|
|
|
|
|
|
CPoint2D lastPoint = GetDC()->GetReal(m_lastPoint);
|
|
|
|
|
|
int nHandleSize = HANDLESIZE; //
|
|
|
|
|
|
double dHandleSize = GetDC()->GetRealSize(CSize(nHandleSize/2, nHandleSize/2)).cx;
|
|
|
|
|
|
int nHandle = pObjSelected->HitTest(lastPoint,dHandleSize,TRUE);
|
|
|
|
|
|
if (nHandle != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
handle = -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
handle = 4;
|
|
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int CItemWellSection::GetSubMenu()
|
|
|
|
|
|
{
|
|
|
|
|
|
// <20><>
|
|
|
|
|
|
int iRMenu = 0;
|
|
|
|
|
|
//if (m_pItemSelected!=NULL)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// if (m_pItemSelected->GetType()==ITEM_VIRTUALWELL)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// iRMenu = 35;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// else if (m_pItemSelected->GetType()==ITEM_SCALE_RULER)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// iRMenu = 37;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// else if (m_pItemSelected->GetType()==ITEM_FAULT)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// iRMenu = 39;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// //else if (m_pItemSelected->GetType()==ITEM_TEXTBOX)
|
|
|
|
|
|
// //{
|
|
|
|
|
|
// // iRMenu = 41;
|
|
|
|
|
|
// //}
|
|
|
|
|
|
// //else if (m_pItemSelected->GetType()==ITEM_WELLMARK)
|
|
|
|
|
|
// //{
|
|
|
|
|
|
// // iRMenu = 42;
|
|
|
|
|
|
// //}
|
|
|
|
|
|
// else
|
|
|
|
|
|
// return m_pItemSelected->GetSubMenu();
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_WellObjSelectlist.GetCount() == 0)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (m_pItemSelected != NULL)
|
|
|
|
|
|
return m_pItemSelected->GetSubMenu();
|
|
|
|
|
|
|
|
|
|
|
|
return iRMenu;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::OnDraw(CXyDC* pXyDC)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawHandle(pXyDC);// (GetDC());
|
|
|
|
|
|
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected->OnDraw(pXyDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::OnDraw(CXyDC* pXyDC,CDC* pDC)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawHandle(pXyDC);// (GetDC());
|
|
|
|
|
|
|
|
|
|
|
|
if (m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected->OnDraw(pXyDC,pDC);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bend<6E><64>
|
|
|
|
|
|
void CItemWellSection::RemoveWell(CWellPole* pWellObj)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellSection* WellSection = GetWellSection();
|
|
|
|
|
|
POSITION posFind = WellSection->m_WellList.Find(pWellObj);
|
|
|
|
|
|
POSITION posTemp = posFind;
|
|
|
|
|
|
CWellPole* pPreWell = NULL;
|
|
|
|
|
|
CWellPole* pNextWell = NULL;
|
|
|
|
|
|
if (posFind==WellSection->m_WellList.GetHeadPosition())
|
|
|
|
|
|
{
|
|
|
|
|
|
WellSection->m_WellList.GetNext(posTemp);
|
|
|
|
|
|
if (posTemp!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
pNextWell = (CWellPole*)WellSection->m_WellList.GetNext(posTemp);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (posFind==WellSection->m_WellList.GetTailPosition())
|
|
|
|
|
|
{
|
|
|
|
|
|
WellSection->m_WellList.GetPrev(posTemp);
|
|
|
|
|
|
if (posTemp!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
pPreWell = (CWellPole*)WellSection->m_WellList.GetPrev(posTemp);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
WellSection->m_WellList.GetPrev(posTemp);
|
|
|
|
|
|
if (posTemp!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
pPreWell = (CWellPole*)WellSection->m_WellList.GetPrev(posTemp);
|
|
|
|
|
|
}
|
|
|
|
|
|
posTemp = posFind;
|
|
|
|
|
|
(CWellPole*)WellSection->m_WellList.GetNext(posTemp);
|
|
|
|
|
|
if (posTemp!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
pNextWell = (CWellPole*)WellSection->m_WellList.GetNext(posTemp);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (posFind!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
BOOL b1 = FALSE;
|
|
|
|
|
|
BOOL b2 = FALSE;
|
|
|
|
|
|
BOOL b3 = FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
POSITION posBend = WellSection->m_BendList.GetHeadPosition();
|
|
|
|
|
|
while (posBend!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CBendObj* pBend = (CBendObj*)WellSection->m_BendList.GetNext(posBend);
|
|
|
|
|
|
if (pBend->m_pWellLeft == pWellObj || pBend->m_pWellRight == pWellObj)
|
|
|
|
|
|
WellSection->DeleteBend(pBend);
|
|
|
|
|
|
//b1 = FALSE;
|
|
|
|
|
|
//b2 = FALSE;
|
|
|
|
|
|
//b3 = FALSE;
|
|
|
|
|
|
//CBendObj* pBend = (CBendObj*)WellSection->m_BendList.GetNext(posBend);
|
|
|
|
|
|
//if (pBend->m_pLayerLeft->GetWell() == pWellObj||(pBend->m_pLayerRight!=NULL&&pBend->m_pLayerRight->GetWell() ==pWellObj))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// b1 = TRUE;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//if (pPreWell!=NULL)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// if (pBend->m_pLayerLeft->GetWell() == pPreWell&&pBend->m_pLayerRight==NULL&&pBend->m_ptEndBreak.x0>pPreWell->GetPos().right)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// b2 = TRUE;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
//if (pNextWell!=NULL)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// if (pBend->m_pLayerLeft->GetWell() == pNextWell&&pBend->m_pLayerRight==NULL&&pBend->m_ptEndBreak.x0<pNextWell->GetPos().left)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// b3 = TRUE;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
//if (b1||b2||b3)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// WellSection->DeleteBend(pBend);
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
WellSection->m_WellList.RemoveAt(posFind);
|
|
|
|
|
|
m_pItemSelected = NULL;
|
|
|
|
|
|
delete pWellObj;
|
|
|
|
|
|
m_WellObjSelectlist.RemoveAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::OnLButtonDblClk(UINT nFlags, CPoint point)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_bUseAddItem)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetState(FALSE);
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_pItemSelected->GetType()==ITEM_ADDFAULT)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected->OnLButtonDblClk(nFlags,point);//<2F><><EFBFBD>¶ϲ㽨<CFB2><E3BDA8>ʱ<EFBFBD><CAB1>ִ<EFBFBD>иú<D0B8><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>m_pItemSelected<65><64><EFBFBD><EFBFBD>CItemAddFault<6C>仯ΪCItemFault
|
|
|
|
|
|
|
|
|
|
|
|
Invalidate();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
delete m_pItemSelected;
|
|
|
|
|
|
}
|
|
|
|
|
|
m_pItemSelected = NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pItemSelected->OnLButtonDblClk(nFlags,point);//<2F><><EFBFBD>¶ϲ㽨<CFB2><E3BDA8>ʱ<EFBFBD><CAB1>ִ<EFBFBD>иú<D0B8><C3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>m_pItemSelected<65><64><EFBFBD><EFBFBD>CItemAddFault<6C>仯ΪCItemFault
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::Clear()
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_pItemSelected != NULL)
|
|
|
|
|
|
delete m_pItemSelected;
|
|
|
|
|
|
m_pItemSelected = NULL;
|
|
|
|
|
|
if(m_pItemOilWaterBoundary != NULL)
|
|
|
|
|
|
delete m_pItemOilWaterBoundary;
|
|
|
|
|
|
m_pItemOilWaterBoundary = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
m_WellObjSelectlist.RemoveAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::DeleteItem()
|
|
|
|
|
|
{
|
|
|
|
|
|
CItemWellBase::DeleteItem();
|
|
|
|
|
|
|
|
|
|
|
|
if(m_pItemOilWaterBoundary != NULL)
|
|
|
|
|
|
delete m_pItemOilWaterBoundary;
|
|
|
|
|
|
m_pItemOilWaterBoundary = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
m_WellObjSelectlist.RemoveAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int CItemWellSection::DeleteSelection(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (m_WellObjSelectlist.GetCount() == 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return;
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
if (m_pItemSelected!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_pItemSelected->GetType() == ITEM_BEND || m_pItemSelected->GetType() == ITEM_FAULT)
|
|
|
|
|
|
SetReUnDoAction(FALSE, IDS_STRING_ACTION_MOVE,2);
|
|
|
|
|
|
else
|
|
|
|
|
|
SetReUnDoAction(FALSE);
|
|
|
|
|
|
|
|
|
|
|
|
((CItemWellBase*)m_pItemSelected)->DeleteSelection();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (m_pItemSelected)
|
|
|
|
|
|
delete m_pItemSelected;
|
|
|
|
|
|
m_pItemSelected = NULL;
|
|
|
|
|
|
Clear();
|
|
|
|
|
|
GetWellSection()->ReSetPosition();
|
|
|
|
|
|
//GetView()->SetScrollBarRange();
|
|
|
|
|
|
GetDoc()->Invalidate();
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SetBendDataForDFOld(CWellSection* pSection ,CBendObj* pBend ,CWellPole* pWell,CWellPole* pWellAnother, CWellBaseObj*pLayerDrawObj , CWellBaseObj* pTrackInObject, int nInt)
|
|
|
|
|
|
{
|
|
|
|
|
|
double xLeftValue, xRightValue;
|
|
|
|
|
|
pBend->GetBendXValue(xLeftValue, xRightValue);
|
|
|
|
|
|
pBend->m_nLithoBreakStyle = 2;
|
|
|
|
|
|
pBend->m_fLithoBreakWidth = 0.1;
|
|
|
|
|
|
pBend->m_fTopLithoBreakPoint = 0.5;
|
|
|
|
|
|
pBend->m_fBottomLithoBreakPoint = 0.5;
|
|
|
|
|
|
pBend->m_fOutBendControlLevel = 0.0;
|
|
|
|
|
|
if (pTrackInObject->GetType() == KEP_RESULT)
|
|
|
|
|
|
{
|
|
|
|
|
|
CInTrackResult* pLayerLeft = (CInTrackResult*)pBend->m_pLayerLeft;
|
|
|
|
|
|
CInTrackResult* pLayerRight = (CInTrackResult*)pBend->m_pLayerRight;
|
|
|
|
|
|
if ((pLayerLeft->m_strResult != pLayerRight->m_strResult) && !(pLayerLeft->m_strResult == "<EFBFBD>ɲ<EFBFBD>" || pLayerRight->m_strResult == "<EFBFBD>ɲ<EFBFBD>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend->m_fWaterTop = pBend->m_fGasBottom = pLayerLeft->GetPos().CenterPoint().y0 - (pLayerLeft->GetPos().CenterPoint().y0 - pLayerRight->GetPos().CenterPoint().y0) / 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double yLeftValue = pLayerDrawObj->GetPos().CenterPoint().y0;
|
|
|
|
|
|
double yRightValue = pTrackInObject->GetRect().CenterPoint().y0;
|
|
|
|
|
|
double HeightLeft = pLayerDrawObj->GetPos().Height();
|
|
|
|
|
|
double HeightRight = pTrackInObject->GetRect().Height();
|
|
|
|
|
|
if (nInt == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
pSection->ComputeBendPosition(pBend, yRightValue, yLeftValue, HeightRight, HeightLeft);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (nInt == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
pSection->ComputeBendPosition(pBend, yLeftValue, yRightValue, HeightLeft, HeightRight);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pBend->AddControlPoints(xLeftValue, yLeftValue, xRightValue, yRightValue, xRightValue - xLeftValue);
|
|
|
|
|
|
|
|
|
|
|
|
dfPoint ptTemp;
|
|
|
|
|
|
ptTemp.x0 = xLeftValue;
|
|
|
|
|
|
ptTemp.y0 = yLeftValue + HeightLeft * 0.5;
|
|
|
|
|
|
pBend->m_ptArrCurveTopOld.Add(ptTemp);
|
|
|
|
|
|
ptTemp.y0 = yLeftValue - HeightLeft * 0.5;
|
|
|
|
|
|
pBend->m_ptArrCurveBotOld.Add(ptTemp);
|
|
|
|
|
|
ptTemp.x0 = xRightValue;
|
|
|
|
|
|
ptTemp.y0 = yRightValue + HeightRight * 0.5;
|
|
|
|
|
|
pBend->m_ptArrCurveTopOld.Add(ptTemp);
|
|
|
|
|
|
ptTemp.y0 = yRightValue - HeightRight * 0.5;
|
|
|
|
|
|
pBend->m_ptArrCurveBotOld.Add(ptTemp);
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>Bend<6E>Ķϲ<C4B6><CFB2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
pBend->SetSlotType();
|
|
|
|
|
|
pBend->BendAddFault();
|
|
|
|
|
|
pBend->ComputeSlopeAndConstant();
|
|
|
|
|
|
pBend->CreateBendLines();
|
|
|
|
|
|
CString strLithoLeft;
|
|
|
|
|
|
CString strLithoRight;
|
|
|
|
|
|
CString strResultLeft;
|
|
|
|
|
|
CString strResultRight;
|
|
|
|
|
|
if (pLayerDrawObj->GetType() == KEP_RESULT)
|
|
|
|
|
|
{
|
|
|
|
|
|
CInTrackResult* pLayerLeft = (CInTrackResult*)pBend->m_pLayerLeft;
|
|
|
|
|
|
strLithoLeft = pLayerLeft->m_strLitho;
|
|
|
|
|
|
strResultLeft = pLayerLeft->m_strResult;
|
|
|
|
|
|
if (NULL != pBend->m_pLayerRight)
|
|
|
|
|
|
{
|
|
|
|
|
|
CInTrackResult* pLayerRight = (CInTrackResult*)pBend->m_pLayerRight;
|
|
|
|
|
|
strLithoRight = pLayerRight->m_strLitho;
|
|
|
|
|
|
strResultRight = pLayerRight->m_strResult;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (pLayerDrawObj->GetType() == KEP_LAYERGROUP)
|
|
|
|
|
|
{
|
|
|
|
|
|
CInTrackLayerGroup* pLayerLeft = (CInTrackLayerGroup*)pBend->m_pLayerLeft;
|
|
|
|
|
|
strLithoLeft = pLayerLeft->m_strLitho;
|
|
|
|
|
|
if (NULL != pBend->m_pLayerRight)
|
|
|
|
|
|
{
|
|
|
|
|
|
CInTrackLayerGroup* pLayerRight = (CInTrackLayerGroup*)pBend->m_pLayerRight;
|
|
|
|
|
|
strLithoRight = pLayerRight->m_strLitho;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if ((/*!strLithoLeft.IsEmpty() && !strLithoRight.IsEmpty() && */strLithoLeft != strLithoRight) ||
|
|
|
|
|
|
(/*!strResultLeft.IsEmpty() && !strResultRight.IsEmpty() && */strResultLeft != strResultRight))
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend->bBreakLithoTemp = TRUE;
|
|
|
|
|
|
pBend->CreateBendLithoBreak();
|
|
|
|
|
|
}
|
|
|
|
|
|
pBend->CreateBendFills();
|
|
|
|
|
|
pBend->SetShowFill(TRUE);
|
|
|
|
|
|
pBend->SetShowTopLine(TRUE);
|
|
|
|
|
|
pBend->SetShowBotLine(TRUE);
|
|
|
|
|
|
|
|
|
|
|
|
if (pSection->IsStratumSmooth())
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend->SmoothBendLines();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SetBendDataForResFormPCG(CWellSection* pSection, CBendObj* pBend, CWellPole* pWell, CWellPole* pWellAnother, CWellBaseObj*pLayerDrawObj, CWellBaseObj* pTrackInObject, int nInt)
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend->SetSlotType();
|
|
|
|
|
|
if (pBend->m_pLayerRight->GetPos().left > pBend->m_pLayerLeft->GetPos().left)
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend->m_ptBeginBreak.x0 = pBend->m_pLayerLeft->GetPos().right;
|
|
|
|
|
|
pBend->m_ptBeginBreak.y0 = pBend->m_pLayerLeft->GetPos().CenterPoint().y0;
|
|
|
|
|
|
CWellPole* pWellLeft = pBend->m_pWellLeft;
|
|
|
|
|
|
pBend->m_ptEndBreak.x0 = pBend->m_pLayerRight->GetPos().left;
|
|
|
|
|
|
pBend->m_ptEndBreak.y0 = pBend->m_pLayerRight->GetPos().CenterPoint().y0;
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend->m_ptBeginBreak.x0 = pBend->m_pLayerLeft->GetPos().left;
|
|
|
|
|
|
pBend->m_ptBeginBreak.y0 = pBend->m_pLayerLeft->GetPos().CenterPoint().y0;
|
|
|
|
|
|
pBend->m_ptEndBreak.x0 = pBend->m_pLayerRight->GetPos().right;
|
|
|
|
|
|
pBend->m_ptEndBreak.y0 = pBend->m_pLayerRight->GetPos().CenterPoint().y0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pBend->InitBendControlPoints();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL compareTwoLayerName(CInTrackDepthSegment* pParentInTrack , CInTrackDepthSegment* pParentThatIn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pParentInTrack->GetType() != pParentThatIn->GetType())
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
if (pParentInTrack->GetLayerName() == pParentThatIn->GetLayerName())
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>bend<6E><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߶ν<DFB6><CEBD><EFBFBD>
|
|
|
|
|
|
BOOL ComputeIntersectBend(CWellSection *pSection, CPoint2D pt1, CPoint2D pt2, CString leftWell, CString rightWell)
|
|
|
|
|
|
{
|
|
|
|
|
|
CPoint2D bpt1, bpt2, rpt;
|
|
|
|
|
|
|
|
|
|
|
|
POSITION pos = pSection->m_BendList.GetHeadPosition();
|
|
|
|
|
|
while (pos != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CBendObj *pBend = (CBendObj*)pSection->m_BendList.GetNext(pos);
|
|
|
|
|
|
if (pBend->m_pLayerRight != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pBend->m_pWellLeft->GetWellName() == leftWell && pBend->m_pWellRight->GetWellName() == rightWell)
|
|
|
|
|
|
{
|
|
|
|
|
|
bpt1 = pBend->m_pLayerLeft->GetRect().CenterPoint();
|
|
|
|
|
|
bpt2 = pBend->m_pLayerRight->GetRect().CenterPoint();
|
|
|
|
|
|
|
|
|
|
|
|
if (nsWellPoleFunc::LineIntersect(rpt, pt1, pt2, bpt1, bpt2))
|
|
|
|
|
|
{
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
////////////// <20>㰴<EFBFBD><E3B0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void CItemWellSection::ConnectOnName(CWellBaseObj* pLayerDrawObj,int nInt, std::vector<CWellBaseObj*>& linkbends)
|
|
|
|
|
|
{
|
|
|
|
|
|
linkbends.clear();
|
|
|
|
|
|
ETrackType trackTypeClass[4]; //<2F>ز<EFBFBD><D8B2><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|
|
|
|
|
trackTypeClass[0] = Track_Stratum;
|
|
|
|
|
|
trackTypeClass[1] = Track_OilLayerGroup;
|
|
|
|
|
|
trackTypeClass[2] = Track_SandLayer;
|
|
|
|
|
|
trackTypeClass[3] = Track_Result;
|
|
|
|
|
|
|
|
|
|
|
|
CTrackObj* pTrack = (CTrackObj*)pLayerDrawObj->GetParent();
|
|
|
|
|
|
int trackClassId = -1;
|
|
|
|
|
|
for (int i = 0; i < 4; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (trackTypeClass[i] == pTrack->GetTrackType())
|
|
|
|
|
|
{
|
|
|
|
|
|
trackClassId = i; break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
CTrackObj* pthisParent = NULL;
|
|
|
|
|
|
CWellPole * pWell = (CWellPole *)pTrack->GetParent();
|
|
|
|
|
|
if (trackClassId > 0)
|
|
|
|
|
|
{//<2F><><EFBFBD>õ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ز<EFBFBD><D8B2>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵز<C4B5><D8B2><EFBFBD>
|
|
|
|
|
|
for (int i = trackClassId - 1; i > -1; i--)
|
|
|
|
|
|
{
|
|
|
|
|
|
TRACKLIST tracklist;
|
|
|
|
|
|
pWell->GetAllTrack(&tracklist, trackTypeClass[i]);
|
|
|
|
|
|
if (tracklist.size() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if ((*tracklist.begin())->GetChildren().size() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
pthisParent = (*tracklist.begin());
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
CInTrackDepthSegment* pCurrentInTrack = (CInTrackDepthSegment*)pLayerDrawObj;
|
|
|
|
|
|
CInTrackDepthSegment* pParentInTrack = NULL;
|
|
|
|
|
|
if (pthisParent != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
WELLOBJLIST::iterator it = pthisParent->GetChildren().begin();
|
|
|
|
|
|
for (; it!= pthisParent->GetChildren().end(); it++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if ((*it)->IsTrackChildTopEnd())
|
|
|
|
|
|
{
|
|
|
|
|
|
CInTrackDepthSegment* ptIn = (CInTrackDepthSegment*)(*it);
|
|
|
|
|
|
if ((ptIn->m_fSdep - 0.0001) < pCurrentInTrack->m_fSdep && (ptIn->m_fEdep + 0.0001) > pCurrentInTrack->m_fEdep)
|
|
|
|
|
|
{
|
|
|
|
|
|
pParentInTrack = ptIn;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CWellSection* pSection = (CWellSection*)pWell->GetParent();
|
|
|
|
|
|
if (NULL == pSection)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
CWellPole* pWellAnother = NULL;
|
|
|
|
|
|
POSITION posFind = pSection->m_WellList.Find(pWell);
|
|
|
|
|
|
if (nInt == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
pSection->m_WellList.GetPrev(posFind);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (nInt == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
pSection->m_WellList.GetNext(posFind);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (posFind!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (nInt == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
pWellAnother = (CWellPole*)pSection->m_WellList.GetNext(posFind);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (nInt == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
pWellAnother = (CWellPole*)pSection->m_WellList.GetPrev(posFind);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (pWellAnother == NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
CInTrackDepthSegment* pParentThatIn = NULL;
|
|
|
|
|
|
CTrackObj* pthatParent = NULL;
|
|
|
|
|
|
if (pParentInTrack != NULL)
|
|
|
|
|
|
{//<2F>Ѽ<EFBFBD><D1BC><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD><D8B2>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD>, <20><><EFBFBD>ö<EFBFBD><C3B6>澮<EFBFBD>ڵĸ<DAB5><C4B8><EFBFBD><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
TRACKLIST tracklist;
|
|
|
|
|
|
pWellAnother->GetAllTrack(&tracklist, pthisParent->GetTrackType());
|
|
|
|
|
|
if (tracklist.size() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if ((*tracklist.begin())->GetChildren().size() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
pthatParent = (*tracklist.begin());
|
|
|
|
|
|
WELLOBJLIST::iterator it = pthatParent->GetChildren().begin();
|
|
|
|
|
|
for (; it != pthatParent->GetChildren().end(); it++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if ((*it)->IsTrackChildTopEnd())
|
|
|
|
|
|
{
|
|
|
|
|
|
CInTrackDepthSegment* ptIn = (CInTrackDepthSegment*)(*it);
|
|
|
|
|
|
if (compareTwoLayerName(pParentInTrack, ptIn))
|
|
|
|
|
|
{
|
|
|
|
|
|
pParentThatIn = ptIn; break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TRACKLIST tracklist;
|
|
|
|
|
|
pWellAnother->GetAllTrack(&tracklist, pTrack->GetTrackType());
|
|
|
|
|
|
TRACKLIST::iterator it = tracklist.begin();
|
|
|
|
|
|
for(; it!= tracklist.end(); it++)
|
|
|
|
|
|
{
|
|
|
|
|
|
CTrackObj* pNextTrackObj = (CTrackObj*)*it;
|
|
|
|
|
|
|
|
|
|
|
|
if (pNextTrackObj->GetTrackType() == pTrack->GetTrackType())
|
|
|
|
|
|
{
|
|
|
|
|
|
WELLOBJLIST::iterator wit = pNextTrackObj->GetChildren().begin();
|
|
|
|
|
|
for(; wit != pNextTrackObj->GetChildren().end(); wit++)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellBaseObj* pTrackInObject = *wit;
|
|
|
|
|
|
BOOL bName = FALSE;
|
|
|
|
|
|
if (!pTrackInObject->IsTrackChildTopEnd())
|
|
|
|
|
|
{
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
CInTrackDepthSegment* pt = (CInTrackDepthSegment*)pTrackInObject;
|
|
|
|
|
|
if (compareTwoLayerName(pCurrentInTrack, pt) == FALSE)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
if(ComputeIntersectBend(pSection,pCurrentInTrack->GetRect().CenterPoint(), pt->GetRect().CenterPoint(), pWell->GetWellName(), pWellAnother->GetWellName()))
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
if (pParentThatIn)
|
|
|
|
|
|
{//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>жϣ<D0B6><CFA3><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD>ֿ<EFBFBD>Խ<EFBFBD><D4BD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4>㡣
|
|
|
|
|
|
if ((pParentThatIn->m_fSdep - 0.0001) < pt->m_fSdep && pt->m_fEdep < (pParentThatIn->m_fEdep + 0.0001))
|
|
|
|
|
|
bName = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
bName = TRUE;
|
|
|
|
|
|
|
|
|
|
|
|
if (bName)
|
|
|
|
|
|
{
|
|
|
|
|
|
POSITION posBend = pSection->m_BendList.GetHeadPosition();
|
|
|
|
|
|
BOOL bCreate = TRUE;
|
|
|
|
|
|
while (posBend!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
BOOL bFirst,bSceond,bThird;
|
|
|
|
|
|
CBendObj* pBend = (CBendObj*)pSection->m_BendList.GetNext(posBend);
|
|
|
|
|
|
if (nInt == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
/////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
bFirst = (pBend->m_pLayerLeft == (CInTrackDepthSegment*)pTrackInObject && pBend->m_pLayerRight == (CInTrackDepthSegment*)pLayerDrawObj)
|
|
|
|
|
|
|| (pBend->m_pLayerRight == (CInTrackDepthSegment*)pTrackInObject && pBend->m_pLayerLeft == (CInTrackDepthSegment*)pLayerDrawObj);
|
|
|
|
|
|
////////<2F><><EFBFBD><EFBFBD><EFBFBD>߲<EFBFBD><DFB2>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
bSceond = pBend->m_pLayerLeft == (CInTrackDepthSegment*)pTrackInObject && pBend->m_pLayerRight == NULL
|
|
|
|
|
|
&& pBend->m_ptArrControls[0].X<pBend->m_ptArrControls[1].X;;
|
|
|
|
|
|
////////<2F><><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
bThird = pBend->m_pLayerLeft == (CInTrackDepthSegment*)pLayerDrawObj && pBend->m_pLayerRight == NULL
|
|
|
|
|
|
&& pBend->m_ptArrControls[0].X>pBend->m_ptArrControls[1].X;;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (nInt == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
/////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
bFirst = (pBend->m_pLayerLeft == (CInTrackDepthSegment*)pTrackInObject && pBend->m_pLayerRight == (CInTrackDepthSegment*)pLayerDrawObj)
|
|
|
|
|
|
|| (pBend->m_pLayerRight == (CInTrackDepthSegment*)pTrackInObject && pBend->m_pLayerLeft == (CInTrackDepthSegment*)pLayerDrawObj);
|
|
|
|
|
|
////////<2F><><EFBFBD><EFBFBD><EFBFBD>߲<EFBFBD><DFB2>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
bSceond = pBend->m_pLayerLeft == (CInTrackDepthSegment*)pTrackInObject && pBend->m_pLayerRight == NULL
|
|
|
|
|
|
&& pBend->m_ptArrControls[0].X>pBend->m_ptArrControls[1].X;
|
|
|
|
|
|
////////<2F><><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
bThird = pBend->m_pLayerLeft == (CInTrackDepthSegment*)pLayerDrawObj && pBend->m_pLayerRight == NULL
|
|
|
|
|
|
&& pBend->m_ptArrControls[0].X<pBend->m_ptArrControls[1].X;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (bFirst || bSceond || bThird)
|
|
|
|
|
|
{
|
|
|
|
|
|
bCreate = FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (bCreate)
|
|
|
|
|
|
{
|
|
|
|
|
|
CBendObj *pBend = new CBendObj();
|
|
|
|
|
|
pBend->SetParent(pSection);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nInt == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend->m_pWellLeft = pWellAnother;
|
|
|
|
|
|
pBend->m_pWellRight = pWell;
|
|
|
|
|
|
|
|
|
|
|
|
pBend->m_pLayerLeft = (CInTrackDepthSegment*)pTrackInObject;
|
|
|
|
|
|
pBend->m_LeftLayerName = ((CInTrackDepthSegment*)pTrackInObject)->GetLayerName();
|
|
|
|
|
|
pBend->m_pLayerRight =(CInTrackDepthSegment*)pLayerDrawObj;
|
|
|
|
|
|
pBend->m_RightLayerName = ((CInTrackDepthSegment*)pLayerDrawObj)->GetLayerName();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend->m_pWellLeft = pWell;
|
|
|
|
|
|
pBend->m_pWellRight = pWellAnother;
|
|
|
|
|
|
|
|
|
|
|
|
pBend->m_pLayerLeft = (CInTrackDepthSegment*)pLayerDrawObj;
|
|
|
|
|
|
pBend->m_LeftLayerName = ((CInTrackDepthSegment*)pLayerDrawObj)->GetLayerName();
|
|
|
|
|
|
pBend->m_pLayerRight = (CInTrackDepthSegment*)pTrackInObject;
|
|
|
|
|
|
pBend->m_RightLayerName = ((CInTrackDepthSegment*)pTrackInObject)->GetLayerName();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pBend->m_ptBeginBreak.x0 = pLayerDrawObj->GetPos().CenterPoint().x0;
|
|
|
|
|
|
pBend->m_ptEndBreak.x0 = pTrackInObject->GetRect().CenterPoint().x0;
|
|
|
|
|
|
|
|
|
|
|
|
CTrackObj* pTrack1 = (CTrackObj*)pBend->m_pLayerLeft->GetParent();
|
|
|
|
|
|
//// <20><><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD>֮<EFBFBD><D6AE><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>(ע<><D7A2>ͨ<EFBFBD><CDA8>λ<EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD>bend<6E><64><EFBFBD><EFBFBD>)
|
|
|
|
|
|
POSITION pos = pSection->m_BendList.GetHeadPosition();
|
|
|
|
|
|
BOOL bBreak = FALSE;
|
|
|
|
|
|
while(pos != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellBaseObj* pObj = pSection->m_BendList.GetNext(pos);
|
|
|
|
|
|
if (pObj->GetType() == KEP_SECTIONBEND)
|
|
|
|
|
|
{
|
|
|
|
|
|
CBendObj* pBendObj = (CBendObj*)pObj;
|
|
|
|
|
|
CTrackObj* pTrack2 = (CTrackObj*)pBendObj->m_pLayerLeft->GetParent();
|
|
|
|
|
|
if (pTrack1->GetTrackType() != pTrack2->GetTrackType())
|
|
|
|
|
|
continue; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>͵IJ<CDB5>λbend<6E><64><EFBFBD><EFBFBD><EFBFBD>ñȽ<C3B1>
|
|
|
|
|
|
double topLeft,topRight;
|
|
|
|
|
|
double TLeft,TRight;
|
|
|
|
|
|
if (pBendObj->m_pLayerRight != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole* pWellLeft = (CWellPole*)pBendObj->m_pLayerLeft->GetWell();
|
|
|
|
|
|
CWellPole* pWellRight = (CWellPole*)pBendObj->m_pLayerRight->GetWell();
|
|
|
|
|
|
if ((pWellLeft == pWell && pWellRight ==pWellAnother) || (pWellLeft == pWellAnother && pWellRight == pWell))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pBendObj->m_pLayerRight->GetPos().left > pBendObj->m_pLayerLeft->GetPos().left)
|
|
|
|
|
|
{
|
|
|
|
|
|
topLeft = pBendObj->m_pLayerLeft->GetPos().top;
|
|
|
|
|
|
topRight = pBendObj->m_pLayerRight->GetPos().top;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
topLeft = pBendObj->m_pLayerRight->GetPos().top;
|
|
|
|
|
|
topRight = pBendObj->m_pLayerLeft->GetPos().top;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (pBend->m_pLayerRight->GetPos().left > pBend->m_pLayerLeft->GetPos().left)
|
|
|
|
|
|
{
|
|
|
|
|
|
TLeft = pBend->m_pLayerLeft->GetPos().top;
|
|
|
|
|
|
TRight = pBend->m_pLayerRight->GetPos().top;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
TLeft = pBend->m_pLayerRight->GetPos().top;
|
|
|
|
|
|
TRight = pBend->m_pLayerLeft->GetPos().top;
|
|
|
|
|
|
}
|
|
|
|
|
|
BOOL bOne = topLeft > TLeft&&topRight < TRight;
|
|
|
|
|
|
BOOL bSecond = topLeft < TLeft&&topRight > TRight;
|
|
|
|
|
|
if (bOne || bSecond)
|
|
|
|
|
|
{
|
|
|
|
|
|
bBreak = TRUE;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (bBreak)
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend = NULL;
|
|
|
|
|
|
delete pBend;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if (nInt == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
((CInTrackDepthSegment*)pLayerDrawObj)->m_BendLeftList.push_back(pBend);
|
|
|
|
|
|
((CInTrackDepthSegment*)pTrackInObject)->m_BendRightList.push_back(pBend);
|
|
|
|
|
|
ReOrederList(((CInTrackDepthSegment*)pLayerDrawObj)->m_BendLeftList,1);
|
|
|
|
|
|
ReOrederList(((CInTrackDepthSegment*)pTrackInObject)->m_BendRightList,2);
|
|
|
|
|
|
}
|
|
|
|
|
|
/////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
else if (nInt == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
((CInTrackDepthSegment*)pLayerDrawObj)->m_BendRightList.push_back(pBend);
|
|
|
|
|
|
((CInTrackDepthSegment*)pTrackInObject)->m_BendLeftList.push_back(pBend);
|
|
|
|
|
|
ReOrederList(((CInTrackDepthSegment*)pLayerDrawObj)->m_BendRightList,2);
|
|
|
|
|
|
ReOrederList(((CInTrackDepthSegment*)pTrackInObject)->m_BendLeftList,1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (pSection->m_bResForm)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetBendDataForResFormPCG(pSection, pBend, pWell, pWellAnother, pLayerDrawObj, pTrackInObject, nInt);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
SetBendDataForDFOld(pSection, pBend, pWell,pWellAnother, pLayerDrawObj, pTrackInObject, nInt);
|
|
|
|
|
|
|
|
|
|
|
|
pSection->m_BendList.AddTail(pBend);
|
|
|
|
|
|
linkbends.push_back(pBend);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
tracklist.clear();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
BOOL bCompareBendLayer(WELLOBJLIST::iterator& it, WELLOBJLIST::iterator& nextIt, int nInt)
|
|
|
|
|
|
{
|
|
|
|
|
|
BOOL b = FALSE;
|
|
|
|
|
|
CWellBaseObj* pObj = *it;
|
|
|
|
|
|
CWellBaseObj* pObjAnOther = *nextIt;
|
|
|
|
|
|
if (pObj->GetType() == KEP_SECTIONBEND && pObjAnOther->GetType() == KEP_SECTIONBEND)
|
|
|
|
|
|
{
|
|
|
|
|
|
CBendObj* pBendObj = (CBendObj*)pObj;
|
|
|
|
|
|
CInTrackDepthSegment* pLayer = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
CBendObj* pBendObjAnother = (CBendObj*)pObjAnOther;
|
|
|
|
|
|
CInTrackDepthSegment* pLayerAnother = NULL;
|
|
|
|
|
|
///////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߲<EFBFBD>λ<EFBFBD>ĸߵ<C4B8><DFB5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if (nInt == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pBendObj->m_pLayerLeft->GetPos().left < pBendObj->m_pLayerRight->GetPos().left)
|
|
|
|
|
|
{
|
|
|
|
|
|
pLayer = pBendObj->m_pLayerLeft;
|
|
|
|
|
|
}
|
|
|
|
|
|
else/////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣨<EFBFBD><E3A3A8><EFBFBD>ߺ<EFBFBD><DFBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ұߺ<D2B1><DFBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
{
|
|
|
|
|
|
pLayer = pBendObj->m_pLayerRight;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
///////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ұ߲<D2B1>λ<EFBFBD>ĸߵ<C4B8><DFB5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
else if (nInt == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pBendObj->m_pLayerLeft->GetPos().left < pBendObj->m_pLayerRight->GetPos().left)
|
|
|
|
|
|
{
|
|
|
|
|
|
pLayer = pBendObj->m_pLayerRight;
|
|
|
|
|
|
}
|
|
|
|
|
|
else/////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣨<EFBFBD><E3A3A8><EFBFBD>ߺ<EFBFBD><DFBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ұߺ<D2B1><DFBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
{
|
|
|
|
|
|
pLayer = pBendObj->m_pLayerLeft;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
///////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߲<EFBFBD>λ<EFBFBD>ĸߵ<C4B8><DFB5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if (nInt == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pBendObjAnother->m_pLayerLeft->GetPos().left < pBendObjAnother->m_pLayerRight->GetPos().left)
|
|
|
|
|
|
{
|
|
|
|
|
|
pLayerAnother = pBendObjAnother->m_pLayerLeft;
|
|
|
|
|
|
}
|
|
|
|
|
|
else/////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣨<EFBFBD><E3A3A8><EFBFBD>ߺ<EFBFBD><DFBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ұߺ<D2B1><DFBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
{
|
|
|
|
|
|
pLayerAnother = pBendObjAnother->m_pLayerRight;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
///////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ұ߲<D2B1>λ<EFBFBD>ĸߵ<C4B8><DFB5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
else if (nInt == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pBendObjAnother->m_pLayerRight->GetPos().left > pBendObjAnother->m_pLayerLeft->GetPos().left)
|
|
|
|
|
|
{
|
|
|
|
|
|
pLayerAnother = pBendObjAnother->m_pLayerRight;
|
|
|
|
|
|
}
|
|
|
|
|
|
else/////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>㣨<EFBFBD><E3A3A8><EFBFBD>ߺ<EFBFBD><DFBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ұߺ<D2B1><DFBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
{
|
|
|
|
|
|
pLayerAnother = pBendObjAnother->m_pLayerLeft;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (pLayerAnother->GetPos().top > pLayer->GetPos().top)
|
|
|
|
|
|
{
|
|
|
|
|
|
b = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
void CItemWellSection::ReOrederList(WELLOBJLIST& BendList, int nInt)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (BendList.size() < 2)
|
|
|
|
|
|
return;
|
|
|
|
|
|
//<2F><><EFBFBD>ݲ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD>иߵ<D0B8><DFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
bool swapped;
|
|
|
|
|
|
auto endIt = BendList.end(); // <20><><EFBFBD><EFBFBD><EFBFBD>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD><EFBFBD>¼δ<C2BC><CEB4><EFBFBD>ֵĽ<D6B5><C4BD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
|
swapped = false;
|
|
|
|
|
|
WELLOBJLIST::iterator it = BendList.begin();
|
|
|
|
|
|
WELLOBJLIST::iterator nextIt = std::next(it);
|
|
|
|
|
|
while (nextIt != endIt)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bCompareBendLayer(it,nextIt,nInt))
|
|
|
|
|
|
{
|
|
|
|
|
|
std::iter_swap(it, nextIt);
|
|
|
|
|
|
swapped = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
++it;
|
|
|
|
|
|
++nextIt;
|
|
|
|
|
|
}
|
|
|
|
|
|
--endIt; // ÿ<><C3BF>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><D4AA><EFBFBD>Ѿ<EFBFBD>ð<EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٱȽ<D9B1>
|
|
|
|
|
|
} while (swapped); // <20><><EFBFBD><EFBFBD>û<EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::ApplingTemplateFile(CFile &fr,BOOL bAll)
|
|
|
|
|
|
{
|
|
|
|
|
|
//Ӧ<><D3A6>ģ<EFBFBD><C4A3><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
CWellBaseObjList WellList;
|
|
|
|
|
|
CWellSection * pSection = (CWellSection *)GetWellSection();
|
|
|
|
|
|
if (bAll)
|
|
|
|
|
|
{
|
|
|
|
|
|
POSITION posWell = pSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
while(posWell!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole *pWellObj = (CWellPole *)pSection->m_WellList.GetNext(posWell);
|
|
|
|
|
|
WellList.AddTail(pWellObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_WellObjSelectlist.GetCount() == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellBaseObj* pDrawObj = (CWellBaseObj*)m_WellObjSelectlist.GetHead();
|
|
|
|
|
|
if (pDrawObj->GetType() == KEP_WELL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole *pWellObj = (CWellPole *)pDrawObj;
|
|
|
|
|
|
WellList.AddTail(pWellObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL bDelete = FALSE;
|
|
|
|
|
|
CPointArr fDistance;
|
|
|
|
|
|
|
|
|
|
|
|
//////<2F><><EFBFBD>澮֮<E6BEAE><D6AE><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|
|
|
|
|
POSITION posSectionWell = pSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
CWellPole* pWellNext = NULL;
|
|
|
|
|
|
while(posSectionWell != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole* pWellObj = (CWellPole*)pSection->m_WellList.GetNext(posSectionWell);
|
|
|
|
|
|
POSITION posFind = pSection->m_WellList.Find(pWellObj);
|
|
|
|
|
|
pSection->m_WellList.GetNext(posFind);
|
|
|
|
|
|
if (posFind!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
pWellNext = (CWellPole*)pSection->m_WellList.GetNext(posFind);
|
|
|
|
|
|
dfPoint temppoint;
|
|
|
|
|
|
temppoint.x0 = pWellNext->GetPos().left - pWellObj->GetPos().right;
|
|
|
|
|
|
fDistance.Add(temppoint);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////<2F><><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD>֮<EFBFBD><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
|
POSITION posBend = pSection->m_BendList.GetHeadPosition();
|
|
|
|
|
|
//while(NULL != posBend)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// double XLeft = 0.0;
|
|
|
|
|
|
// double XRight = 0.0;
|
|
|
|
|
|
// CBendObj* pBend = (CBendObj*)pSection->m_BendList.GetNext(posBend);
|
|
|
|
|
|
// pBend->GetBendXValue(XLeft,XRight);
|
|
|
|
|
|
// for (int i = 0; i<pBend->m_faultArr.GetCount(); i++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// CFaultObj* pFault = (CFaultObj*)pBend->m_faultArr.GetAt(i).pFault;
|
|
|
|
|
|
// for (int j = 0;j<pFault->m_ptArr.GetCount(); j++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// pFault->m_ptArr[j].z0 = pFault->m_ptArr[j].x0-XLeft;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
POSITION posWell = WellList.GetHeadPosition();
|
|
|
|
|
|
while(posWell!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole *pWellObj = (CWellPole *)WellList.GetNext(posWell);
|
|
|
|
|
|
|
|
|
|
|
|
fr.SeekToBegin();
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>ݾ<EFBFBD><DDBE>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
TRACKLIST tracklist;
|
|
|
|
|
|
tracklist.assign(pWellObj->GetTrackList().rbegin(), pWellObj->GetTrackList().rend()); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//pWellObj->GetAllTrack(&tracklist);
|
|
|
|
|
|
pWellObj->GetTrackList().clear(); // ->RemoveAll();
|
|
|
|
|
|
|
|
|
|
|
|
CString strWellTitle = pWellObj->m_strTitle;
|
|
|
|
|
|
CString strWellName = pWellObj->GetWellName();
|
|
|
|
|
|
double fx = 0.0;
|
|
|
|
|
|
double fy = 0.0;
|
|
|
|
|
|
fx = ((CSectionWellObj*)pWellObj)->m_fX;
|
|
|
|
|
|
fy = ((CSectionWellObj*)pWellObj)->m_fY;
|
|
|
|
|
|
double fLevel = pWellObj->m_fLevel;
|
|
|
|
|
|
double topDepth = pWellObj->m_dSdep;
|
|
|
|
|
|
double endDepth = pWellObj->m_dEdep;
|
|
|
|
|
|
double left = pWellObj->GetPos().left;
|
|
|
|
|
|
double proportion = pWellObj->m_fProportion;
|
|
|
|
|
|
double dOldTrackHead = pWellObj->m_dHeightTrackHead;
|
|
|
|
|
|
double dOldWellHead = pWellObj->m_dHeightWellHead;
|
|
|
|
|
|
double tracktop = pWellObj->GetPos().top-dOldWellHead-dOldTrackHead;
|
|
|
|
|
|
double nWellId = pWellObj->GetId();
|
|
|
|
|
|
std::vector<CWellPole::well_interval > oldWellIntervalVec;
|
|
|
|
|
|
oldWellIntervalVec.insert(oldWellIntervalVec.begin(),pWellObj->GetIntervalVec()->begin(),pWellObj->GetIntervalVec()->end());
|
|
|
|
|
|
|
|
|
|
|
|
AfxGetPublicFunction()->SetCodeType(CODE_GB2321);
|
|
|
|
|
|
if(pWellObj->ReadPCG(fr, -1) == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
//<2F>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
pWellObj->GetTrackList().assign(tracklist.begin(), tracklist.end());
|
|
|
|
|
|
tracklist.clear();
|
|
|
|
|
|
return ;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
////<2F>ͷ<EFBFBD><CDB7><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
pWellObj->m_strTitle = strWellTitle;
|
|
|
|
|
|
pWellObj->SetWellName(strWellName);
|
|
|
|
|
|
//pWellObj->ReSetWellHead();
|
|
|
|
|
|
pWellObj->m_fLevel = fLevel;
|
|
|
|
|
|
((CSectionWellObj*)pWellObj)->m_fX=fx;
|
|
|
|
|
|
((CSectionWellObj*)pWellObj)->m_fY=fy;
|
|
|
|
|
|
pWellObj->GetPos().left = left;
|
|
|
|
|
|
pWellObj->GetPos().top = tracktop+pWellObj->m_dHeightWellHead+pWellObj->m_dHeightTrackHead;
|
|
|
|
|
|
pWellObj->m_dSdep = topDepth;
|
|
|
|
|
|
pWellObj->m_dEdep = endDepth;
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->GetIntervalVec()->clear();
|
|
|
|
|
|
pWellObj->GetIntervalVec()->insert(pWellObj->GetIntervalVec()->begin(),oldWellIntervalVec.begin(),oldWellIntervalVec.end());
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->m_fProportion = proportion;
|
|
|
|
|
|
pWellObj->m_fMarginLR = pWellObj->m_fMarginTB = 0.0;
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->SetId(nWellId);
|
|
|
|
|
|
pWellObj->CalculateSize(pWellObj->GetPos().TopLeft());
|
|
|
|
|
|
|
|
|
|
|
|
//Ӧ<>þ<EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
|
|
|
|
|
|
|
TRACKLIST::iterator it;
|
|
|
|
|
|
pWellObj->GetTemplateList().assign(tracklist.begin(), tracklist.end());
|
|
|
|
|
|
//<2F>ྮ<EFBFBD><E0BEAE><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
|
tracklist.clear();
|
|
|
|
|
|
pWellObj->GetAllTrack(&tracklist);
|
|
|
|
|
|
POSITION posBend = pSection->m_BendList.GetTailPosition();
|
|
|
|
|
|
while(posBend != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CBendObj* pBend = (CBendObj*)pSection->m_BendList.GetPrev(posBend);
|
|
|
|
|
|
if (pBend->m_pWellLeft == pWellObj || pBend->m_pWellRight == pWellObj)
|
|
|
|
|
|
{
|
|
|
|
|
|
BOOL bExist = FALSE;
|
|
|
|
|
|
it = tracklist.begin();
|
|
|
|
|
|
for(; it!= tracklist.end(); it++)
|
|
|
|
|
|
{
|
|
|
|
|
|
CTrackObj *pTrack = *it;
|
|
|
|
|
|
if (((CTrackObj*)pBend->m_pLayerLeft->GetParent())->GetTrackType() == pTrack->GetTrackType())
|
|
|
|
|
|
{
|
|
|
|
|
|
bExist = TRUE;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (pBend->m_pLayerRight != NULL &&
|
|
|
|
|
|
((CTrackObj*)pBend->m_pLayerRight->GetParent())->GetTrackType() == pTrack->GetTrackType())
|
|
|
|
|
|
{
|
|
|
|
|
|
bExist = TRUE;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (pBend->m_pLayerRight == NULL && pBend->m_pWellRight == pWellObj)
|
|
|
|
|
|
{
|
|
|
|
|
|
bExist = TRUE;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!bExist)
|
|
|
|
|
|
{
|
|
|
|
|
|
pSection->DeleteBend(pBend);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
tracklist.clear();
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->ApplingTemplate(TRUE,pWellObj->m_dHeightTrackHead,pWellObj->m_dHeightWellHead);
|
|
|
|
|
|
CItemWcsSingleWell itemwell(GetDoc());
|
|
|
|
|
|
itemwell.ImportDataAll(pWellObj, FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
//AfxGetPublicFunction()->SetCodeType((DWORD)::GetPreferences().WorkaroundSave.m_nCodeMode);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
fr.Close();
|
|
|
|
|
|
//<2F><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
CRect8 oldrect = pSection->GetRect();
|
|
|
|
|
|
|
|
|
|
|
|
if (fDistance.GetCount()>0)
|
|
|
|
|
|
{
|
|
|
|
|
|
int nWell = 0;
|
|
|
|
|
|
double dWellRight = 0;
|
|
|
|
|
|
POSITION pos = pSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
while (pos != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole* pWellObj = (CWellPole*)pSection->m_WellList.GetNext(pos);
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>¼<EFBFBD><C2BC>㾮λ<E3BEAE><CEBB>
|
|
|
|
|
|
if(nWell > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
pWellObj->GetPos().left = fDistance.GetAt(nWell-1).x0 + dWellRight;
|
|
|
|
|
|
pWellObj->CalculateSize(pWellObj->GetPos().TopLeft());
|
|
|
|
|
|
}
|
|
|
|
|
|
nWell ++;
|
|
|
|
|
|
dWellRight = pWellObj->GetPos().right;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
posWell = pSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
while(posWell!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole *pWellObj = (CWellPole *)pSection->m_WellList.GetNext(posWell);
|
|
|
|
|
|
pSection->ReComputeBends(pWellObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////<2F><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
|
posBend = pSection->m_BendList.GetHeadPosition();
|
|
|
|
|
|
while(NULL != posBend)
|
|
|
|
|
|
{
|
|
|
|
|
|
double XLeft = 0.0;
|
|
|
|
|
|
double XRight = 0.0;
|
|
|
|
|
|
CBendObj* pBend = (CBendObj*)pSection->m_BendList.GetNext(posBend);
|
|
|
|
|
|
pBend->GetBendXValue(XLeft,XRight);
|
|
|
|
|
|
for (int i = 0; i<pBend->m_faultArr.GetCount(); i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
CFaultObj* pFault = (CFaultObj*)pBend->m_faultArr.GetAt(i).pFault;
|
|
|
|
|
|
for (int j = 0;j<pFault->m_ptArr.GetCount(); j++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pFault->m_ptArr.GetAt(j).x0 = XLeft + pFault->m_ptArr.GetAt(j).z0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
POSITION posFault = pSection->m_FaultList.GetHeadPosition();
|
|
|
|
|
|
while(posFault != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CFaultObj* pFault = (CFaultObj*)pSection->m_FaultList.GetNext(posFault);
|
|
|
|
|
|
|
|
|
|
|
|
pFault->FaultReCut();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>淶Χ
|
|
|
|
|
|
pSection->ReSetPosition();
|
|
|
|
|
|
|
|
|
|
|
|
//ˢ<><CBA2>
|
|
|
|
|
|
CRect8 rect = pSection->GetRect();
|
|
|
|
|
|
rect.CombinRect(oldrect);
|
|
|
|
|
|
CRect rt = GetDC()->GetScreen(rect);
|
|
|
|
|
|
rt.InflateRect(10,10);
|
|
|
|
|
|
GetDoc()->Invalidate();
|
|
|
|
|
|
|
|
|
|
|
|
WellList.RemoveAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
void CItemWellSection::ApplingWellDbTemplate(BOOL bAll)
|
|
|
|
|
|
{
|
|
|
|
|
|
//CDlgApplyTemplate dlg("Section");
|
|
|
|
|
|
//if(dlg.DoModal() == IDCANCEL)
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
|
|
|
|
//if(dlg.m_pMemFile)
|
|
|
|
|
|
// ApplingTemplateFile(*dlg.m_pMemFile,bAll);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::ApplingWellTemplate(BOOL bAll)
|
|
|
|
|
|
{
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
//SetReUnDoAction(FALSE);
|
|
|
|
|
|
|
|
|
|
|
|
//CFileDialog dlg(TRUE,NULL,"", OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_ALLOWMULTISELECT,
|
|
|
|
|
|
// "Well Template (*.dml)|*.dml|",NULL,0);
|
|
|
|
|
|
|
|
|
|
|
|
//CString filepathstr;
|
|
|
|
|
|
|
|
|
|
|
|
//if (dlg.DoModal()!=IDOK)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return;
|
|
|
|
|
|
//}
|
|
|
|
|
|
////<2F><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
|
|
|
|
|
//filepathstr=dlg.GetPathName();
|
|
|
|
|
|
|
|
|
|
|
|
//CString ext = dlg.GetFileExt();
|
|
|
|
|
|
//if(ext == "dml") //dml<6D><6C>ʽ
|
|
|
|
|
|
//{
|
|
|
|
|
|
// SetReUnDoAction(FALSE);
|
|
|
|
|
|
|
|
|
|
|
|
// CStdioFile fr;
|
|
|
|
|
|
// if(!fr.Open(filepathstr,CFile::modeRead))
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
|
|
|
|
// ApplingTemplateFile(fr,bAll);
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::GetLegendObject(const CStringArray &StyleList,CRect8 rt)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NULL == m_pWellSection || StyleList.GetCount() == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
CXy* pXy = (CXy*)m_pWellSection->GetParentXY();
|
|
|
|
|
|
if (NULL == pXy)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
WELLOBJLIST Objectlist;
|
|
|
|
|
|
CStringArray StrArr;
|
|
|
|
|
|
POSITION pos = m_pWellSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
//while(pos)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// CWellBaseObj* pObj = (CWellBaseObj*)m_pWellSection->m_WellList.GetNext(pos);
|
|
|
|
|
|
// if (pObj->GetType() == KEP_WELL)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// CWellPole* pWell = (CWellPole*)pObj;
|
|
|
|
|
|
// GetSymbolObj(Objectlist,StyleList,pWell);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
//CreatLegendObject(Objectlist,rt,pXy);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::ConnectLayer(CSectionWellObj* pWell, int TrackType, int layerType)
|
|
|
|
|
|
{
|
|
|
|
|
|
CTrackObj* pTrack = NULL;
|
|
|
|
|
|
//////<2F>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
pTrack = pWell->FindTrack(ETrackType(TrackType));
|
|
|
|
|
|
std::vector<CWellBaseObj*> linkBends;
|
|
|
|
|
|
if (NULL != pTrack)
|
|
|
|
|
|
{
|
|
|
|
|
|
//POSITION pos1 = pTrack->GetChildObjList().GetHeadPosition();
|
|
|
|
|
|
WELLOBJLIST::iterator pos1 = pTrack->GetChildren().begin();
|
|
|
|
|
|
for (; pos1 != pTrack->GetChildren().end(); pos1++)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellBaseObj* pObj1 = *pos1;
|
|
|
|
|
|
if (pObj1->GetType() == layerType)
|
|
|
|
|
|
{
|
|
|
|
|
|
CInTrackDepthSegment* pTopEnd = (CInTrackDepthSegment*)pObj1;
|
|
|
|
|
|
if (pTopEnd->m_fSdep >= pWell->m_dSdep && pTopEnd->m_fEdep <= pWell->m_dEdep)
|
|
|
|
|
|
{
|
|
|
|
|
|
ConnectOnName(pTopEnd, 2,linkBends);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::CreateLayers()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NULL == m_pWellSection)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
POSITION pos = m_pWellSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
while(pos != m_pWellSection->m_WellList.GetTailPosition())
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellBaseObj* pObj = m_pWellSection->m_WellList.GetNext(pos);
|
|
|
|
|
|
if (pObj->GetType() == KEP_WELL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CSectionWellObj* pWell = (CSectionWellObj*)pObj;
|
|
|
|
|
|
|
|
|
|
|
|
ConnectLayer(pWell, Track_Stratum, KEP_LAYERGROUP); //<2F>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
ConnectLayer(pWell, Track_StandardLayer, KEP_STANDARD); //<2F><><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
ConnectLayer(pWell, Track_OilLayerGroup, KEP_LAYERGROUP); //<2F>Ͳ<EFBFBD><CDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
ConnectLayer(pWell, Track_SandLayer, KEP_LAYERGROUP); //ɰ<><C9B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
ConnectLayer(pWell, Track_Result, KEP_RESULT);///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (m_pWellSection->m_bResForm)
|
|
|
|
|
|
{//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><C2A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bend<6E><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ben<65>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD>
|
|
|
|
|
|
m_pWellSection->ComputeAllBendsTopBottomForResForm();
|
|
|
|
|
|
m_pWellSection->ComputeAllBendsByThreads();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::CreateLayers(std::vector<int>layersTrackType)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NULL == m_pWellSection)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
POSITION pos = m_pWellSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
while (pos != m_pWellSection->m_WellList.GetTailPosition())
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellBaseObj* pObj = m_pWellSection->m_WellList.GetNext(pos);
|
|
|
|
|
|
if (pObj->GetType() == KEP_WELL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CSectionWellObj* pWell = (CSectionWellObj*)pObj;
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < layersTrackType.size(); i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(layersTrackType[i] == Track_Stratum)
|
|
|
|
|
|
ConnectLayer(pWell, Track_Stratum, KEP_LAYERGROUP);
|
|
|
|
|
|
if (layersTrackType[i] == Track_StandardLayer)
|
|
|
|
|
|
ConnectLayer(pWell, Track_StandardLayer, KEP_STANDARD);
|
|
|
|
|
|
if (layersTrackType[i] == Track_OilLayerGroup)
|
|
|
|
|
|
ConnectLayer(pWell, Track_OilLayerGroup, KEP_LAYERGROUP);
|
|
|
|
|
|
if (layersTrackType[i] == Track_SandLayer)
|
|
|
|
|
|
ConnectLayer(pWell, Track_SandLayer, KEP_LAYERGROUP);
|
|
|
|
|
|
if (layersTrackType[i] == Track_Result)
|
|
|
|
|
|
ConnectLayer(pWell, Track_Result, KEP_RESULT);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//ConnectLayer(pWell, Track_Stratum, KEP_LAYERGROUP); //<2F>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//ConnectLayer(pWell, Track_StandardLayer, KEP_STANDARD); //<2F><><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//ConnectLayer(pWell, Track_OilLayerGroup, KEP_LAYERGROUP); //<2F>Ͳ<EFBFBD><CDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//ConnectLayer(pWell, Track_SandLayer, KEP_LAYERGROUP); //ɰ<><C9B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//ConnectLayer(pWell, Track_Result, KEP_RESULT);///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (m_pWellSection->m_bResForm)
|
|
|
|
|
|
{//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><C2A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bend<6E><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ben<65>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD>
|
|
|
|
|
|
m_pWellSection->ComputeAllBendsTopBottomForResForm();
|
|
|
|
|
|
m_pWellSection->ComputeAllBendsByThreads();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::BreakLayers()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NULL == m_pWellSection)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
POSITION pos = m_pWellSection->m_BendList.GetTailPosition();
|
|
|
|
|
|
while(pos != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellBaseObj* pObj = m_pWellSection->m_BendList.GetPrev(pos);
|
|
|
|
|
|
m_pWellSection->DeleteBend((CBendObj*)pObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
m_pWellSection->m_BendList.RemoveAll();
|
|
|
|
|
|
if (this->m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this->m_pItemSelected->GetType() == ITEM_BEND)
|
|
|
|
|
|
{
|
|
|
|
|
|
delete m_pItemSelected;
|
|
|
|
|
|
m_pItemSelected = NULL;
|
|
|
|
|
|
m_WellObjSelectlist.RemoveAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GetDoc()->Invalidate();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CItem* CItemWellSection::GetItem()
|
|
|
|
|
|
{ //ggff 20160526
|
|
|
|
|
|
if(m_pItemSelected)
|
|
|
|
|
|
return m_pItemSelected;
|
|
|
|
|
|
else
|
|
|
|
|
|
return CItemWcsSingleWell::GetItem();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::MakeFaultFromFaultPoint()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NULL == m_pWellSection)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
m_pWellSection->MakeFaultFromFaultPoint();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::SetAllWellColumnLineShape()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NULL == m_pWellSection)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
CSize8 size = GetDC()->GetRealSize(CSize(2,0));
|
|
|
|
|
|
m_pWellSection->SetAllWellColumnLineShape(size.cx);
|
|
|
|
|
|
}
|
|
|
|
|
|
void CItemWellSection::DeleteAllFaults()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NULL == m_pWellSection)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
SetItem(NULL);
|
|
|
|
|
|
m_WellObjSelectlist.RemoveAll();
|
|
|
|
|
|
m_pWellSection->DeleteAllFaults();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL GetFaultsIntersect(CFaultObj* pFault1,CFaultObj*pFault2,dfPoint &retPt,int& f1Id,int& f2Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
BOOL b= FALSE;
|
|
|
|
|
|
PointF tp,f1pt1,f1Pt2,f2pt1,f2pt2;
|
|
|
|
|
|
|
|
|
|
|
|
for(int ii = 0; ii<pFault1->m_ptArr.GetSize() -1; ii++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(b)
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
f1pt1.X = pFault1->m_ptArr[ii].x0; f1pt1.Y = pFault1->m_ptArr[ii].y0;
|
|
|
|
|
|
f1Pt2.X = pFault1->m_ptArr[ii+1].x0; f1Pt2.Y = pFault1->m_ptArr[ii+1].y0;
|
|
|
|
|
|
for(int jj = 0; jj<pFault2->m_ptArr.GetSize()-1; jj++)
|
|
|
|
|
|
{
|
|
|
|
|
|
f2pt1.X = pFault2->m_ptArr[jj].x0; f2pt1.Y = pFault2->m_ptArr[jj].y0;
|
|
|
|
|
|
f2pt2.X = pFault2->m_ptArr[jj+1].x0; f2pt2.Y = pFault2->m_ptArr[jj+1].y0;
|
|
|
|
|
|
|
|
|
|
|
|
if(GetLinesWithSegmentPt1(tp,f1pt1,f1Pt2,f2pt1,f2pt2))
|
|
|
|
|
|
{
|
|
|
|
|
|
if(IsValidIntersect(tp,pFault1->m_ptArr.GetSize(),ii,f1pt1,ii+1,f1Pt2,pFault2->m_ptArr.GetSize(),jj,f2pt1,jj+1,f2pt2))//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD>ϵ㣬<CFB5><E3A3AC>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ϲ<EFBFBD><CFB2>ߵ<EFBFBD><DFB5><EFBFBD>ͷ<EFBFBD>˵<EFBFBD>ֻ<EFBFBD>ǼӴ<F2B5A5BD><D3B4><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
{
|
|
|
|
|
|
f1Id = ii;
|
|
|
|
|
|
f2Id =jj;
|
|
|
|
|
|
retPt.x0 = tp.X; retPt.y0 = tp.Y;
|
|
|
|
|
|
b = TRUE;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
void CItemWellSection::GetIntersectFaults(FAULTVECTOR &faultVec1,FAULTVECTOR &faultVec2,CPointArr &retPtArr,CUIntArray &f1idArr,CUIntArray &f2idArr)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NULL == m_pWellSection)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_pWellSection->m_FaultList.GetSize() == 0)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
CFaultObj *pFaultObj1,*pFaultObj2;
|
|
|
|
|
|
|
|
|
|
|
|
FAULTVECTOR allFaultVec;
|
|
|
|
|
|
POSITION pos = m_pWellSection->m_FaultList.GetHeadPosition();
|
|
|
|
|
|
while(pos)
|
|
|
|
|
|
{
|
|
|
|
|
|
pFaultObj1 = (CFaultObj *)m_pWellSection->m_FaultList.GetNext(pos);
|
|
|
|
|
|
|
|
|
|
|
|
if(pFaultObj1->m_strName.IsEmpty())
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
allFaultVec.push_back(pFaultObj1);
|
|
|
|
|
|
}
|
|
|
|
|
|
if(allFaultVec.size()<1)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
dfPoint retPt;
|
|
|
|
|
|
int f1Id,f2Id;
|
|
|
|
|
|
for(int ii = 0; ii< allFaultVec.size()-1; ii++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pFaultObj1 = allFaultVec[ii];
|
|
|
|
|
|
if(pFaultObj1->m_strName.IsEmpty())
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
for(int jj = ii+1; jj<allFaultVec.size(); jj++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pFaultObj2 = allFaultVec[jj];
|
|
|
|
|
|
if(pFaultObj2->m_strName.IsEmpty())
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
if(GetFaultsIntersect(pFaultObj1,pFaultObj2,retPt,f1Id,f2Id))
|
|
|
|
|
|
{
|
|
|
|
|
|
faultVec1.push_back(pFaultObj1);
|
|
|
|
|
|
faultVec2.push_back(pFaultObj2);
|
|
|
|
|
|
retPtArr.Add(retPt);
|
|
|
|
|
|
f1idArr.Add(f1Id);
|
|
|
|
|
|
f2idArr.Add(f2Id);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD>Ŷϲ<C5B6><CFB2><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6>ƶ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>
|
|
|
|
|
|
dfPoint MovePtalongFault(dfPoint fpt,double offv,CFaultObj *pCutFault,int cutId)
|
|
|
|
|
|
{
|
|
|
|
|
|
dfPoint retPt = fpt;
|
|
|
|
|
|
double miny,maxy;
|
|
|
|
|
|
dfPoint pt1,pt2;
|
|
|
|
|
|
for(int ii =0; ii< pCutFault->m_ptArr.GetSize()-1; ii++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pt1 = pCutFault->m_ptArr[ii] ; pt2 = pCutFault->m_ptArr[ii+1];
|
|
|
|
|
|
maxy = pt1.y0 > pt2.y0 ? pt1.y0 : pt2.y0;
|
|
|
|
|
|
miny = pt1.y0 < pt2.y0 ? pt1.y0 : pt2.y0;
|
|
|
|
|
|
if(((miny-0.000001)< (fpt.y0+offv)) && ((fpt.y0+offv)<(maxy+0.000001)))
|
|
|
|
|
|
{
|
|
|
|
|
|
retPt.y0 = fpt.y0+offv;
|
|
|
|
|
|
if(abs(pt1.x0-pt2.x0)<0.000001)
|
|
|
|
|
|
{
|
|
|
|
|
|
retPt.x0 = pt1.x0;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if(abs(pt1.y0 - pt2.y0)< 0.000001)
|
|
|
|
|
|
retPt.x0 = pt2.x0;
|
|
|
|
|
|
else
|
|
|
|
|
|
retPt.x0 = pt1.x0 + (pt2.x0 - pt1.x0)*(retPt.y0 - pt1.y0)/(pt2.y0 - pt1.y0);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return retPt;
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F>Ա<EFBFBD><D4B1>и<EFBFBD><D0B8>Ķϲ<C4B6><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һЩ<D2BB><D0A9><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD><D0B8><EFBFBD><EFBFBD>Ķϲ<C4B6><CFB2>Ͼ<EFBFBD>,pHCutFault<6C><74>ָ<EFBFBD>жϱ<D0B6><CFB1>в<EFBFBD><D0B2><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>Ķϲ<C4B6>,pTCutFault<6C><74>ָβ<D6B8><CEB2>
|
|
|
|
|
|
void MoveBeCutFault(CWellSection *pSection,CFaultObj *pBeCutFault,CFaultObj *pHCutFault,int hCutId,CFaultObj *pTCutFault,int tCutId)
|
|
|
|
|
|
{
|
|
|
|
|
|
CSectionWellObj *pWell =(CSectionWellObj *) pSection->m_WellList.GetHead();
|
|
|
|
|
|
double v;
|
|
|
|
|
|
if(pHCutFault)
|
|
|
|
|
|
{
|
|
|
|
|
|
dfPoint retPt;
|
|
|
|
|
|
if(pBeCutFault->m_ptArr[0].x0 > pBeCutFault->m_ptArr[pBeCutFault->m_ptArr.GetSize()-1].x0)
|
|
|
|
|
|
v = pWell->HeightToScreenCY(pHCutFault->m_fLeftThrow);
|
|
|
|
|
|
else
|
|
|
|
|
|
v = pWell->HeightToScreenCY(-pHCutFault->m_fRightThrow);
|
|
|
|
|
|
|
|
|
|
|
|
retPt = MovePtalongFault(pBeCutFault->m_ptArr[0],v,pHCutFault,hCutId);
|
|
|
|
|
|
pBeCutFault->m_ptArr[0] = retPt;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(pTCutFault)
|
|
|
|
|
|
{
|
|
|
|
|
|
dfPoint retPt;
|
|
|
|
|
|
if(pBeCutFault->m_ptArr[0].x0 > pBeCutFault->m_ptArr[pBeCutFault->m_ptArr.GetSize()-1].x0)
|
|
|
|
|
|
v = pWell->HeightToScreenCY(-pTCutFault->m_fRightThrow);
|
|
|
|
|
|
else
|
|
|
|
|
|
v = pWell->HeightToScreenCY(pTCutFault->m_fLeftThrow);
|
|
|
|
|
|
|
|
|
|
|
|
retPt = MovePtalongFault(pBeCutFault->m_ptArr[pBeCutFault->m_ptArr.GetSize()-1],v,pTCutFault,tCutId);
|
|
|
|
|
|
pBeCutFault->m_ptArr[pBeCutFault->m_ptArr.GetSize()-1] = retPt;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AddFaultPoint(CFaultObj *pNewFault,dfPoint newPt)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(pNewFault->m_ptArr.GetSize()>0)
|
|
|
|
|
|
{
|
|
|
|
|
|
dfPoint tpoint = pNewFault->m_ptArr[pNewFault->m_ptArr.GetSize()-1];
|
|
|
|
|
|
if(!(abs(tpoint.x0 - newPt.x0)<0.01 && abs(tpoint.y0 - newPt.y0)<0.01)) //<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>ĵ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ظ<EFBFBD>,<2C>Ͳ<EFBFBD><CDB2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
pNewFault->m_ptArr.Add(newPt);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
pNewFault->m_ptArr.Add(newPt);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::DoFaultsIntersect(CFaultObj *pBeCutFault,CUIntArray &PtIdArr,CPointArr &SectPointArr,FAULTVECTOR &CutFaultVec,CUIntArray &CutPtIdArr,FAULTVECTOR &newFaultVec)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (NULL == m_pWellSection)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(m_pWellSection->m_FaultList.GetSize() == 0 || PtIdArr.GetSize()==0)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
CFaultObj *pNewFault;
|
|
|
|
|
|
pNewFault = new CFaultObj;
|
|
|
|
|
|
pNewFault->m_strName = pBeCutFault->m_strName;
|
|
|
|
|
|
pNewFault->m_fLeftThrow = pBeCutFault->m_fLeftThrow; pNewFault->m_fRightThrow = pBeCutFault->m_fRightThrow;
|
|
|
|
|
|
pNewFault->SetParent(m_pWellSection);
|
|
|
|
|
|
for(int ii = 0; ii<=PtIdArr[0]; ii++)
|
|
|
|
|
|
{
|
|
|
|
|
|
AddFaultPoint(pNewFault,pBeCutFault->m_ptArr[ii]);//pNewFault->m_ptArr.Add(pBeCutFault->m_ptArr[ii]);
|
|
|
|
|
|
}
|
|
|
|
|
|
AddFaultPoint(pNewFault,SectPointArr[0]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
newFaultVec.push_back(pNewFault);
|
|
|
|
|
|
MoveBeCutFault(m_pWellSection,pNewFault,NULL,0,CutFaultVec[0],CutPtIdArr[0]);
|
|
|
|
|
|
|
|
|
|
|
|
for(int ii = 0; ii<PtIdArr.GetSize()-1; ii++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pNewFault = new CFaultObj;
|
|
|
|
|
|
pNewFault->m_strName = pBeCutFault->m_strName;
|
|
|
|
|
|
pNewFault->m_fLeftThrow = pBeCutFault->m_fLeftThrow; pNewFault->m_fRightThrow = pBeCutFault->m_fRightThrow;
|
|
|
|
|
|
|
|
|
|
|
|
AddFaultPoint(pNewFault,SectPointArr[ii]);
|
|
|
|
|
|
|
|
|
|
|
|
pNewFault->SetParent(m_pWellSection);
|
|
|
|
|
|
for(int jj = PtIdArr[ii]+1; jj<=PtIdArr[ii+1]; jj++)
|
|
|
|
|
|
{
|
|
|
|
|
|
AddFaultPoint(pNewFault,pBeCutFault->m_ptArr[jj]);//pNewFault->m_ptArr.Add(pBeCutFault->m_ptArr[jj]);
|
|
|
|
|
|
}
|
|
|
|
|
|
AddFaultPoint(pNewFault,SectPointArr[ii+1]);
|
|
|
|
|
|
|
|
|
|
|
|
newFaultVec.push_back(pNewFault);
|
|
|
|
|
|
MoveBeCutFault(m_pWellSection,pNewFault,CutFaultVec[ii],CutPtIdArr[ii],CutFaultVec[ii+1],CutPtIdArr[ii+1]);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pNewFault = new CFaultObj;
|
|
|
|
|
|
pNewFault->m_strName = pBeCutFault->m_strName;
|
|
|
|
|
|
pNewFault->m_fLeftThrow = pBeCutFault->m_fLeftThrow; pNewFault->m_fRightThrow = pBeCutFault->m_fRightThrow;
|
|
|
|
|
|
AddFaultPoint(pNewFault,SectPointArr[SectPointArr.GetSize()-1]);
|
|
|
|
|
|
|
|
|
|
|
|
pNewFault->SetParent(m_pWellSection);
|
|
|
|
|
|
for(int ii = PtIdArr[PtIdArr.GetSize()-1]+1; ii< pBeCutFault->m_ptArr.GetSize(); ii++)
|
|
|
|
|
|
{
|
|
|
|
|
|
AddFaultPoint(pNewFault,pBeCutFault->m_ptArr[ii]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
newFaultVec.push_back(pNewFault);
|
|
|
|
|
|
MoveBeCutFault(m_pWellSection,pNewFault,CutFaultVec[CutFaultVec.size()-1],CutPtIdArr[CutPtIdArr.GetSize()-1],NULL,0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CItemWellSection::IsAddBendLayerPoint()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_pItemSelected == NULL)
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
BOOL b = FALSE;
|
|
|
|
|
|
if (m_pItemSelected->GetType() == ITEM_BEND)
|
|
|
|
|
|
{
|
|
|
|
|
|
b = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
BOOL CItemWellSection::IsAddFaultPoint()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_pItemSelected == NULL)
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
BOOL b = FALSE;
|
|
|
|
|
|
if (m_pItemSelected->GetType() == ITEM_FAULT)
|
|
|
|
|
|
{
|
|
|
|
|
|
b = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::AddBendLayerPoint()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_pItemSelected->GetType() == ITEM_BEND)
|
|
|
|
|
|
{
|
|
|
|
|
|
CItemBend *pItemBend = (CItemBend *)m_pItemSelected;
|
|
|
|
|
|
pItemBend->AddBendLayerPoint();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
void CItemWellSection::DeleteBendLayerPoint()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_pItemSelected->GetType() == ITEM_BEND)
|
|
|
|
|
|
{
|
|
|
|
|
|
CItemBend *pItemBend = (CItemBend *)m_pItemSelected;
|
|
|
|
|
|
pItemBend->DeleteBendLayerPoint();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWellSection::SetPos(POSITION pos)
|
|
|
|
|
|
{
|
|
|
|
|
|
CItem::SetPos(pos);
|
|
|
|
|
|
COne* pOne = GetDoc()->GetDraw()->GetAt(pos);
|
|
|
|
|
|
if (pOne->GetType() == KEP_WELLSECTION)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetDrawObj((CWellBaseObj*)pOne->GetValue());
|
|
|
|
|
|
if (m_pItemSelected != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
delete m_pItemSelected;
|
|
|
|
|
|
m_pItemSelected = NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
m_WellObjSelectlist.RemoveAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//this->m_pWellSection
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CWellBaseObj* CItemWellSection::GetDrawObj()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_pWellSection;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CItemWellSection::ApplingTemplate(CKXmlParse& xp, CSectionWellObj* pSelectWellObj)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellBaseObjList WellList;
|
|
|
|
|
|
CWellSection* pSection = (CWellSection*)GetWellSection();
|
|
|
|
|
|
if (pSelectWellObj == NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
POSITION posWell = pSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
while (posWell != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole* pWellObj = (CWellPole*)pSection->m_WellList.GetNext(posWell);
|
|
|
|
|
|
WellList.AddTail(pWellObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
WellList.AddTail(pSelectWellObj);
|
|
|
|
|
|
//if (m_WellObjSelectlist.GetCount() == 1)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// CWellBaseObj* pDrawObj = (CWellBaseObj*)m_WellObjSelectlist.GetHead();
|
|
|
|
|
|
// if (pDrawObj->GetType() == KEP_WELL)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// CWellPole* pWellObj = (CWellPole*)pDrawObj;
|
|
|
|
|
|
// WellList.AddTail(pWellObj);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL bDelete = FALSE;
|
|
|
|
|
|
CPointArr fDistance;
|
|
|
|
|
|
|
|
|
|
|
|
//////<2F><><EFBFBD>澮֮<E6BEAE><D6AE><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|
|
|
|
|
POSITION posSectionWell = pSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
CWellPole* pWellNext = NULL;
|
|
|
|
|
|
while (posSectionWell != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole* pWellObj = (CWellPole*)pSection->m_WellList.GetNext(posSectionWell);
|
|
|
|
|
|
POSITION posFind = pSection->m_WellList.Find(pWellObj);
|
|
|
|
|
|
pSection->m_WellList.GetNext(posFind);
|
|
|
|
|
|
if (posFind != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
pWellNext = (CWellPole*)pSection->m_WellList.GetNext(posFind);
|
|
|
|
|
|
dfPoint temppoint;
|
|
|
|
|
|
temppoint.x0 = pWellNext->GetPos().left - pWellObj->GetPos().right;
|
|
|
|
|
|
fDistance.Add(temppoint);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////<2F><><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD>֮<EFBFBD><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
|
POSITION posBend = pSection->m_BendList.GetHeadPosition();
|
|
|
|
|
|
//while(NULL != posBend)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// double XLeft = 0.0;
|
|
|
|
|
|
// double XRight = 0.0;
|
|
|
|
|
|
// CBendObj* pBend = (CBendObj*)pSection->m_BendList.GetNext(posBend);
|
|
|
|
|
|
// pBend->GetBendXValue(XLeft,XRight);
|
|
|
|
|
|
// for (int i = 0; i<pBend->m_faultArr.GetCount(); i++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// CFaultObj* pFault = (CFaultObj*)pBend->m_faultArr.GetAt(i).pFault;
|
|
|
|
|
|
// for (int j = 0;j<pFault->m_ptArr.GetCount(); j++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// pFault->m_ptArr[j].z0 = pFault->m_ptArr[j].x0-XLeft;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
POSITION posWell = WellList.GetHeadPosition();
|
|
|
|
|
|
while (posWell != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole* pWellObj = (CWellPole*)WellList.GetNext(posWell);
|
|
|
|
|
|
|
|
|
|
|
|
//fr.SeekToBegin();
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>ݾ<EFBFBD><DDBE>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
TRACKLIST tracklist;
|
|
|
|
|
|
|
|
|
|
|
|
//TRACKLIST::reverse_iterator rit = pWellObj->GetTrackList().rbegin();
|
|
|
|
|
|
//for(; rit != pWellObj->GetTrackList().rend(); rit++)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// tracklist.push_front(*rit);
|
|
|
|
|
|
//}
|
|
|
|
|
|
tracklist.assign(pWellObj->GetTrackList().rbegin(), pWellObj->GetTrackList().rend()); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//pWellObj->GetAllTrack(&tracklist);
|
|
|
|
|
|
pWellObj->GetTrackList().clear(); // ->RemoveAll();
|
|
|
|
|
|
|
|
|
|
|
|
CString strWellTitle = pWellObj->m_strTitle;
|
|
|
|
|
|
CString strWellName = pWellObj->GetWellName();
|
|
|
|
|
|
double fx = 0.0;
|
|
|
|
|
|
double fy = 0.0;
|
|
|
|
|
|
fx = ((CSectionWellObj*)pWellObj)->m_fX;
|
|
|
|
|
|
fy = ((CSectionWellObj*)pWellObj)->m_fY;
|
|
|
|
|
|
double fLevel = pWellObj->m_fLevel;
|
|
|
|
|
|
double topDepth = pWellObj->m_dSdep;
|
|
|
|
|
|
double endDepth = pWellObj->m_dEdep;
|
|
|
|
|
|
double left = pWellObj->GetPos().left;
|
|
|
|
|
|
double proportion = pWellObj->m_fProportion;
|
|
|
|
|
|
double dOldTrackHead = pWellObj->m_dHeightTrackHead;
|
|
|
|
|
|
double dOldWellHead = pWellObj->m_dHeightWellHead;
|
|
|
|
|
|
double tracktop = pWellObj->GetPos().top - dOldWellHead - dOldTrackHead;
|
|
|
|
|
|
double nWellId = pWellObj->GetId();
|
|
|
|
|
|
std::vector<CWellPole::well_interval > oldWellIntervalVec;
|
|
|
|
|
|
oldWellIntervalVec.insert(oldWellIntervalVec.begin(), pWellObj->GetIntervalVec()->begin(), pWellObj->GetIntervalVec()->end());
|
|
|
|
|
|
|
|
|
|
|
|
AfxGetPublicFunction()->SetCodeType(CODE_GB2321);
|
|
|
|
|
|
xp.InitRootNode(); //ÿ<><C3BF><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>¶<EFBFBD>ȡ<EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
|
if (pWellObj->ReadPCG(xp, -1) == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
//<2F>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
pWellObj->GetTrackList().assign(tracklist.begin(), tracklist.end());
|
|
|
|
|
|
//POSITION pos = tracklist.GetTailPosition();
|
|
|
|
|
|
//while (pos!=NULL)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// CTrackObj* pTrackObj = (CTrackObj*)tracklist.GetPrev(pos);
|
|
|
|
|
|
|
|
|
|
|
|
// pWellObj->GetTrackList()->AddHead(pTrackObj);
|
|
|
|
|
|
//}
|
|
|
|
|
|
tracklist.clear();
|
|
|
|
|
|
|
|
|
|
|
|
//<2F>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//pos = trackGroupList.GetHeadPosition();
|
|
|
|
|
|
//while (pos!=NULL)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// CTrackGroupObj* pTrackGroupObj = trackGroupList.GetNext(pos);
|
|
|
|
|
|
// pWellObj->GetTrackGroupList()->AddTail(pTrackGroupObj);
|
|
|
|
|
|
//}
|
|
|
|
|
|
//trackGroupList.RemoveAll();
|
|
|
|
|
|
|
|
|
|
|
|
//AfxGetPublicFunction()->SetCodeType((DWORD)::GetPreferences().WorkaroundSave.m_nCodeMode);
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
////<2F>ͷ<EFBFBD><CDB7><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//pos = trackGroupList.GetTailPosition();
|
|
|
|
|
|
//while(pos != NULL)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// delete trackGroupList.GetPrev(pos);
|
|
|
|
|
|
//}
|
|
|
|
|
|
//trackGroupList.RemoveAll();
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->m_strTitle = strWellTitle;
|
|
|
|
|
|
pWellObj->SetWellName(strWellName);
|
|
|
|
|
|
//pWellObj->ReSetWellHead();
|
|
|
|
|
|
pWellObj->m_fLevel = fLevel;
|
|
|
|
|
|
((CSectionWellObj*)pWellObj)->m_fX = fx;
|
|
|
|
|
|
((CSectionWellObj*)pWellObj)->m_fY = fy;
|
|
|
|
|
|
pWellObj->GetPos().left = left;
|
|
|
|
|
|
pWellObj->GetPos().top = tracktop + pWellObj->m_dHeightWellHead + pWellObj->m_dHeightTrackHead;
|
|
|
|
|
|
pWellObj->m_dSdep = topDepth;
|
|
|
|
|
|
pWellObj->m_dEdep = endDepth;
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->GetIntervalVec()->clear();
|
|
|
|
|
|
pWellObj->GetIntervalVec()->insert(pWellObj->GetIntervalVec()->begin(), oldWellIntervalVec.begin(), oldWellIntervalVec.end());
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->m_fProportion = proportion;
|
|
|
|
|
|
pWellObj->m_fMarginLR = pWellObj->m_fMarginTB = 0.0;
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->SetId(nWellId);
|
|
|
|
|
|
pWellObj->CalculateSize(pWellObj->GetPos().TopLeft());
|
|
|
|
|
|
|
|
|
|
|
|
//Ӧ<>þ<EFBFBD>ģ<EFBFBD><C4A3>
|
|
|
|
|
|
//pos = tracklist.GetHeadPosition();
|
|
|
|
|
|
//TRACKLIST::iterator it = tracklist.begin();
|
|
|
|
|
|
//for (; it != tracklist.end(); it++)
|
|
|
|
|
|
// pWellObj->GetTemplateList().push_front(*it);
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->GetTemplateList().assign(tracklist.begin(), tracklist.end());
|
|
|
|
|
|
//while(pos != NULL)
|
|
|
|
|
|
// pWellObj->GetTemplateList().AddHead(tracklist.GetNext(pos));
|
|
|
|
|
|
|
|
|
|
|
|
//<2F>ྮ<EFBFBD><E0BEAE><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
|
tracklist.clear();
|
|
|
|
|
|
pWellObj->GetAllTrack(&tracklist);
|
|
|
|
|
|
POSITION posBend = pSection->m_BendList.GetTailPosition();
|
|
|
|
|
|
TRACKLIST::iterator it;
|
|
|
|
|
|
while (posBend != NULL)
|
|
|
|
|
|
{//ʹ<><CAB9><EFBFBD>¾<EFBFBD>ģ<EFBFBD><C4A3>״̬<D7B4>£<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>bend<6E><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>bend
|
|
|
|
|
|
CBendObj* pBend = (CBendObj*)pSection->m_BendList.GetPrev(posBend);
|
|
|
|
|
|
if (pBend->m_pWellLeft == pWellObj || pBend->m_pWellRight == pWellObj)
|
|
|
|
|
|
{
|
|
|
|
|
|
BOOL bExist = FALSE;
|
|
|
|
|
|
it = tracklist.begin();
|
|
|
|
|
|
for (; it != tracklist.end(); it++)
|
|
|
|
|
|
{
|
|
|
|
|
|
CTrackObj* pTrack = *it;
|
|
|
|
|
|
if (((CTrackObj*)pBend->m_pLayerLeft->GetParent())->GetTrackType() == pTrack->GetTrackType())
|
|
|
|
|
|
{
|
|
|
|
|
|
bExist = TRUE;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (pBend->m_pLayerRight != NULL &&
|
|
|
|
|
|
((CTrackObj*)pBend->m_pLayerRight->GetParent())->GetTrackType() == pTrack->GetTrackType())
|
|
|
|
|
|
{
|
|
|
|
|
|
bExist = TRUE;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (pBend->m_pLayerRight == NULL && pBend->m_pWellRight == pWellObj)
|
|
|
|
|
|
{
|
|
|
|
|
|
bExist = TRUE;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!bExist)
|
|
|
|
|
|
{
|
|
|
|
|
|
pSection->DeleteBend(pBend);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
tracklist.clear();
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->ApplingTemplate(TRUE, pWellObj->m_dHeightTrackHead, pWellObj->m_dHeightWellHead);
|
|
|
|
|
|
//CItemWcsSingleWell itemwell(GetDoc());
|
|
|
|
|
|
//itemwell.ImportDataAll(pWellObj, FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
//AfxGetPublicFunction()->SetCodeType((DWORD)::GetPreferences().WorkaroundSave.m_nCodeMode);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
//fr.Close();
|
|
|
|
|
|
//<2F><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
CRect8 oldrect = pSection->GetRect();
|
|
|
|
|
|
|
|
|
|
|
|
if (fDistance.GetCount() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
int nWell = 0;
|
|
|
|
|
|
double dWellRight = 0;
|
|
|
|
|
|
POSITION pos = pSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
while (pos != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole* pWellObj = (CWellPole*)pSection->m_WellList.GetNext(pos);
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>¼<EFBFBD><C2BC>㾮λ<E3BEAE><CEBB>
|
|
|
|
|
|
if (nWell > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
pWellObj->GetPos().left = fDistance.GetAt(nWell - 1).x0 + dWellRight;
|
|
|
|
|
|
pWellObj->CalculateSize(pWellObj->GetPos().TopLeft());
|
|
|
|
|
|
}
|
|
|
|
|
|
nWell++;
|
|
|
|
|
|
dWellRight = pWellObj->GetPos().right;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
posWell = pSection->m_WellList.GetHeadPosition();
|
|
|
|
|
|
while (posWell != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole* pWellObj = (CWellPole*)pSection->m_WellList.GetNext(posWell);
|
|
|
|
|
|
pSection->ReComputeBends(pWellObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////<2F><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
|
posBend = pSection->m_BendList.GetHeadPosition();
|
|
|
|
|
|
while (NULL != posBend)
|
|
|
|
|
|
{
|
|
|
|
|
|
double XLeft = 0.0;
|
|
|
|
|
|
double XRight = 0.0;
|
|
|
|
|
|
CBendObj* pBend = (CBendObj*)pSection->m_BendList.GetNext(posBend);
|
|
|
|
|
|
pBend->GetBendXValue(XLeft, XRight);
|
|
|
|
|
|
for (int i = 0; i < pBend->m_faultArr.GetCount(); i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
CFaultObj* pFault = (CFaultObj*)pBend->m_faultArr.GetAt(i).pFault;
|
|
|
|
|
|
for (int j = 0; j < pFault->m_ptArr.GetCount(); j++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pFault->m_ptArr.GetAt(j).x0 = XLeft + pFault->m_ptArr.GetAt(j).z0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
POSITION posFault = pSection->m_FaultList.GetHeadPosition();
|
|
|
|
|
|
while (posFault != NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CFaultObj* pFault = (CFaultObj*)pSection->m_FaultList.GetNext(posFault);
|
|
|
|
|
|
|
|
|
|
|
|
pFault->FaultReCut();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>淶Χ
|
|
|
|
|
|
pSection->ReSetPosition();
|
|
|
|
|
|
|
|
|
|
|
|
//ˢ<><CBA2>
|
|
|
|
|
|
CRect8 rect = pSection->GetRect();
|
|
|
|
|
|
rect.CombinRect(oldrect);
|
|
|
|
|
|
CRect rt = GetDC()->GetScreen(rect);
|
|
|
|
|
|
rt.InflateRect(10, 10);
|
|
|
|
|
|
//GetDoc()->Invalidate(rt);
|
|
|
|
|
|
|
|
|
|
|
|
WellList.RemoveAll();
|
|
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CItemWellSection::ApplyingTemplateFileForWell(CString filePath, ULONGLONG wellHandle)
|
|
|
|
|
|
{
|
|
|
|
|
|
BOOL b = FALSE;
|
|
|
|
|
|
CString strExt = "";
|
|
|
|
|
|
if (filePath.GetLength() < 4)
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
strExt = filePath.Right(4);
|
|
|
|
|
|
strExt = strExt.MakeLower();
|
|
|
|
|
|
if (strExt == ".pcg")
|
|
|
|
|
|
{
|
|
|
|
|
|
CKXmlParse xp;
|
|
|
|
|
|
if (xp.ReadXmlFile(filePath.GetBuffer()))
|
|
|
|
|
|
{
|
|
|
|
|
|
SetReUnDoAction();
|
|
|
|
|
|
if (wellHandle != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
CSectionWellObj* pWell = (CSectionWellObj*)wellHandle;
|
|
|
|
|
|
b = ApplingTemplate(xp, pWell);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
b = ApplingTemplate(xp, NULL);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL CItemWellSection::ApplyingWellTemplateForSection(ULONGLONG wellHandle)
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellPole* pWellObj = (CWellPole*)(wellHandle);
|
|
|
|
|
|
|
|
|
|
|
|
SetReUnDoAction();
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->SetActionTemplate(TRUE);
|
|
|
|
|
|
pWellObj->SetNoSaveCallouts(TRUE);
|
|
|
|
|
|
CMemFile fw;
|
|
|
|
|
|
|
|
|
|
|
|
DWORD tcode = AfxGetPublicFunction()->GetCodeType();
|
|
|
|
|
|
|
|
|
|
|
|
AfxGetPublicFunction()->SetCodeType(CODE_GB2321);
|
|
|
|
|
|
//AfxGetPublicFunction()->WriteDML_Head_Version(fw);
|
|
|
|
|
|
//AfxGetPublicFunction()->WriteDML_Head_Xmlns(fw);
|
|
|
|
|
|
nsWellPoleFunc::WritePCG_Head_Version(fw);
|
|
|
|
|
|
pWellObj->WritePCG(fw, 2, 1);//pWellObj->WriteDML(fw, -1, 1);
|
|
|
|
|
|
nsWellPoleFunc::WritePCG_Tail(fw);
|
|
|
|
|
|
//AfxGetPublicFunction()->SetCodeType((DWORD)::GetPreferences().WorkaroundSave.m_nCodeMode);
|
|
|
|
|
|
|
|
|
|
|
|
AfxGetPublicFunction()->InitSaveCounter();
|
|
|
|
|
|
|
|
|
|
|
|
pWellObj->SetActionTemplate(FALSE);
|
|
|
|
|
|
pWellObj->SetNoSaveCallouts(FALSE);
|
|
|
|
|
|
AfxGetPublicFunction()->SetCodeType(tcode);
|
|
|
|
|
|
|
|
|
|
|
|
int fileLen = fw.GetLength();
|
|
|
|
|
|
//char* pBuf = new char[fileLen];
|
|
|
|
|
|
BYTE* pBuf = fw.Detach();
|
|
|
|
|
|
|
|
|
|
|
|
//fw.Read(pBuf,fileLen);
|
|
|
|
|
|
|
|
|
|
|
|
CKXmlParse xp;
|
|
|
|
|
|
if (xp.SetXmlFileBuffer((char*)pBuf, fileLen))
|
|
|
|
|
|
{
|
|
|
|
|
|
ApplingTemplate(xp, NULL);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|