|
|
|
|
|
|
|
|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "ItemText.h"
|
|
|
|
|
|
|
|
|
|
|
|
//#include "DlgTrackText.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "WellPoleLib/WellMarkNamesList.h"
|
|
|
|
|
|
#include "WellPoleLib/WellBaseObj.h"
|
|
|
|
|
|
#include "WellPoleLib/WellClassObjGroup.h"
|
|
|
|
|
|
#include "WellPoleLib/InTrackDepthSegment.h"
|
|
|
|
|
|
#include "WellPoleLib/InTrackTextBase.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "WellPoleLib\InTrackLith.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackTextRange.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackPicture.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackSymbol.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackResult.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackCoring.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackCoreWell.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackShot.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackSample.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackOilTest.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackLayerGroup.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackLayerGroup.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackTestExtraction.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackFaultPoint.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "WellPoleLib/TrackObj.h"
|
|
|
|
|
|
#include "WellPoleLib/InclinedTrack.h"
|
|
|
|
|
|
#include "WellPoleLib\TrackOilTest.h"
|
|
|
|
|
|
#include "WellPoleLib\TrackResult.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "WellPoleLib\TrackCoreWell.h"
|
|
|
|
|
|
#include "WellPoleLib\WellPole.h"
|
|
|
|
|
|
#include "MultiWellSectionLib/BendObj.h"
|
|
|
|
|
|
#include "MultiWellSectionLib/FaultObj.h"
|
|
|
|
|
|
#include "MultiWellSectionLib/WellSection.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "MultiWellSectionDoc.h"
|
|
|
|
|
|
#include "MultiWellSectionlView.h"
|
|
|
|
|
|
//#include "DataPropertyPage.h"
|
|
|
|
|
|
#include "ItemWcsTrackIn.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "CxImage\CxImage\ximagegeotiff.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TrackInOilTestMid 98304
|
|
|
|
|
|
namespace NItem
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
CItemWcsTrackIn::CItemWcsTrackIn(CSigmaDoc* pDoc)
|
|
|
|
|
|
: CItemWellBase(pDoc)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetType(ITEM_TRACKIN);
|
|
|
|
|
|
m_bChangeAllLayerSet = FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CItemWcsTrackIn::~CItemWcsTrackIn(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CImageInsert* CItemWcsTrackIn::ReadImage(LPCTSTR lpcsImageName)
|
|
|
|
|
|
{
|
|
|
|
|
|
int type = CImageBase::GetImageType(lpcsImageName);
|
|
|
|
|
|
|
|
|
|
|
|
if (type == CXIMAGE_FORMAT_TIF) //<2F><>ȡGeoTiff<66>ļ<EFBFBD>
|
|
|
|
|
|
{
|
|
|
|
|
|
FILE* hFile = fopen(lpcsImageName, "rb");
|
|
|
|
|
|
if (hFile == NULL) return FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
CImageBase *pi = new CImageBase;
|
|
|
|
|
|
CxImageGeoTIFF newima;
|
|
|
|
|
|
if (!newima.CxImageTIF::Decode(hFile))
|
|
|
|
|
|
{
|
|
|
|
|
|
fclose(hFile);
|
|
|
|
|
|
delete pi;
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CImageInsert* pImage = new CImageInsert();
|
|
|
|
|
|
pi->Transfer(newima);
|
|
|
|
|
|
pImage->m_pImage = pi;
|
|
|
|
|
|
pImage->SetName(lpcsImageName);
|
|
|
|
|
|
|
|
|
|
|
|
if (newima.m_bIsGeoTiff && fabs(newima.dx) > 1e-15 && fabs(newima.dy) > 1e-15)
|
|
|
|
|
|
{
|
|
|
|
|
|
pImage->x0 = newima.x0;
|
|
|
|
|
|
pImage->y0 = newima.y0;
|
|
|
|
|
|
pImage->m_size.cx = newima.dx*pImage->m_pImage->GetWidth();
|
|
|
|
|
|
pImage->m_size.cy = newima.dy*pImage->m_pImage->GetHeight();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
pImage->m_size.cx = pImage->GetImage()->GetWidth();
|
|
|
|
|
|
pImage->m_size.cy = pImage->GetImage()->GetHeight();
|
|
|
|
|
|
pImage->x0 = 0;
|
|
|
|
|
|
pImage->y0 = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fclose(hFile);
|
|
|
|
|
|
return pImage;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CImageInsert* pImage = new CImageInsert();
|
|
|
|
|
|
if (!pImage->LoadImage(lpcsImageName))
|
|
|
|
|
|
{
|
|
|
|
|
|
delete pImage;
|
|
|
|
|
|
::AfxMessageBox("Load image file error!");
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
pImage->m_size.cx = pImage->GetImage()->GetWidth();
|
|
|
|
|
|
pImage->m_size.cy = pImage->GetImage()->GetHeight();
|
|
|
|
|
|
pImage->x0 = 0;
|
|
|
|
|
|
pImage->y0 = 0;
|
|
|
|
|
|
return pImage;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWcsTrackIn::RemoveSelectedTrackIn()
|
|
|
|
|
|
{
|
|
|
|
|
|
CTrackObj* pTrack = (CTrackObj*)m_pTrackIn->GetParent();
|
|
|
|
|
|
pTrack->RemoveChild(m_pTrackIn);
|
|
|
|
|
|
//pTrack->RemoveFromObjList(m_pTrackIn);
|
|
|
|
|
|
//delete m_pTrackIn;
|
|
|
|
|
|
m_pTrackIn = NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int CItemWcsTrackIn::DeleteSelection(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(GetDrawObj() == NULL)
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
CTrackObj* pTrack = (CTrackObj*)m_pTrackIn->GetParent();
|
|
|
|
|
|
if (((CWellPole*)(pTrack->GetParent()))->IsSectionWell())
|
|
|
|
|
|
{
|
|
|
|
|
|
CWellSection* pSection = (CWellSection*)(pTrack->GetParent()->GetParent());
|
|
|
|
|
|
POSITION posBend = pSection->m_BendList.GetHeadPosition();
|
|
|
|
|
|
while(posBend!=NULL)
|
|
|
|
|
|
{
|
|
|
|
|
|
CBendObj * pBend = (CBendObj *)pSection->m_BendList.GetNext(posBend);
|
|
|
|
|
|
if (pBend->m_pLayerLeft==m_pTrackIn||(pBend->m_pLayerRight!=NULL&&pBend->m_pLayerRight==m_pTrackIn))
|
|
|
|
|
|
{
|
|
|
|
|
|
pSection->DeleteBend(pBend);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
RemoveSelectedTrackIn();
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CItemWcsTrackIn::ChangeAllLayerSet(CInTrackLayerGroup* pLayer, DWORD nLayerLinkFlag, DWORD nLayerPropertyFlag)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(pLayer == NULL)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
CBendObj * pBend = NULL;
|
|
|
|
|
|
if(nLayerLinkFlag & LayerLinkFlagLeft)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
CInTrackLayerGroup* pLayerLeft = NULL;
|
|
|
|
|
|
WELLOBJLIST::iterator pos = pLayer->m_BendLeftList.begin();
|
|
|
|
|
|
for(; pos != pLayer->m_BendLeftList.end(); pos++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend = (CBendObj*)*pos; // pLayer->m_BendLeftList.GetNext(pos);
|
|
|
|
|
|
|
|
|
|
|
|
if(pBend->m_pLayerLeft && pBend->m_pLayerRight)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(pBend->m_pLayerLeft->GetPosition().CenterPoint().x0 < pBend->m_pLayerRight->GetPosition().CenterPoint().x0)
|
|
|
|
|
|
pLayerLeft = (CInTrackLayerGroup*)pBend->m_pLayerLeft;
|
|
|
|
|
|
else
|
|
|
|
|
|
pLayerLeft = (CInTrackLayerGroup*)pBend->m_pLayerRight;
|
|
|
|
|
|
|
|
|
|
|
|
if(pLayerLeft != pLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(nLayerPropertyFlag & LayerPropertyFlagColor)
|
|
|
|
|
|
pLayerLeft->m_brush.m_color = pLayer->m_brush.m_color;
|
|
|
|
|
|
if(nLayerPropertyFlag & LayerPropertyFlagFont)
|
|
|
|
|
|
pLayerLeft->m_font = pLayer->m_font;
|
|
|
|
|
|
if(nLayerPropertyFlag & LayerPropertyFlagLitho)
|
|
|
|
|
|
{
|
|
|
|
|
|
pLayerLeft->m_strLitho = pLayer->m_strLitho;
|
|
|
|
|
|
pLayerLeft->m_pMarkFill = pLayer->m_pMarkFill;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(nLayerPropertyFlag & LayerPropertyFlagTop)
|
|
|
|
|
|
pLayerLeft->SetTopUnComformity(pLayer->IsTopUnConformity());
|
|
|
|
|
|
if(nLayerPropertyFlag & LayerPropertyFlagBottom)
|
|
|
|
|
|
pLayerLeft->SetBottomUnDrill(pLayer->IsBottomUnDrill());
|
|
|
|
|
|
|
|
|
|
|
|
ChangeAllLayerSet(pLayerLeft, LayerLinkFlagLeft, nLayerPropertyFlag);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(nLayerLinkFlag & LayerLinkFlagRight)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
CInTrackLayerGroup* pLayerRight = NULL;
|
|
|
|
|
|
WELLOBJLIST::iterator pos = pLayer->m_BendRightList.begin();
|
|
|
|
|
|
for (; pos != pLayer->m_BendRightList.end(); pos++)
|
|
|
|
|
|
{
|
|
|
|
|
|
pBend = (CBendObj*)*pos; // pLayer->m_BendRightList.GetNext(pos);
|
|
|
|
|
|
if(pBend->m_pLayerLeft && pBend->m_pLayerRight)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(pBend->m_pLayerLeft->GetPosition().CenterPoint().x0 < pBend->m_pLayerRight->GetPosition().CenterPoint().x0)
|
|
|
|
|
|
pLayerRight = (CInTrackLayerGroup*)pBend->m_pLayerRight;
|
|
|
|
|
|
else
|
|
|
|
|
|
pLayerRight = (CInTrackLayerGroup*)pBend->m_pLayerLeft;
|
|
|
|
|
|
|
|
|
|
|
|
if(pLayerRight != pLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
//ͬ<><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
|
if(nLayerPropertyFlag & LayerPropertyFlagColor)
|
|
|
|
|
|
pLayerRight->m_brush.m_color = pLayer->m_brush.m_color;
|
|
|
|
|
|
if(nLayerPropertyFlag & LayerPropertyFlagFont)
|
|
|
|
|
|
pLayerRight->m_font = pLayer->m_font;
|
|
|
|
|
|
if(nLayerPropertyFlag & LayerPropertyFlagLitho)
|
|
|
|
|
|
{
|
|
|
|
|
|
pLayerRight->m_strLitho = pLayer->m_strLitho;
|
|
|
|
|
|
pLayerRight->m_pMarkFill = pLayer->m_pMarkFill;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(nLayerPropertyFlag & LayerPropertyFlagTop)
|
|
|
|
|
|
pLayerRight->SetTopUnComformity(pLayer->IsTopUnConformity());
|
|
|
|
|
|
if(nLayerPropertyFlag & LayerPropertyFlagBottom)
|
|
|
|
|
|
pLayerRight->SetBottomUnDrill(pLayer->IsBottomUnDrill());
|
|
|
|
|
|
|
|
|
|
|
|
ChangeAllLayerSet(pLayerRight, LayerLinkFlagRight, nLayerPropertyFlag);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|