You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
251 lines
7.5 KiB
C++
251 lines
7.5 KiB
C++
/*************************************************
|
|
|
|
实现道内对象的属性页显示以及属性交互,并且完成道内对象的删除功能
|
|
Others:
|
|
Function List:
|
|
1. virtual BOOL InitPropertyGrid(CXTPPropertyGrid& grid); 初始化属性窗口
|
|
2. virtual BOOL OnGridItemChangeValue(CXTPPropertyGridItem* pItem);响应属性框改变消息的函数
|
|
3. virtual void OnInplaceButtonDown(CXTPPropertyGridItem* pItem);响应属性框内按钮弹出新的对话框
|
|
4. void RemoveSelectedTrackIn();删除选中的道内对象
|
|
5. virtual void DeleteSelection(void);剖面或栅状图时,移除道内与连层相连层时相关的连层也要删除
|
|
*************************************************/
|
|
#include "StdAfx.h"
|
|
//#include "CustomItemButton.h"
|
|
//
|
|
//#include "TextDlg.h"
|
|
|
|
#include "ItemText.h"
|
|
|
|
#include "WellPoleDoc.h"
|
|
#include "WellPoleView.h"
|
|
//#include "DlgTrackText.h"
|
|
//#include "DlgTrackOilAnaly.h"
|
|
//#include "DlgTrackOilStatis.h"
|
|
//#include "DlgTrackProductionNow.h"
|
|
//#include "DlgTrackProductionOld.h"
|
|
//#include "DlgTrackProductionTotal.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 "PropertyGridItemAdd.h"//#include "DataPropertyPage.h"
|
|
#include "ItemTrackIn.h"
|
|
|
|
#include "CxImage\CxImage\ximagegeotiff.h"
|
|
//#include "DlgTrackText.h"
|
|
|
|
#define TrackInOilTestMid 98304
|
|
namespace NItem
|
|
{
|
|
|
|
CItemTrackIn::CItemTrackIn(CSigmaDoc* pDoc)
|
|
: CItemWellBase(pDoc)
|
|
{
|
|
SetType(ITEM_TRACKIN);
|
|
m_bChangeAllLayerSet = FALSE;
|
|
}
|
|
|
|
CItemTrackIn::~CItemTrackIn(void)
|
|
{
|
|
}
|
|
|
|
CImageInsert* CItemTrackIn::ReadImage(LPCTSTR lpcsImageName)
|
|
{
|
|
int type = CImageBase::GetImageType(lpcsImageName);
|
|
|
|
if (type == CXIMAGE_FORMAT_TIF) //读取GeoTiff文件
|
|
{
|
|
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 CItemTrackIn::RemoveSelectedTrackIn()
|
|
{
|
|
CTrackObj* pTrack = (CTrackObj*)m_pTrackIn->GetParent();
|
|
pTrack->RemoveChild(m_pTrackIn);
|
|
//pTrack->RemoveFromObjList(m_pTrackIn);
|
|
//delete m_pTrackIn;
|
|
m_pTrackIn = NULL;
|
|
}
|
|
|
|
int CItemTrackIn::DeleteSelection(void)
|
|
{
|
|
if(GetDrawObj() == NULL)
|
|
return 0;
|
|
|
|
CTrackObj* pTrack = (CTrackObj*)m_pTrackIn->GetParent();
|
|
//if (((CWellObj*)(pTrack->GetParentObj()))->GetWellType()==Well_Section)
|
|
//{
|
|
// CWellSection* pSection = (CWellSection*)(pTrack->GetParentObj()->GetParentObj());
|
|
// 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 CItemTrackIn::ChangeAllLayerSet(CInTrackLayerGroup* pLayer, DWORD nLayerLinkFlag, DWORD nLayerPropertyFlag)
|
|
{
|
|
if(pLayer == NULL)
|
|
return;
|
|
|
|
//CBendObj * pBend = NULL;
|
|
if(nLayerLinkFlag & LayerLinkFlagLeft)
|
|
{
|
|
|
|
////遍历左连层
|
|
//CInTrackLayerGroup* pLayerLeft = NULL;
|
|
//POSITION pos = pLayer->m_BendLeftList.GetHeadPosition();
|
|
//while(pos != NULL)
|
|
//{
|
|
// pBend = (CBendObj*)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)
|
|
{
|
|
|
|
//遍历右连层
|
|
//CInTrackLayerGroup* pLayerRight = NULL;
|
|
//POSITION pos = pLayer->m_BendRightList.GetHeadPosition();
|
|
//while(pos != NULL)
|
|
//{
|
|
// pBend = (CBendObj*)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)
|
|
// {
|
|
// //同步属性值
|
|
// 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);
|
|
// }
|
|
// }
|
|
//}
|
|
}
|
|
}
|
|
} |