# include "StdAfx.h"
# include "stdio.h"
# include <vector>
# include "WellPoleDoc.h"
# include "WellPoleView.h"
# include "WellPoleLib/WellBaseObj.h"
# include "WellPoleLib/WellClassObjGroup.h"
# include "WellPoleLib/InTrackDepthSegment.h"
# include "WellPoleLib/InTrackTextBase.h"
# include "WellPoleLib\InTrackTextRange.h"
# include "WellPoleLib\InTrackPicture.h"
# include "WellPoleLib\InTrackLith.h"
# include "WellPoleLib\InTrackResult.h"
# include "WellPoleLib\InTrackSymbol.h"
# include "WellPoleLib\TrackObj.h"
# include "WellPoleLib/InclinedTrack.h"
# include "WellPoleLib\TrackGroup.h"
# include "WellPoleLib\TrackCurveBase.h"
# include "WellPoleLib\TrackSample.h"
# include "WellPoleLib\TrackSymbol.h"
# include "WellPoleLib\TrackLith.h"
# include "WellPoleLib\TrackResult.h"
# include "WellPoleLib/TrackDiscrete.h"
# include "WellPoleLib/TrackCurve.h"
# include "WellPoleLib/WellPole.h"
# include "WellPoleLib/InclinedWellPole.h"
# include "WellPoleLib/WellObjExtendInfo.h"
# include "ItemText.h"
# include "ActionAddItem.h"
# include "ItemTrack.h"
# include "ItemTrackIn.h"
# include "ItemSingleWell.h"
//#include "DlgAddTrack.h"
//#include "DataTrackPropertyPage.h"
//#include "PropertyGridItemAdd.h"
//<2F> <> <EFBFBD> <EFBFBD> (ptx,pty)<29> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> x1,y1),(x2,y2)<29> <> <EFBFBD> ߵ Ľ<DFB5> <C4BD> <EFBFBD> .
CPoint2D GetVPt_Line ( double x1 , double y1 , double x2 , double y2 , double ptx , double pty )
{
CPoint2D ptf ;
if ( abs ( x1 - x2 ) < 0.000001 & & abs ( y1 - y2 ) < 0.000001 )
{
ptf . x0 = x1 ; ptf . y0 = y1 ;
}
else
{
if ( abs ( y1 - y2 ) < 0.000001 )
{ //<2F> <> <EFBFBD> <EFBFBD> (x1,y1),(x2,y2)ˮƽ <CBAE> <C6BD> <EFBFBD> <EFBFBD> <EFBFBD> 䴹<EFBFBD> ߴ <EFBFBD> ֱ
ptf . x0 = ptx ; ptf . y0 = y1 ;
}
else if ( abs ( x1 - x2 ) < 0.000001 )
{ //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ
ptf . x0 = x1 ;
ptf . y0 = pty ;
}
else
{
double k = - ( x1 - x2 ) / ( y1 - y2 ) ;
ptf . x0 = ( pty - k * ptx - y1 + x1 * ( y2 - y1 ) / ( x2 - x1 ) ) / ( ( y2 - y1 ) / ( x2 - x1 ) - k ) ;
ptf . y0 = k * ptf . x0 + pty - k * ptx ;
}
}
return ptf ;
}
/*<2A> õ<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> 㣬<EFBFBD> <E3A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㣨ox<6F> <78> oy<6F> <79> <EFBFBD> ľ<EFBFBD> <C4BE> <EFBFBD> <EFBFBD> <EFBFBD> l,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> start<72> <74> <EFBFBD> <EFBFBD> end<6E> 㴹ֱ<E3B4B9> <D6B1> ,oid<69> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> ־<EFBFBD> <D6BE> =1<> <31> ʾ ˳ʱ<CBB3> <CAB1> <EFBFBD> <EFBFBD> ת90<39> <30> =2<> <32> ʾ <EFBFBD> <CABE> ʱ<EFBFBD> <CAB1>
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ľ <EFBFBD> <EFBFBD> <EFBFBD> l <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ij <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ <EFBFBD> <EFBFBD> λ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ <EFBFBD> <EFBFBD> oid <EFBFBD> <EFBFBD> ʾ <EFBFBD> <EFBFBD> <EFBFBD> ĸ <EFBFBD> */
CPoint2D GetPtV_Vector ( double ox , double oy , double startx , double starty , double endx , double endy , double l , int oid )
{
CPoint2D retPt ;
if ( abs ( startx - endx ) < 0.00001 & & abs ( starty - endy ) < 0.00001 )
{
retPt . x0 = startx ; retPt . y0 = starty ;
}
else
{
double sel = sqrt ( ( endx - startx ) * ( endx - startx ) + ( endy - starty ) * ( endy - starty ) ) ;
if ( oid = = 1 )
{
retPt . x0 = ox + l * ( starty - endy ) / sel ;
retPt . y0 = oy + l * ( endx - startx ) / sel ;
}
else
{
retPt . x0 = ox - l * ( starty - endy ) / sel ;
retPt . y0 = oy - l * ( endx - startx ) / sel ;
}
}
return retPt ;
}
namespace NItem
{
CItemSingleWell : : CItemSingleWell ( CSigmaDoc * pDoc )
: CItemWellBase ( pDoc )
{
m_pWndOld = pDoc ;
SetType ( ITEM_WELLPOLE ) ;
m_pItemSelected = NULL ;
m_pWell = NULL ;
m_pDragImage = NULL ;
m_bEditTrackInData = FALSE ;
m_nTrackPos = - 1 ;
m_bDragImage = FALSE ;
m_VCursor = m_HCursor = NULL ;
m_pVCursorBmp = m_pVCursorMaskBmp = m_pHCursorBmp = m_pHCursorMaskBmp = NULL ;
m_PointNum = 0 ;
m_pPointBuf = NULL ;
m_bWellFrame = TRUE ;
//CMapEditFrame *pParentFrame = (CMapEditFrame*)pWnd->GetMapFrame();
//if(!pParentFrame->IsKindOf(RUNTIME_CLASS(CMapWellFrame)))
//{
// m_bWellFrame = FALSE;
//}
//CMapWellFrame *pFrame = (CMapWellFrame*)pWnd->GetMapFrame();
//for(int ii = 0; ii< pFrame->GetMapFrame2D().m_SplitterWnd.GetSize(); ii++)
//{
// m_DcVec.push_back(pFrame->GetMapFrame2D().m_SplitterWnd[ii].pMapWnd2D->GetDC());
// m_WndVec.push_back(pFrame->GetMapFrame2D().m_SplitterWnd[ii].pMapWnd2D);
//}
strcpy ( m_logFont . lfFaceName , " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ;
m_logFont . lfHeight = - 12 ;
m_logFont . lfWidth = 0 ;
m_logFont . lfCharSet = 1 ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ּ<EFBFBD>
m_logFont . lfUnderline = 0 ; //<2F> <> <EFBFBD> »<EFBFBD> <C2BB> <EFBFBD>
m_logFont . lfStrikeOut = 0 ; //<2F> ᴩ<DEB9> <E1B4A9>
m_logFont . lfWeight = 400 ; //<2F> <> <EFBFBD> <EFBFBD> //<2F> <> 700;
m_logFont . lfItalic = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
m_logFont . lfCharSet = GB2312_CHARSET ;
m_logFont . lfEscapement = 0 ;
m_logFont . lfOrientation = 0 ;
m_bAddFaultPoint = FALSE ;
}
CItemSingleWell : : ~ CItemSingleWell ( void )
{
DestroyVHCursor ( ) ;
if ( m_pItemSelected ! = NULL )
{
delete m_pItemSelected ;
m_pItemSelected = NULL ;
}
if ( m_pDragImage ! = NULL )
{
delete m_pDragImage ;
m_pDragImage = NULL ;
}
if ( m_pWell ! = NULL )
{
//m_pWell->ClearCurveSegmentObj();
}
if ( m_pPointBuf )
delete [ ] m_pPointBuf ;
}
CWellBaseObj * CItemSingleWell : : GetDrawObj ( )
{
CWellPoleDoc * pDoc = ( CWellPoleDoc * ) ( GetView ( ) - > m_pDoc ) ;
return pDoc - > GetWellPole ( ) ;
}
void CItemSingleWell : : OnLButtonDown ( CDC * pDC , UINT nFlags , CPoint point , int vk )
{
if ( m_bEditTrackInData )
{
if ( m_pItemSelected ! = NULL )
{
m_pItemSelected - > OnLButtonDown ( pDC , nFlags , point , vk ) ;
return ;
}
}
CWellPoleDoc * pDoc = ( CWellPoleDoc * ) GetDoc ( ) ;
CWellPoleView * pView = ( CWellPoleView * ) GetView ( ) ;
m_bLDown = TRUE ;
int nHandleSize = HANDLESIZE ; // ::GetPreferences().WorkaroundHandle.m_nHandleSize;
double dHandleSize = GetDC ( ) - > GetRealSize ( CSize ( nHandleSize / 2 , nHandleSize / 2 ) ) . cx ;
CPoint2D ptReal = GetDC ( ) - > GetReal ( point ) ;
m_downPoint = m_firstPoint = m_lastPoint = point ;
selectMode = CItemNestBase : : selnone ;
CWellPole * pWell = GetWellObject ( ) ;
CWellBaseObj * pObj = NULL ;
CTrackObj * pTrackObj = NULL ;
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) > 0 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
if ( pObjSelected = = NULL )
{
nDragHandle = pWell - > HitTest ( ptReal , dHandleSize , TRUE ) ;
if ( nDragHandle ! = 0 )
{
selectMode = CItemNestBase : : size ;
//GetView()->SetCapture();
return ;
}
}
else
{
pObj = pObjSelected ;
nDragHandle = pObj - > HitTest ( ptReal , dHandleSize , TRUE ) ;
if ( nDragHandle ! = 0 )
{
selectMode = CItemNestBase : : size ;
//GetView()->SetCapture();
return ;
}
}
//ѡ <> е <EFBFBD> <D0B5> ߿<EFBFBD> <DFBF> ϶<EFBFBD> <CFB6> <EFBFBD> <EFBFBD> <EFBFBD>
BeSelectBorderLine ( pWell , ptReal , dHandleSize ) ;
if ( selectMode = = CItemNestBase : : selnone )
{
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 ) ;
////<2F> е <EFBFBD> ǰѡ <C7B0> ж<EFBFBD> <D0B6> <EFBFBD> <20> <> <EFBFBD> жϵ<D0B6> ǰ<EFBFBD> <C7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> <EFBFBD> ΪNULL<4C> <4C> <EFBFBD> жϾ<D0B6> <CFBE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
CWellBaseObj * pCurrentObj = NULL ;
if ( pObjSelected ! = NULL )
{
pCurrentObj = pObjSelected - > ObjectAt ( r , dHandleSize , TRUE ) ;
}
if ( pCurrentObj )
{
pObj = pCurrentObj ;
}
else
{
pObj = pWell - > ObjectAt ( r , dHandleSize , TRUE ) ;
}
if ( pObjSelected ! = NULL )
{
/////// <20> <> <EFBFBD> <EFBFBD> о <EFBFBD> <D0BE> Ϊ<EFBFBD> ༭<EFBFBD> <E0BCAD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɢ<EFBFBD> <C9A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> m_childObjects<74> ڵĶ<DAB5> <C4B6> <EFBFBD>
//if (pObjSelected->GetType() == GDOUBLEFOX_DISCRETESEGMENT && pObj != pObjSelected)
//{
// CTrackDiscreteObj* pTrackDiscrete = (CTrackDiscreteObj*)pObjSelected->GetParentObj();
// if(pTrackDiscrete != NULL)
// pTrackDiscrete->GetChildObjList().RemoveAll();
//}
///////<2F> <> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> ߵ <EFBFBD> <DFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȶ<EFBFBD> <C8B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߵ <EFBFBD> <DFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> m_childObjects<74> ڵĶ<DAB5> <C4B6> <EFBFBD>
//else if (pObjSelected->GetType() == GDOUBLEFOX_LOGCURVESEGMENT && pObj != pObjSelected)
//{
// CTrackCurveObj* pTrackCurveObj = (CTrackCurveObj*)pObjSelected->GetParentObj();
// if(pTrackCurveObj != NULL)
// pTrackCurveObj->GetChildObjList().RemoveAll();
//}
}
BOOL bChange = FALSE ;
if ( pObj ! = NULL & & ! IsSelected ( pObj ) )
{
bChange = TRUE ;
//OnDraw(GetDC());
Select ( pObj ) ;
m_pItemSelected = CreateItem ( pObj ) ;
( ( CItemWellBase * ) m_pItemSelected ) - > SetDrawObj ( pObj ) ;
m_pItemSelected - > SetPos ( GetPos ( ) ) ;
}
if ( pObj ! = NULL )
{
selectMode = CItemNestBase : : move ;
if ( pObj - > GetType ( ) = = KEP_TRACK )
{
CTrackObj * pTrackObj = ( CTrackObj * ) pObj ;
if ( ! pTrackObj - > IsInTrackHead ( ptReal , sx , sy ) )
{
if ( pTrackObj - > GetTrackType ( ) = = Track_Curve )
{
CTrackCurveBase * pCurveTrack = ( CTrackCurveBase * ) pTrackObj ;
selectMode = CItemNestBase : : selnone ;
if ( m_pItemSelected ! = NULL )
delete m_pItemSelected ;
m_pItemSelected = NULL ;
return ;
}
else
{
if ( ( pTrackObj - > GetTrackType ( ) = = Track_Depth ) )
{ //<2F> <> <EFBFBD> ȵ<EFBFBD> ,б <> <D0B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> ӵ<EFBFBD> <D3B5> ڶ<EFBFBD> <DAB6> <EFBFBD> s
if ( bChange )
{
OnDraw ( GetDC ( ) ) ;
}
return ;
}
selectMode = CItemNestBase : : selnone ;
if ( m_pItemSelected ! = NULL )
delete m_pItemSelected ;
CItemTrack * pItemTrack = ( CItemTrack * ) CreateItem ( pTrackObj ) /*new CItemTrack(GetDoc())*/ ;
m_pItemSelected = pItemTrack ;
pItemTrack - > SetDrawObj ( pTrackObj ) ;
pItemTrack - > SetItemWell ( this ) ;
pItemTrack - > m_bAddFaultPoint = this - > m_bAddFaultPoint ;
m_pItemSelected - > OnLButtonDown ( pDC , nFlags , point , vk ) ;
m_bEditTrackInData = TRUE ;
return ;
}
}
}
else
{
if ( pWell - > IsSectionWell ( ) & &
( pObj - > GetType ( ) = = KEP_RESULT | |
pObj - > GetType ( ) = = KEP_LAYERGROUP | |
pObj - > GetType ( ) = = KEP_STANDARD ) )
{
return ;
}
else
{
}
}
//GetView()->SetCapture();
//CreateDragImage();
}
else
{
//if(GetType() == ITEM_SECTIONWELL)
// selectMode = CItemSelect::move;
//GetView()->SetCapture();
m_WellObjSelectlist . RemoveAll ( ) ;
if ( m_pItemSelected ! = NULL )
{
delete m_pItemSelected ;
m_pItemSelected = NULL ;
}
if ( pObj ! = pObjSelected )
{
//OnDraw(GetDC());
bChange = TRUE ; // FALSE;
}
DrawHandle ( GetDC ( ) ) ;
}
if ( bChange )
{ //<2F> <> <EFBFBD> <EFBFBD> ʮ<EFBFBD> <CAAE> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> Ҫȫͼ<C8AB> <CDBC> <EFBFBD> ƿ<EFBFBD> <C6BF> <EFBFBD> ȥ<EFBFBD> <C8A5> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> ظ<EFBFBD> <D8B8> <EFBFBD> <EFBFBD> Ƶ<EFBFBD> <C6B5> µ<EFBFBD> ʮ<EFBFBD> <CAAE> <EFBFBD> ߴ <EFBFBD> <DFB4> <EFBFBD> <F3A3ACB5> <EFBFBD> Ҫʮ<D2AA> <CAAE> <EFBFBD> <EFBFBD> ʱֱ<CAB1> <D6B1> OnDrawЧ<77> ʸ<EFBFBD>
}
}
}
void CItemSingleWell : : OnLButtonUp ( CDC * pDC , UINT nFlags , CPoint point , int vk )
{
CWellPole * pWellObj = GetWellObject ( ) ;
m_firstPoint = m_lastPoint = point ;
BOOL bDiscreteNoAdd = FALSE ;
if ( m_pItemSelected ! = NULL & & m_bEditTrackInData )
{
CWellPole * pWell = GetWellObject ( ) ;
bDiscreteNoAdd = TRUE ;
m_bEditTrackInData = FALSE ;
m_pItemSelected - > OnLButtonUp ( pDC , nFlags , point , vk ) ;
if ( m_downPoint = = point )
{
OnDraw ( GetDC ( ) ) ;
}
ReleaseCapture ( ) ;
m_bDrag = FALSE ;
m_bLDown = FALSE ;
nDragHandle = 0 ;
selectMode = CItemNestBase : : selnone ;
}
CRect oldrect = GetDC ( ) - > GetScreen ( pWellObj - > GetRect ( ) ) ;
CPoint2D downPoint = GetDC ( ) - > GetReal ( m_downPoint ) ;
CPoint2D lastPoint = GetDC ( ) - > GetReal ( m_lastPoint ) ;
CPoint2D delta ( lastPoint . x0 - downPoint . x0 , lastPoint . y0 - downPoint . y0 ) ;
if ( ( m_downPoint . x - m_lastPoint . x ) ! = 0 | | ( m_downPoint . y - m_lastPoint . y ) ! = 0 )
{
if ( IsCaptureState ( ) )
{
//<2F> Ͼ<EFBFBD> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD> <EFBFBD> ߽<EFBFBD>
if ( selectMode = = CItemNestBase : : border )
{
SetReUnDoAction ( ) ;
pWellObj = GetWellObject ( ) ;
CPoint2D ptf = pWellObj - > GetAnchorPoint ( ) ; //ʹ <> þ<EFBFBD> ͷ<EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> б <EFBFBD> <D0B1> ʱҲ<CAB1> <D2B2> <EFBFBD> <EFBFBD> (<28> <> Ϊб <CEAA> <D0B1> <EFBFBD> <EFBFBD> m_position<6F> <6E> <EFBFBD> 仯)
CPoint2D dpt , lpt ;
dpt = pWellObj - > ReCalculatePoint ( downPoint ) ;
lpt = pWellObj - > ReCalculatePoint ( lastPoint ) ;
delta . SetPoint ( lpt . x0 - dpt . x0 , lpt . y0 - dpt . y0 ) ;
if ( nDragHandle = = 6 )
{
double oldHigh = pWellObj - > m_dHeightTrackHead ;
pWellObj - > m_dHeightTrackHead + = delta . y0 ;
//////<2F> <> <EFBFBD> Ƶ<EFBFBD> ͷ<EFBFBD> <CDB7> С <EFBFBD> ߶<EFBFBD>
if ( pWellObj - > m_dHeightTrackHead < 5 )
{
pWellObj - > m_dHeightTrackHead = 5 ;
delta . y0 = pWellObj - > m_dHeightTrackHead - oldHigh ;
}
ptf . y0 + = delta . y0 ;
}
else if ( nDragHandle = = 2 )
{
double oldHigh = pWellObj - > m_dHeightWellHead ;
pWellObj - > m_dHeightWellHead + = delta . y0 ;
if ( pWellObj - > m_dHeightWellHead < pWellObj - > m_font . m_dHeight )
{
pWellObj - > m_dHeightWellHead = pWellObj - > m_font . m_dHeight ;
delta . y0 = pWellObj - > m_dHeightWellHead - oldHigh ;
}
ptf . y0 + = delta . y0 ;
}
pWellObj - > CalculateSize ( ptf ) ;
}
else
{
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) > 0 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
if ( pObjSelected = = NULL ) //<2F> ϶<EFBFBD> <CFB6> <EFBFBD>
{
if ( selectMode = = CItemSelect : : move & & ( GetWellObject ( ) - > GetParent ( ) ! = NULL & & GetWellObject ( ) - > GetParent ( ) - > GetType ( ) ! = KEP_FENCE ) )
{
CRect8 position = pWellObj - > GetPos ( ) ;
pWellObj - > m_delta = delta ;
position . OffsetRect ( delta . x0 , delta . y0 ) ;
pWellObj - > MoveTo ( position ) ;
}
else if ( selectMode = = CItemSelect : : size ) //<2F> ϶<EFBFBD> <CFB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶ㣬<C6B5> <E3A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
SetReUnDoAction ( ) ;
pWellObj = GetWellObject ( ) ;
CPoint2D lastPoint = GetDC ( ) - > GetReal ( m_lastPoint ) ;
pWellObj - > MoveHandleTo ( nDragHandle , lastPoint ) ;
}
}
else
{
CWellBaseObj * pObj = pObjSelected ;
if ( selectMode = = CItemNestBase : : move )
{
if ( pObj - > GetType ( ) = = KEP_TRACK )
{
CTrackObj * pTrackObj = ( CTrackObj * ) pObj ;
CSize size ( m_lastPoint . x - m_downPoint . x , m_lastPoint . y - m_downPoint . y ) ;
if ( size . cx ! = 0 )
{
////<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> λ<EFBFBD> <CEBB>
int ideep = 0 ;
SortTrackWhenMoving ( pWellObj , pTrackObj , ideep ) ;
CPoint2D ptf = pWellObj - > GetAnchorPoint ( ) ; //ʹ <> þ<EFBFBD> ͷ<EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> б <EFBFBD> <D0B1> ʱҲ<CAB1> <D2B2> <EFBFBD> <EFBFBD> (<28> <> Ϊб <CEAA> <D0B1> <EFBFBD> <EFBFBD> m_position<6F> <6E> <EFBFBD> 仯) pWellObj->GetPos().TopLeft();
pWellObj - > CalculateSize ( ptf ) ;
//<2F> <> <EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD>
pWellObj - > ResetChildPosition ( ) ;
}
}
else
{
SetReUnDoAction ( ) ;
pWellObj = GetWellObject ( ) ;
if ( pWellObj - > GetWellType ( ) ! = Well_Incline )
{
if ( delta . y0 > 0 )
{
POSITION pos = m_WellObjSelectlist . GetHeadPosition ( ) ;
while ( pos ! = NULL )
{
CWellBaseObj * pObj = m_WellObjSelectlist . GetNext ( pos ) ;
CRect8 position = pObj - > GetRect ( ) ;
pObj - > SetDelta ( CPoint2D ( 0 , delta . y0 ) ) ;
position . OffsetRect ( delta . x0 , delta . y0 ) ;
pObj - > MoveTo ( position ) ;
}
}
else
{
POSITION pos = m_WellObjSelectlist . GetTailPosition ( ) ;
while ( pos ! = NULL )
{
CWellBaseObj * pObj = m_WellObjSelectlist . GetPrev ( pos ) ;
CRect8 position = pObj - > GetRect ( ) ;
pObj - > SetDelta ( CPoint2D ( 0 , delta . y0 ) ) ;
position . OffsetRect ( delta . x0 , delta . y0 ) ;
pObj - > MoveTo ( position ) ;
}
}
}
else
{
CInTrackDepthSegment * pInTrackSeg = ( CInTrackDepthSegment * ) pObjSelected ;
CInclinedTrack * pInclinedTrack = ( CInclinedTrack * ) pObjSelected - > GetParent ( ) ;
CPoint2D realDownPt = GetDC ( ) - > GetReal ( m_downPoint ) ;
CPoint2D realLastPt = GetDC ( ) - > GetReal ( m_lastPoint ) ;
double sDepth = pInclinedTrack - > GetDepthInWellTrace ( realDownPt ) ;
double nDepth = pInclinedTrack - > GetDepthInWellTrace ( realLastPt ) ;
double offDepth = nDepth - sDepth ;
if ( ( pInTrackSeg - > m_fSdep + offDepth ) < pWellObj - > m_dSdep ) //<2F> <> <EFBFBD> <EFBFBD> һ <EFBFBD> ²<EFBFBD> <C2B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
offDepth = pWellObj - > m_dSdep - pInTrackSeg - > m_fSdep ;
}
if ( ( pInTrackSeg - > m_fEdep + offDepth ) > pWellObj - > m_dEdep )
{
offDepth = pWellObj - > m_dEdep - pInTrackSeg - > m_fEdep ;
}
pInTrackSeg - > m_fSdep + = offDepth ;
pInTrackSeg - > m_fEdep + = offDepth ;
pInTrackSeg - > CalcInclinedBorder ( ) ;
}
}
}
else if ( selectMode = = CItemNestBase : : size & & nDragHandle ! = 0 )
{
SetReUnDoAction ( ) ; pWellObj = GetWellObject ( ) ;
if ( pObj - > GetType ( ) = = KEP_TRACK )
{
CPoint2D ptf = pWellObj - > GetAnchorPoint ( ) ; //ʹ <> þ<EFBFBD> ͷ<EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> б <EFBFBD> <D0B1> ʱҲ<CAB1> <D2B2> <EFBFBD> <EFBFBD> (<28> <> Ϊб <CEAA> <D0B1> <EFBFBD> <EFBFBD> m_position<6F> <6E> <EFBFBD> 仯) pWellObj->GetPos().TopLeft();
CTrackObj * pCTrackObj = ( CTrackObj * ) pObj ;
if ( nDragHandle = = 4 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
CPoint2D lastPoint = GetDC ( ) - > GetReal ( m_lastPoint ) ;
lastPoint = pWellObj - > ReCalculatePoint ( lastPoint ) ;
pObj - > MoveHandleTo ( nDragHandle , lastPoint ) ;
}
pWellObj - > CalculateSize ( ptf ) ;
}
else
{
//<2F> <> <EFBFBD> ö<EFBFBD> <C3B6> <EFBFBD> <F3BDBBBB> <EFBFBD> <EFBFBD> <EFBFBD>
pObj - > MoveHandleTo ( nDragHandle , lastPoint ) ;
}
}
//CXTPPropertyGrid &grid = GetPropertyGrid(GetDoc()->GetMainFrame());
//InitPropertyGrid(grid);
}
}
//ˢ<> <CBA2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
GetDoc ( ) - > Invalidate ( /*rect*/ ) ;
}
}
/// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɢ<EFBFBD> <C9A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 巶Χ ֮<CEA7> <D6AE> <EFBFBD> ҷ<EFBFBD> <D2B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> о <EFBFBD> <D0BE> λ<EFBFBD> <CEBB> <EFBFBD> ȶ<EFBFBD> ʱȡ<CAB1> <C8A1> ɢ<EFBFBD> <C9A2> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1> ״̬
if ( ( m_downPoint . y - m_lastPoint . y ) = = 0 )
{
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) > 0 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
if ( pObjSelected ! = NULL )
{
if ( pObjSelected - > GetType ( ) = = KEP_TRACK )
{
CTrackObj * pTrack = ( CTrackObj * ) pObjSelected ;
if ( pTrack - > GetTrackType ( ) = = Track_Discrete )
{
CTrackDiscrete * pTrackDiscrete = ( CTrackDiscrete * ) pTrack ;
if ( bDiscreteNoAdd )
{
if ( pTrackDiscrete - > GetChildren ( ) . size ( ) = = 0 )
{
if ( m_pItemSelected ! = NULL )
{
delete m_pItemSelected ;
m_pItemSelected = NULL ;
}
m_pItemSelected = CreateItem ( pTrack ) ;
( ( CItemWellBase * ) m_pItemSelected ) - > SetDrawObj ( pTrack ) ;
m_pItemSelected - > SetPos ( GetPos ( ) ) ;
//OnDraw(GetDC());
//CXTPPropertyGrid &grid = GetPropertyGrid(GetDoc()->GetMainFrame());
//InitPropertyGrid(grid);
}
}
}
else if ( pTrack - > GetTrackType ( ) = = Track_Curve )
{
if ( m_pItemSelected ! = NULL & & m_pItemSelected - > GetType ( ) ! = ITEM_SELECT )
{ //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ߵ <EFBFBD> <DFB5> У <EFBFBD> <D0A3> <EFBFBD> <EFBFBD> <EFBFBD> ԭ<EFBFBD> ص<EFBFBD> <D8B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ꣬<EFBFBD> ͻ<EFBFBD> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> ߵ <EFBFBD>
delete m_pItemSelected ;
m_pItemSelected = CreateItem ( pTrack ) ;
( ( CItemWellBase * ) m_pItemSelected ) - > SetDrawObj ( pTrack ) ;
m_pItemSelected - > SetPos ( GetPos ( ) ) ;
//OnDraw(GetDC());
//CXTPPropertyGrid &grid = GetPropertyGrid(GetDoc()->GetMainFrame());
//InitPropertyGrid(grid);
}
}
}
}
}
// End dragging image
if ( m_pDragImage ! = NULL )
{
CWnd * pWnd = CWnd : : FromHandle ( GetView ( ) - > GetHWND ( ) ) ;
m_pDragImage - > DragLeave ( pWnd ) ;
m_pDragImage - > EndDrag ( ) ;
delete m_pDragImage ; m_pDragImage = NULL ;
m_bDragImage = FALSE ;
}
ReleaseCapture ( ) ;
m_bDrag = FALSE ;
m_bLDown = FALSE ;
nDragHandle = 0 ;
}
void CItemSingleWell : : OnLButtonDblClk ( UINT nFlags , CPoint point )
{
}
void CItemSingleWell : : DrawMovedTrackPicture ( CDC * pDC )
{
if ( m_WellObjSelectlist . GetCount ( ) ! = 1 )
return ;
CTrackObj * pTrackObj = ( CTrackObj * ) m_WellObjSelectlist . GetHead ( ) ;
CXyDC xyDC ;
xyDC = * GetDC ( ) ;
xyDC . Create ( pDC ) ;
CWellPole * pWellObj = GetWellObject ( ) ;
CPoint2D endPoint = GetDC ( ) - > GetReal ( m_lastPoint ) ;
CPoint2D downPoint = GetDC ( ) - > GetReal ( m_downPoint ) ;
CPoint2D deltaPt ( endPoint . x0 - downPoint . x0 , endPoint . y0 - downPoint . y0 ) ;
if ( m_pWell - > GetWellType ( ) = = Well_Incline )
{
m_pWell - > SetRotateHeadAngleDC ( & xyDC ) ;
}
CTrackObj * pCurrentInTrack = GetMoveInTrack ( pWellObj , pTrackObj ) ;
if ( pCurrentInTrack )
{
CRect oldrect ;
CRect rect = GetDC ( ) - > GetScreen ( pCurrentInTrack - > m_HeadRect ) ;
CBrush brush ;
brush . CreateSolidBrush ( RGB ( 230 , 230 , 150 ) ) ;
xyDC . GetDC ( ) - > FillRect ( rect , & brush ) ;
pCurrentInTrack - > DrawMoveTrackFrame ( & xyDC , CPoint2D ( 0 , 0 ) ) ;
}
if ( m_pWell - > GetWellType ( ) = = Well_Incline )
{
float sx , sy , ex , ey ;
PtRotatePt ( m_pWell - > m_HeadLineAngle / 180 * PI , deltaPt . x0 , deltaPt . y0
, 0 , 0 , sx , sy ) ; // <20> <> <EFBFBD> ĽǶ<C4BD> <C7B6> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> 룬 <20> ˺<EFBFBD> <CBBA> <EFBFBD> <EFBFBD> <EFBFBD> ˳ʱ<CBB3> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> 㣬<EFBFBD> <E3A3AC> <EFBFBD> Խ<EFBFBD> ƫ<EFBFBD> <C6AB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƫת<C6AB> <D7AA> ֱ<EFBFBD> <D6B1> ƫת<C6AB> <D7AA> <EFBFBD> <EFBFBD>
deltaPt . x0 = sx ; deltaPt . y0 = sy ;
}
pTrackObj - > DrawMoveTrackFrame ( & xyDC , deltaPt ) ;
if ( m_pWell - > GetWellType ( ) = = Well_Incline )
{
m_pWell - > RecoverRotateHeadAngleDC ( & xyDC ) ;
}
}
int CItemSingleWell : : OnMouseMove ( CDC * pDC , UINT nFlags , CPoint point )
{
if ( m_pItemSelected ! = NULL & & m_bEditTrackInData )
{
return m_pItemSelected - > OnMouseMove ( pDC , nFlags , point ) ;
}
CPoint2D lastPoint = GetDC ( ) - > GetReal ( point ) ;
CWellPole * pWellObj = GetWellObject ( ) ;
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) = = 1 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ק<EFBFBD> <D7A7> ʼ <EFBFBD> <CABC>
int nHandleSize = HANDLESIZE ; //::GetPreferences().WorkaroundHandle.m_nHandleSize;
double dHandleSize = GetDC ( ) - > GetRealSize ( CSize ( nHandleSize / 2 , nHandleSize / 2 ) ) . cx ;
if ( IsCaptureState ( ) & & m_bLDown )
{
if ( m_pDragImage = = NULL )
{
//OnDraw(GetDC());
CWnd * pWnd = CWnd : : FromHandle ( GetView ( ) - > GetHWND ( ) ) ;
DrawSelected ( GetDC ( ) , pWnd ) ;
}
//ˢ<> <CBA2>
//OnDraw(GetDC());
if ( m_pDragImage ! = NULL & & pObjSelected ! = NULL )
{
if ( pObjSelected - > GetType ( ) = = KEP_TRACK )
{
CTrackObj * pTrack = ( CTrackObj * ) pObjSelected ;
CPoint2D ptBegin , ptEnd ;
int nPos = pWellObj - > FindTrackPosition ( pTrack , ptBegin , ptEnd ) ;
m_nTrackPos = nPos ;
if ( nPos > = 0 )
{
m_ptBegin = ptBegin ;
m_ptEnd = ptEnd ;
}
}
}
m_bDrag = TRUE ;
m_lastPoint = point ;
if ( selectMode = = CItemSelect : : move & & pObjSelected ! = NULL ) // <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 ) ;
endPoint = pWellObj - > ReCalculatePoint ( endPoint ) ;
startPoint = pWellObj - > ReCalculatePoint ( startPoint ) ;
CPoint2D delta ( endPoint . x0 - startPoint . x0 , endPoint . y0 - startPoint . y0 ) ;
CWellBaseObj * pDrawObj = pObjSelected ;
pDrawObj - > m_delta = delta ; ///????
//m_pObjSelected->m_delta = delta;
if ( pDrawObj - > GetType ( ) = = KEP_TRACK )
{
CTrackObj * pTrackObj = ( CTrackObj * ) pObjSelected ;
CRect8 activehead = pTrackObj - > m_active_head ;
//<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
activehead . OffsetRect ( delta . x0 , delta . y0 ) ;
pTrackObj - > MoveToActiveTrackHead ( activehead ) ;
}
}
//ˢ<> <CBA2>
//OnDraw(GetDC());
if ( m_pDragImage = = NULL )
{
CWnd * pWnd = CWnd : : FromHandle ( GetView ( ) - > GetHWND ( ) ) ;
DrawSelected ( GetDC ( ) , pWnd ) ;
}
m_firstPoint = m_lastPoint ;
}
else
{
m_lastPoint = point ;
}
return 1 ;
}
void CItemSingleWell : : OnRButtonDown ( UINT nFlags , CPoint point )
{
//OnLButtonDown(nFlags, point);
m_bLDown = FALSE ;
CItem : : OnRButtonDown ( nFlags , point ) ;
//OnLButtonUp(nFlags, point);
}
int CItemSingleWell : : GetSubMenu ( )
{ //???????
// <20> <>
int iRMenu = 42 ;
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) > 0 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
if ( pObjSelected = = NULL )
return iRMenu ;
if ( pObjSelected - > GetType ( ) = = KEP_TRACK )
{
CTrackObj * pTrackObj = ( CTrackObj * ) pObjSelected ;
// <20> <> <EFBFBD> ȵ<EFBFBD> <C8B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD>
if ( pTrackObj - > GetTrackType ( ) = = Track_Depth | | pTrackObj - > GetTrackType ( ) = = Track_Group )
{
iRMenu = 44 ;
}
else if ( pTrackObj - > GetTrackType ( ) = = Track_Curve | | pTrackObj - > GetTrackType ( ) = = Track_Discrete )
{
iRMenu = 43 ;
}
else if ( pTrackObj - > GetTrackType ( ) = = Track_VdlImage
| | pTrackObj - > GetTrackType ( ) = = Track_WaveCurve
| | pTrackObj - > GetTrackType ( ) = = Track_SeisSection )
iRMenu = 54 ;
else
iRMenu = 43 ;
TRACE ( " select track right menu \r \n " ) ;
}
else if ( GetWellObject ( ) - > IsSectionWell ( ) & &
( pObjSelected - > GetType ( ) = = KEP_RESULT | |
pObjSelected - > GetType ( ) = = KEP_LAYERGROUP | |
pObjSelected - > GetType ( ) = = KEP_STANDARD ) )
{
iRMenu = 38 ;
}
//else if (pObjSelected->GetType()==GDOUBLEFOX_LOGCURVESEGMENT)
//{
// iRMenu = 51;
//}
else if ( pObjSelected - > GetType ( ) = = KEP_MARK )
{
iRMenu = 45 ;
}
//else if (pObjSelected->GetType()== KEP_TEXTBOX)
//{
// iRMenu = 41;
//}
//else if (pObjSelected->GetType()==GDOUBLEFOX_DISCRETESEGMENT)
//{
// iRMenu = 50;
//}
else if ( pObjSelected - > GetType ( ) ! = NULL & & pObjSelected - > GetParent ( ) - > GetType ( ) = = KEP_TRACK )
{
TRACE ( " select track in right menu \r \n " ) ;
iRMenu = 45 ;
}
return iRMenu ;
}
BOOL CItemSingleWell : : OnSetCursor ( CWnd * pWnd , UINT nHitTest , UINT message )
{
return TRUE ;
if ( m_pItemSelected ! = NULL & & m_bEditTrackInData )
{
//return m_pItemSelected->OnSetCursor(pWnd, nHitTest, message);
}
CWellPole * pWellObj = GetWellObject ( ) ;
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) = = 1 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
int nHandleSize = HANDLESIZE ; // ::GetPreferences().WorkaroundHandle.m_nHandleSize;
double dHandleSize = GetDC ( ) - > GetRealSize ( CSize ( nHandleSize / 2 , nHandleSize / 2 ) ) . cx ;
CPoint2D lastPoint = GetDC ( ) - > GetReal ( m_lastPoint ) ;
if ( pObjSelected = = NULL )
{
int nHandle = pWellObj - > HitTest ( lastPoint , dHandleSize , TRUE ) ;
if ( nHandle ! = 0 )
{
: : SetCursor ( GetHandleCursor ( nHandle ) ) ;
return TRUE ;
}
}
else /*if(pObjSelected != NULL)*/
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> ǵ<EFBFBD> <C7B5> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> ״̬
if ( pObjSelected - > GetType ( ) ! = KEP_TRACK )
{
//if (pObjSelected->GetType()!=GDOUBLEFOX_STANDARD &&
// pObjSelected->GetType()!=GDOUBLEFOX_FAULTPOINT)
{
int nHandle = pObjSelected - > HitTest ( lastPoint , dHandleSize , TRUE ) ;
if ( nHandle ! = 0 )
{
SetCursor ( GetHandleCursor ( nHandle ) ) ;
return TRUE ;
}
}
}
}
if ( SetMoveCursor ( pWellObj , lastPoint , dHandleSize , pWellObj ) )
return TRUE ;
//else
//{
// GetDoc()->GetCursor().SetCursor(CursorSelect);
// return GetDoc()->GetCursor().SetCursor();
//}
return TRUE ;
}
BOOL CItemSingleWell : : OnSetCursor ( CPoint pt , int & handle )
{
handle = - 1 ;
if ( m_pItemSelected ! = NULL & & m_bEditTrackInData )
{
return m_pItemSelected - > OnSetCursor ( pt , handle ) ;
}
CWellPole * pWellObj = GetWellObject ( ) ;
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) = = 1 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
int nHandleSize = HANDLESIZE ; // ::GetPreferences().WorkaroundHandle.m_nHandleSize;
double dHandleSize = GetDC ( ) - > GetRealSize ( CSize ( nHandleSize / 2 , nHandleSize / 2 ) ) . cx ;
CPoint2D lastPoint = GetDC ( ) - > GetReal ( pt ) ; // m_lastPoint);
CPoint ptt = m_lastPoint ;
if ( pObjSelected = = NULL )
{
int nHandle = pWellObj - > HitTest ( lastPoint , dHandleSize , TRUE ) ;
if ( nHandle ! = 0 )
{
if ( nHandle > 1 )
handle = 3 ;
return TRUE ;
}
}
else /*if(pObjSelected != NULL)*/
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> ǵ<EFBFBD> <C7B5> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> ״̬
if ( pObjSelected - > GetType ( ) ! = KEP_TRACK )
{
int nHandle = pObjSelected - > HitTest ( lastPoint , dHandleSize , TRUE ) ;
if ( nHandle ! = 0 )
{
handle = 2 ;
return TRUE ;
}
}
}
if ( SetMoveCursor ( pWellObj , lastPoint , dHandleSize , pWellObj , handle ) )
return TRUE ;
return TRUE ;
}
void CItemSingleWell : : OnDraw ( CXyDC * pXyDC )
{
//if(m_bAddObj)
//{
// m_pItemSelected->OnDraw(pXyDC);
// return;
//}
CWellPoleView * pView = ( CWellPoleView * ) GetView ( ) ;
CWnd * pWnd = CWnd : : FromHandle ( GetView ( ) - > GetHWND ( ) ) ;
if ( ! m_bWellFrame )
{
DrawHandle ( pXyDC ) ;
DrawSelected ( pXyDC , pWnd ) ;
}
else
{
//DrawHandle(pXyDC);
//DrawSelected(pXyDC, GetView());
CXyDC xyDC ;
xyDC = * GetDC ( ) ;
pView - > BeginSelectBmpDC ( ) ;
xyDC . Create ( & pView - > GetSelectDC ( ) ) ;
DrawHandle ( & xyDC ) ;
DrawSelected ( & xyDC , pWnd ) ;
pView - > EndItemSelectBmpDC ( ) ; // pView->GetMemDC());
pView - > m_pDoc - > Invalidate ( ) ;
}
}
void CItemSingleWell : : OnDraw ( CXyDC * pXyDC , CDC * pDC )
{
//if(m_bAddObj)
//{
// m_pItemSelected->OnDraw(pXyDC);
// return;
//}
CWellPoleView * pView = ( CWellPoleView * ) GetView ( ) ;
CWnd * pWnd = CWnd : : FromHandle ( GetView ( ) - > GetHWND ( ) ) ;
if ( ! m_bWellFrame )
{
DrawHandle ( pXyDC ) ;
DrawSelected ( pXyDC , pWnd ) ;
}
else
{
//DrawHandle(pXyDC);
//DrawSelected(pXyDC, GetView());
CXyDC xyDC ;
xyDC = * GetDC ( ) ;
pView - > BeginSelectBmpDC ( ) ;
xyDC . Create ( & pView - > GetSelectDC ( ) ) ;
DrawHandle ( & xyDC ) ;
DrawSelected ( & xyDC , pWnd ) ;
pView - > EndItemSelectBmpDC ( ) ; // pView->GetMemDC());
pView - > m_pDoc - > Invalidate ( ) ;
}
}
void CItemSingleWell : : DrawMoveSelected ( CXyDC * pXyDC , CWnd * pWnd )
{
CSigmaView * pView = GetView ( ) ;
CDC * pDC = pView - > m_pImgDC ;
if ( this - > m_bLDown & & pView - > GetScreenDC ( ) ! = NULL )
{
pDC = pView - > GetScreenDC ( ) ; // pXyDC->GetDC();
//TRACE("use screendc --------------\r\n");
}
//else
//{
// TRACE("use imgDC --- --------------\r\n");
//}
CPen pen ( PS_DOT , 0 , RGB ( 0 , 0 , 0 ) ) ;
CPen * pOldPen = ( CPen * ) pDC - > SelectObject ( & pen ) ;
int old = pDC - > SetROP2 ( R2_NOTXORPEN ) ;
CWellPoleDoc * pDoc = ( CWellPoleDoc * ) GetDoc ( ) ;
CWellPole * pWell = GetWellObject ( ) ;
BOOL bInclineWell = FALSE ;
if ( m_pWell - > GetWellType ( ) = = Well_Incline )
bInclineWell = TRUE ;
if ( m_bDrag & & m_lastPoint ! = m_downPoint ) //<2F> <> <EFBFBD> <EFBFBD> ק<EFBFBD> <D7A7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 塢<EFBFBD> <E5A1A2> <EFBFBD> Ƶ㣩
{
CPoint pt1 , pt2 ;
if ( selectMode = = CItemNestBase : : border ) //<2F> ϵ<EFBFBD> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD>
{
if ( pWell - > GetWellType ( ) = = Well_Incline )
{
CPoint2D tpt1 , tpt2 , vpt , lastpt , fpt , tpt3 , tpt4 ;
if ( nDragHandle = = 6 )
{ //<2F> <> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
tpt1 . x0 = pWell - > GetWellHeadCurve ( ) . x [ 3 ] ; tpt1 . y0 = pWell - > GetWellHeadCurve ( ) . y [ 3 ] ;
tpt2 . x0 = pWell - > GetWellHeadCurve ( ) . x [ 2 ] ; tpt2 . y0 = pWell - > GetWellHeadCurve ( ) . y [ 2 ] ;
}
else if ( nDragHandle = = 2 )
{ //<2F> <> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
tpt1 . x0 = pWell - > GetWellHeadCurve ( ) . x [ 0 ] ; tpt1 . y0 = pWell - > GetWellHeadCurve ( ) . y [ 0 ] ;
tpt2 . x0 = pWell - > GetWellHeadCurve ( ) . x [ 1 ] ; tpt2 . y0 = pWell - > GetWellHeadCurve ( ) . y [ 1 ] ;
}
if ( nDragHandle = = 2 | | nDragHandle = = 6 )
{
lastpt = pXyDC - > GetReal ( m_lastPoint ) ;
fpt . x0 = lastpt . x0 - ( tpt2 . x0 - tpt1 . x0 ) ; fpt . y0 = lastpt . y0 - ( tpt2 . y0 - tpt1 . y0 ) ; // fpt,lastpt<70> ൱<EFBFBD> <E0B5B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> tpt1,tpt2ͬ<32> <CDAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> <> <EFBFBD> Կ<EFBFBD> <D4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (tpt1,tpt2)ƫ<> Ƶ<EFBFBD> <C6B5> <EFBFBD> (fpt,lastPt)λ<> <CEBB> )
vpt = nsWellPoleFunc : : GetVPt_Line ( tpt1 . x0 , tpt1 . y0 , tpt2 . x0 , tpt2 . y0 , lastpt . x0 , lastpt . y0 ) ; //vpt=<3D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> tpt1,tpt2<74> ϵ<EFBFBD> ͶӰ
double xx = ( tpt2 . x0 - vpt . x0 ) ;
double yy = ( tpt2 . y0 - vpt . y0 ) ;
tpt3 . x0 = fpt . x0 + xx ; tpt3 . y0 = fpt . y0 + yy ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (fpt,lastpt)ƫ<> <C6AB> xx,yy<79> <79> <EFBFBD> ͵õ<CDB5> (tpt1,tpt2)<29> ڹ<EFBFBD> <DAB9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> lastPt<50> <74> ƽ <EFBFBD> <C6BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> ͶӰ
tpt4 . x0 = lastpt . x0 + xx ; tpt4 . y0 = lastpt . y0 + yy ;
pt1 = pXyDC - > GetScreen ( tpt3 ) ; pt2 = pXyDC - > GetScreen ( tpt4 ) ;
pDC - > MoveTo ( pt1 ) ; pDC - > LineTo ( pt2 ) ;
}
}
else
{
if ( nDragHandle = = 6 ) //<2F> ϵ<EFBFBD> ͷ
{
pt1 . x = pXyDC - > GetScreen ( pWell - > GetPos ( ) . TopLeft ( ) ) . x ;
pt2 . x = pXyDC - > GetScreen ( pWell - > GetPos ( ) . BottomRight ( ) ) . x ;
pt1 . y = pt2 . y = m_lastPoint . y ;
pDC - > MoveTo ( pt1 ) ; pDC - > LineTo ( pt2 ) ;
}
else if ( nDragHandle = = 2 ) //<2F> <> ק<EFBFBD> <D7A7> ͷ
{
pt1 . x = pXyDC - > GetScreen ( pWell - > GetPos ( ) . TopLeft ( ) ) . x ;
pt2 . x = pXyDC - > GetScreen ( pWell - > GetPos ( ) . BottomRight ( ) ) . x ;
pt1 . y = pt2 . y = m_lastPoint . y ;
pDC - > MoveTo ( pt1 ) ; pDC - > LineTo ( pt2 ) ;
}
}
}
else
{
if ( m_WellObjSelectlist . GetCount ( ) = = 0 ) //<2F> <> ѡ <EFBFBD> <D1A1> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD> <F3A3ACBB> <EFBFBD> ѡ <EFBFBD> <D1A1> ״̬
{
if ( selectMode = = CItemNestBase : : move ) //<2F> <> <EFBFBD> <EFBFBD>
{
CRect position = pXyDC - > GetScreen ( pWell - > GetRect ( ) ) ;
position . NormalizeRect ( ) ;
CRect rect = position ;
CPoint delta = CPoint ( m_lastPoint . x - m_downPoint . x , m_lastPoint . y - m_downPoint . y ) ;
rect . OffsetRect ( delta . x , delta . y ) ;
pDC - > Rectangle ( rect ) ;
}
else if ( nDragHandle ! = 0 ) //<2F> <> <EFBFBD> Ƶ<EFBFBD>
{
CRect rect = pXyDC - > GetScreen ( pWell - > GetRect ( ) ) ;
MoveHandle ( nDragHandle , m_lastPoint , rect ) ;
pDC - > Rectangle ( rect ) ;
}
}
else
{
CWellBaseObj * pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
BOOL bNoInclineObj = TRUE ;
CWellBaseObj * pParentObj = pObjSelected - > GetParent ( ) ;
//if(pParentObj && bInclineWell)
//{//<2F> ж<EFBFBD> <D0B6> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD> ,
// if(pParentObj->GetType() == KEP_TRACK)
// bNoInclineObj = FALSE; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD> <EFBFBD> <EFBFBD> ڶ<EFBFBD> <DAB6> <EFBFBD> ,<2C> Ͳ<EFBFBD> <CDB2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶ<EFBFBD> ״̬
//}
//if(bNoInclineObj)
//{
if ( selectMode = = CItemNestBase : : move ) //<2F> <> <EFBFBD> <EFBFBD>
{
if ( pWell - > GetWellType ( ) = = Well_Incline )
{
if ( pObjSelected - > IsTrackChildTopEnd ( ) )
{
CInTrackDepthSegment * pInTrackSeg = ( CInTrackDepthSegment * ) pObjSelected ;
CInclinedTrack * pInclinedTrack = ( CInclinedTrack * ) pObjSelected - > GetParent ( ) ;
CPoint2D realDownPt = pXyDC - > GetReal ( m_downPoint ) ;
CPoint2D realLastPt = pXyDC - > GetReal ( m_lastPoint ) ;
double sDepth = pInclinedTrack - > GetDepthInWellTrace ( realDownPt ) ;
double nDepth = pInclinedTrack - > GetDepthInWellTrace ( realLastPt ) ;
double offDepth = nDepth - sDepth ;
double startDepth = pInTrackSeg - > m_fSdep + offDepth ;
double endDepth = pInTrackSeg - > m_fEdep + offDepth ;
if ( startDepth < pWell - > m_dSdep | | endDepth > pWell - > m_dEdep )
{
}
else
{
CPoint2D lpt , rpt ;
CPoint lcpt , rcpt ;
pInclinedTrack - > GetBorderPoint ( startDepth , lpt , rpt ) ;
lcpt = GetDC ( ) - > GetScreen ( lpt ) ;
rcpt = GetDC ( ) - > GetScreen ( rpt ) ;
pDC - > MoveTo ( lcpt . x , lcpt . y ) ;
pDC - > LineTo ( rcpt . x , rcpt . y ) ;
pInclinedTrack - > GetBorderPoint ( endDepth , lpt , rpt ) ;
lcpt = GetDC ( ) - > GetScreen ( lpt ) ;
rcpt = GetDC ( ) - > GetScreen ( rpt ) ;
pDC - > MoveTo ( lcpt . x , lcpt . y ) ;
pDC - > LineTo ( rcpt . x , rcpt . y ) ;
}
}
}
else
{
if ( pObjSelected - > GetType ( ) ! = KEP_TRACK /*&& */
/* pObjSelected->GetType()!=GDOUBLEFOX_LOGCURVESEGMENT
& & pObjSelected - > GetType ( ) ! = GDOUBLEFOX_DISCRETESEGMENT */ )
{
CWellPole * pWell = GetWellObject ( ) ;
POSITION pos = m_WellObjSelectlist . GetHeadPosition ( ) ;
while ( pos ! = NULL )
{
CWellBaseObj * pObj = m_WellObjSelectlist . GetNext ( pos ) ;
CRect position = pXyDC - > GetScreen ( pObj - > GetSelectedRange ( ) ) ;
position . NormalizeRect ( ) ;
CRect rect = position ;
CPoint delta = CPoint ( 0 , m_lastPoint . y - m_downPoint . y ) ;
rect . OffsetRect ( delta . x , delta . y ) ;
if ( pObj - > GetType ( ) = = KEP_STANDARD | | //<2F> <> <EFBFBD> <D7BC> <EFBFBD> <EFBFBD> <EFBFBD> ڶ<EFBFBD> <DAB6> <EFBFBD> <EFBFBD> <EFBFBD> ק<EFBFBD> <D7A7>
pObj - > GetType ( ) = = KEP_FAULTPOINT /*||//<2F> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> ڶ<EFBFBD> <DAB6> <EFBFBD> <EFBFBD> <EFBFBD> ק<EFBFBD> <D7A7>
pObj - > GetType ( ) = = GDOUBLEFOX_COREWELL */ ) //<2F> <> <EFBFBD> <EFBFBD> ȡо <C8A1> <D0BE> <EFBFBD> ڶ<EFBFBD> <DAB6> <EFBFBD> <EFBFBD> <EFBFBD> ק<EFBFBD> <D7A7>
{
pDC - > MoveTo ( rect . TopLeft ( ) ) ;
pDC - > LineTo ( rect . BottomRight ( ) ) ;
}
else
{
pDC - > Rectangle ( rect ) ;
}
}
}
}
}
else if ( nDragHandle ! = 0 ) //<2F> <> <EFBFBD> Ƶ<EFBFBD>
{
if ( pObjSelected - > GetType ( ) = = KEP_TRACK ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
CTrackObj * pTrackObj = ( CTrackObj * ) pObjSelected ;
if ( nDragHandle = = 4 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ק
{
if ( pWell - > GetWellType ( ) = = Well_Incline )
{
double h = pWell - > GetTrackHeadHigh ( ) ;
CPoint2D tpt1 , tpt2 ; //tpt1,tpt2<74> ǵ<EFBFBD> ͷ<EFBFBD> ײ<EFBFBD> <D7B2> ĺ<EFBFBD> <C4BA> ߶<EFBFBD>
tpt1 . x0 = pWell - > GetWellHeadCurve ( ) . x [ 2 ] ; tpt1 . y0 = pWell - > GetWellHeadCurve ( ) . y [ 2 ] ;
tpt2 . x0 = pWell - > GetWellHeadCurve ( ) . x [ 3 ] ; tpt2 . y0 = pWell - > GetWellHeadCurve ( ) . y [ 3 ] ;
if ( abs ( tpt1 . x0 - tpt2 . x0 ) > 0.0001 & & abs ( tpt1 . y0 - tpt2 . y0 ) > 0.0001 )
{
CPoint2D tpt3 , tpt4 , lastpt ;
lastpt = pXyDC - > GetReal ( m_lastPoint ) ;
tpt3 = nsWellPoleFunc : : GetVPt_Line ( tpt1 . x0 , tpt1 . y0 , tpt2 . x0 , tpt2 . y0 , lastpt . x0 , lastpt . y0 ) ; //tpt3<74> <33> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǵ<EFBFBD> ͷ<EFBFBD> ײ<EFBFBD> <D7B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ཻ<EFBFBD> ĵ<EFBFBD>
//tpt4 = GetPtAlongVector(tpt3.x0,tpt3.y0,lastpt.x0,lastpt.y0,h,1);//tpt3,tpt4<74> <34> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͷ<EFBFBD> ײ<EFBFBD> <D7B2> <EFBFBD> <EFBFBD> ߴ <EFBFBD> ֱ<EFBFBD> <D6B1>
tpt4 = nsWellPoleFunc : : GetPtV_Vector ( tpt3 . x0 , tpt3 . y0 , tpt1 . x0 , tpt1 . y0 , tpt2 . x0 , tpt2 . y0 , h , 1 ) ;
pt1 = pXyDC - > GetScreen ( tpt3 ) ;
pt2 = pXyDC - > GetScreen ( tpt4 ) ;
pDC - > MoveTo ( pt1 ) ; pDC - > LineTo ( pt2 ) ;
}
}
else
{
CRect8 headrect = pWell - > m_HeadRect ;
pt1 . y = pXyDC - > GetScreen ( headrect ) . bottom ;
pt2 . y = pXyDC - > GetScreen ( pWell - > GetPos ( ) ) . bottom ;
pt1 . x = pt2 . x = m_lastPoint . x ;
pDC - > MoveTo ( pt1 ) ; pDC - > LineTo ( pt2 ) ;
}
}
}
else if ( pObjSelected - > GetType ( ) = = KEP_STANDARD | |
pObjSelected - > GetType ( ) = = KEP_FAULTPOINT | |
pObjSelected - > GetType ( ) = = KEP_COREWELL )
{
//if(GetView()->GetCapture() == pWnd)
{
CRect rect = pXyDC - > GetScreen ( pObjSelected - > GetRect ( ) ) ;
pDC - > MoveTo ( CPoint ( rect . left , m_lastPoint . y ) ) ;
pDC - > LineTo ( CPoint ( rect . right , m_lastPoint . y ) ) ;
}
}
else
{
if ( pWell - > GetWellType ( ) = = Well_Incline )
{ //б <> <D0B1> <EFBFBD> ϶<EFBFBD> <CFB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڶ<EFBFBD> <DAB6> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> Ƶ<EFBFBD>
CInclinedTrack * pIncliendTrack = ( CInclinedTrack * ) pObjSelected - > GetParent ( ) ;
CPoint2D lastPt = GetDC ( ) - > GetReal ( m_lastPoint . x , m_lastPoint . y ) ;
CPoint2D lpt , rpt ;
double depth = pIncliendTrack - > GetDepthInWellTrace ( lastPt ) ;
pIncliendTrack - > GetBorderPoint ( depth , lpt , rpt ) ;
CPoint lcpt , rcpt ;
lcpt = GetDC ( ) - > GetScreen ( lpt ) ;
rcpt = GetDC ( ) - > GetScreen ( rpt ) ;
pDC - > MoveTo ( lcpt . x , lcpt . y ) ;
pDC - > LineTo ( rcpt . x , rcpt . y ) ;
}
else
{
CRect rect = pXyDC - > GetScreen ( pObjSelected - > GetRect ( ) ) ;
if ( nDragHandle = = 2 )
{
if ( m_lastPoint . y > rect . bottom )
{
m_lastPoint . y = rect . bottom ;
}
}
else if ( nDragHandle = = 6 )
{
if ( m_lastPoint . y < rect . top )
{
m_lastPoint . y = rect . top ;
}
}
MoveHandle ( nDragHandle , m_lastPoint , rect ) ;
pDC - > Rectangle ( rect ) ;
}
}
}
//}
}
}
}
if ( ! m_bDrag | | m_firstPoint = = m_downPoint )
{
CPoint2D point ;
//<2F> <> ѡ <EFBFBD> <D1A1> ״̬
if ( m_WellObjSelectlist . GetCount ( ) = = 0 ) //<2F> <> ѡ <EFBFBD> <D1A1> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD> <F3A3ACBB> <EFBFBD> ѡ <EFBFBD> <D1A1> ״̬
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ƶ<EFBFBD>
point = pWell - > GetHandle ( 4 ) ;
DrawHandle ( pXyDC , point ) ;
point = pWell - > GetHandle ( 8 ) ;
DrawHandle ( pXyDC , point ) ;
}
else
{
POSITION pos = m_WellObjSelectlist . GetHeadPosition ( ) ;
CBrush brush ; brush . CreateSolidBrush ( RGB ( 95 , 63 , 0 ) ) ;
CPen penLine ( PS_DOT , 0 , RGB ( 255 , 0 , 0 ) ) ;
CPen * pOldPenLine = NULL ;
CRect rect , oldrect ;
CWellBaseObj * pObj = NULL ;
while ( pos ! = NULL )
{
pObj = m_WellObjSelectlist . GetNext ( pos ) ;
rect = pXyDC - > GetScreen ( pObj - > GetRect ( ) ) ;
oldrect = CRect ( 0 , 0 , 0 , 0 ) ;
if ( pObj - > GetType ( ) = = KEP_TRACK )
{
CTrackObj * pTrack = ( CTrackObj * ) pObj ;
rect = pXyDC - > GetScreen ( pTrack - > m_HeadRect ) ;
//TRACE(" draw tarck select ");
if ( bInclineWell )
{
//pTrack->DrawSelectRange(pXyDC);
std : : vector < CPoint2D > PtsVec ;
pTrack - > GetSelectRange ( PtsVec ) ;
DrawSelectPolyRange ( pXyDC , PtsVec ) ;
continue ;
}
}
else
{ //<2F> <> ѡ <EFBFBD> п<EFBFBD>
if ( pObj - > GetViewState ( ) = = UNVIEW_STATE )
continue ;
TRACE ( " draw in obj select \r \n " ) ;
CWellBaseObj * pParentObj = pObj - > GetParent ( ) ;
if ( pParentObj & & bInclineWell )
{ //<2F> ж<EFBFBD> <D0B6> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD> ,<2C> <> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> ѡ <EFBFBD> <D1A1> ״̬
if ( pParentObj - > GetType ( ) = = KEP_TRACK )
{
CWellBaseObj * pDrawObj = pObj ;
if ( pDrawObj - > IsTrackChildTopEnd ( ) )
{
CInTrackDepthSegment * pTopEndObj = ( CInTrackDepthSegment * ) pDrawObj ;
std : : vector < CPoint2D > PtsVec ;
pTopEndObj - > GetSelectRange ( PtsVec ) ;
DrawSelectPolyRange ( pXyDC , PtsVec ) ;
continue ;
}
}
}
rect = pXyDC - > GetScreen ( pObj - > GetSelectedRange ( ) ) ;
pOldPenLine = ( CPen * ) pDC - > SelectObject ( & penLine ) ;
pDC - > Rectangle ( rect ) ;
pDC - > SelectObject ( pOldPenLine ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ƶ<EFBFBD>
if ( pObj - > GetType ( ) ! = KEP_COREWELL ) //ȡо <C8A1> <D0BE> <EFBFBD> ݲ<EFBFBD> <DDB2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶ<EFBFBD>
{
point = pObj - > GetHandle ( 2 ) ;
DrawHandle ( pXyDC , point ) ;
if ( pObj - > GetType ( ) ! = KEP_STANDARD & &
pObj - > GetType ( ) ! = KEP_FAULTPOINT /*&&*/
/*pObj->GetType()!=GDOUBLEFOX_COREWELL*/ )
{
point = pObj - > GetHandle ( 6 ) ;
DrawHandle ( pXyDC , point ) ;
}
//if(pObj->GetType() == GDOUBLEFOX_LOGCURVESEGMENT ||
//pObj->GetType() == GDOUBLEFOX_DISCRETESEGMENT)
//{
// //д<> <D0B4> <EFBFBD> <EFBFBD>
// CFont font;
// font.CreateFontIndirect(&m_logFont);
// CFont* oldFont=pDC->SelectObject(&font);
// CTrackCurveObjBase* pTrack = (CTrackCurveObjBase*)pObj->GetParentObj();
// pDC->TextOut(rect.left, rect.top, pTrack->m_strTrackName);
// pDC->SelectObject(oldFont);
//}
}
}
//ѡ <> <D1A1> <EFBFBD> <EFBFBD> Χ <EFBFBD> <CEA7> ɫ
rect = GetNegativeRect ( & rect ) ;
rect . left = max ( 0L , rect . left ) ;
rect . right = max ( 0L , rect . right ) ;
rect . top = max ( 0L , rect . top ) ;
rect . bottom = max ( 0L , rect . bottom ) ;
rect . InflateRect ( 1 , 1 ) ;
pDC - > DrawDragRect ( & rect , CSize ( 1 , 1 ) , & oldrect , CSize ( 1 , 1 ) , & brush ) ;
}
}
}
pDC - > SelectObject ( pOldPen ) ;
pen . DeleteObject ( ) ;
pDC - > SetROP2 ( old ) ;
}
void CItemSingleWell : : DrawSelected ( CXyDC * pXyDC , CWnd * pWnd )
{
DrawMoveSelected ( pXyDC , pWnd ) ;
}
//BOOL CItemSingleWell::InitPropertyGrid(CXTPPropertyGrid& grid)
//{
// if (!this->IsEditState())
// return FALSE;
// if(grid.GetSafeHwnd() == NULL)
// return FALSE;
// grid.ResetContent();
// CWellBaseObj* pObjSelected = NULL;
// if(m_WellObjSelectlist.GetCount() == 1)
// pObjSelected = m_WellObjSelectlist.GetHead();
// else if(m_WellObjSelectlist.GetCount() > 1)
// return FALSE;
// if (pObjSelected != NULL)
// {
// if(m_pItemSelected != NULL)
// {
// if(((CItemWellBase*)m_pItemSelected)->GetDrawObj()==pObjSelected && !m_bEditTrackInData)
// return m_pItemSelected->InitPropertyGrid(grid);
// else
// {
// delete m_pItemSelected;
// m_pItemSelected = NULL;
// }
// }
// }
// CWellPole *pWell = GetWellObject();
// if(m_pItemSelected != NULL)
// delete m_pItemSelected;
// m_pItemSelected = NULL;
// CPropertyGridItemAdd ItemAdd(NULL);
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// CXTPPropertyGridItem *pItem= grid.AddCategory(IDS_STR_WELL_BASICPROPERTY);
// ItemAdd.SetItem(pItem);
// ItemAdd.AddItemString(IDS_STR_WELL_TITLE, pWell->m_strTitle);//<2F> <> <EFBFBD> <EFBFBD>
// ItemAdd.AddItemString(IDS_STR_WELL_NAME, pWell->GetWellName());//<2F> <> <EFBFBD> <EFBFBD>
// //<2F> <> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
// CString Level;
// Level.Format("%.3f", pWell->m_fLevel);
// ItemAdd.AddItemString(IDS_STR_WELL_LEVEL, Level);
// //<2F> <> <EFBFBD> ȱ<EFBFBD> <C8B1> <EFBFBD>
// CXTPPropertyGridItem* ComboxEditSc;
// double startvalue;
// startvalue = pWell->m_fProportion;
// ComboxEditSc =pItem->AddChildItem(new CXTPPropertyGridItemDouble(IDS_STR_WELL_DEPTHSCALER,startvalue));
// ComboxEditSc->GetConstraints()->AddConstraint("100");
// ComboxEditSc->GetConstraints()->AddConstraint("200");
// ComboxEditSc->GetConstraints()->AddConstraint("500");
// ComboxEditSc->GetConstraints()->AddConstraint("800");
// ComboxEditSc->GetConstraints()->AddConstraint("1000");
// ComboxEditSc->GetConstraints()->AddConstraint("1500");
// ComboxEditSc->GetConstraints()->AddConstraint("2000");
// ComboxEditSc->GetConstraints()->AddConstraint("3000");
// ComboxEditSc->GetConstraints()->AddConstraint("5000");
// ComboxEditSc->GetConstraints()->AddConstraint("8000");
// ComboxEditSc->GetConstraints()->AddConstraint("10000");
// ComboxEditSc->GetConstraints()->AddConstraint("50000");
// ComboxEditSc->GetConstraints()->AddConstraint("80000");
// ComboxEditSc->GetConstraints()->AddConstraint("100000");
// ComboxEditSc->SetFlags(xtpGridItemHasComboButton | xtpGridItemHasEdit);
// //CWellSection* pWellSection = (CWellSection*)pWell->GetParentObj();
// //if(pWell->GetWellType() == Well_Incline && pWellSection == NULL)
// //{//ˮƽ <CBAE> <C6BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> (<28> ྮ<EFBFBD> <E0BEAE> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> ,ֱ<> <D6B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˮƽ <CBAE> <C6BD> <EFBFBD> <EFBFBD> )
// // CInclinedWellObj *pIncWell = (CInclinedWellObj *)pWell;
// // startvalue = pIncWell->m_level_proportion;
// // ComboxEditSc =pItem->AddChildItem(new CXTPPropertyGridItemDouble(IDS_HORIZONTAL_SCALE,startvalue));
// // ComboxEditSc->GetConstraints()->AddConstraint("100");
// // ComboxEditSc->GetConstraints()->AddConstraint("200");
// // ComboxEditSc->GetConstraints()->AddConstraint("500");
// // ComboxEditSc->GetConstraints()->AddConstraint("800");
// // ComboxEditSc->GetConstraints()->AddConstraint("1000");
// // ComboxEditSc->GetConstraints()->AddConstraint("1500");
// // ComboxEditSc->GetConstraints()->AddConstraint("2000");
// // ComboxEditSc->GetConstraints()->AddConstraint("3000");
// // ComboxEditSc->GetConstraints()->AddConstraint("5000");
// // ComboxEditSc->GetConstraints()->AddConstraint("8000");
// // ComboxEditSc->GetConstraints()->AddConstraint("10000");
// // ComboxEditSc->GetConstraints()->AddConstraint("50000");
// // ComboxEditSc->GetConstraints()->AddConstraint("80000");
// // ComboxEditSc->GetConstraints()->AddConstraint("100000");
// // ComboxEditSc->SetFlags(xtpGridItemHasComboButton | xtpGridItemHasEdit);
// //}
// ////<2F> <> ʼ <EFBFBD> <CABC> <EFBFBD> <EFBFBD>
// //if(pWell->GetWellType() == Well_Incline)
// {
// CString Sdep;
// Sdep.Format("%.3f", pWell->m_dSdep);
// ItemAdd.AddItemString(IDS_STR_WELL_TOPDEPTH, Sdep);
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// CString Edep;
// Edep.Format("%.3f", pWell->m_dEdep);
// ItemAdd.AddItemString(IDS_STR_WELL_ENDDEPTH, Edep);
// }
// //<2F> <> <EFBFBD> ҿհ <D5B0> <D7BC> <EFBFBD>
// CString MarginLR;
// MarginLR.Format("%.3f", pWell->m_fMarginLR);
// ItemAdd.AddItemString(IDS_STR_WELL_MARGINLR, MarginLR);
// //<2F> <> <EFBFBD> ¿հ <D5B0> <D7BC> <EFBFBD>
// CString MarginTB;
// MarginTB.Format("%.3f", pWell->m_fMarginTB);
// ItemAdd.AddItemString(IDS_STR_WELL_MARGINTB, MarginTB);
// pItem->Expand();
// //if(pWell->GetWellType() != Well_Incline)
// //{
// // CXTPPropertyGridItem *pParentGridItem = grid.AddCategory(IDS_STR_WELL_INTERVAL_INFO);
// //
// // AddWellIntervals(pParentGridItem);
// // pParentGridItem->Expand();
// //}
// if(pWell->GetWellType() == Well_Incline)
// {
// CString str;
// CInclinedWellPole *pInclineWell = (CInclinedWellPole *)pWell;
// str.Format("%.3f", pInclineWell->GetProjectionAngle());
// ItemAdd.AddItemString(IDS_STR_WELL_PROJECTANGLE, str);
// }
// //<2F> ̶ȼ<CCB6> <C8BC> <EFBFBD>
// pItem=grid.AddCategory(IDS_STR_WELL_SPACE_SET);
// ItemAdd.SetItem(pItem);
// //<2F> <> <EFBFBD> ̶ȼ<CCB6> <C8BC> <EFBFBD>
// CString MajorSpace;
// MajorSpace.Format("%.3f", pWell->m_fMajorSpace);
// ItemAdd.AddItemString(IDS_STR_WELL_MAJORSPACE,MajorSpace);
// //<2F> <> <EFBFBD> ̶ȼ<CCB6> <C8BC> <EFBFBD>
// CString MinorSpace;
// MinorSpace.Format("%.3f", pWell->m_fMinorSpace);
// ItemAdd.AddItemString(IDS_STR_WELL_MINORSPACE, MinorSpace);
// pItem->Expand();
// //<2F> <> <EFBFBD> <EFBFBD>
// pItem=grid.AddCategory(IDS_STR_FONT);
// ItemAdd.SetItem(pItem);
// ItemAdd.AddItemFont(IDS_STR_WELL_FONT, pWell->m_font.m_logFont, pWell->m_font.m_color);
// ItemAdd.AddItemFont(IDS_STR_WELL_FONTTRACK, pWell->m_fontTrack.m_logFont,pWell->m_fontTrack.m_color);
// ItemAdd.AddItemFont(IDS_STR_WELL_FONTHEADMARK, pWell->m_fontHeadMark.m_logFont, pWell->m_fontHeadMark.m_color);
// ItemAdd.AddItemFont(IDS_STR_WELL_FONTGRIDMARK, pWell->m_fontGridMark.m_logFont , pWell->m_fontGridMark.m_color);
// pItem->Expand();
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// pItem= grid.AddCategory(IDS_STR_WELL_LINEPROPERTY);
// ItemAdd.SetItem(pItem);
// ItemAdd.AddItemLine1(IDS_STR_WELL_LINE, pWell->m_pen, &pWell->m_pen , LineType_Frame);
// ItemAdd.AddItemLine1(IDS_STR_WELL_LINETRACK, pWell->m_penTrack, &pWell->m_penTrack , LineType_Curve);
// ItemAdd.AddItemLine1(IDS_STR_WELL_LINEMAJORGRID, pWell->m_penGridMajor, &pWell->m_penGridMajor, LineType_Curve);
// ItemAdd.AddItemLine1(IDS_STR_WELL_LINEMINORGRID, pWell->m_penGridMinor, &pWell->m_penGridMinor, LineType_Curve);
// pItem->Expand();
// //CItem::InitPropertyGrid(grid);
// return TRUE;
//}
//
//void CItemSingleWell::OnInplaceButtonDown(CXTPPropertyGridItem* pItem)
//{
// //if(pItem == NULL)
// // return;
// //if(pItem->GetID() == IDS_STR_WELLDEPTHSETUP && m_pWell != NULL)
// //{
// // CDialogWellIntervalSetup dlg;
// // for(int ii = 0; ii< m_pWell->GetIntervalVec()->size(); ii++)
// // {
// // dlg.m_wellTopVec.push_back(m_pWell->GetIntervalTop(ii));
// // dlg.m_wellBottomVec.push_back(m_pWell->GetIntervalBottom(ii));
// // }
// // if(dlg.DoModal() == IDOK)
// // {
// // if(dlg.m_wellTopVec.size()>0)
// // {
// // m_pWell->GetIntervalVec()->clear();
// // for(int ii =0 ;ii< dlg.m_wellTopVec.size(); ii++)
// // {
// // m_pWell->AddWellInterval(dlg.m_wellTopVec[ii],dlg.m_wellBottomVec[ii]);
// // }
// // m_pWell->m_fSdep = m_pWell->GetIntervalTop(0);
// // m_pWell->m_fEdep = m_pWell->GetIntervalBottom(m_pWell->GetIntervalVec()->size()-1);
// // m_pWell->SetIntervalSpaceDis(0,0);
// // m_pWell->ComputeSize(m_pWell->GetAnchorPoint());
// // m_pWell->ReadCurveData();
// // m_pWell->ResetChildPosition();
// // CXTPPropertyGrid &grid = GetPropertyGrid(GetDoc()->GetActiveFrame()->GetMapCtrl());
// // CXTPPropertyGridItems *pItems = grid.GetCategories();
// // CXTPPropertyGridItem *pItem1;
// // int cateNum = pItems->GetCount();
// // int id ;
// // for(int ii = 0; ii< cateNum; ii++)
// // {
// // pItem1 = pItems->GetAt(ii);
// // id = pItem1->GetID();
// // if(id == IDS_STR_WELL_INTERVAL_INFO)
// // {
// // pItem1->GetChilds()->Clear();
// // AddWellIntervals(pItem1);
// // break;
// // }
// // }
// // <09> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// // SetScrollBarRange();
// // GetDoc()->Invalidate();
// // }
// // }
// //}
//}
//
//void CItemSingleWell::SetScrollBarRange()
//{
// //CMapFrame2D& mapFrame2D = GetWnd()->GetMapFrame()->GetMapFrame2D();
// //for(int i=mapFrame2D.m_SplitterWnd.GetCount()-1; i>-1; i--)
// //{
// // mapFrame2D.m_SplitterWnd[i].pMapWnd2D->SetScrollBarRange();
// //}
//}
//BOOL CItemSingleWell::OnGridItemChangeValue(CXTPPropertyGridItem* pItem)
//{
// if(m_pItemSelected != NULL)
// return m_pItemSelected->OnGridItemChangeValue(pItem);
// if(!IsEditState())
// return FALSE;
// CWellPole *pWell = GetWellObject();
// CRect oldrect = GetDC()->GetScreen(pWell->GetRect());
// CWellPoleDoc* pWellDoc = (CWellPoleDoc*)GetDoc();
// double dOldSdep = pWell->m_dSdep;
// double dProp = pWell->m_fProportion;
// double dOldProp = pWell->m_fProportion;
// double dDelDepth = 0;
// switch (pItem->GetID())
// {
// case IDS_STR_WELL_NAME://<2F> <> <EFBFBD> <EFBFBD>
// {
// pWell->SetWellName(pItem->GetValue());
// pWell->SetTitle(pWell->GetWellName());
// CXTPPropertyGridItem *pItemFind=FindItem(pItem, IDS_STR_WELL_TITLE);
// pItemFind->SetValue(pWell->GetWellName());
// }
// break;
// case IDS_STR_WELL_TITLE://<2F> <> <EFBFBD> <EFBFBD>
// {
// pWell->SetTitle(pItem->GetValue());
// }
// break;
// case IDS_STR_WELL_FONT:// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// {
// ((CXTPPropertyGridItemFont*)pItem)->GetFont(&pWell->m_font.m_logFont);
// pWell->m_font.m_color = ((CXTPPropertyGridItemFont*)pItem)->GetColor();
//
// pWellDoc->NormalEXTLogFont(pWell->m_font);
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> õ<EFBFBD> <C3B5> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD> λ<EFBFBD> <CEBB>
// double dOldWellHead = pWell->m_dHeightWellHead;
// pWell->ReSetWellHead();
// double dNewWellHead = pWell->m_dHeightWellHead;
// if(fabs(dNewWellHead - dOldWellHead) > ZERO)
// {
// CPoint2D pt = pWell->GetAnchorPoint(); //pWell->GetPos().TopLeft();
// pt.y0 += (dNewWellHead-dOldWellHead);
// pWell->CalculateSize(pt);
// }
// }
// break;
// case IDS_STR_WELL_FONTTRACK:// <20> <> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD>
// {
// ((CXTPPropertyGridItemFont*)pItem)->GetFont(&pWell->m_fontTrack.m_logFont);
// pWell->m_fontTrack.m_color = ((CXTPPropertyGridItemFont*)pItem)->GetColor();
// pWellDoc->NormalEXTLogFont(pWell->m_fontTrack);
// pWell->SetFontTrack(pWell->m_fontTrack);
// }
// break;
// case IDS_STR_WELL_FONTHEADMARK:// <20> <> ͷ<EFBFBD> ̶<EFBFBD> <CCB6> <EFBFBD> <EFBFBD> <EFBFBD>
// {
// ((CXTPPropertyGridItemFont*)pItem)->GetFont(&pWell->m_fontHeadMark.m_logFont);
// pWell->m_fontHeadMark.m_color = ((CXTPPropertyGridItemFont*)pItem)->GetColor();
// pWellDoc->NormalEXTLogFont(pWell->m_fontHeadMark);
// //pWell->SetFontHeadMark(pWell->m_fontHeadMark);
// }
// break;
// case IDS_STR_WELL_FONTGRIDMARK:// <20> <> <EFBFBD> ȿ̶<C8BF> <CCB6> <EFBFBD> <EFBFBD> <EFBFBD>
// {
// ((CXTPPropertyGridItemFont*)pItem)->GetFont(&pWell->m_fontGridMark.m_logFont);
// pWell->m_fontGridMark.m_color = ((CXTPPropertyGridItemFont*)pItem)->GetColor();
// pWellDoc->NormalEXTLogFont(pWell->m_fontGridMark);
// pWell->SetFontGridMark(pWell->m_fontGridMark);
// }
// break;
// case IDS_STR_WELL_LINETRACK://<2F> <> <EFBFBD> <EFBFBD>
// {
// pWell->SetPenTrack(pWell->m_penTrack);
// }
// break;
// case IDS_STR_WELL_LINEMAJORGRID://<2F> <> <EFBFBD> ̸<EFBFBD> <CCB8> <EFBFBD>
// {
// pWell->SetPenGrid(pWell->m_penGridMajor, pWell->m_penGridMinor);
// }
// break;
// case IDS_STR_WELL_LINEMINORGRID://<2F> ο ̸<CEBF> <CCB8> <EFBFBD>
// {
// pWell->SetPenGrid(pWell->m_penGridMajor, pWell->m_penGridMinor);
// }
// break;
// case IDS_STR_WELL_MAJORSPACE:// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ȱ<EFBFBD> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD>
// {
// pWell->m_fMajorSpace=atof(pItem->GetValue());
// pWell->SetSpace(pWell->m_fMajorSpace, pWell->m_fMinorSpace);
// }
// break;
// case IDS_STR_WELL_MINORSPACE:// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ȱ<EFBFBD> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD>
// {
// pWell->m_fMinorSpace=atof(pItem->GetValue());
// pWell->SetSpace(pWell->m_fMajorSpace, pWell->m_fMinorSpace);
// }
// break;
// case IDS_STR_WELL_TOPDEPTH:// <20> <> ʼ <EFBFBD> <CABC> <EFBFBD> <EFBFBD>
// {
// double fSdep;
// fSdep = atof(pItem->GetValue());
// pWell->m_dSdep=fSdep;
// if (fSdep>pWell->m_dEdep)
// {
// pWell->m_dSdep = pWell->m_dEdep;
// }
// CWellPoleView* pWellView = (CWellPoleView*)GetView();
// if (pWellView->m_bLockWellHead)
// {
// pWellView->ReComputeLockWellHead();
// }
// else
// {
// pWell->SetIntervalTop(0, pWell->m_dSdep);
// pWell->ReadCurveData();
// pWell->CalculateSize(pWell->GetAnchorPoint());
// pWell->ResetChildPosition();
// CreateVHCursor(); //б <> <D0B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʼ <EFBFBD> <CABC> <EFBFBD> ȵ<EFBFBD> <C8B5> <EFBFBD> ,<2C> п<EFBFBD> <D0BF> <EFBFBD> Ӱ<EFBFBD> <D3B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 仯
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// SetScrollBarRange();
// }
// }
// break;
// case IDS_STR_WELL_ENDDEPTH:// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// {
// double fEdep;
// fEdep = atof(pItem->GetValue());
// pWell->m_dEdep=fEdep;
// if (fEdep<pWell->m_dSdep)
// {
// pWell->m_dEdep = pWell->m_dSdep;
// }
// CWellPoleView* pWellView = (CWellPoleView*)GetView();
// if (pWellView->m_bLockWellHead)
// {
// pWellView->ReComputeLockWellHead();
// }
// else
// {
// pWell->SetIntervalBottom(pWell->GetIntervalVec()->size() - 1, pWell->m_dEdep);
// pWell->ReadCurveData();
// pWell->CalculateSize(pWell->GetAnchorPoint());
// pWell->ResetChildPosition();
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// SetScrollBarRange();
// }
// }
// break;
// case IDS_STR_WELL_MARGINLR:// <20> <> <EFBFBD> ҿհ <D5B0> Χ
// {
// if (atof(pItem->GetValue())>=0)
// {
// pWell->m_fMarginLR=atof(pItem->GetValue());
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// SetScrollBarRange();
// }
// }
// break;
// case IDS_STR_WELL_MARGINTB:// <20> <> <EFBFBD> ¿հ <D5B0> Χ
// {
// if (atof(pItem->GetValue())>=0)
// {
// pWell->m_fMarginTB=atof(pItem->GetValue());
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// SetScrollBarRange();
// }
// }
// break;
// case IDS_STR_WELL_DEPTHSCALER:// <20> <> <EFBFBD> ȱ<EFBFBD> <C8B1> <EFBFBD>
// {
// pWell->m_fProportion=atof(pItem->GetValue());
// CWellPoleView* pWellView = (CWellPoleView*)GetView();
// if (pWellView->m_bLockWellHead)
// {
// pWellView->ReComputeLockWellHead();
// }
// else
// {
// pWell->CalculateSize(pWell->GetAnchorPoint());
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// SetScrollBarRange();
// }
// }
// break;
// case IDS_HORIZONTAL_SCALE:
// {
// pWell->m_level_proportion=atof(pItem->GetValue());
// pWell->CalculateSize(pWell->GetAnchorPoint()); //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// SetScrollBarRange();
// }
// break;
// case IDS_STR_WELL_PROJECTANGLE:
// {
// if(pWell->GetWellType() == Well_Incline)
// {
// CInclinedWellPole *pIncWell = (CInclinedWellPole*)pWell;
// pIncWell->SetProjectionAngle(atof(pItem->GetValue()));
// pIncWell->ComputeTrajectory();
// pIncWell->CalculateSize(pIncWell->GetAnchorPoint());
// //CRaconObj *pRaconObj = ((CMapWellDoc*)GetDoc())->GetWellRaconObj();
// //if(pRaconObj)
// // pRaconObj->m_prejectionang = pIncWell->GetProjectionAngle();
// }
// }
// break;
// default:
// break;
// }
// dProp = pWell->m_fProportion;
// dDelDepth = pWell->m_dSdep - dOldSdep;
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> õ<EFBFBD> <C3B5> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD> λ<EFBFBD> <CEBB>
// if(fabs(dOldProp-dProp) > ZERO || fabs(dDelDepth) > ZERO)
// {
// pWell->ResetChildPosition(dOldProp, dProp, dDelDepth);
// }
// GetDoc()->Invalidate();
// return TRUE;//CItem::OnGridItemChangeValue(pItem);
//}
bool CItemSingleWell : : AddTrack ( )
{
CWellPole * pWellPole = GetWellObject ( ) ;
return AddTrackDlg ( pWellPole , NULL ) ;
}
bool CItemSingleWell : : AddTrackDlg ( CWellPole * pWellObj , CTrackObj * pSelectTrack )
{
//CDlgAddTrack dlg;
//if (dlg.DoModal() != IDOK)
//{
// return false;
//}
//if (dlg.m_SelectTrackTypes.size() == 0)
// return false;
//TRACKLIST trackList;
//CTrackObj* pTrackObj = NULL;
//CString strTrack,str;
//strTrack.LoadString(IDS_STR_TRACK);
//for (int ii = 0; ii < dlg.m_SelectTrackTypes.size(); ii++)
//{
// pTrackObj = CTrackObj::CreateTrackObj(ETrackType(dlg.m_SelectTrackTypes[ii].type));
// str = dlg.m_SelectTrackTypes[ii].trackName;
// int pos = str.Find(strTrack);
// if (pos > 0)//ȥ<> <C8A5> <20> <> <EFBFBD> <EFBFBD> "
// str = str.Left(pos);
// pTrackObj->m_strTrackName = pTrackObj->m_strTitle = str;
// trackList.push_back(pTrackObj);
//}
//AddTrack(pSelectTrack, trackList);
return true ;
}
BOOL CItemSingleWell : : AddTrack ( CTrackObj * pSelectTrack , int trackType [ ] , int trackNum , TRACKLIST & newTracks )
{
TRACKLIST trackList ;
CTrackObj * pTrackObj = NULL ;
CString strTrack , str ;
strTrack = " <EFBFBD> <EFBFBD> " ;
for ( int ii = 0 ; ii < trackNum ; ii + + )
{
pTrackObj = CTrackObj : : CreateTrackObj ( ETrackType ( trackType [ ii ] ) ) ;
CWellObjExtendInfo objInfo ;
CWellObjExtendInfoMgr : : GetInstance ( ) - > GetTypeInfo ( trackType [ ii ] , objInfo ) ;
str = objInfo . m_cTypeStr ;
int pos = str . Find ( strTrack ) ;
if ( pos > 0 ) //ȥ<> <C8A5> <20> <> <EFBFBD> <EFBFBD> "
str = str . Left ( pos ) ;
pTrackObj - > m_strTrackName = pTrackObj - > m_strTitle = str ;
trackList . push_back ( pTrackObj ) ;
newTracks . push_back ( pTrackObj ) ;
}
AddTrack ( pSelectTrack , trackList ) ;
return TRUE ;
}
CTrackObj * CItemSingleWell : : GetSelectedTrack ( )
{
if ( m_WellObjSelectlist . GetCount ( ) = = 1 )
{
CWellBaseObj * pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
if ( pObjSelected - > GetType ( ) = = KEP_TRACK )
{
return ( CTrackObj * ) pObjSelected ;
}
}
return NULL ;
}
bool CItemSingleWell : : AddTrackAfterSelected ( )
{
CTrackObj * pTrackSelected = NULL ;
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) > 0 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
if ( pObjSelected - > GetType ( ) = = KEP_TRACK )
{
pTrackSelected = ( CTrackObj * ) pObjSelected ;
}
if ( NULL = = pTrackSelected )
{
return false ;
}
AddTrackDlg ( GetWellObject ( ) , pTrackSelected ) ;
return true ;
}
void CItemSingleWell : : AddTrack ( CTrackObj * pTrackSelected , TRACKLIST & trackAddList , BOOL bTrackGroup )
{ //<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1<EFBFBD> <31> <EFBFBD> <EFBFBD> ֱ<EFBFBD> Ӽӵ<D3BC> <D3B5> <EFBFBD> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2<EFBFBD> <32> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӣ<EFBFBD> <D3A3> ӵ<EFBFBD> <D3B5> ˾<EFBFBD> <CBBE> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> 棩
//<2F> <> 3<EFBFBD> <33> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> ϵ<EFBFBD> <CFB5> е <EFBFBD> <D0B5> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> ѡ <EFBFBD> е ľ<D0B5> <C4BE> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> 4<EFBFBD> <34> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵĵ<D3B5> <C4B5> <EFBFBD> ѡ <EFBFBD> е ĵ<D0B5> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> £<EFBFBD> Ȼ<EFBFBD> <C8BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> 룬<EFBFBD> <EBA3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɶ<EFBFBD> <C9B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߵ <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ݵ<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ã<EFBFBD>
CTrackObj * pTrackObj = NULL ;
BOOL bAddTrackCurve = FALSE ;
TRACKLIST : : iterator it = trackAddList . begin ( ) ;
for ( ; it ! = trackAddList . end ( ) ; it + + )
{
pTrackObj = * it ;
if ( pTrackObj - > GetTrackType ( ) = = Track_Curve | | pTrackObj - > GetTrackType ( ) = = Track_Discrete )
{
bAddTrackCurve = TRUE ;
break ;
}
}
//<2F> <> <EFBFBD> <EFBFBD>
SetReUnDoAction ( ! bAddTrackCurve ) ;
CWellBaseObj * pObj = NULL ;
CTrackObj * pTrack = NULL ;
CWellPole * pWellObj = ( CWellPole * ) GetWellObject ( ) ;
CTrackGroup * pGroupParent = pWellObj ;
BOOL posSlected = FALSE ;
if ( pTrackSelected )
{
pGroupParent = ( CTrackGroup * ) pTrackSelected - > GetParent ( ) ;
posSlected = pGroupParent - > FindTrack ( pTrackSelected , true ) ;
if ( pGroupParent - > GetTrackType ( ) ! = Track_Group & & posSlected & & bTrackGroup )
{ //<2F> <> trackAddList<73> е ĵ<D0B5> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> £<EFBFBD> Ȼ<EFBFBD> <C8BB> <EFBFBD> <EFBFBD> <EFBFBD> 룬<EFBFBD> <EBA3AC> <EFBFBD> <EFBFBD> pTrackSelectedҲ<64> <D2B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD>
pGroupParent = new CTrackGroup ( ) ;
pGroupParent - > SetGroupType ( Group_Vertical ) ;
pGroupParent - > m_font = pWellObj - > m_font ;
pGroupParent - > m_pen = pWellObj - > m_pen ;
pGroupParent - > m_HeadRect = pTrackSelected - > m_HeadRect ;
pGroupParent - > SetRange ( pTrackSelected - > m_HeadRect ) ;
pGroupParent - > m_dTrackWidth = pTrackSelected - > m_dTrackWidth ;
pGroupParent - > SetParent ( pWellObj ) ;
pGroupParent - > SetParentXY ( pWellObj - > GetParentXY ( ) ) ;
pGroupParent - > AddTrack ( pTrackSelected ) ;
TRACKLIST : : const_iterator cit = std : : find ( pWellObj - > GetTrackList ( ) . begin ( ) , pWellObj - > GetTrackList ( ) . end ( ) , pTrackSelected ) ;
pWellObj - > GetTrackList ( ) . insert ( cit , pGroupParent ) ;
cit = std : : find ( pWellObj - > GetTrackList ( ) . begin ( ) , pWellObj - > GetTrackList ( ) . end ( ) , pTrackSelected ) ;
pWellObj - > GetTrackList ( ) . erase ( cit ) ;
}
}
TRACKLIST tracklist ;
pWellObj - > GetAllTrack ( & tracklist ) ;
//CDataTableConfig dataConfig;
CString strTrackType , tableinfo , strcurvename ;
CString str , strRight ;
int nNumber = - 1 ;
int nIndex = 0 ;
CString strNumber ;
TRACKLIST : : iterator itpos ;
if ( pTrackSelected )
{
itpos = std : : find ( pGroupParent - > GetTrackList ( ) . begin ( ) , pGroupParent - > GetTrackList ( ) . end ( ) , pTrackSelected ) ; //ѡ <> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> е <EFBFBD> λ<EFBFBD> <CEBB>
if ( itpos ! = pGroupParent - > GetTrackList ( ) . end ( ) )
itpos + + ; //ʹ <> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> е <EFBFBD> <D0B5> ĺ<EFBFBD> <C4BA> <EFBFBD>
}
it = trackAddList . begin ( ) ;
for ( ; it ! = trackAddList . end ( ) ; it + + )
{ //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е ĵ<D0B5> <C4B5> <EFBFBD> <EFBFBD> 뵽<EFBFBD> ½<EFBFBD> <C2BD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD>
pTrackObj = * it ;
pTrackObj - > SetParent ( pGroupParent ) ;
//pTrackObj->SetParentObj(pWellObj);
pTrackObj - > SetParentXY ( pWellObj - > GetParentXY ( ) ) ;
pTrackObj - > SetPenTrack ( pWellObj - > m_penTrack ) ;
pTrackObj - > SetPenGrid ( pWellObj - > m_penGridMajor , pWellObj - > m_penGridMinor ) ;
pTrackObj - > SetFontTrack ( pWellObj - > m_fontTrack ) ;
pTrackObj - > SetFontHeadMark ( pWellObj - > m_fontHeadMark ) ;
pTrackObj - > SetFontGridMark ( pWellObj - > m_fontGridMark ) ;
pTrackObj - > SetSpace ( pWellObj - > m_fMajorSpace , pWellObj - > m_fMinorSpace ) ;
/////<2F> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵĵ<D3B5> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
nNumber = - 1 ;
str = pTrackObj - > m_strTrackName ;
str . MakeUpper ( ) ;
TRACKLIST : : iterator it1 = tracklist . begin ( ) ;
for ( ; it1 ! = tracklist . end ( ) ; it1 + + )
{
CWellBaseObj * pObj = * it1 ;
if ( pObj - > GetType ( ) = = KEP_TRACK )
{
CTrackObj * pTrack = ( CTrackObj * ) pObj ;
CString strTrackName = pTrack - > m_strTrackName ;
strTrackName . MakeUpper ( ) ;
nIndex = strTrackName . Find ( str ) ;
if ( nIndex > - 1 )
{
strRight = strTrackName . Right ( strTrackName . GetLength ( ) - str . GetLength ( ) - nIndex ) ;
nNumber = max ( nNumber , atoi ( strRight ) ) ;
}
}
}
if ( nNumber > - 1 )
{
str . Format ( " %d " , + + nNumber ) ;
pTrackObj - > m_strTrackName + = str ;
}
//<2F> <> <EFBFBD> ӵ<EFBFBD>
if ( posSlected )
{
pGroupParent - > GetTrackList ( ) . insert ( itpos , pTrackObj ) ; // InsertAfter(posSlected, pTrackObj);
pTrackObj - > m_dTrackWidth = pTrackSelected - > GetWidth ( ) ;
}
else
pGroupParent - > GetTrackList ( ) . push_back ( pTrackObj ) ;
if ( GetWellObject ( ) - > GetWellType ( ) = = Well_Straight )
{
str = pTrackObj - > m_strTrackName ;
}
else
{
str = pTrackObj - > m_strTrackName + " / " + pWellObj - > m_strTrackName ;
}
pTrackObj - > m_strTitle = pTrackObj - > m_strTrackName ;
pTrackObj - > m_strDataRef = str ;
//tracklist.AddTail(pTrackObj);
}
CPoint2D ptf = pWellObj - > GetAnchorPoint ( ) ; //->GetPos().TopLeft();
pWellObj - > CalculateSize ( ptf ) ;
//this->SetActionAddTrackItem(trackAddList);
//<2F> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ã<EFBFBD> <C3A3> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD>
//pos = trackAddList.GetHeadPosition();
//while(pos != NULL)
//{
// pTrackObj = trackAddList.GetNext(pos);
// GetTrackTable(pTrackObj, strTrackType, tableinfo, strcurvename);
// dataConfig.SetTableID(strTrackType);
// dataConfig.Read();
// pTrackObj->m_strConfigTable = dataConfig.GetTableDB();
// pTrackObj->m_VecConfigField = dataConfig.GetFieldsDB();
// ImportTrackDataFromDB(pTrackObj, pWellObj, AfxGetGeo()->GetSqlStatementManager());
// pTrackObj->ReadCurveData();
//}
GetDoc ( ) - > Invalidate ( ) ;
}
CTrackObj * CItemSingleWell : : GetLastTrackFromTrackGroup ( CTrackGroup * trackGroupObj )
{
CTrackObj * pTrack = NULL ;
TRACKLIST : : reverse_iterator rit = trackGroupObj - > GetTrackList ( ) . rbegin ( ) ;
if ( rit ! = trackGroupObj - > GetTrackList ( ) . rend ( ) )
{
pTrack = * rit ;
if ( pTrack - > GetTrackType ( ) = = Track_Group )
{
pTrack = GetLastTrackFromTrackGroup ( ( CTrackGroup * ) pTrack ) ;
}
else
{
return pTrack ;
}
}
return pTrack ;
}
CItemWellBase * CItemSingleWell : : CreateItem ( CWellBaseObj * pObj )
{
CItemWellBase * pItem = NULL ;
if ( pObj - > GetType ( ) = = KEP_TRACK )
{
CItemTrack * pItemTrack = new CItemTrack ( GetDoc ( ) ) ;
pItem = pItemTrack ;
pItem - > SetPos ( GetPos ( ) ) ;
pItem - > SetDrawObj ( pObj ) ;
pItem - > SetItemWell ( this ) ;
pItemTrack - > m_bAddFaultPoint = this - > m_bAddFaultPoint ;
}
else if ( pObj - > GetParent ( ) ! = NULL & & pObj - > GetParent ( ) - > GetType ( ) = = KEP_TRACK )
{
pItem = new CItemTrackIn ( GetDoc ( ) ) ;
pItem - > SetPos ( GetPos ( ) ) ;
( ( CItemTrackIn * ) pItem ) - > SetDrawObj ( pObj ) ;
pItem - > SetItemWell ( this ) ;
}
//else if (pObj->GetType()==GDOUBLEFOX_LOGCURVESEGMENT)
//{
// pItem = new CItemTrackInCurveSegment(GetWnd());
// pItem->SetPos(GetPos());
// CTrackInCurveSegment* pTrackInCurveSegment = (CTrackInCurveSegment*)pObj;
// ((CItemTrackInCurveSegment*)pItem)->SetTracCurve(pTrackInCurveSegment->m_pCurve);
// ((CItemTrackInCurveSegment*)pItem)->SetDrawObj(pObj);
// pItem->SetItemWell(this);
//}
//else if(pObj->GetType() == GDOUBLEFOX_MARK)
//{
// //pItem = new CItemWellMark(GetWnd());
// //pItem->SetPos(GetPos());
// //((CItemWellMark*)pItem)->SetDrawObj(pObj);
// //pItem->SetItemWell(this);
//}
//else if (pObj->GetType()==GDOUBLEFOX_TEXTBOX)
//{
// //pItem = new CItemTextBox(GetWnd());
// //pItem->SetPos(GetPos());
// //((CItemTextBox*)pItem)->SetDrawObj(pObj);
// //pItem->SetItemWell(this);
//}
return pItem ;
}
void CItemSingleWell : : DeleteItem ( )
{
CItemWellBase : : DeleteItem ( ) ;
CWellPole * pWell = GetWellObject ( ) ;
m_WellObjSelectlist . RemoveAll ( ) ;
}
void CItemSingleWell : : CreateDragImage ( )
{
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) = = 1 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
if ( pObjSelected = = NULL )
return ;
CRect rect = GetDC ( ) - > GetScreen ( pObjSelected - > GetRect ( ) ) ;
CRect inclineWellRect ;
BOOL bTrack = FALSE ;
CPoint plgPts [ 4 ] ;
if ( pObjSelected - > GetType ( ) = = KEP_TRACK )
{
CTrackObj * pTrackObj = ( CTrackObj * ) pObjSelected ;
//rect = GetDC()->GetScreen(pTrackObj->m_HeadRect);
rect = GetDC ( ) - > GetScreen ( pTrackObj - > GetDragMoveRect ( ) ) ; // (pTrackObj->GetRect()); //<2F> <> <EFBFBD> ƴ<EFBFBD> <C6B4> ϶<EFBFBD> <CFB6> <EFBFBD>
rect . InflateRect ( 2 , 2 , 2 , 2 ) ;
if ( m_pWell - > GetWellType ( ) = = Well_Incline )
{
CPoint topleftPt , botRightPt , tpt ;
if ( pTrackObj - > GetTrackType ( ) = = Track_Group )
{
/* CPoint2D pospts[4];
pospts [ 0 ] . x0 = pTrackObj - > m_HeadRect . left ; pospts [ 0 ] . y0 = pTrackObj - > m_HeadRect . top ;
pospts [ 1 ] . x0 = pTrackObj - > m_HeadRect . right ; pospts [ 1 ] . y0 = pTrackObj - > m_HeadRect . top ;
pospts [ 2 ] . x0 = pTrackObj - > m_HeadRect . right ; pospts [ 2 ] . y0 = pTrackObj - > m_HeadRect . bottom ;
pospts [ 3 ] . x0 = pTrackObj - > m_HeadRect . left ; pospts [ 3 ] . y0 = pTrackObj - > m_HeadRect . bottom ;
for ( int ii = 0 ; ii < 4 ; ii + + )
{
pospts [ ii ] . RotatePt ( m_pWell - > GetTraceStartPt ( ) . x0 , m_pWell - > GetTraceStartPt ( ) . y0 , m_pWell - > GetHeadLineAngle ( ) ) ;
}
botRightPt = topleftPt = GetDC ( ) - > GetScreen ( pospts [ 0 ] . x0 , pospts [ 0 ] . y0 ) ;
plgPts [ 0 ] = botRightPt ;
for ( int ii = 1 ; ii < 4 ; ii + + )
{
tpt = GetDC ( ) - > GetScreen ( pospts [ ii ] . x0 , pospts [ ii ] . y0 ) ;
plgPts [ ii ] = tpt ;
if ( tpt . x < topleftPt . x )
topleftPt . x = tpt . x ;
if ( tpt . x > botRightPt . x )
botRightPt . x = tpt . x ;
if ( tpt . y < topleftPt . y )
topleftPt . y = tpt . y ;
if ( tpt . y > botRightPt . y )
botRightPt . y = tpt . y ;
inclineWellRect . SetRect ( topleftPt , botRightPt ) ;
} */
}
else
{
botRightPt = topleftPt = GetDC ( ) - > GetScreen ( pTrackObj - > m_HeadCurve . x [ 0 ] , pTrackObj - > m_HeadCurve . y [ 0 ] ) ;
plgPts [ 0 ] = botRightPt ;
for ( int ii = 1 ; ii < 4 ; ii + + )
{
tpt = GetDC ( ) - > GetScreen ( pTrackObj - > m_HeadCurve . x [ ii ] , pTrackObj - > m_HeadCurve . y [ ii ] ) ;
plgPts [ ii ] = tpt ;
if ( tpt . x < topleftPt . x )
topleftPt . x = tpt . x ;
if ( tpt . x > botRightPt . x )
botRightPt . x = tpt . x ;
if ( tpt . y < topleftPt . y )
topleftPt . y = tpt . y ;
if ( tpt . y > botRightPt . y )
botRightPt . y = tpt . y ;
inclineWellRect . SetRect ( topleftPt , botRightPt ) ;
}
}
bTrack = TRUE ;
}
}
//else if (pObjSelected->GetType()==GDOUBLEFOX_LOGCURVESEGMENT)
//{
// CTrackInCurveSegment* pSegment = (CTrackInCurveSegment*)pObjSelected;
// rect = GetDC()->GetScreen(pSegment->GetPos());
//}
//else if (pObjSelected->GetType()==GDOUBLEFOX_DISCRETESEGMENT)
//{
// CTrackInDiscreteSegment* pDiscreteSegment = (CTrackInDiscreteSegment*)pObjSelected;
// rect = GetDC()->GetScreen(pDiscreteSegment->GetPos());
//}
else
return ;
if ( m_pWell - > GetWellType ( ) = = Well_Incline )
m_rectImage = inclineWellRect ;
else
m_rectImage = rect ;
CBitmap * pBitmap = GetBitmap ( m_pScreenDC /*GetDC()->GetDC()*/ , rect , inclineWellRect , bTrack , ( CPoint * ) plgPts ) ;
if ( pBitmap = = NULL )
return ;
//// Create a drag image
m_pDragImage = new CImageList ; //m_wndList.CreateDragImage(m_nDragIndex, &pt);
m_pDragImage - > Create ( m_rectImage . Width ( ) , m_rectImage . Height ( ) , ILC_COLOR24 | ILC_MASK , 0 , 0 ) ;
ASSERT ( m_pDragImage ) ; //make sure it was created
//We will call delete later (in LButtonUp) to clean this up
m_pDragImage - > Add ( pBitmap , RGB ( 255 , 255 , 255 ) ) ;
delete pBitmap ;
}
CBitmap * CItemSingleWell : : GetBitmap ( CDC * pdc , CRect wellHRect , CRect ilnWellHRect , BOOL bTrack , CPoint * plgPts )
{
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) = = 1 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
CRect rect = wellHRect ; //m_rectImage;
CDC dc ;
BOOL b = dc . CreateCompatibleDC ( pdc ) ;
if ( b = = FALSE )
{
DWORD error = GetLastError ( ) ;
return NULL ;
}
CXyDC xyDC ;
xyDC = * GetDC ( ) ;
xyDC . Create ( & dc ) ;
CRect rt = CRect ( 0 , 0 , rect . Width ( ) , rect . Height ( ) ) ;
int planes = dc . GetDeviceCaps ( PLANES ) ;
int bpp = dc . GetDeviceCaps ( BITSPIXEL ) ;
CBitmap * pBitmap , * pOldBitmap ;
pBitmap = new CBitmap ( ) ;
pBitmap - > CreateBitmap ( rt . Width ( ) , rt . Height ( ) , planes , bpp , NULL ) ;
pOldBitmap = dc . SelectObject ( pBitmap ) ;
dc . FillSolidRect ( 0 , 0 , rt . Width ( ) , rt . Height ( ) , RGB ( 255 , 255 , 255 ) ) ;
if ( pObjSelected ! = NULL )
{
CRect8 rectReal = xyDC . GetReal ( rect ) ;
xyDC . Extend ( rectReal , rt , EXTEND_MODE_CENTER ) ;
if ( pObjSelected - > GetType ( ) = = KEP_TRACK )
{
CTrackObj * pTrackObj = ( CTrackObj * ) pObjSelected ;
pTrackObj - > DrawActiveTrackHead ( & xyDC ) ;
GDFLOGPEN pen = pTrackObj - > m_pen ;
pen . m_color = RGB ( 230 , 35 , 35 ) ;
pen . m_dWidth = 4 ;
CRect8 rect = pTrackObj - > GetDragMoveRect ( ) ; // pTrackObj->GetRect();//<2F> <> <EFBFBD> ƴ<EFBFBD> <C6B4> ϶<EFBFBD> <CFB6> <EFBFBD>
xyDC . DrawRect ( rect , pen ) ;
}
//else if (pObjSelected->GetType()==GDOUBLEFOX_LOGCURVESEGMENT ||
// pObjSelected->GetType() ==GDOUBLEFOX_DISCRETESEGMENT)
//{
// pObjSelected->Draw(xyDC);
//}
}
dc . SelectObject ( pOldBitmap ) ;
if ( m_pWell - > GetWellType ( ) = = Well_Incline & & bTrack )
{
CRect ilnrt = CRect ( 0 , 0 , ilnWellHRect . Width ( ) , ilnWellHRect . Height ( ) ) ;
CBitmap * pplgBitmap , * pplgOldBitmap ;
pplgBitmap = new CBitmap ( ) ;
pplgBitmap - > CreateBitmap ( ilnrt . Width ( ) , ilnrt . Height ( ) , planes , bpp , NULL ) ;
pplgOldBitmap = dc . SelectObject ( pplgBitmap ) ;
dc . FillSolidRect ( 0 , 0 , ilnrt . Width ( ) , ilnrt . Height ( ) , RGB ( 255 , 255 , 255 ) ) ;
CDC memDC ;
memDC . CreateCompatibleDC ( & dc ) ;
CBitmap maskBmp ;
ZeroMemory ( ( void * ) ( & maskBmp ) , sizeof ( maskBmp ) ) ;
memDC . SelectObject ( pBitmap ) ;
CPoint points [ 3 ] ;
points [ 0 ] = plgPts [ 0 ] ; points [ 0 ] . Offset ( - ilnWellHRect . left , - ilnWellHRect . top ) ;
points [ 1 ] = plgPts [ 1 ] ; points [ 1 ] . Offset ( - ilnWellHRect . left , - ilnWellHRect . top ) ;
points [ 2 ] = plgPts [ 3 ] ; points [ 2 ] . Offset ( - ilnWellHRect . left , - ilnWellHRect . top ) ;
dc . PlgBlt ( points , & memDC , 0 , 0 , wellHRect . Width ( ) , wellHRect . Height ( ) , maskBmp , 0 , 0 ) ;
dc . SelectObject ( & pplgOldBitmap ) ;
memDC . Detach ( ) ;
//maskBmp.DeleteObject();
delete pBitmap ;
pBitmap = pplgBitmap ;
}
dc . Detach ( ) ;
return pBitmap ;
}
void CItemSingleWell : : TrackLeftGroup ( )
{
CWellPole * pWellObj = GetWellObject ( ) ;
CTrackObj * pTrackObj = NULL ;
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) = = 1 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
if ( pObjSelected - > GetType ( ) = = KEP_TRACK )
{
pTrackObj = ( CTrackObj * ) pObjSelected ;
}
if ( pTrackObj = = NULL )
return ;
CTrackGroup * pParentGroup = ( CTrackGroup * ) pTrackObj - > GetParent ( ) ; // GetParentGroup();
POSITION posFind = NULL ;
POSITION pos = NULL ;
TRACKLIST : : iterator it = pParentGroup - > GetTrackList ( ) . begin ( ) ;
if ( it = = pParentGroup - > GetTrackList ( ) . end ( ) )
return ;
if ( * it = = pTrackObj ) // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǰѡ <C7B0> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD>
return ;
SetReUnDoAction ( ) ;
pWellObj = GetWellObject ( ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> undoaction<6F> <6E> Ҫ<EFBFBD> <D2AA> <EFBFBD> »<EFBFBD> <C2BB> <EFBFBD> һ <EFBFBD> ¾<EFBFBD> <C2BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8>
TRACKLIST : : reverse_iterator rit = std : : find ( pParentGroup - > GetTrackList ( ) . rbegin ( ) , pParentGroup - > GetTrackList ( ) . rend ( ) , pTrackObj ) ;
rit + + ;
CTrackObj * pTrackLeft = * rit ; //
CTrackGroup * pGroupNew = new CTrackGroup ;
pGroupNew - > SetGroupType ( Group_Horizon ) ;
pGroupNew - > m_font = m_pWell - > m_fontTrack ;
pGroupNew - > m_pen = m_pWell - > m_penTrack ;
pGroupNew - > m_dTrackWidth = pTrackLeft - > m_dTrackWidth + pTrackObj - > m_dTrackWidth ;
pGroupNew - > SetParent ( pTrackObj - > GetParent ( ) ) ;
pGroupNew - > SetParentXY ( pTrackObj - > GetParentXY ( ) ) ;
pGroupNew - > AddTrack ( pTrackLeft ) ;
pGroupNew - > AddTrack ( pTrackObj ) ;
TRACKLIST : : const_iterator cit = std : : find ( pParentGroup - > GetTrackList ( ) . begin ( ) , pParentGroup - > GetTrackList ( ) . end ( ) , pTrackLeft ) ;
pParentGroup - > GetTrackList ( ) . insert ( cit , pGroupNew ) ; //<2F> <> <EFBFBD> 룬<EFBFBD> <EBA3AC> <EFBFBD> Ӷ<EFBFBD> ʹ <EFBFBD> <CAB9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
pParentGroup - > GetTrackList ( ) . erase ( cit ) ;
cit = std : : find ( pParentGroup - > GetTrackList ( ) . begin ( ) , pParentGroup - > GetTrackList ( ) . end ( ) , pTrackObj ) ;
pParentGroup - > GetTrackList ( ) . erase ( cit ) ;
CPoint2D point = pWellObj - > GetAnchorPoint ( ) ; //pWellObj->GetPos().TopLeft();
pWellObj - > CalculateSize ( point ) ;
}
void CItemSingleWell : : TrackRightGroup ( )
{
CWellPole * pWellObj = GetWellObject ( ) ;
CTrackObj * pTrackObj = NULL ;
CWellBaseObj * pObjSelected = NULL ;
if ( m_WellObjSelectlist . GetCount ( ) = = 1 )
pObjSelected = m_WellObjSelectlist . GetHead ( ) ;
if ( pObjSelected - > GetType ( ) = = KEP_TRACK )
{
pTrackObj = ( CTrackObj * ) pObjSelected ;
}
if ( pTrackObj = = NULL )
return ;
CTrackGroup * pParentGroup = ( CTrackGroup * ) pTrackObj - > GetParent ( ) ;
TRACKLIST : : reverse_iterator rit = pParentGroup - > GetTrackList ( ) . rbegin ( ) ;
if ( rit = = pParentGroup - > GetTrackList ( ) . rend ( ) )
return ;
if ( * rit = = pTrackObj ) // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǰѡ <C7B0> е <EFBFBD> <D0B5> Ҳ<EFBFBD> û<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD>
return ;
SetReUnDoAction ( ) ;
pWellObj = GetWellObject ( ) ;
TRACKLIST : : iterator it = std : : find ( pParentGroup - > GetTrackList ( ) . begin ( ) , pParentGroup - > GetTrackList ( ) . end ( ) , pTrackObj ) ;
TRACKLIST : : iterator it1 = it ;
it + + ;
CTrackObj * pTrackRight = * it ; // pParentGroup->GetTrackList()->GetAt(pos);
CTrackGroup * pGroupNew = new CTrackGroup ;
pGroupNew - > SetGroupType ( Group_Horizon ) ;
pGroupNew - > m_font = m_pWell - > m_fontTrack ;
pGroupNew - > m_pen = m_pWell - > m_penTrack ;
pGroupNew - > m_dTrackWidth = pTrackRight - > m_dTrackWidth + pTrackObj - > m_dTrackWidth ;
pGroupNew - > SetParent ( pTrackObj - > GetParent ( ) ) ;
pGroupNew - > SetParentXY ( pTrackObj - > GetParentXY ( ) ) ;
pGroupNew - > AddTrack ( pTrackObj ) ;
pGroupNew - > AddTrack ( pTrackRight ) ;
pParentGroup - > GetTrackList ( ) . insert ( it1 , pGroupNew ) ;
pParentGroup - > GetTrackList ( ) . erase ( it1 ) ;
pParentGroup - > GetTrackList ( ) . erase ( it ) ;
CPoint2D point = pWellObj - > GetAnchorPoint ( ) ;
pWellObj - > CalculateSize ( point ) ;
}
void CItemSingleWell : : Clear ( )
{
if ( m_pItemSelected ! = NULL )
delete m_pItemSelected ;
m_pItemSelected = NULL ;
m_WellObjSelectlist . RemoveAll ( ) ;
}
int CItemSingleWell : : DeleteSelection ( void )
{
//if(GetDrawObj() == NULL)
// return;
if ( m_WellObjSelectlist . GetCount ( ) = = 0 )
{
return 0 ;
}
if ( m_pItemSelected ! = NULL )
{
SetReUnDoAction ( ) ;
if ( GetWellObject ( ) ! = NULL & & m_WellObjSelectlist . GetCount ( ) > 0 & & m_pItemSelected - > GetType ( ) = = ITEM_TRACKIN )
{
delete m_pItemSelected ;
CItemTrackIn * pItemTrackIn = new CItemTrackIn ( GetDoc ( ) ) ;
m_pItemSelected = pItemTrackIn ;
POSITION pos = m_WellObjSelectlist . GetHeadPosition ( ) ;
while ( pos ! = NULL )
{
CWellBaseObj * pObj = m_WellObjSelectlist . GetNext ( pos ) ;
pItemTrackIn - > SetDrawObj ( pObj ) ;
pItemTrackIn - > DeleteSelection ( ) ;
}
delete m_pItemSelected ;
m_pItemSelected = NULL ;
}
else
{
( ( CItemWellBase * ) m_pItemSelected ) - > DeleteSelection ( ) ;
delete m_pItemSelected ;
m_pItemSelected = NULL ;
}
}
else
{
if ( m_WellObjSelectlist . GetCount ( ) = = 0 )
delete GetWellObject ( ) ;
else
{
SetReUnDoAction ( FALSE ) ;
POSITION pos = m_WellObjSelectlist . GetHeadPosition ( ) ;
while ( pos ! = NULL )
{
CWellBaseObj * pObj = m_WellObjSelectlist . GetNext ( pos ) ;
if ( pObj - > GetType ( ) = = KEP_TRACK )
{
CItemTrack itemtrack ( GetDoc ( ) ) ;
itemtrack . SetDrawObj ( pObj ) ;
itemtrack . DeleteSelection ( ) ;
}
}
}
}
m_WellObjSelectlist . RemoveAll ( ) ;
GetDoc ( ) - > Invalidate ( ) ;
return 1 ;
}
void CItemSingleWell : : GetTrackTable ( CTrackObj * pTrackObj , CString & strTrackType , CString & table , CString & curve )
{
switch ( pTrackObj - > GetTrackType ( ) )
{
case Track_Trajectory :
break ;
case Track_Block :
break ;
case Track_Facies :
break ;
case Track_ValidThick :
break ;
case Track_Bury :
break ;
case Track_Curve :
{
strTrackType = " Curve " ;
curve = ( ( CTrackCurveBase * ) pTrackObj ) - > m_strTrackName ;
}
break ;
case Track_Discrete :
{
strTrackType = " Discrete " ;
curve = ( ( CTrackCurveBase * ) pTrackObj ) - > m_strTrackName ;
}
break ;
case Track_Stratum :
{
strTrackType = " Stratum " ;
}
break ;
case Track_SandLayer :
{
strTrackType = " SandLayer " ;
}
break ;
case Track_OilLayerGroup :
{
strTrackType = " OilLayerGroup " ;
}
break ;
case Track_ProduceLayer :
{
strTrackType = " ProduceLayer " ;
}
break ;
case Track_ReserveUnit :
{
strTrackType = " ReserveUnit " ;
}
break ;
case Track_StandardLayer :
{
strTrackType = " StandardLayer " ;
}
break ;
case Track_Lith :
{
strTrackType = " Lith " ;
}
break ;
case Track_CorePosition :
{
strTrackType = " CorePosition " ;
}
break ;
case Track_CoreWell :
{
strTrackType = " CoreWell " ;
}
break ;
case Track_OilTest :
{
strTrackType = " OilTest " ;
}
break ;
case Track_Result :
{
strTrackType = " Result " ;
}
break ;
case Track_Picture :
{
strTrackType = " Picture " ;
}
break ;
case Track_Text :
{
strTrackType = " Text " ;
}
break ;
case Track_Symbol :
{
strTrackType = " Symbol " ;
}
break ;
case Track_Sample :
{
strTrackType = " Sample " ;
}
break ;
case Track_Shot :
{
strTrackType = " Shot " ;
}
break ;
case Track_TestExtraction :
{
strTrackType = " TestExtraction " ;
}
break ;
case Track_CementingQuality :
{
strTrackType = " CementingQuality " ;
}
break ;
case Track_CementingQualityCurve :
{
strTrackType = " CementingQualityCurve " ;
}
break ;
case Track_FluidProducingProfile :
{
strTrackType = " FluidProducingProfile " ;
}
break ;
case Track_WaterInjectionProfile :
{
strTrackType = " WaterInjectionProfile " ;
}
break ;
case Track_WaveShape :
{
strTrackType = " WaveShape " ;
}
break ;
case Track_FaultPoint :
strTrackType = " FaultPoint " ;
break ;
case Track_VdlImage :
strTrackType = " well_wavetrace " ;
break ;
case Track_WaveCurve :
strTrackType = " well_wavetrace " ;
break ;
default :
break ;
}
}
void CItemSingleWell : : AddTrackInObjData ( )
{
if ( NULL = = m_pItemSelected )
return ;
}
void CItemSingleWell : : BuildTrackInObj ( CTrackObj * pTrackObj , double * pDepth , double * pData , int datanum )
{
CWellPole * pWellObj = pTrackObj - > GetWell ( ) ; //static_cast<CWellPole*>(pTrackObj->GetParent());
if ( NULL = = pWellObj )
return ;
if ( datanum = = 0 )
return ;
pTrackObj - > ClearChildren ( ) ;
pTrackObj - > BuidChildObject ( pDepth , pData , datanum ) ;
}
void CItemSingleWell : : BuildTrackInObj ( CTrackObj * pTrackObj , vector < CString > & fields , StringVectorSet & datas , vector < CString > & fields2 , StringVectorSet & vecdatas2 )
{
CWellPole * pWellObj = pTrackObj - > GetWell ( ) ; // static_cast<CWellPole*>(pTrackObj->GetParent());
if ( NULL = = pWellObj )
return ;
if ( datas . size ( ) = = 0 & & vecdatas2 . size ( ) = = 0 )
{
if ( pTrackObj - > GetTrackType ( ) = = Track_Curve )
{
CTrackCurve * pTrackCurve = ( CTrackCurve * ) pTrackObj ;
pTrackCurve - > ClearCurveData ( ) ;
}
else
pTrackObj - > ClearChildren ( ) ;
GetDoc ( ) - > Invalidate ( ) ;
return ;
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ½<EFBFBD> <C2BD> ͽ<EFBFBD> <CDBD> ۵ <EFBFBD> <DBB5> ͵ز<CDB5> <D8B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱɾ<CAB1> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//if (pTrackObj->GetTrackType() == Track_Result || pTrackObj->GetTrackType() == Track_Stratum)
//{
// CWellSection* pWellSection = (CWellSection*)pWellObj->GetParentObj();
// if (NULL != pWellSection)
// {
// POSITION pos = pWellSection->m_BendList.GetHeadPosition();
// while(NULL != pos)
// {
// CWellBaseObj* pObj = (CDrawObj*)pWellSection->m_BendList.GetNext(pos);
// if (pObj->GetType() == GDOUBLEFOX_SECTIONBEND)
// {
// CBendObj* pBend = (CBendObj*)pObj;
// CTrackObj* pTrackLeft = NULL;
// CTrackObj* pTrackRight = NULL;
// pTrackLeft = (CTrackObj*)pBend->m_pLayerLeft->GetParentObj();
// if (pBend->m_pLayerRight != NULL)
// {
// pTrackRight = (CTrackObj*)pBend->m_pLayerRight->GetParentObj();
// }
// if (pTrackRight == pTrackObj || pTrackLeft ==pTrackObj)
// {
// pWellSection->DeleteBend(pBend);
// GetDoc()->Invalidate(pWellSection);
// }
// }
// }
// }
//}
//<2F> <> <EFBFBD> յ<EFBFBD> <D5B5> ڵ<EFBFBD> <DAB5> Ӷ<EFBFBD> <D3B6> <EFBFBD>
pTrackObj - > ClearChildren ( ) ;
if ( pTrackObj - > GetTrackType ( ) ! = Track_Sample )
{
pTrackObj - > BuidChildObject ( fields , datas ) ;
}
else
{
if ( vecdatas2 . size ( ) = = 0 )
return ;
CTrackSample * pTrackSample = ( CTrackSample * ) pTrackObj ;
pTrackSample - > BuidChildObject ( fields , datas , fields2 , vecdatas2 ) ;
}
}
void CItemSingleWell : : ApplingWellDbTemplate ( )
{
//CDlgApplyTemplate dlg("WellColumn");
//
//if(dlg.DoModal() == IDCANCEL)
// return;
//if(dlg.m_pMemFile)
// ApplingFileTemplate(*dlg.m_pMemFile);
}
BOOL CItemSingleWell : : ApplingFileTemplate ( CKXmlParse & xp )
{
CWellPole * pWellObj = GetWellObject ( ) ;
SetReUnDoAction ( FALSE ) ;
//<2F> <> <EFBFBD> ݾ<EFBFBD> <DDBE> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD>
//CTrackList tracklist;
TRACKLIST tracklist ;
tracklist . assign ( pWellObj - > GetTrackList ( ) . begin ( ) , pWellObj - > GetTrackList ( ) . end ( ) ) ;
pWellObj - > GetTrackList ( ) . clear ( ) ;
//POSITION pos = pWellObj->GetTrackList()->GetTailPosition();
//while (pos!=NULL)
//{
// CTrackObj* pTrackObj = (CTrackObj*)pWellObj->GetTrackList()->GetPrev(pos);
// tracklist.AddHead(pTrackObj);
//}
//pWellObj->GetTrackList()->RemoveAll();
CString strWellTitle = pWellObj - > m_strTitle ;
CString strWellName = pWellObj - > GetWellName ( ) ;
double fLevel = pWellObj - > m_fLevel ;
double topDepth = pWellObj - > m_dSdep ;
double endDepth = pWellObj - > m_dEdep ;
double top = pWellObj - > GetPos ( ) . top ;
double left = pWellObj - > GetPos ( ) . left ;
double proportion = pWellObj - > m_fProportion ;
double dOldTrackHead = pWellObj - > m_dHeightTrackHead ;
double dOldWellHead = pWellObj - > m_dHeightTrackHead ;
std : : vector < CWellPole : : well_interval > oldWellIntervalVec ;
oldWellIntervalVec . insert ( oldWellIntervalVec . begin ( ) , pWellObj - > GetIntervalVec ( ) - > begin ( ) , pWellObj - > GetIntervalVec ( ) - > end ( ) ) ;
AfxGetPublicFunction ( ) - > SetCodeType ( CODE_GB2321 ) ;
if ( pWellObj - > ReadPCG ( xp , - 1 ) = = 0 )
{
//<2F> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
TRACKLIST : : reverse_iterator rit = tracklist . rbegin ( ) ;
for ( ; rit ! = tracklist . rend ( ) ; rit + + )
{
pWellObj - > GetTrackList ( ) . push_front ( * rit ) ;
}
tracklist . clear ( ) ;
//POSITION pos = tracklist.GetTailPosition();
//while (pos!=NULL)
//{
// CTrackObj* pTrackObj = (CTrackObj*)tracklist.GetPrev(pos);
// pWellObj->GetTrackList()->AddHead(pTrackObj);
//}
//tracklist.RemoveAll();
//AfxGetPublicFunction()->SetCodeType((DWORD)::GetPreferences().WorkaroundSave.m_nCodeMode);
return FALSE ;
}
else
{
pWellObj - > m_strTitle = strWellTitle ;
pWellObj - > SetWellName ( strWellName ) ;
pWellObj - > m_fLevel = fLevel ;
pWellObj - > GetPos ( ) . left = left ;
pWellObj - > GetPos ( ) . top = top ;
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 - > ReSetWellHead ( ) ;
pWellObj - > CalculateSize ( pWellObj - > GetPos ( ) . TopLeft ( ) ) ;
//Ӧ<> þ<EFBFBD> ģ<EFBFBD> <C4A3>
TRACKLIST : : iterator it = tracklist . begin ( ) ;
for ( ; it ! = tracklist . end ( ) ; it + + )
pWellObj - > GetTemplateList ( ) . push_front ( * it ) ;
pWellObj - > ApplingTemplate ( TRUE , dOldTrackHead , dOldWellHead ) ;
//ImportDataAll(pWellObj, FALSE);
}
return TRUE ;
//AfxGetPublicFunction()->SetCodeType((DWORD)::GetPreferences().WorkaroundSave.m_nCodeMode);
}
//void CItemSingleWell::ApplingWellTemplate()
//{
// 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> ʽ
// {
// CStdioFile fr;
// if(!fr.Open(filepathstr,CFile::modeRead))
// return;
// ApplingFileTemplate(fr);
// }
void CItemSingleWell : : ImportDataAll ( CWellPole * pWell , BOOL bReplace )
{
AfxGetMainWnd ( ) - > BeginWaitCursor ( ) ;
if ( NULL = = pWell )
{
return ;
}
CString strWellName = pWell - > GetWellName ( ) ;
}
void CItemSingleWell : : ExportDataAll ( CWellPole * pWell )
{
TRACKLIST tracklist ;
pWell - > GetAllTrack ( & tracklist ) ;
TRACKLIST : : iterator it = tracklist . begin ( ) ;
for ( ; it ! = tracklist . end ( ) ; it + + )
ExportDataToDB ( * it ) ;
}
void CItemSingleWell : : ExportDataToDB ( CTrackObj * pTrackObj )
{
}
void CItemSingleWell : : DrawWellHandle ( )
{
DrawHandle ( & GetView ( ) - > m_pDoc - > GetDC ( ) ) ;
}
void CItemSingleWell : : GetOperationAndVersion ( const CString strWellName , const CString strCurveName , vector < CString > & OperatVec , vector < CString > & VersionVec )
{
}
void CItemSingleWell : : GetAllCurveNameInDb ( CStringArray & strNameArr , const CString strTableName , CString nameField )
{
}
CInsertDraw * CItemSingleWell : : GetLegendInsertDraw ( CString strMark )
{
CInsertDraw * pNewDraw = NULL ;
return pNewDraw ;
}
void CItemSingleWell : : BeSelectBorderLine ( CTrackGroup * pGroup , CPoint2D pt , double dHandleSize )
{
CTrackObj * pTrack = NULL ;
CTrackGroup * pTrackGroup = NULL ;
TRACKLIST : : reverse_iterator rit = pGroup - > GetTrackList ( ) . rbegin ( ) ;
for ( ; rit ! = pGroup - > GetTrackList ( ) . rend ( ) ; rit + + )
{
pTrack = * rit ;
if ( pTrack - > IsOnTrackRight ( pt , dHandleSize ) )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ϶<EFBFBD>
nDragHandle = 4 ;
selectMode = CItemNestBase : : size ;
OnDraw ( GetDC ( ) ) ;
Select ( pTrack ) ;
OnDraw ( GetDC ( ) ) ;
//GetView()->SetCapture();
return ;
}
else if ( pTrack - > IsOnTrackTop ( pt , dHandleSize ) )
{ //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ϶<EFBFBD>
nDragHandle = 6 ;
selectMode = CItemNestBase : : border ;
//GetView()->SetCapture();
return ;
}
else if ( pTrack - > IsOnWellTop ( pt , dHandleSize ) )
{ //<2F> <> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD> <EFBFBD> ϶<EFBFBD>
nDragHandle = 2 ;
selectMode = CItemNestBase : : border ;
//GetView()->SetCapture();
return ;
}
else if ( pTrack - > GetTrackType ( ) = = Track_Group )
{
pTrackGroup = ( CTrackGroup * ) pTrack ;
BeSelectBorderLine ( pTrackGroup , pt , dHandleSize ) ;
}
}
}
BOOL CItemSingleWell : : SetMoveCursor ( CTrackGroup * pGroup , CPoint2D pt , double dHandleSize , CWellPole * pWell )
{
CTrackObj * pTrack = NULL ;
CWellBaseObj * pObjIn = NULL ;
CTrackGroup * pTrackGroup = NULL ;
TRACKLIST : : reverse_iterator rit = pGroup - > GetTrackList ( ) . rbegin ( ) ;
for ( ; rit ! = pGroup - > GetTrackList ( ) . rend ( ) ; rit + + )
{
//<2F> <> <EFBFBD> ù<EFBFBD> <C3B9> <EFBFBD> <EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߽硢<DFBD> <E7A1A2> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD> <EFBFBD> ڶ<EFBFBD> <DAB6> <EFBFBD> ʱ<EFBFBD> <CAB1> ״̬
double tracktop = pWell - > m_HeadRect . bottom - pWell - > m_dHeightTrackHead ;
double trackbot = pWell - > GetPos ( ) . bottom ;
pTrack = * rit ;
if ( pTrack - > GetTrackType ( ) = = Track_Group )
{
pTrackGroup = ( CTrackGroup * ) pTrack ;
if ( pTrackGroup - > FindTrackGroupOnRight ( pt , dHandleSize ) ! = NULL )
{
if ( pWell - > GetWellType ( ) = = Well_Incline & & m_VCursor )
SetCursor ( m_VCursor ) ;
else
SetCursor ( AfxGetApp ( ) - > LoadCursor ( IDC_SIZEWE ) ) ;
return TRUE ;
}
else
{
if ( SetMoveCursor ( pTrackGroup , pt , dHandleSize , pWell ) )
return TRUE ;
else if ( pTrackGroup - > IsInTrackHead ( pt , dHandleSize ) )
{
SetCursor ( AfxGetApp ( ) - > LoadCursor ( IDC_MOVE4WAY ) ) ;
return TRUE ;
}
}
}
else if ( pTrack - > IsOnTrackRight ( pt , dHandleSize ) )
{
if ( pWell - > GetWellType ( ) = = Well_Incline & & m_VCursor )
SetCursor ( m_VCursor ) ;
else
SetCursor ( AfxGetApp ( ) - > LoadCursor ( IDC_SIZENS ) ) ;
return TRUE ;
}
//<2F> <> ͷ<EFBFBD> <CDB7> <EFBFBD> ±߽<C2B1>
else if ( pTrack - > IsOnTrackTop ( pt , dHandleSize ) )
{
if ( pWell - > GetWellType ( ) = = Well_Incline & & m_HCursor )
SetCursor ( m_HCursor ) ;
else
SetCursor ( AfxGetApp ( ) - > LoadCursor ( IDC_SIZENS ) ) ;
return TRUE ;
}
//<2F> <> ͷ<EFBFBD> ߽<EFBFBD>
else if ( pTrack - > IsOnWellTop ( pt , dHandleSize ) )
{
if ( pWell - > GetWellType ( ) = = Well_Incline & & m_HCursor )
SetCursor ( m_HCursor ) ;
else
SetCursor ( AfxGetApp ( ) - > LoadCursor ( IDC_SIZENS ) ) ;
return TRUE ;
}
////<2F> <> <EFBFBD> <EFBFBD>
else if ( pTrack - > IsInTrackHead ( pt , dHandleSize ) )
{
SetCursor ( AfxGetApp ( ) - > LoadCursor ( IDC_MOVE4WAY ) ) ;
return TRUE ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD>
else if ( ( pt . y0 < tracktop ) & & ( pt . y0 > trackbot ) & & ( pt . x0 > pTrack - > m_HeadRect . left ) & & ( pt . x0 < pTrack - > GetPos ( ) . right ) )
{
CRect8 r = CRect8 ( pt . x0 , pt . y0 , pt . x0 , pt . y0 ) ;
CSize8 sz = GetDoc ( ) - > GetSelectSize ( ) ;
double sx = GetDC ( ) - > GetRealWidth ( sz . cx ) ;
double sy = fabs ( GetDC ( ) - > GetRealHeight ( sz . cy ) ) ;
r . InflateRect ( sx , sy ) ;
pObjIn = pTrack - > ObjectAt ( r , dHandleSize ) ;
if ( pObjIn )
{
if ( ( pWell - > IsSectionWell ( ) ) & &
( pTrack - > GetTrackType ( ) = = Track_Stratum | | pTrack - > GetTrackType ( ) = = Track_Result | | pTrack - > GetTrackType ( ) = = Track_StandardLayer ) )
{
SetCursor ( AfxGetApp ( ) - > LoadCursor ( IDC_MOVE4WAY ) ) ; // (IDC_DRAG_BREAK));
return TRUE ;
}
else
{
if ( ( pObjIn = = pTrack & & ( pTrack - > GetTrackType ( ) = = Track_Curve | | pTrack - > GetTrackType ( ) = = Track_Discrete ) )
| | pObjIn ! = pTrack )
{
SetCursor ( AfxGetApp ( ) - > LoadCursor ( IDC_MOVE4WAY ) ) ;
return TRUE ;
}
}
}
}
}
return FALSE ;
}
BOOL CItemSingleWell : : SetMoveCursor ( CTrackGroup * pGroup , CPoint2D pt , double dHandleSize , CWellPole * pWell , int & handle )
{
CTrackObj * pTrack = NULL ;
CWellBaseObj * pObjIn = NULL ;
CTrackGroup * pTrackGroup = NULL ;
TRACKLIST : : reverse_iterator rit = pGroup - > GetTrackList ( ) . rbegin ( ) ;
for ( ; rit ! = pGroup - > GetTrackList ( ) . rend ( ) ; rit + + )
{
//<2F> <> <EFBFBD> ù<EFBFBD> <C3B9> <EFBFBD> <EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߽硢<DFBD> <E7A1A2> ͷ<EFBFBD> <CDB7> <EFBFBD> <EFBFBD> <EFBFBD> ڶ<EFBFBD> <DAB6> <EFBFBD> ʱ<EFBFBD> <CAB1> ״̬
double tracktop = pWell - > m_HeadRect . bottom - pWell - > m_dHeightTrackHead ;
double trackbot = pWell - > GetPos ( ) . bottom ;
pTrack = * rit ;
if ( pTrack - > GetTrackType ( ) = = Track_Group )
{
pTrackGroup = ( CTrackGroup * ) pTrack ;
if ( pTrackGroup - > FindTrackGroupOnRight ( pt , dHandleSize ) ! = NULL )
{
if ( pWell - > GetWellType ( ) = = Well_Incline & & m_VCursor )
SetCursor ( m_VCursor ) ;
else
handle = 11 ; // SetCursor(AfxGetApp()->LoadCursor(IDC_SIZEWE));
return TRUE ;
}
else
{
if ( SetMoveCursor ( pTrackGroup , pt , dHandleSize , pWell , handle ) )
return TRUE ;
else if ( pTrackGroup - > IsInTrackHead ( pt , dHandleSize ) )
{
handle = 5 ;
//SetCursor(AfxGetApp()->LoadCursor(IDC_MOVE4WAY));
return TRUE ;
}
}
}
else if ( pTrack - > IsOnTrackRight ( pt , dHandleSize ) )
{
if ( pWell - > GetWellType ( ) = = Well_Incline & & m_VCursor )
SetCursor ( m_VCursor ) ;
else
handle = 11 ; // SetCursor(AfxGetApp()->LoadCursor(IDC_SIZENS));
return TRUE ;
}
//<2F> <> ͷ<EFBFBD> <CDB7> <EFBFBD> ±߽<C2B1>
else if ( pTrack - > IsOnTrackTop ( pt , dHandleSize ) )
{
if ( pWell - > GetWellType ( ) = = Well_Incline & & m_HCursor )
SetCursor ( m_HCursor ) ;
else
handle = 10 ; // SetCursor(AfxGetApp()->LoadCursor(IDC_SIZENS));
return TRUE ;
}
//<2F> <> ͷ<EFBFBD> ߽<EFBFBD>
else if ( pTrack - > IsOnWellTop ( pt , dHandleSize ) )
{
if ( pWell - > GetWellType ( ) = = Well_Incline & & m_HCursor )
SetCursor ( m_HCursor ) ;
else
handle = 10 ; // SetCursor(AfxGetApp()->LoadCursor(IDC_SIZENS));
return TRUE ;
}
////<2F> <> <EFBFBD> <EFBFBD>
else if ( pTrack - > IsInTrackHead ( pt , dHandleSize ) )
{
handle = 5 ; //SetCursor(AfxGetApp()->LoadCursor(IDC_MOVE4WAY));
return TRUE ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> <D3B6> <EFBFBD>
else if ( ( pt . y0 < tracktop ) & & ( pt . y0 > trackbot ) & & ( pt . x0 > pTrack - > m_HeadRect . left ) & & ( pt . x0 < pTrack - > GetPos ( ) . right ) )
{
CRect8 r = CRect8 ( pt . x0 , pt . y0 , pt . x0 , pt . y0 ) ;
CSize8 sz = GetDoc ( ) - > GetSelectSize ( ) ;
double sx = GetDC ( ) - > GetRealWidth ( sz . cx ) ;
double sy = fabs ( GetDC ( ) - > GetRealHeight ( sz . cy ) ) ;
r . InflateRect ( sx , sy ) ;
pObjIn = pTrack - > ObjectAt ( r , dHandleSize ) ;
if ( pObjIn )
{
if ( ( pWell - > IsSectionWell ( ) ) & &
( pTrack - > GetTrackType ( ) = = Track_Stratum | | pTrack - > GetTrackType ( ) = = Track_Result | | pTrack - > GetTrackType ( ) = = Track_StandardLayer ) )
{
handle = 5 ; //SetCursor(AfxGetApp()->LoadCursor(IDC_MOVE4WAY));// (IDC_DRAG_BREAK));
return TRUE ;
}
else
{
if ( ( pObjIn = = pTrack & & ( pTrack - > GetTrackType ( ) = = Track_Curve | | pTrack - > GetTrackType ( ) = = Track_Discrete ) )
| | pObjIn ! = pTrack )
{
handle = 5 ; // SetCursor(AfxGetApp()->LoadCursor(IDC_MOVE4WAY));
return TRUE ;
}
}
}
}
}
return FALSE ;
}
CTrackObj * CItemSingleWell : : GetMoveInTrack ( CTrackGroup * pGroup , CTrackObj * pTrackMoving )
{
CTrackObj * pRetTrack = NULL ;
if ( pTrackMoving - > m_HeadRect . PtInRect ( pTrackMoving - > m_active_head . CenterPoint ( ) ) )
{
return pRetTrack ;
}
CTrackObj * pTrack = NULL ;
CTrackObj * pParentGroup = NULL ;
CWellBaseObj * pParentObj = NULL ;
//pGroup->RemoveTrack(pTrackMoving);
TRACKLIST : : iterator posObj ;
TRACKLIST : : iterator it = pGroup - > GetTrackList ( ) . begin ( ) ;
for ( ; it ! = pGroup - > GetTrackList ( ) . end ( ) ; it + + )
{
pTrack = * it ; // pGroup->GetTrackList()->GetAt(pos);
posObj = it ;
pParentGroup = ( CTrackGroup * ) pTrack - > GetParent ( ) ;
pParentObj = pTrack - > GetParent ( ) ;
//<2F> <> <EFBFBD> ڲ<EFBFBD> <DAB2> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ң<EFBFBD> <D2A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е ĵ<D0B5> <C4B5> <EFBFBD> <EFBFBD> б Ƚϣ<C8BD> <CFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ±<EFBFBD> <C2B1> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <C5B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱֻҪ<D6BB> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <D0A1> Ŀ<EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ㼴<C4B5> <E3BCB4>
BOOL bLeft = pTrackMoving - > m_active_head . CenterPoint ( ) . x0 < = pTrack - > m_HeadRect . CenterPoint ( ) . x0 ;
BOOL bRight = pTrackMoving - > m_active_head . CenterPoint ( ) . x0 > = pTrack - > m_HeadRect . CenterPoint ( ) . x0 & &
pTrackMoving - > m_active_head . CenterPoint ( ) . x0 < = pTrack - > m_HeadRect . right ;
BOOL bIn = pTrack - > m_HeadRect . PtInRect ( pTrackMoving - > m_active_head . CenterPoint ( ) ) ;
if ( bLeft | | bRight )
{
if ( pTrack - > GetTrackType ( ) = = Track_Group )
{ //<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <C5B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> ,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ұߵ ķ<DFB5> Χ <EFBFBD> <CEA7>
CTrackGroup * pTrackGroup = ( CTrackGroup * ) pTrack ;
if ( bIn ) //pTrackGroup->m_HeadRect.PtInRect(pTrackMoving->m_active_head.CenterPoint()))
{ //<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <C5B5> <EFBFBD> pTrack<63> ڲ<EFBFBD>
if ( pTrackGroup - > GetGroupType ( ) = = Group_Vertical )
{
return pTrackGroup ;
}
else
{ //ˮƽ <CBAE> <C6BD> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݹ<EFBFBD>
return ( GetMoveInTrack ( pTrackGroup , pTrackMoving ) ) ;
}
}
else
{ //<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ㲻<C5B5> <E3B2BB> pTrack<63> ڲ<EFBFBD> <DAB2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <C5B5> <EFBFBD> pTrack<63> <6B> <EFBFBD> ϱ <CFB1> <DFBB> ±ߣ<C2B1> <DFA3> <EFBFBD> ֱ<EFBFBD> Ӽ<EFBFBD> <D3BC> 뵽pGroup
return pTrack ;
}
}
else
{ //<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ㲻<C5B5> <E3B2BB> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> ,<2C> <> <EFBFBD> ұߵ ķ<DFB5> Χ
return pTrack ;
}
}
}
//<2F> <> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> Ҳ<EFBFBD>
return pTrack ;
}
BOOL CItemSingleWell : : SortTrackWhenMoving ( CTrackGroup * pGroup , CTrackObj * pTrackMoving , int & ideep )
{
////<2F> <> <EFBFBD> ƶ<EFBFBD>
if ( pTrackMoving - > m_HeadRect . PtInRect ( pTrackMoving - > m_active_head . CenterPoint ( ) ) )
{
return FALSE ;
}
if ( ideep = = 0 ) //<2F> <> ¼undo/redoʱ<6F> <CAB1> ִ<EFBFBD> <D6B4> һ <EFBFBD> ξͿ <CEBE> <CDBF> <EFBFBD> <EFBFBD> ˣ<EFBFBD> <CBA3> <EFBFBD> ֹŲ<D6B9> <C5B2> һ <EFBFBD> ε<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ݹ<EFBFBD> <DDB9> <EFBFBD> <EFBFBD> ã<EFBFBD> <C3A3> <EFBFBD> <EFBFBD> ж<EFBFBD> <D0B6> ν <EFBFBD> <CEBD> <EFBFBD> undo/redo
SetReUnDoAction ( ) ;
ideep + + ;
CTrackObj * pTrack = NULL ;
CTrackObj * pParentGroup = NULL ;
CWellBaseObj * pParentObj = NULL ;
pGroup - > RemoveTrack ( pTrackMoving ) ;
TRACKLIST : : iterator posObj ;
TRACKLIST : : iterator it = pGroup - > GetTrackList ( ) . begin ( ) ;
for ( ; it ! = pGroup - > GetTrackList ( ) . end ( ) ; it + + )
{
pTrack = * it ; // pGroup->GetTrackList()->GetAt(pos);
posObj = it ;
pParentGroup = ( CTrackGroup * ) pTrack - > GetParent ( ) ;
pParentObj = pTrack - > GetParent ( ) ;
//<2F> <> <EFBFBD> ڲ<EFBFBD> <DAB2> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ң<EFBFBD> <D2A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е ĵ<D0B5> <C4B5> <EFBFBD> <EFBFBD> б Ƚϣ<C8BD> <CFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ±<EFBFBD> <C2B1> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <C5B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱֻҪ<D6BB> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <D0A1> Ŀ<EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ㼴<C4B5> <E3BCB4>
BOOL bLeft = pTrackMoving - > m_active_head . CenterPoint ( ) . x0 < = pTrack - > m_HeadRect . CenterPoint ( ) . x0 ;
BOOL bRight = pTrackMoving - > m_active_head . CenterPoint ( ) . x0 > = pTrack - > m_HeadRect . CenterPoint ( ) . x0 & &
pTrackMoving - > m_active_head . CenterPoint ( ) . x0 < = pTrack - > m_HeadRect . right ;
BOOL bIn = pTrack - > m_HeadRect . PtInRect ( pTrackMoving - > m_active_head . CenterPoint ( ) ) ;
if ( bLeft | | bRight )
{
if ( pTrack - > GetTrackType ( ) = = Track_Group )
{ //<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <C5B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> ,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ұߵ ķ<DFB5> Χ <EFBFBD> <CEA7>
CTrackGroup * pTrackGroup = ( CTrackGroup * ) pTrack ;
if ( bIn ) //pTrackGroup->m_HeadRect.PtInRect(pTrackMoving->m_active_head.CenterPoint()))
{ //<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <C5B5> <EFBFBD> pTrack<63> ڲ<EFBFBD>
if ( pTrackGroup - > GetGroupType ( ) = = Group_Vertical )
{
pTrackMoving - > SetTrackWidthRatio ( pTrack - > m_dTrackWidth / pTrackMoving - > m_dTrackWidth ) ;
pTrackGroup - > GetTrackList ( ) . push_back ( pTrackMoving ) ;
pTrackMoving - > SetParent ( pTrackGroup ) ;
return TRUE ;
}
else
{ //ˮƽ <CBAE> <C6BD> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݹ<EFBFBD>
( SortTrackWhenMoving ( pTrackGroup , pTrackMoving , ideep ) ) ;
return TRUE ;
}
}
else
{ //<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ㲻<C5B5> <E3B2BB> pTrack<63> ڲ<EFBFBD> <DAB2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <C5B5> <EFBFBD> pTrack<63> <6B> <EFBFBD> ϱ <CFB1> <DFBB> ±ߣ<C2B1> <DFA3> <EFBFBD> ֱ<EFBFBD> Ӽ<EFBFBD> <D3BC> 뵽pGroup
if ( pGroup - > GetGroupType ( ) = = Group_Vertical )
{
pTrackMoving - > SetTrackWidthRatio ( pGroup - > m_dTrackWidth / pTrackMoving - > m_dTrackWidth ) ;
}
if ( bRight ) //<2F> <> <EFBFBD> ŵ<EFBFBD> <C5B5> <EFBFBD> Ŀ<EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> <EFBFBD> Ҳ࣬<D2B2> <E0A3AC> <EFBFBD> <EFBFBD> <EFBFBD> 뵽Ŀ<EBB5BD> ĵ<EFBFBD> <C4B5> ĺ<EFBFBD> <C4BA> <EFBFBD>
posObj + + ;
pGroup - > GetTrackList ( ) . insert ( posObj , pTrackMoving ) ;
pTrackMoving - > SetParent ( pGroup ) ;
return TRUE ;
}
}
else
{ //<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> <C5B5> Dz<EFBFBD> <C7B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> ,<2C> <> <EFBFBD> ұߵ ķ<DFB5> Χ
if ( ( pTrack - > GetTrackType ( ) = = Track_Curve | | pTrack - > GetTrackType ( ) = = Track_Discrete | |
pTrackMoving - > GetTrackType ( ) = = Track_Curve | | pTrackMoving - > GetTrackType ( ) = = Track_Discrete ) & &
bIn )
{ //<2F> <> <EFBFBD> <EFBFBD> ɢ<EFBFBD> <C9A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD> ϣ<EFBFBD> <CFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD>
CTrackGroup * pTrackGroup = new CTrackGroup ( ) ;
pTrackGroup - > SetGroupType ( Group_Vertical ) ;
pTrackGroup - > m_font = pGroup - > m_font ;
pTrackGroup - > m_pen = pGroup - > m_pen ;
pTrackGroup - > m_dTrackWidth = pTrack - > m_dTrackWidth ;
pTrackMoving - > m_dTrackWidth = pTrack - > m_dTrackWidth ;
pTrackGroup - > SetParent ( pParentObj ) ;
pTrackGroup - > SetParentXY ( pGroup - > GetParentXY ( ) ) ;
if ( pTrack - > m_HeadRect . CenterPoint ( ) . y0 > pTrackMoving - > m_active_head . CenterPoint ( ) . y0 )
{
pTrackGroup - > AddTrack ( pTrack ) ;
pTrackGroup - > AddTrack ( pTrackMoving ) ;
}
else
{
pTrackGroup - > AddTrack ( pTrackMoving ) ;
pTrackGroup - > AddTrack ( pTrack ) ;
}
pGroup - > GetTrackList ( ) . insert ( posObj , pTrackGroup ) ;
pGroup - > GetTrackList ( ) . erase ( posObj ) ;
return TRUE ;
}
else
{ //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͵ĵ<CDB5> <C4B5> <EFBFBD> ֱ<EFBFBD> Ӽ<EFBFBD> <D3BC> 롣
if ( pGroup - > GetGroupType ( ) = = Group_Vertical )
{
pTrackMoving - > SetTrackWidthRatio ( pGroup - > m_dTrackWidth / pTrackMoving - > m_dTrackWidth ) ;
}
if ( bRight )
posObj + + ;
pGroup - > GetTrackList ( ) . insert ( posObj , pTrackMoving ) ;
pTrackMoving - > SetParent ( pGroup ) ;
return TRUE ;
}
}
}
}
//<2F> <> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> Ҳ<EFBFBD>
if ( pGroup - > GetGroupType ( ) = = Group_Vertical )
{
pTrackMoving - > SetTrackWidthRatio ( pGroup - > m_dTrackWidth / pTrackMoving - > m_dTrackWidth ) ;
}
pGroup - > GetTrackList ( ) . push_back ( pTrackMoving ) ;
pTrackMoving - > SetParent ( pGroup ) ;
return TRUE ;
// return FALSE;
}
void CItemSingleWell : : SetDrawObj ( CWellBaseObj * pObj )
{
double oldangle = 0 ;
//if(m_pWell)
// oldangle = m_pWell->GetHeadLineAngle();
m_pWell = ( CWellPole * ) pObj ;
if ( m_pWell )
{
//if(abs(m_pWell->GetHeadLineAngle() - oldangle)>0.0001)
// CreateVHCursor();
}
}
void CItemSingleWell : : DestroyVHCursor ( )
{
if ( m_HCursor )
{
: : DestroyCursor ( m_HCursor ) ;
m_HCursor = NULL ;
m_pHCursorBmp - > DeleteObject ( ) ;
delete m_pHCursorBmp ;
m_pHCursorMaskBmp - > DeleteObject ( ) ;
delete m_pHCursorMaskBmp ;
}
if ( m_VCursor )
{
: : DestroyCursor ( m_VCursor ) ;
m_VCursor = NULL ;
m_pVCursorBmp - > DeleteObject ( ) ;
delete m_pVCursorBmp ;
m_pVCursorMaskBmp - > DeleteObject ( ) ;
delete m_pVCursorMaskBmp ;
}
}
void CItemSingleWell : : CreateVHCursor ( )
{
if ( ! m_pWell )
return ;
if ( m_pWell - > GetWellType ( ) = = Well_Incline )
{
if ( abs ( m_pWell - > GetHeadLineAngle ( ) ) < 0.0001 )
return ;
DestroyVHCursor ( ) ;
HCURSOR cursor = AfxGetApp ( ) - > LoadCursor ( IDC_SIZEWE ) ; //AfxGetApp()->LoadStandardCursor(IDC_DRAG_HOR);
m_pVCursorBmp = new CBitmap ;
m_pVCursorMaskBmp = new CBitmap ;
m_VCursor = CreateAngleCursor ( cursor , m_pVCursorBmp , m_pVCursorMaskBmp , - m_pWell - > GetHeadLineAngle ( ) ) ;
cursor = AfxGetApp ( ) - > LoadCursor ( IDC_SIZENS ) ; //AfxGetApp()->LoadStandardCursor(IDC_DRAG_HOR);
m_pHCursorBmp = new CBitmap ;
m_pHCursorMaskBmp = new CBitmap ;
m_HCursor = CreateAngleCursor ( cursor , m_pHCursorBmp , m_pHCursorMaskBmp , - m_pWell - > GetHeadLineAngle ( ) ) ;
}
}
HCURSOR CItemSingleWell : : CreateAngleCursor ( HCURSOR cursor , CBitmap * pCursorBmp , CBitmap * pCursorMaskBmp , double angle )
{
HCURSOR retCursor = NULL ;
ICONINFO cursorinfo ;
BOOL b = GetIconInfo ( ( HICON ) ( cursor ) , & cursorinfo ) ;
BITMAP maskBitInfo , cursorBitInfo ;
: : GetObject ( ( HGDIOBJ ) cursorinfo . hbmMask , sizeof ( BITMAP ) , & maskBitInfo ) ; //<2F> õ<EFBFBD> ԭʼ <D4AD> <CABC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊͼ<CEAA> <CDBC> Ϣ
: : GetObject ( ( HGDIOBJ ) cursorinfo . hbmColor , sizeof ( BITMAP ) , & cursorBitInfo ) ; //<2F> õ<EFBFBD> ԭʼ <D4AD> <CABC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λͼ<CEBB> <CDBC> Ϣ
CBitmap sCousorbmp , sMaskbmp ;
sCousorbmp . Attach ( cursorinfo . hbmColor ) ;
sMaskbmp . Attach ( cursorinfo . hbmMask ) ;
CDC * pDC = GetDC ( ) - > GetDC ( ) ;
CPoint2D pospts [ 4 ] ; //ԭʼ <D4AD> <CABC> <EFBFBD> <EFBFBD> <EFBFBD> Ĵ<EFBFBD> С
pospts [ 0 ] . x0 = 0 ; pospts [ 0 ] . y0 = maskBitInfo . bmHeight ;
pospts [ 1 ] . x0 = maskBitInfo . bmWidth ; pospts [ 1 ] . y0 = maskBitInfo . bmHeight ;
pospts [ 2 ] . x0 = maskBitInfo . bmWidth ; pospts [ 2 ] . y0 = 0 ;
pospts [ 3 ] . x0 = 0 ; pospts [ 3 ] . y0 = 0 ;
for ( int ii = 0 ; ii < 4 ; ii + + )
{
//pospts[ii].RotatePt(0,0,angle);
}
CPoint plgPts [ 4 ] ; //<2F> <> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¹<EFBFBD> <C2B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĸ<EFBFBD> <C4B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
CPoint topleftPt , botRightPt , tpt ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϣ<EFBFBD> <CFA3> <EFBFBD> <EFBFBD> ½<EFBFBD>
botRightPt . x = topleftPt . x = int ( pospts [ 0 ] . x0 ) ;
botRightPt . y = topleftPt . y = int ( pospts [ 0 ] . y0 ) ;
for ( int ii = 0 ; ii < 4 ; ii + + )
{
tpt . x = int ( pospts [ ii ] . x0 ) ;
tpt . y = int ( pospts [ ii ] . y0 ) ;
plgPts [ ii ] = tpt ;
if ( tpt . x < topleftPt . x )
topleftPt . x = tpt . x ;
if ( tpt . x > botRightPt . x )
botRightPt . x = tpt . x ;
if ( tpt . y < topleftPt . y )
topleftPt . y = tpt . y ;
if ( tpt . y > botRightPt . y )
botRightPt . y = tpt . y ;
}
if ( topleftPt . y < 0 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <D0A1> 0<EFBFBD> <30> <EFBFBD> <EFBFBD> ƫ<EFBFBD> <C6AB> һ <EFBFBD> £<EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
int l = - topleftPt . y ;
topleftPt . y + = l ;
botRightPt . y + = l ;
for ( int ii = 0 ; ii < 4 ; ii + + )
{
plgPts [ ii ] . y + = l ;
}
}
if ( topleftPt . x < 0 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <D0A1> 0<EFBFBD> <30> <EFBFBD> <EFBFBD> ƫ<EFBFBD> <C6AB> һ <EFBFBD> £<EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
int l = - topleftPt . x ;
botRightPt . x + = l ;
topleftPt . x + = l ;
for ( int ii = 0 ; ii < 4 ; ii + + )
{
plgPts [ ii ] . x + = l ;
}
}
CRect rect ;
rect . SetRect ( topleftPt , botRightPt ) ; //<2F> <> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
CBitmap * pOldBitmap ;
CBitmap * pOldmaskmap ;
CDC dc ; dc . CreateCompatibleDC ( pDC ) ;
CDC smaskdc , scursordc ;
smaskdc . CreateCompatibleDC ( pDC ) ;
scursordc . CreateCompatibleDC ( pDC ) ;
pOldmaskmap = smaskdc . SelectObject ( & sMaskbmp ) ; //ʹ <> <CAB9> ԭʼ <D4AD> <CABC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λͼ
pOldBitmap = scursordc . SelectObject ( & sCousorbmp ) ; //ʹ <> <CAB9> ԭʼ <D4AD> <CABC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λͼ
CDC memDC ;
memDC . CreateCompatibleDC ( & dc ) ;
CBitmap * pNewbkCousorbmp ; //ʹ <> <CAB9> ԭʼ <D4AD> <CABC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λͼ<CEBB> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λͼ<CEBB> γ <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> µĹ<C2B5> <C4B9> <EFBFBD> λͼ<CEBB> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> µĹ<C2B5> <C4B9> <EFBFBD> λͼ<CEBB> ı <EFBFBD> <C4B1> <EFBFBD> ɫ<EFBFBD> ƶ<EFBFBD> Ϊ<EFBFBD> <CEAA> ɫ
pNewbkCousorbmp = new CBitmap ;
pNewbkCousorbmp - > CreateBitmap ( cursorBitInfo . bmWidth , cursorBitInfo . bmHeight , cursorBitInfo . bmPlanes , cursorBitInfo . bmBitsPixel , NULL ) ;
CBitmap * pOldNewbkBmp = memDC . SelectObject ( pNewbkCousorbmp ) ;
memDC . FillSolidRect ( 0 , 0 , cursorBitInfo . bmWidth , cursorBitInfo . bmHeight , RGB ( 0 , 0 , 255 ) ) ; //<2F> <> λͼ<CEBB> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɫ
scursordc . SetBkColor ( RGB ( 0 , 0 , 0 ) ) ;
scursordc . SetTextColor ( RGB ( 255 , 255 , 255 ) ) ;
scursordc . BitBlt ( 0 , 0 , maskBitInfo . bmWidth , maskBitInfo . bmHeight , & smaskdc , 0 , 0 , SRCAND ) ;
memDC . SetBkColor ( RGB ( 255 , 255 , 255 ) ) ;
memDC . SetTextColor ( RGB ( 0 , 0 , 0 ) ) ;
memDC . BitBlt ( 0 , 0 , cursorBitInfo . bmWidth , cursorBitInfo . bmHeight , & smaskdc , 0 , 0 , SRCAND ) ;
memDC . BitBlt ( 0 , 0 , cursorBitInfo . bmWidth , cursorBitInfo . bmHeight , & scursordc , 0 , 0 , SRCPAINT ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¹<EFBFBD> <C2B9> <EFBFBD> λͼ<CEBB> <CDBC> <EFBFBD> <EFBFBD> ɫ<EFBFBD> <C9AB> <EFBFBD> <EFBFBD> ɫ(<28> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <CDB8> λͼ<CEBB> <CDBC> ԭ<EFBFBD> <D4AD> )
//pDC->BitBlt(10,100,maskBitInfo.bmWidth,maskBitInfo.bmHeight,&memDC,0,0,SRCCOPY);
smaskdc . SelectObject ( pOldmaskmap ) ;
scursordc . SelectObject ( pOldBitmap ) ;
smaskdc . DeleteDC ( ) ; scursordc . DeleteDC ( ) ;
//pCursorBmp = new CBitmap();
pCursorBmp - > CreateBitmap ( rect . Width ( ) , rect . Height ( ) , cursorBitInfo . bmPlanes , cursorBitInfo . bmBitsPixel , NULL ) ; //<2F> <> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> Ĺ<EFBFBD> <C4B9> <EFBFBD> λͼ<CEBB> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> Ĵ<EFBFBD> С <EFBFBD> <D0A1> <EFBFBD> <EFBFBD>
pOldBitmap = dc . SelectObject ( pCursorBmp ) ;
//pCursorMaskmap = new CBitmap();
pCursorMaskBmp - > CreateBitmap ( rect . Width ( ) , rect . Height ( ) , 1 , 1 , NULL ) ; //<2F> <> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> Ĺ<EFBFBD> <C4B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λͼ<CEBB> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> Ĵ<EFBFBD> С <EFBFBD> <D0A1> <EFBFBD> <EFBFBD>
CPoint points [ 3 ] ;
points [ 0 ] = plgPts [ 0 ] ; /*points[0].Offset(-rect.left,-rect.top);*/
points [ 1 ] = plgPts [ 1 ] ; /* points[1].Offset(-rect.left,-rect.top);*/
points [ 2 ] = plgPts [ 3 ] ; /*points[2].Offset(-rect.left,-rect.top);*/
CBitmap maskBmp ;
ZeroMemory ( & maskBmp , sizeof ( maskBmp ) ) ;
dc . FillSolidRect ( 0 , 0 , rect . Width ( ) , rect . Height ( ) , RGB ( 0 , 0 , 255 ) ) ; //<2F> <> <EFBFBD> нǶȹ<C7B6> <C8B9> <EFBFBD> <EFBFBD> <EFBFBD> λͼ<CEBB> <CDBC> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <C8AB> <EFBFBD> <EFBFBD> ɫ
dc . PlgBlt ( points , & memDC , 0 , 0 , cursorBitInfo . bmWidth , cursorBitInfo . bmHeight , maskBmp , 0 , 0 ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ±<EFBFBD> <C2B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λͼ<CEBB> <CDBC> ת
maskBmp . DeleteObject ( ) ;
memDC . SelectObject ( pOldNewbkBmp ) ;
delete pNewbkCousorbmp ;
pOldmaskmap = memDC . SelectObject ( pCursorMaskBmp ) ;
dc . SetBkColor ( RGB ( 0 , 0 , 255 ) ) ;
memDC . BitBlt ( 0 , 0 , rect . Width ( ) , rect . Height ( ) , & dc , 0 , 0 , SRCCOPY ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> нǶȹ<C7B6> <C8B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊͼ,<> <CDB8> ɫ<EFBFBD> <C9AB> <EFBFBD> <EFBFBD> ɫ
//pDC->BitBlt(100,10,rect.Width(),rect.Height(),&memDC,0,0,SRCCOPY);
//pDC->BitBlt(100,100,rect.Width(),rect.Height(),&dc,0,0,SRCCOPY);
memDC . SelectObject ( pOldmaskmap ) ;
memDC . DeleteDC ( ) ;
dc . SelectObject ( pOldBitmap ) ;
ICONINFO newicon ;
newicon . fIcon = FALSE ;
newicon . xHotspot = rect . Width ( ) / 2 ;
newicon . yHotspot = rect . Height ( ) / 2 ;
newicon . hbmMask = HBITMAP ( pCursorMaskBmp - > GetSafeHandle ( ) ) ;
newicon . hbmColor = HBITMAP ( pCursorBmp - > GetSafeHandle ( ) ) ;
retCursor = : : CreateIconIndirect ( & newicon ) ;
sCousorbmp . Detach ( ) ;
sMaskbmp . Detach ( ) ;
: : DeleteObject ( cursorinfo . hbmColor ) ;
: : DeleteObject ( cursorinfo . hbmMask ) ;
return retCursor ;
}
void CItemSingleWell : : DrawHandle ( CXyDC * pDC , const CPoint2D & point )
{
CItemNestBase : : DrawHandle ( pDC , point ) ;
}
void CItemSingleWell : : DrawHandle ( CXyDC * pDC )
{
if ( m_pWell ! = NULL )
{
if ( m_pWell - > GetWellType ( ) = = Well_Incline )
{
}
else
CItemNestBase : : DrawHandle ( pDC ) ;
}
else
CItemNestBase : : DrawHandle ( pDC ) ;
}
BOOL CItemSingleWell : : AnalysisPor ( )
{
/* CWellPole* pWell = GetWellObject();
if ( NULL = = pWell )
{
return FALSE ;
}
CDlgCurvePorAnalysis dlg ;
CTrackList CurveList ;
pWell - > GetTrackCurve ( & CurveList ) ;
POSITION pos = CurveList . GetHeadPosition ( ) ;
while ( pos )
{
CTrackCurveObj * pTrackCurve = ( CTrackCurveObj * ) CurveList . GetNext ( pos ) ;
dlg . m_CurveList . AddTail ( pTrackCurve - > GetDataObj ( ) ) ;
dlg . m_Por1 . m_CurveList . AddTail ( pTrackCurve - > GetDataObj ( ) ) ;
}
CDataObj_Curve * pChild = NULL ;
if ( dlg . m_CurveList . GetCount ( ) > 0 )
{
pChild = ( CDataObj_Curve * ) dlg . m_CurveList . GetHead ( ) ;
}
if ( pChild = = NULL )
{
return FALSE ;
}
double PorTemp , SwWaterTemp , SwOilTemp , AnalysisHd ;
dlg . m_Por1 . m_stdep = pChild - > m_startdep ;
dlg . m_Por1 . m_endep = pChild - > m_enddep ;
dlg . m_Por1 . m_rlev = pChild - > m_rlev ;
dlg . m_Por1 . m_porPara . sdep = dlg . m_Por1 . m_stdep ;
dlg . m_Por1 . m_porPara . edep = dlg . m_Por1 . m_endep ;
dlg . m_Por2 . m_stdep = pWell - > m_fSdep ;
dlg . m_Por2 . m_endep = pWell - > m_fEdep ;
if ( dlg . DoModal ( ) ! = IDOK )
{
return FALSE ;
}
PorTemp = dlg . m_Por ;
SwWaterTemp = dlg . m_SwWater ;
SwOilTemp = dlg . m_SwOil ;
AnalysisHd = dlg . m_AnalysisHd ;
if ( ! dlg . m_bAddTrack )
{
return FALSE ;
}
CreatePorTrack ( pWell , dlg . m_Por1 . m_CurveList , dlg . m_bShowAnalysis , PorTemp , SwWaterTemp , SwOilTemp , AnalysisHd ) ; */
return TRUE ;
}
BOOL CItemSingleWell : : AnalysisSand ( )
{
//CWellPole* pWell = GetWellObject();
//if (NULL == pWell)
//{
// return FALSE;
//}
//CDlgCurveSandAnalysis dlg;
//CTrackList CurveList;
//pWell->GetTrackCurve(&CurveList);
//POSITION pos = CurveList.GetHeadPosition();
//while(pos)
//{
// CTrackCurveObj* pTrackCurve = (CTrackCurveObj*)CurveList.GetNext(pos);
// dlg.m_CurveList.AddTail(pTrackCurve->GetDataObj());
// dlg.m_Sand1.m_CurveList.AddTail(pTrackCurve->GetDataObj());
// dlg.m_Sand2.m_CurveList.AddTail(pTrackCurve->GetDataObj());
//}
//CurveList.RemoveAll();
//CDataObj_Curve *pChild = NULL;
//if(dlg.m_CurveList.GetCount() > 0)
//{
// pChild = (CDataObj_Curve*)dlg.m_CurveList.GetHead();
//}
//if(pChild == NULL)
//{
// return FALSE;
//}
//dlg.m_Sand1.m_rlev = pChild->m_rlev;
//dlg.m_Sand1.m_stdep = pWell->m_fSdep;
//dlg.m_Sand1.m_endep = pWell->m_fEdep;
//dlg.m_Sand1.m_sandPara.sdep = pChild->m_startdep;
//dlg.m_Sand1.m_sandPara.edep = pChild->m_enddep;
////dlg.m_Sand1.m_pCurve = pCurveData;
////dlg.m_Sand2.m_pCurve = pCurveData;
//dlg.m_Sand2.m_rlev = pChild->m_rlev;
//dlg.m_Sand2.m_sandPara.sdep = pWell->m_fSdep;
//dlg.m_Sand2.m_sandPara.edep = pWell->m_fEdep;
//dlg.m_Sand2.m_stdep = pWell->m_fSdep;
//dlg.m_Sand2.m_endep = pWell->m_fEdep;
//if(dlg.DoModal() != IDOK)
//{
// return FALSE;
//}
//double PorTemp,SwWaterTemp,SwOilTemp,AnalysisHd;
//PorTemp = dlg.m_Por;
//SwWaterTemp = dlg.m_SwWater;
//SwOilTemp = dlg.m_SwOil;
//AnalysisHd = dlg.m_AnalysisHd;
//if (!dlg.m_bAddTrack)
//{
// return FALSE;
//}
//CreateSandTrack(pWell,dlg.m_Sand1.m_CurveList,dlg.m_bShowAnalysis,PorTemp,SwWaterTemp,SwOilTemp,AnalysisHd);
return TRUE ;
}
BOOL CItemSingleWell : : CalculatePor ( )
{
//CTrackObj* pTrackSelected = NULL;
//CWellBaseObj* pObjSelected = NULL;
//if(m_WellObjSelectlist.GetCount() > 0)
// pObjSelected = m_WellObjSelectlist.GetHead();
//if (pObjSelected->GetType() == GDOUBLEFOX_TRACK)
//{
// pTrackSelected = (CTrackObj*)pObjSelected;
//}
//if (NULL == pTrackSelected)
// return FALSE;
//if(pTrackSelected->GetTrackType() != Track_Curve)
// return FALSE;
//CTrackCurveObj* pTrackCurve = (CTrackCurveObj*)pTrackSelected;
//CDlgCurvePor dlg;
//dlg.m_dSkeleon = pTrackCurve->m_curve_left;
//dlg.m_dFluid = pTrackCurve->m_curve_right;
//if(dlg.DoModal() != IDOK)
// return FALSE;
//CTrackCurveObj* pTrackCurveNew = new CTrackCurveObj;
//pTrackCurveNew->m_strTrackName = "POR";
//pTrackCurveNew->m_curve_left = 0.0;
//pTrackCurveNew->m_curve_right = 100.0;
//pTrackCurveNew->m_pen = pTrackCurve->m_pen;
//pTrackCurveNew->m_penCurve = pTrackCurve->m_penCurve;
//pTrackCurveNew->m_font = pTrackCurve->m_font;
//pTrackCurveNew->m_fontHeadMark = pTrackCurve->m_fontHeadMark;
//pTrackCurveNew->m_dataObj.m_curve_name = pTrackCurveNew->m_strTitle;
//pTrackCurveNew->m_dataObj.m_curve_unit = pTrackCurve->m_dataObj.m_depth_unit;
//pTrackCurveNew->m_dataObj.m_startdep = pTrackCurve->m_dataObj.m_startdep;
//pTrackCurveNew->m_dataObj.m_enddep = pTrackCurve->m_dataObj.m_enddep;
//pTrackCurveNew->m_dataObj.m_rlev = pTrackCurve->m_dataObj.m_rlev;
//pTrackCurveNew->m_dataObj.m_construct_num = pTrackCurve->m_dataObj.m_construct_num;
//pTrackCurveNew->m_dataObj.m_maxvalue = pTrackCurve->m_dataObj.m_maxvalue;
//pTrackCurveNew->m_dataObj.m_minvalue = pTrackCurve->m_dataObj.m_minvalue;
//pTrackCurveNew->m_dataObj.m_sample_count = pTrackCurve->m_dataObj.m_sample_count;
//if(pTrackCurveNew->m_dataObj.m_sample_count > 0)
//{
// pTrackCurveNew->m_dataObj.m_curve_depth = new float [pTrackCurveNew->m_dataObj.m_sample_count];
// pTrackCurveNew->m_dataObj.m_curve_value = new float [pTrackCurveNew->m_dataObj.m_sample_count];
// double dValue = 0;
// for(int i=0; i<pTrackCurveNew->m_dataObj.m_sample_count; i++)
// {
// pTrackCurveNew->m_dataObj.m_curve_depth[i] = pTrackCurve->m_dataObj.m_curve_depth[i];
// dValue = (pTrackCurve->m_dataObj.m_curve_value[i]-dlg.m_dSkeleon)/(dlg.m_dFluid-dlg.m_dSkeleon);
// pTrackCurveNew->m_dataObj.m_curve_value[i] = dValue * 100.0;
// }
//}
////<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ·<EFBFBD>
//CTrackList tracklist;
//tracklist.AddTail(pTrackCurveNew);
//AddTrack(pTrackSelected, tracklist, TRUE);
return TRUE ;
}
BOOL CItemSingleWell : : CalculateSH ( )
{
//CTrackObj* pTrackSelected = NULL;
//CWellBaseObj* pObjSelected = NULL;
//if(m_WellObjSelectlist.GetCount() > 0)
// pObjSelected = m_WellObjSelectlist.GetHead();
//if (pObjSelected->GetType() == GDOUBLEFOX_TRACK)
//{
// pTrackSelected = (CTrackObj*)pObjSelected;
//}
//if (NULL == pTrackSelected)
// return FALSE;
//if(pTrackSelected->GetTrackType() != Track_Curve)
// return FALSE;
//CTrackCurveObj* pTrackCurve = (CTrackCurveObj*)pTrackSelected;
//CDlgCurveSH dlg;
//dlg.m_dSand = pTrackCurve->m_curve_left;
//dlg.m_dMud = pTrackCurve->m_curve_right;
//if(dlg.DoModal() != IDOK)
// return FALSE;
//CTrackCurveObj* pTrackCurveNew = new CTrackCurveObj;
//pTrackCurveNew->m_strTrackName = "SH";
//pTrackCurveNew->m_curve_left = 0.0;
//pTrackCurveNew->m_curve_right = 100.0;
//pTrackCurveNew->m_pen = pTrackCurve->m_pen;
//pTrackCurveNew->m_penCurve = pTrackCurve->m_penCurve;
//pTrackCurveNew->m_font = pTrackCurve->m_font;
//pTrackCurveNew->m_fontHeadMark = pTrackCurve->m_fontHeadMark;
//pTrackCurveNew->m_dataObj.m_curve_name = pTrackCurveNew->m_strTitle;
//pTrackCurveNew->m_dataObj.m_curve_unit = pTrackCurve->m_dataObj.m_depth_unit;
//pTrackCurveNew->m_dataObj.m_startdep = pTrackCurve->m_dataObj.m_startdep;
//pTrackCurveNew->m_dataObj.m_enddep = pTrackCurve->m_dataObj.m_enddep;
//pTrackCurveNew->m_dataObj.m_rlev = pTrackCurve->m_dataObj.m_rlev;
//pTrackCurveNew->m_dataObj.m_construct_num = pTrackCurve->m_dataObj.m_construct_num;
//pTrackCurveNew->m_dataObj.m_maxvalue = pTrackCurve->m_dataObj.m_maxvalue;
//pTrackCurveNew->m_dataObj.m_minvalue = pTrackCurve->m_dataObj.m_minvalue;
//pTrackCurveNew->m_dataObj.m_sample_count = pTrackCurve->m_dataObj.m_sample_count;
//if(pTrackCurveNew->m_dataObj.m_sample_count > 0)
//{
// pTrackCurveNew->m_dataObj.m_curve_depth = new float [pTrackCurveNew->m_dataObj.m_sample_count];
// pTrackCurveNew->m_dataObj.m_curve_value = new float [pTrackCurveNew->m_dataObj.m_sample_count];
// double dValue = 0;
// for(int i=0; i<pTrackCurveNew->m_dataObj.m_sample_count; i++)
// {
// pTrackCurveNew->m_dataObj.m_curve_depth[i] = pTrackCurve->m_dataObj.m_curve_depth[i];
// dValue = (pTrackCurve->m_dataObj.m_curve_value[i] - dlg.m_dSand)/(dlg.m_dMud - dlg.m_dSand);
// if(dValue < 0.0) dValue = 0.0;
// if(dValue > 1.0) dValue = 1.0;
// dValue = (exp(dlg.m_dGCUR * dValue * log(2.0)) - 1.0) / (exp(dlg.m_dGCUR * log(2.0)) - 1.0);
// if(dValue < 0.0) dValue = 0.0;
// if(dValue > .999) dValue = .999;
// pTrackCurveNew->m_dataObj.m_curve_value[i] = dValue * 100.0;
// }
//}
////<2F> <> <EFBFBD> 뵽<EFBFBD> <EBB5BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//CTrackList tracklist;
//tracklist.AddTail(pTrackCurveNew);
//AddTrack(pTrackSelected, tracklist, TRUE);
return TRUE ;
}
void CItemSingleWell : : CurveDataStatistic ( )
{
if ( GetItem ( ) = = NULL )
return ;
CWellBaseObj * pObjSelect = ( ( CItemWellBase * ) GetItem ( ) ) - > GetDrawObj ( ) ;
//if (pObjSelect->GetType() == GDOUBLEFOX_LOGCURVESEGMENT)
//{
// CTrackInCurveSegment* pTrackInCurveSegment = (CTrackInCurveSegment*)pObjSelect;
// CTrackCurveObj* pTrackCurve = (CTrackCurveObj*)pTrackInCurveSegment->GetParentObj();
// double sdep = pTrackInCurveSegment->m_fSdep;
// double edep = pTrackInCurveSegment->m_fEdep;
// //<2F> <> <EFBFBD> <D7BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// if(float(sdep/pTrackCurve->m_fRlev) != int(sdep/pTrackCurve->m_fRlev))
// {
// sdep = float(int(sdep/pTrackCurve->m_fRlev + 1)*pTrackCurve->m_fRlev);
// }
// if(float(edep/pTrackCurve->m_fRlev) != int(edep/pTrackCurve->m_fRlev))
// {
// edep = float(int(edep/pTrackCurve->m_fRlev)*pTrackCurve->m_fRlev);
// }
// StringVectorSet datas;
// vector<CString> vectorfield;
// vectorfield.push_back("DEPTH");
// vectorfield.push_back(pTrackCurve->m_strTrackName);
// CString strDepth;
// CString strValue;
// double fDepth;
// vector<CString> vectorinfor;
// int nCount = int((edep - sdep)/pTrackCurve->m_fRlev) + 1;
// CString strTitle;
// strTitle.LoadString(IDS_STR_TEMPLATE_CHART);
// CPropertySheet StatisticSheet(strTitle);
// StatisticSheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;
// CDlgCurveStatisticHistogram page1;
// page1.m_StructCurveData.fSdep = sdep;
// page1.m_StructCurveData.fEdep = edep;
// page1.m_StructCurveData.fRlev = pTrackCurve->m_fRlev;
// page1.m_StructCurveData.curve_name = pTrackCurve->m_strTrackName;
// page1.m_StructCurveData.curve_num = pTrackCurve->m_curve_num;
// page1.m_StructCurveData.curve_value = new float[nCount];
// page1.m_StructCurveData.curve_depth = new float[nCount];
// int curveStart = int((sdep - pTrackCurve->m_fSdep)/pTrackCurve->m_fRlev+0.5);
// for(int j=0; j<nCount; j++)
// {
// page1.m_StructCurveData.curve_value[j] = pTrackCurve->GetCurveValue(curveStart+j);
// page1.m_StructCurveData.curve_depth[j] = sdep+j*pTrackCurve->m_fRlev;
// vectorinfor.clear();
// strValue.Format("%f",pTrackCurve->GetCurveValue(curveStart+j));
// fDepth = sdep+j*pTrackCurve->m_fRlev;
// strDepth.Format("%f",fDepth);
// vectorinfor.push_back(strDepth);
// vectorinfor.push_back(strValue);
// datas.push_back(vectorinfor);
// }
// page1.m_strTrackName = pTrackCurve->m_strTrackName;
// StatisticSheet.AddPage(&page1);
// CDataPropertyPage datapage(vectorfield,datas);
// datapage.SetGridCtrlEdit(false);
// datapage.SetCurveStatistic(true);
// StatisticSheet.AddPage(&datapage);
// StatisticSheet.DoModal();
//}
//if (pObjSelect->GetType() == KEP_TRACK)
//{
// CTrackObj* pTrack = (CTrackObj*)pObjSelect;
// //<2F> <> ȡͼ<C8A1> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݱ<EFBFBD> <DDB1> <EFBFBD> <EFBFBD> ֶ<EFBFBD>
// CString table;
// CDataTableConfig TempDataConfig;
// CString strTitle;
// strTitle.LoadString(IDS_STR_TEMPLATE_CHART);
// if (pTrack->GetTrackType() == Track_Curve)
// {
// CTrackCurveObj* pTrackCurve = (CTrackCurveObj*)pTrack;
// if (0 == pTrackCurve->GetDataCount())
// {
// return;
// }
// double sdep = pTrackCurve->m_fSdep;
// double edep = pTrackCurve->m_fEdep;
// //<2F> <> <EFBFBD> <D7BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// if(float(sdep/pTrackCurve->m_fRlev) != int(sdep/pTrackCurve->m_fRlev))
// {
// sdep = float(int(sdep/pTrackCurve->m_fRlev + 1)*pTrackCurve->m_fRlev);
// }
// if(float(edep/pTrackCurve->m_fRlev) != int(edep/pTrackCurve->m_fRlev))
// {
// edep = float(int(edep/pTrackCurve->m_fRlev)*pTrackCurve->m_fRlev);
// }
// StringVectorSet datas;
// vector<CString> vectorfield;
// vectorfield.push_back("DEPTH");
// vectorfield.push_back(pTrackCurve->m_strTrackName);
// CString strDepth;
// CString strValue;
// double fDepth;
// vector<CString> vectorinfor;
// CPropertySheet StatisticSheet(strTitle);
// StatisticSheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;
// CDlgCurveStatisticHistogram page1;
// page1.m_StructCurveData.fSdep = sdep;
// page1.m_StructCurveData.fEdep = edep;
// page1.m_StructCurveData.fRlev = pTrackCurve->m_fRlev;
// page1.m_StructCurveData.curve_name = pTrackCurve->m_strTrackName;
// page1.m_StructCurveData.curve_num = pTrackCurve->m_curve_num;
// page1.m_StructCurveData.curve_value = new float[pTrackCurve->GetDataCount()];
// page1.m_StructCurveData.curve_depth = new float[pTrackCurve->GetDataCount()];
// for(int j=0; j<pTrackCurve->GetDataCount(); j++)
// {
// page1.m_StructCurveData.curve_value[j] = pTrackCurve->GetCurveValue(j);
// page1.m_StructCurveData.curve_depth[j] = sdep+j*pTrackCurve->m_fRlev;
// vectorinfor.clear();
// strValue.Format("%f",pTrackCurve->GetCurveValue(j));
// fDepth = sdep+j*pTrackCurve->m_fRlev;
// strDepth.Format("%f",fDepth);
// vectorinfor.push_back(strDepth);
// vectorinfor.push_back(strValue);
// datas.push_back(vectorinfor);
// }
// page1.m_strTrackName = pTrackCurve->m_strTrackName;
// StatisticSheet.AddPage(&page1);
// TempDataConfig.SetTableID("Curve");
// TempDataConfig.Read();
// table = TempDataConfig.GetTableBase();
// CDataTrackPropertyPage datapage(GetWellObject(),pTrackCurve,datas,table,pTrackCurve->m_strTrackName);
// datapage.m_bCurve = TRUE;
// datapage.SetDataConfig(TempDataConfig);
// datapage.SetGridCtrlEdit(false);
// datapage.SetCurveStatistic(true);
// StatisticSheet.AddPage(&datapage);
// StatisticSheet.DoModal();
// }
// else if (pTrack->GetTrackType() == Track_Discrete)
// {
// CTrackDiscreteObj* pTrackDiscrete = (CTrackDiscreteObj*)pTrack;
// if (0 == pTrackDiscrete->GetDataCount())
// {
// return;
// }
// CWellPole* pWell = (CWellPole*)pTrackDiscrete->GetParentObj();
// double sdep = pWell->m_fSdep;
// double edep = pWell->m_fEdep;
// StringVectorSet datas;
// vector<CString> vectorfield;
// vectorfield.push_back("DEPTH");
// vectorfield.push_back(pTrackDiscrete->m_strTrackName);
// CString strDepth;
// CString strValue;
// double fDepth;
// vector<CString> vectorinfor;
// CPropertySheet StatisticSheet(strTitle);
// StatisticSheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;
// CDlgCurveStatisticHistogram page1;
// page1.m_bDiscrete = true;
// page1.m_StructCurveData.fSdep = sdep;
// page1.m_StructCurveData.fEdep = edep;
// page1.m_StructCurveData.curve_name = pTrackDiscrete->m_strTrackName;
// page1.m_StructCurveData.curve_num = pTrackDiscrete->m_curve_num;
// page1.m_nDiscreteCount = pTrackDiscrete->GetDataCount();
// page1.m_StructCurveData.curve_value = new float[pTrackDiscrete->GetDataCount()];
// page1.m_StructCurveData.curve_depth = new float[pTrackDiscrete->GetDataCount()];
// for(int j=0; j<pTrackDiscrete->GetDataCount(); j++)
// {
// page1.m_StructCurveData.curve_value[j] = pTrackDiscrete->GetCurveValue(j);
// page1.m_StructCurveData.curve_depth[j] = pTrackDiscrete->GetCurveDepth(j);
// vectorinfor.clear();
// strValue.Format("%f",pTrackDiscrete->GetCurveValue(j));
// fDepth = pTrackDiscrete->GetCurveDepth(j);
// strDepth.Format("%f",fDepth);
// vectorinfor.push_back(strDepth);
// vectorinfor.push_back(strValue);
// datas.push_back(vectorinfor);
// }
// page1.m_strTrackName = pTrackDiscrete->m_strTrackName;
// StatisticSheet.AddPage(&page1);
// TempDataConfig.SetTableID("Discrete");
// TempDataConfig.Read();
// table = TempDataConfig.GetTableBase();
// CDataTrackPropertyPage datapage(GetWellObject(),pTrackDiscrete, datas, table,pTrackDiscrete->m_strTrackName);
// datapage.m_bCurve = TRUE;
// datapage.SetDataConfig(TempDataConfig);
// datapage.SetGridCtrlEdit(false);
// datapage.SetCurveStatistic(true);
// StatisticSheet.AddPage(&datapage);
// StatisticSheet.DoModal();
// }
//}
}
//void CItemSingleWell::CreatePorTrack(CWellPole* pWell,CDataObjList& CurveList,BOOL bAddResult,double PorTemp,double SwWaterTemp,double SwOilTemp,double AnalysisHd)
//{
// CTrackList trackList;
// CWellBaseObj* pObj = NULL;
// CTrackObj* pTrack = NULL;
// /////////////////////////////////////////////////////////////////////////////////////////////////
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> ϵ<EFBFBD>
// CTrackGroupObj* pTrackGroup_1 = new CTrackGroupObj;
// pTrackGroup_1->SetGroupType(Group_Vertical);
// pTrackGroup_1->m_font = pWell->m_fontTrack;
// pTrackGroup_1->m_pen = pWell->m_penTrack;
// pTrackGroup_1->SetPenGrid(pWell->m_penGridMajor, pWell->m_penGridMinor);
// pTrackGroup_1->SetFontHeadMark(pWell->m_fontHeadMark);
// pTrackGroup_1->SetFontGridMark(pWell->m_fontGridMark);
// pTrackGroup_1->SetSpace(pWell->m_fMajorSpace, pWell->m_fMinorSpace);
// pTrackGroup_1->m_dTrackWidth = 30.0;
// CTrackCurveObj* pTrackCurveObj_11 = NULL;
// pTrackCurveObj_11 = CreateNewCurveTrack(pWell,"SW","%",30.0,atof("100"),float(atof("0")),FALSE,RGB(0,0,255));
// CTrackCurveObj* pTrackCurveObj_12 = NULL;
// pTrackCurveObj_12 = CreateNewCurveTrack(pWell,"PERM","<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ",30.0,atof("0.1"),atof("1000"),TRUE,RGB(255,128,0));
// pTrackGroup_1->SetParentGroup(pWell);
// pTrackGroup_1->SetParentObj(pWell);
// pTrackGroup_1->SetParentXY(pWell->GetParentXY());
// pTrackGroup_1->AddTrack(pTrackCurveObj_11);
// pTrackGroup_1->AddTrack(pTrackCurveObj_12);
// /////////////////////////////////////////////////////////////////////////////////////////////////
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> ϵ<EFBFBD>
// CTrackGroupObj* pTrackGroup_2 = new CTrackGroupObj;
// pTrackGroup_2->SetGroupType(Group_Vertical);
// pTrackGroup_2->m_font = pWell->m_fontTrack;
// pTrackGroup_2->m_pen = pWell->m_penTrack;
// pTrackGroup_2->SetPenGrid(pWell->m_penGridMajor, pWell->m_penGridMinor);
// pTrackGroup_2->SetFontHeadMark(pWell->m_fontHeadMark);
// pTrackGroup_2->SetFontGridMark(pWell->m_fontGridMark);
// pTrackGroup_2->SetSpace(pWell->m_fMajorSpace, pWell->m_fMinorSpace);
// pTrackGroup_2->m_dTrackWidth = 30.0;
// CTrackCurveObj* pTrackCurveObj_21 = NULL;
// pTrackCurveObj_21 = CreateNewCurveTrack(pWell,"SH","%",30.0,atof("0"),atof("100"),FALSE,RGB(255,0,0));
// CTrackCurveObj* pTrackCurveObj_22 = NULL;
// pTrackCurveObj_22 = CreateNewCurveTrack(pWell,"POR","%",30.0,atof("100"),atof("0"),FALSE,RGB(0,0,255));
// //////
// pTrackCurveObj_21->SetFillStyleLeft(TRUE);
// pTrackCurveObj_21->SetFillBrushPattern(TRUE);
// pTrackCurveObj_21->SetShowHeadFill(FALSE);
// pTrackCurveObj_21->m_fillClr = RGB(213, 213, 213);
// pTrackCurveObj_21->m_penCurve.m_color = RGB(255,0,0);
// pTrackCurveObj_21->m_strFillSymbol = "ɰ<> <C9B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ";
// if(!pTrackCurveObj_21->m_strFillSymbol.IsEmpty())
// {
// CString strMark;
// strMark.Format("%s", LIB_MARK_FILL);
// strMark = strMark + pTrackCurveObj_21->m_strFillSymbol;
// pTrackCurveObj_21->m_pMarkFill = (CXyBase*)AfxGetGlobalWellXy()->GetMark()->FindMark(strMark);
// }
// pTrackCurveObj_22->SetFillStyleLeft(TRUE);
// pTrackCurveObj_22->SetFillBrushPattern(TRUE);
// pTrackCurveObj_22->SetShowHeadFill(FALSE);
// pTrackCurveObj_22->m_fillClr = RGB(255, 255, 0);
// pTrackCurveObj_22->m_penCurve.m_color = RGB(0,0,255);
// pTrackCurveObj_22->m_strFillSideCurve = "SH";
// pTrackCurveObj_22->m_strFillSymbol = "ɰ<> <C9B0> ";
// if(!pTrackCurveObj_22->m_strFillSymbol.IsEmpty())
// {
// CString strMark;
// strMark.Format("%s", LIB_MARK_FILL);
// strMark = strMark + pTrackCurveObj_22->m_strFillSymbol;
// pTrackCurveObj_22->m_pMarkFill = (CXyBase*)AfxGetGlobalWellXy()->GetMark()->FindMark(strMark);
// }
// //////
// pTrackGroup_2->SetParentGroup(pWell);
// pTrackGroup_2->SetParentObj(pWell);
// pTrackGroup_2->SetParentXY(pWell->GetParentXY());
// pTrackGroup_2->AddTrack(pTrackCurveObj_21);
// pTrackGroup_2->AddTrack(pTrackCurveObj_22);
// /////////////////////////////////////////////////////////////////////////////////////////////////
// pWell->AddTrack(pTrackGroup_1);
// pWell->AddTrack(pTrackGroup_2);
// int nIndex = 0;
// CDataObj_Curve* pDataObj_Curve = NULL;
// POSITION pos = CurveList.GetHeadPosition();
// while(pos)
// {
// pDataObj_Curve = (CDataObj_Curve*)CurveList.GetNext(pos);
// if (nIndex == 4)
// {
// break;
// }
// if (pDataObj_Curve->m_curve_name == pTrackCurveObj_11->m_strTrackName)
// {
// pTrackCurveObj_11->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_11->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_11->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_11->ReadCurveData();
// nIndex++;
// }
// else if (pDataObj_Curve->m_curve_name == pTrackCurveObj_12->m_strTrackName)
// {
// pTrackCurveObj_12->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_12->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_12->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_12->ReadCurveData();
// nIndex++;
// }
// else if (pDataObj_Curve->m_curve_name == pTrackCurveObj_21->m_strTrackName)
// {
// pTrackCurveObj_21->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_21->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_21->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_21->ReadCurveData();
// nIndex++;
// }
// else if (pDataObj_Curve->m_curve_name == pTrackCurveObj_22->m_strTrackName)
// {
// pTrackCurveObj_22->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_22->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_22->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_22->ReadCurveData();
// nIndex++;
// }
// }
// if(bAddResult)
// {
// //<2F> <> <EFBFBD> ӽ<EFBFBD> <D3BD> ͵<EFBFBD>
// CClientDC dc(NULL);
// //<2F> <> <EFBFBD> þ<EFBFBD> <C3BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// CTrackResultObj* pTrackResult = new CTrackResultObj();
// pTrackResult->m_strTitle = "<22> <> <EFBFBD> <EFBFBD> ";
// pTrackResult->m_font = pWell->m_fontTrack;
// pTrackResult->m_pen = pWell->m_penTrack;
// pTrackResult->SetPenGrid(pWell->m_penGridMajor, pWell->m_penGridMinor);
// pTrackResult->SetFontHeadMark(pWell->m_fontHeadMark,FALSE);
// pTrackResult->SetFontGridMark(pWell->m_fontGridMark);
// pTrackResult->SetSpace(pWell->m_fMajorSpace, pWell->m_fMinorSpace);
// CString titlename = pTrackResult->m_strTitle;
// pTrackResult->m_dTrackWidth = 30.0;
// pWell->AddTrack(pTrackResult);
// CPoint2D ptf = pWell->GetPos().TopLeft();
// pWell->ComputeSize(ptf);
// ////////////////////////////////////////////////////////////////////////
// if (pTrackCurveObj_11!=NULL&&pTrackCurveObj_22!=NULL)
// {
// double sdep = pTrackCurveObj_11->m_fSdep;
// double edep = pTrackCurveObj_11->m_fEdep;
// //<2F> <> <EFBFBD> <D7BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// if(float(sdep/pTrackCurveObj_11->m_fRlev) != int(sdep/pTrackCurveObj_11->m_fRlev))
// {
// sdep = float(int(sdep/pTrackCurveObj_11->m_fRlev + 1)*pTrackCurveObj_11->m_fRlev);
// }
// if(float(edep/pTrackCurveObj_11->m_fRlev) != int(edep/pTrackCurveObj_11->m_fRlev))
// {
// edep = float(int(edep/pTrackCurveObj_11->m_fRlev)*pTrackCurveObj_11->m_fRlev);
// }
// int index1,index2;
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݵ<EFBFBD> <DDB5> <EFBFBD> ʼ <EFBFBD> <CABC> <EFBFBD> ͽ<EFBFBD> <CDBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// index1 = int((pWell->m_fSdep - sdep)/pTrackCurveObj_11->m_fRlev);
// index2 = int((pWell->m_fEdep - sdep)/pTrackCurveObj_11->m_fRlev);
// index2 +=1;
// float fTop,fEnd;
// CString strType,strType1;
// CRect8 analysisrect;
// int analysisIndex = -1;
// CRect8 rect = pTrackResult->GetPos();
// rect.top= pTrackResult->m_HeadRect.bottom;
// for (int i=index1;i<index2;i++)
// {
// if(analysisIndex == -1)
// {
// fTop = fEnd = sdep+(i-index1)*pTrackCurveObj_11->m_fRlev;
// if (pTrackCurveObj_11->GetCurveValue(i)>=SwWaterTemp&&pTrackCurveObj_11->GetCurveValue(i)<=100&&pTrackCurveObj_22->GetCurveValue(i)>PorTemp)
// {
// analysisIndex = i;
// strType = "ˮ<> <CBAE> ";
// }
// else if (pTrackCurveObj_11->GetCurveValue(i)>=SwOilTemp&&pTrackCurveObj_11->GetCurveValue(i)<SwWaterTemp&&pTrackCurveObj_22->GetCurveValue(i)>PorTemp)
// {
// analysisIndex = i;
// strType = "<22> <> ˮͬ<CBAE> <CDAC> ";
// }
// else if (pTrackCurveObj_11->GetCurveValue(i)<SwOilTemp&&pTrackCurveObj_22->GetCurveValue(i)>PorTemp)
// {
// analysisIndex = i;
// strType = "<22> Ͳ<EFBFBD> ";
// }
// }
// else
// {
// strType1="";
// if (pTrackCurveObj_11->GetCurveValue(i)>=SwWaterTemp&&pTrackCurveObj_11->GetCurveValue(i)<=100)
// {
// strType1 = "ˮ<> <CBAE> ";
// }
// else if (pTrackCurveObj_11->GetCurveValue(i)>=SwOilTemp&&pTrackCurveObj_11->GetCurveValue(i)<SwWaterTemp)
// {
// strType1 = "<22> <> ˮͬ<CBAE> <CDAC> ";
// }
// else if (pTrackCurveObj_11->GetCurveValue(i)<SwOilTemp)
// {
// strType1 = "<22> Ͳ<EFBFBD> ";
// }
// if ((pTrackCurveObj_22->GetCurveValue(i)<=PorTemp||strType1!=strType)&&(fEnd>fTop))
// {
// if((fEnd-fTop)>AnalysisHd)
// {
// analysisrect.left = pTrackResult->GetPos().left;
// analysisrect.right = pTrackResult->GetPos().right;
// //analysisrect.top = pTrackResult->m_HeadRect.bottom+(fTop-pWell->m_fSdep)/0.0254/
// // (double)pWell->m_fProportion * dc.GetDeviceCaps(LOGPIXELSY);
// //analysisrect.bottom = pTrackResult->m_HeadRect.bottom+(fEnd-pWell->m_fSdep)/0.0254/
// // (double)pWell->m_fProportion * dc.GetDeviceCaps(LOGPIXELSY);
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD>
// CTrackInResult* pTrackInResult = new CTrackInResult();
// pTrackInResult->m_fSdep = fTop/*pWell->ScreenYToDepth(pTrackInResult->GetPos().top)*/;
// pTrackInResult->m_fEdep = fEnd/*pWell->ScreenYToDepth(pTrackInResult->GetPos().bottom)*/;
// analysisrect.top = pWell->DepthToScreenY(pTrackInResult->m_fSdep);
// analysisrect.bottom = pWell->DepthToScreenY(pTrackInResult->m_fEdep);
// pTrackInResult->SetRange(analysisrect);
// pTrackInResult->m_strResult = strType;
// if(!pTrackInResult->m_strResult.IsEmpty())
// {
// CString strMark;
// strMark.Format("%s", LIB_MARK_STRATUMFLUID);
// strMark = strMark + pTrackInResult->m_strResult;
// if(AfxGetGlobalWellXy() != NULL)
// pTrackInResult->m_pMarkResult = (CXyBase*)AfxGetGlobalWellXy()->GetMark()->FindMark(strMark);
// strMark = pTrackInResult->GetMarkSymbol();
// if(AfxGetGlobalWellXy() != NULL)
// pTrackInResult->m_pMarkSymbol = (CXyBase*)AfxGetGlobalWellXy()->GetMark()->FindMark(strMark);
// strMark.Format("%s", LIB_MARK_FLUIDCOLOR);
// strMark = strMark + pTrackInResult->m_strResult;
// if(AfxGetGlobalWellXy() != NULL)
// pTrackInResult->m_brush.m_color = AfxGetGlobalWellXy()->GetMark()->FindMarkColor(strMark);
// }
// pTrackInResult->m_fValidThick = pTrackInResult->m_fEdep - pTrackInResult->m_fSdep;
// //if (pTrackInResult->GetPos().top < rect.top||pTrackInResult->GetPos().bottom>rect.bottom)
// //{
// // //<2F> <> <EFBFBD> ض<EFBFBD> <D8B6> <EFBFBD>
// // pTrackInResult->SetViewState(UNVIEW_STATE);
// //}
// if(pTrackInResult->m_fSdep >= pWell->m_fEdep || pTrackInResult->m_fEdep <= pWell->m_fSdep)
// pTrackInResult->SetViewState(UNVIEW_STATE);
// //<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> Ӷ<EFBFBD> <D3B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// pTrackResult->Add(pTrackInResult);
// }
// analysisIndex = -1;
// }
// else
// {
// fEnd = sdep+(i-index1)*pTrackCurveObj_11->m_fRlev;
// }
// }
// }
// //<2F> <> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ͽ<EFBFBD> <CDBD> <EFBFBD>
// if(analysisIndex!=-1)
// {
// if ((fEnd-fTop)>AnalysisHd)
// {
// analysisrect.left = pTrackResult->GetPos().left;
// analysisrect.right = pTrackResult->GetPos().right;
// //analysisrect.top = pTrackResult->m_HeadRect.bottom+(fTop-pWell->m_fSdep)/0.0254/
// // (double)pWell->m_fProportion * dc.GetDeviceCaps(LOGPIXELSY);
// //analysisrect.bottom = pTrackResult->m_HeadRect.bottom+(fEnd-pWell->m_fEdep)/0.0254/
// // (double)pWell->m_fProportion * dc.GetDeviceCaps(LOGPIXELSY);
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD>
// CTrackInResult* pTrackInResult = new CTrackInResult();
// pTrackInResult->m_fSdep = fTop/*pWell->ScreenYToDepth(pTrackInResult->GetPos().top)*/;
// pTrackInResult->m_fEdep = fEnd/*pWell->ScreenYToDepth(pTrackInResult->GetPos().bottom)*/;
// analysisrect.top = pWell->DepthToScreenY(pTrackInResult->m_fSdep);
// analysisrect.bottom = pWell->DepthToScreenY(pTrackInResult->m_fEdep);
// pTrackInResult->SetRange(analysisrect);
// //if (pTrackInResult->GetPos().top < rect.top||pTrackInResult->GetPos().bottom>rect.bottom)
// //{
// // //<2F> <> <EFBFBD> ض<EFBFBD> <D8B6> <EFBFBD>
// // pTrackInResult->SetViewState(UNVIEW_STATE);
// //}
// pTrackInResult->m_fValidThick = pTrackInResult->m_fEdep - pTrackInResult->m_fSdep;
// if(pTrackInResult->m_fSdep >= pWell->m_fEdep || pTrackInResult->m_fEdep <= pWell->m_fSdep)
// pTrackInResult->SetViewState(UNVIEW_STATE);
// //<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> Ӷ<EFBFBD> <D3B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// pTrackResult->Add(pTrackInResult);
// }
// }
// }
// }
// else
// {
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϲ <EFBFBD> ϵ
// //pWell->SortTrackGroup();
// CPoint2D ptf = pWell->GetPos().TopLeft();
// pWell->ComputeSize(ptf);
// }
//}
//void CItemSingleWell::CreateSandTrack(CWellPole* pWell,CDataObjList& CurveList,BOOL bAddResult,double PorTemp,double SwWaterTemp,double SwOilTemp,double AnalysisHd)
//{
// CTrackList trackList;
// CWellBaseObj* pObj = NULL;
// CTrackObj* pTrack = NULL;
// /////////////////////////////////////////////////////////////////////////////////////////////////
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> ϵ<EFBFBD>
// CTrackGroupObj* pTrackGroup_1 = new CTrackGroupObj;
// pTrackGroup_1->SetGroupType(Group_Vertical);
// pTrackGroup_1->m_font = pWell->m_fontTrack;
// pTrackGroup_1->m_pen = pWell->m_penTrack;
// pTrackGroup_1->SetPenGrid(pWell->m_penGridMajor, pWell->m_penGridMinor);
// pTrackGroup_1->SetFontHeadMark(pWell->m_fontHeadMark);
// pTrackGroup_1->SetFontGridMark(pWell->m_fontGridMark);
// pTrackGroup_1->SetSpace(pWell->m_fMajorSpace, pWell->m_fMinorSpace);
// pTrackGroup_1->m_dTrackWidth = 30.0;
// CTrackCurveObj* pTrackCurveObj_11 = NULL;
// pTrackCurveObj_11 = CreateNewCurveTrack(pWell,"SH","%",30.0,float(atof("0")),float(atof("100")),FALSE,RGB(0,0,255));
// CTrackCurveObj* pTrackCurveObj_12 = NULL;
// pTrackCurveObj_12 = CreateNewCurveTrack(pWell,"PERM","<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ",30.0,float(atof("0.1")),float(atof("1000")),TRUE,RGB(255,128,0));
// pTrackGroup_1->SetParentGroup(pWell);
// pTrackGroup_1->SetParentObj(pWell);
// pTrackGroup_1->SetParentXY(pWell->GetParentXY());
// pTrackGroup_1->AddTrack(pTrackCurveObj_11);
// pTrackGroup_1->AddTrack(pTrackCurveObj_12);
// /////////////////////////////////////////////////////////////////////////////////////////////////
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> ϵ<EFBFBD>
// CTrackGroupObj* pTrackGroup_2 = new CTrackGroupObj;
// pTrackGroup_2->SetGroupType(Group_Vertical);
// pTrackGroup_2->m_font = pWell->m_fontTrack;
// pTrackGroup_2->m_pen = pWell->m_penTrack;
// pTrackGroup_2->SetPenGrid(pWell->m_penGridMajor, pWell->m_penGridMinor);
// pTrackGroup_2->SetFontHeadMark(pWell->m_fontHeadMark);
// pTrackGroup_2->SetFontGridMark(pWell->m_fontGridMark);
// pTrackGroup_2->SetSpace(pWell->m_fMajorSpace, pWell->m_fMinorSpace);
// pTrackGroup_2->m_dTrackWidth = 30.0;
// CTrackCurveObj* pTrackCurveObj_21 = NULL;
// pTrackCurveObj_21 = CreateNewCurveTrack(pWell,"SW","%",30.0,float(atof("100")),float(atof("0")),FALSE,RGB(0,0,255));
// CTrackCurveObj* pTrackCurveObj_22 = NULL;
// pTrackCurveObj_22 = CreateNewCurveTrack(pWell,"PORH","%",30.0,float(atof("0")),float(atof("25")),FALSE,RGB(255,128,0));
// CTrackCurveObj* pTrackCurveObj_23 = NULL;
// pTrackCurveObj_23 = CreateNewCurveTrack(pWell,"PORX","%",30.0,float(atof("0")),float(atof("25")),FALSE,RGB(255,128,255));
// pTrackGroup_2->SetParentGroup(pWell);
// pTrackGroup_2->SetParentObj(pWell);
// pTrackGroup_2->SetParentXY(pWell->GetParentXY());
// pTrackGroup_2->AddTrack(pTrackCurveObj_21);
// pTrackGroup_2->AddTrack(pTrackCurveObj_22);
// pTrackGroup_2->AddTrack(pTrackCurveObj_23);
// /////////////////////////////////////////////////////////////////////////////////////////////////
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> ϵ<EFBFBD>
// CTrackGroupObj* pTrackGroup_3 = new CTrackGroupObj;
// pTrackGroup_3->SetGroupType(Group_Vertical);
// pTrackGroup_3->m_font = pWell->m_fontTrack;
// pTrackGroup_3->m_pen = pWell->m_penTrack;
// pTrackGroup_3->SetPenGrid(pWell->m_penGridMajor, pWell->m_penGridMinor);
// pTrackGroup_3->SetFontHeadMark(pWell->m_fontHeadMark);
// pTrackGroup_3->SetFontGridMark(pWell->m_fontGridMark);
// pTrackGroup_3->SetSpace(pWell->m_fMajorSpace, pWell->m_fMinorSpace);
// pTrackGroup_3->m_dTrackWidth = 30.0;
// CTrackCurveObj* pTrackCurveObj_31 = NULL;
// pTrackCurveObj_31 = CreateNewCurveTrack(pWell,"CAL","Ӣ<> <D3A2> ",30.0,float(atof("8")),float(atof("18")),FALSE,RGB(255,0,0));
// CTrackCurveObj* pTrackCurveObj_32 = NULL;
// pTrackCurveObj_32 = CreateNewCurveTrack(pWell,"POR","%",30.0,float(atof("50")),float(atof("0")),FALSE,RGB(255,128,0));
// CTrackCurveObj* pTrackCurveObj_33 = NULL;
// pTrackCurveObj_33 = CreateNewCurveTrack(pWell,"PORF","%",30.0,float(atof("50")),float(atof("0")),FALSE,RGB(0,0,255));
// CTrackCurveObj* pTrackCurveObj_34 = NULL;
// pTrackCurveObj_34 = CreateNewCurveTrack(pWell,"PORW","%",30.0,float(atof("50")),float(atof("0")),FALSE,RGB(0,0,255));
// pTrackCurveObj_33->SetFillStyleLeft(TRUE);
// pTrackCurveObj_33->SetFillBrushPattern(TRUE);
// pTrackCurveObj_33->SetShowHeadFill(FALSE);
// pTrackCurveObj_33->m_fillClr = RGB(0,0,0);
// pTrackCurveObj_33->m_strFillSideCurve = "POR";
// pTrackCurveObj_34->SetFillStyleLeft(TRUE);
// pTrackCurveObj_34->SetFillBrushPattern(TRUE);
// pTrackCurveObj_34->SetShowHeadFill(FALSE);
// pTrackCurveObj_34->m_fillClr = RGB(255,0,0);
// pTrackCurveObj_34->m_strFillSideCurve = "PORF";
// pTrackGroup_3->SetParentGroup(pWell);
// pTrackGroup_3->SetParentObj(pWell);
// pTrackGroup_3->SetParentXY(pWell->GetParentXY());
// pTrackGroup_3->AddTrack(pTrackCurveObj_31);
// pTrackGroup_3->AddTrack(pTrackCurveObj_32);
// pTrackGroup_3->AddTrack(pTrackCurveObj_33);
// pTrackGroup_3->AddTrack(pTrackCurveObj_34);
// /////////////////////////////////////////////////////////////////////////////////////////////////
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> ϵ<EFBFBD>
// CTrackGroupObj* pTrackGroup_4 = new CTrackGroupObj;
// pTrackGroup_4->SetGroupType(Group_Vertical);
// pTrackGroup_4->m_font = pWell->m_fontTrack;
// pTrackGroup_4->m_pen = pWell->m_penTrack;
// pTrackGroup_4->SetPenGrid(pWell->m_penGridMajor, pWell->m_penGridMinor);
// pTrackGroup_4->SetFontHeadMark(pWell->m_fontHeadMark);
// pTrackGroup_4->SetFontGridMark(pWell->m_fontGridMark);
// pTrackGroup_4->SetSpace(pWell->m_fMajorSpace, pWell->m_fMinorSpace);
// pTrackGroup_4->m_dTrackWidth = 30.0;
// CTrackCurveObj* pTrackCurveObj_41 = NULL;
// pTrackCurveObj_41 = CreateNewCurveTrack(pWell,"SH","%",30.0,float(atof("0")),float(atof("100")),FALSE,RGB(255,0,0));
// CTrackCurveObj* pTrackCurveObj_42 = NULL;
// pTrackCurveObj_42 = CreateNewCurveTrack(pWell,"POR","%",30.0,float(atof("100")),float(atof("0")),FALSE,RGB(0,0,255));
// pTrackCurveObj_41->SetFillStyleLeft(TRUE);
// pTrackCurveObj_41->SetFillBrushPattern(TRUE);
// pTrackCurveObj_41->SetShowHeadFill(FALSE);
// pTrackCurveObj_41->m_fillClr = RGB(213, 213, 213);
// pTrackCurveObj_41->m_strFillSymbol = "ɰ<> <C9B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ";
// if(!pTrackCurveObj_41->m_strFillSymbol.IsEmpty())
// {
// CString strMark;
// strMark.Format("%s", LIB_MARK_FILL);
// strMark = strMark + pTrackCurveObj_41->m_strFillSymbol;
// pTrackCurveObj_41->m_pMarkFill = (CXyBase*)AfxGetGlobalWellXy()->GetMark()->FindMark(strMark);
// }
// pTrackCurveObj_42->SetFillStyleLeft(TRUE);
// pTrackCurveObj_42->SetFillBrushPattern(TRUE);
// pTrackCurveObj_42->SetShowHeadFill(FALSE);
// pTrackCurveObj_42->m_fillClr = RGB(255, 255, 0);
// pTrackCurveObj_42->m_strFillSideCurve = "SH";
// pTrackCurveObj_42->m_strFillSymbol = "ɰ<> <C9B0> ";
// if(!pTrackCurveObj_42->m_strFillSymbol.IsEmpty())
// {
// CString strMark;
// strMark.Format("%s", LIB_MARK_FILL);
// strMark = strMark + pTrackCurveObj_42->m_strFillSymbol;
// pTrackCurveObj_42->m_pMarkFill = (CXyBase*)AfxGetGlobalWellXy()->GetMark()->FindMark(strMark);
// }
// pTrackGroup_4->SetParentGroup(pWell);
// pTrackGroup_4->SetParentObj(pWell);
// pTrackGroup_4->SetParentXY(pWell->GetParentXY());
// pTrackGroup_4->AddTrack(pTrackCurveObj_41);
// pTrackGroup_4->AddTrack(pTrackCurveObj_42);
// /////////////////////////////////////////////////////////////////////////////////////////////////
// pWell->AddTrack(pTrackGroup_1);
// pWell->AddTrack(pTrackGroup_2);
// pWell->AddTrack(pTrackGroup_3);
// pWell->AddTrack(pTrackGroup_4);
// int nIndex = 0;
// CDataObj_Curve* pDataObj_Curve = NULL;
// POSITION pos = CurveList.GetHeadPosition();
// while(pos)
// {
// pDataObj_Curve = (CDataObj_Curve*)CurveList.GetNext(pos);
// if (nIndex == 11)
// {
// break;
// }
// if (pDataObj_Curve->m_curve_name == pTrackCurveObj_11->m_strTrackName)
// {
// pTrackCurveObj_11->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_11->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_11->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_11->ReadCurveData();
// nIndex++;
// }
// /*else*/ if (pDataObj_Curve->m_curve_name == pTrackCurveObj_12->m_strTrackName)
// {
// pTrackCurveObj_12->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_12->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_12->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_12->ReadCurveData();
// nIndex++;
// }
// /*else*/ if (pDataObj_Curve->m_curve_name == pTrackCurveObj_21->m_strTrackName)
// {
// pTrackCurveObj_21->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_21->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_21->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_21->ReadCurveData();
// nIndex++;
// }
// /*else*/ if (pDataObj_Curve->m_curve_name == pTrackCurveObj_22->m_strTrackName)
// {
// pTrackCurveObj_22->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_22->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_22->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_22->ReadCurveData();
// nIndex++;
// }
// /*else*/ if (pDataObj_Curve->m_curve_name == pTrackCurveObj_23->m_strTrackName)
// {
// pTrackCurveObj_23->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_23->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_23->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_23->ReadCurveData();
// nIndex++;
// }
// /*else*/ if (pDataObj_Curve->m_curve_name == pTrackCurveObj_31->m_strTrackName)
// {
// pTrackCurveObj_31->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_31->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_31->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_31->ReadCurveData();
// nIndex++;
// }
// /*else*/ if (pDataObj_Curve->m_curve_name == pTrackCurveObj_32->m_strTrackName)
// {
// pTrackCurveObj_32->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_32->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_32->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_32->ReadCurveData();
// nIndex++;
// }
// /*else*/ if (pDataObj_Curve->m_curve_name == pTrackCurveObj_33->m_strTrackName)
// {
// pTrackCurveObj_33->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_33->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_33->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_33->ReadCurveData();
// nIndex++;
// }
// /*else*/ if (pDataObj_Curve->m_curve_name == pTrackCurveObj_34->m_strTrackName)
// {
// pTrackCurveObj_34->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_34->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_34->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_34->ReadCurveData();
// nIndex++;
// }
// /*else*/ if (pDataObj_Curve->m_curve_name == pTrackCurveObj_41->m_strTrackName)
// {
// pTrackCurveObj_41->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_41->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_41->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_41->ReadCurveData();
// nIndex++;
// }
// /*else*/ if (pDataObj_Curve->m_curve_name == pTrackCurveObj_42->m_strTrackName)
// {
// pTrackCurveObj_42->m_dataObj = *pDataObj_Curve;
// pTrackCurveObj_42->m_fSdep = pDataObj_Curve->m_startdep;
// pTrackCurveObj_42->m_fEdep = pDataObj_Curve->m_enddep;
// pTrackCurveObj_42->ReadCurveData();
// nIndex++;
// }
// }
// if(bAddResult)
// {
// //<2F> <> <EFBFBD> ӽ<EFBFBD> <D3BD> ͵<EFBFBD>
// CClientDC dc(NULL);
// //<2F> <> <EFBFBD> þ<EFBFBD> <C3BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// CTrackResultObj* pTrackResult = new CTrackResultObj();
// pTrackResult->m_strTitle = "<22> <> <EFBFBD> <EFBFBD> ";
// pTrackResult->m_font = pWell->m_fontTrack;
// pTrackResult->m_pen = pWell->m_penTrack;
// pTrackResult->SetPenGrid(pWell->m_penGridMajor, pWell->m_penGridMinor);
// pTrackResult->SetFontHeadMark(pWell->m_fontHeadMark,FALSE);
// pTrackResult->SetFontGridMark(pWell->m_fontGridMark);
// pTrackResult->SetSpace(pWell->m_fMajorSpace, pWell->m_fMinorSpace);
// CString titlename = pTrackResult->m_strTitle;
// pTrackResult->m_dTrackWidth = 30.0;
// pWell->AddTrack(pTrackResult);
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϲ <EFBFBD> ϵ
// //pWell->SortTrackGroup();
// CPoint2D ptf = pWell->GetPos().TopLeft();
// pWell->ComputeSize(ptf);
// ////////////////////////////////////////////////////////////////////////
// if (pTrackCurveObj_21!=NULL&&pTrackCurveObj_32!=NULL)
// {
// double sdep = pTrackCurveObj_21->m_fSdep;
// double edep = pTrackCurveObj_21->m_fEdep;
// //<2F> <> <EFBFBD> <D7BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// if(float(sdep/pTrackCurveObj_21->m_fRlev) != int(sdep/pTrackCurveObj_21->m_fRlev))
// {
// sdep = float(int(sdep/pTrackCurveObj_21->m_fRlev + 1)*pTrackCurveObj_21->m_fRlev);
// }
// if(float(edep/pTrackCurveObj_21->m_fRlev) != int(edep/pTrackCurveObj_21->m_fRlev))
// {
// edep = float(int(edep/pTrackCurveObj_21->m_fRlev)*pTrackCurveObj_21->m_fRlev);
// }
// int index1,index2;
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݵ<EFBFBD> <DDB5> <EFBFBD> ʼ <EFBFBD> <CABC> <EFBFBD> ͽ<EFBFBD> <CDBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// index1 = int((pWell->m_fSdep - sdep)/pTrackCurveObj_21->m_fRlev);
// index2 = int((pWell->m_fEdep - sdep)/pTrackCurveObj_21->m_fRlev);
// index2 +=1;
// float fTop,fEnd;
// CString strType,strType1;
// CRect8 analysisrect;
// int analysisIndex = -1;
// CRect8 rect = pTrackResult->GetPos();
// rect.top= pTrackResult->m_HeadRect.bottom;
// for (int i=index1;i<index2;i++)
// {
// if(analysisIndex == -1)
// {
// fTop = fEnd = sdep+(i-index1)*pTrackCurveObj_21->m_fRlev;
// if (pTrackCurveObj_21->GetCurveValue(i)>=SwWaterTemp&&pTrackCurveObj_21->GetCurveValue(i)<=100&&pTrackCurveObj_32->GetCurveValue(i)>PorTemp)
// {
// analysisIndex = i;
// strType = "ˮ<> <CBAE> ";
// }
// else if (pTrackCurveObj_21->GetCurveValue(i)>=SwOilTemp&&pTrackCurveObj_21->GetCurveValue(i)<SwWaterTemp&&pTrackCurveObj_32->GetCurveValue(i)>PorTemp)
// {
// analysisIndex = i;
// strType = "<22> <> ˮͬ<CBAE> <CDAC> ";
// }
// else if (pTrackCurveObj_21->GetCurveValue(i)<SwOilTemp&&pTrackCurveObj_32->GetCurveValue(i)>PorTemp)
// {
// analysisIndex = i;
// strType = "<22> Ͳ<EFBFBD> ";
// }
// }
// else
// {
// strType1="";
// if (pTrackCurveObj_21->GetCurveValue(i)>=SwWaterTemp&&pTrackCurveObj_21->GetCurveValue(i)<=100)
// {
// strType1 = "ˮ<> <CBAE> ";
// }
// else if (pTrackCurveObj_21->GetCurveValue(i)>=SwOilTemp&&pTrackCurveObj_21->GetCurveValue(i)<SwWaterTemp)
// {
// strType1 = "<22> <> ˮͬ<CBAE> <CDAC> ";
// }
// else if (pTrackCurveObj_21->GetCurveValue(i)<SwOilTemp)
// {
// strType1 = "<22> Ͳ<EFBFBD> ";
// }
// if ((pTrackCurveObj_32->GetCurveValue(i)<=PorTemp||strType1!=strType)&&(fEnd>fTop))
// {
// if((fEnd-fTop)>AnalysisHd)
// {
// analysisrect.left = pTrackResult->GetPos().left;
// analysisrect.right = pTrackResult->GetPos().right;
// //analysisrect.top = pTrackResult->m_HeadRect.bottom+(fTop-pWell->m_fSdep)/0.0254/
// // (double)pWell->m_fProportion * dc.GetDeviceCaps(LOGPIXELSY);
// //analysisrect.bottom = pTrackResult->m_HeadRect.bottom+(fEnd-pWell->m_fSdep)/0.0254/
// // (double)pWell->m_fProportion * dc.GetDeviceCaps(LOGPIXELSY);
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD>
// CTrackInResult* pTrackInResult = new CTrackInResult();
// pTrackInResult->m_fSdep = fTop/*pWell->ScreenYToDepth(pTrackInResult->GetPos().top)*/;
// pTrackInResult->m_fEdep = fEnd/*pWell->ScreenYToDepth(pTrackInResult->GetPos().bottom)*/;
// analysisrect.top = pWell->DepthToScreenY(pTrackInResult->m_fSdep);
// analysisrect.bottom = pWell->DepthToScreenY(pTrackInResult->m_fEdep);
// pTrackInResult->SetRange(analysisrect);
// pTrackInResult->m_strResult = strType;
// if(!pTrackInResult->m_strResult.IsEmpty())
// {
// CString strMark;
// strMark.Format("%s", LIB_MARK_STRATUMFLUID);
// strMark = strMark + pTrackInResult->m_strResult;
// if(AfxGetGlobalWellXy() != NULL)
// pTrackInResult->m_pMarkResult = (CXyBase*)AfxGetGlobalWellXy()->GetMark()->FindMark(strMark);
// strMark = pTrackInResult->GetMarkSymbol();
// if(AfxGetGlobalWellXy() != NULL)
// pTrackInResult->m_pMarkSymbol = (CXyBase*)AfxGetGlobalWellXy()->GetMark()->FindMark(strMark);
// strMark.Format("%s", LIB_MARK_FLUIDCOLOR);
// strMark = strMark + pTrackInResult->m_strResult;
// if(AfxGetGlobalWellXy() != NULL)
// pTrackInResult->m_brush.m_color = AfxGetGlobalWellXy()->GetMark()->FindMarkColor(strMark);
// }
// pTrackInResult->m_fValidThick = pTrackInResult->m_fEdep - pTrackInResult->m_fSdep;
// //if (pTrackInResult->GetPos().top < rect.top||pTrackInResult->GetPos().bottom>rect.bottom)
// //{
// // //<2F> <> <EFBFBD> ض<EFBFBD> <D8B6> <EFBFBD>
// // pTrackInResult->SetViewState(UNVIEW_STATE);
// //}
// if(pTrackInResult->m_fSdep >= pWell->m_fEdep || pTrackInResult->m_fEdep <= pWell->m_fSdep)
// pTrackInResult->SetViewState(UNVIEW_STATE);
// //<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> Ӷ<EFBFBD> <D3B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// pTrackResult->Add(pTrackInResult);
// }
// analysisIndex = -1;
// }
// else
// {
// fEnd = sdep+(i-index1)*pTrackCurveObj_21->m_fRlev;
// }
// }
// }
// //<2F> <> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ͽ<EFBFBD> <CDBD> <EFBFBD>
// if(analysisIndex!=-1)
// {
// if ((fEnd-fTop)>AnalysisHd)
// {
// analysisrect.left = pTrackResult->GetPos().left;
// analysisrect.right = pTrackResult->GetPos().right;
// //analysisrect.top = pTrackResult->m_HeadRect.bottom+(fTop-pWell->m_fSdep)/0.0254/
// // (double)pWell->m_fProportion * dc.GetDeviceCaps(LOGPIXELSY);
// //analysisrect.bottom = pTrackResult->m_HeadRect.bottom+(fEnd-pWell->m_fEdep)/0.0254/
// // (double)pWell->m_fProportion * dc.GetDeviceCaps(LOGPIXELSY);
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD>
// CTrackInResult* pTrackInResult = new CTrackInResult();
// pTrackInResult->m_fSdep = fTop/*pWell->ScreenYToDepth(pTrackInResult->GetPos().top)*/;
// pTrackInResult->m_fEdep = fEnd/*pWell->ScreenYToDepth(pTrackInResult->GetPos().bottom)*/;
// analysisrect.top = pWell->DepthToScreenY(pTrackInResult->m_fSdep);
// analysisrect.bottom = pWell->DepthToScreenY(pTrackInResult->m_fEdep);
// pTrackInResult->SetRange(analysisrect);
// //if (pTrackInResult->GetPos().top < rect.top||pTrackInResult->GetPos().bottom>rect.bottom)
// //{
// // //<2F> <> <EFBFBD> ض<EFBFBD> <D8B6> <EFBFBD>
// // pTrackInResult->SetViewState(UNVIEW_STATE);
// //}
// pTrackInResult->m_fValidThick = pTrackInResult->m_fEdep - pTrackInResult->m_fSdep;
// if(pTrackInResult->m_fSdep >= pWell->m_fEdep || pTrackInResult->m_fEdep <= pWell->m_fSdep)
// pTrackInResult->SetViewState(UNVIEW_STATE);
// //<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> Ӷ<EFBFBD> <D3B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// pTrackResult->Add(pTrackInResult);
// }
// }
// }
// }
// else
// {
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϲ <EFBFBD> ϵ
// //pWell->SortTrackGroup();
// CPoint2D ptf = pWell->GetPos().TopLeft();
// pWell->ComputeSize(ptf);
// }
//}
CTrackCurve * CItemSingleWell : : CreateNewCurveTrack ( CWellPole * pWell , CString strTrackName , CString strUnit , double TrackWidth , double LeftValue , double RightValue , BOOL bLog , COLORREF clr )
{
CTrackCurve * pTrackCurveObj = new CTrackCurve ;
pTrackCurveObj - > m_font = pWell - > m_fontTrack ;
pTrackCurveObj - > m_pen = pWell - > m_penTrack ;
pTrackCurveObj - > SetPenGrid ( pWell - > m_penGridMajor , pWell - > m_penGridMinor ) ;
pTrackCurveObj - > SetFontHeadMark ( pWell - > m_fontHeadMark , FALSE ) ;
pTrackCurveObj - > SetFontGridMark ( pWell - > m_fontGridMark ) ;
pTrackCurveObj - > SetSpace ( pWell - > m_fMajorSpace , pWell - > m_fMinorSpace ) ;
pTrackCurveObj - > m_dTrackWidth = TrackWidth ;
pTrackCurveObj - > m_strTrackName = strTrackName ;
pTrackCurveObj - > m_strTitle = strTrackName ;
pTrackCurveObj - > m_curve_num = 1 ;
pTrackCurveObj - > m_curve_unit = strUnit ;
pTrackCurveObj - > m_curve_left = LeftValue ;
pTrackCurveObj - > m_curve_right = RightValue ;
pTrackCurveObj - > SetLog ( bLog ) ;
pTrackCurveObj - > m_penCurve . m_color = clr ;
return pTrackCurveObj ;
}
void CItemSingleWell : : DrawSelectPolyRange ( CXyDC * pXyDC , std : : vector < CPoint2D > & PtsVec )
{
if ( PtsVec . size ( ) = = 0 )
return ;
int ptNum = PtsVec . size ( ) ;
if ( m_PointNum < ptNum )
{
if ( m_PointNum > 0 )
{
delete [ ] m_pPointBuf ;
}
m_PointNum = ptNum ;
m_pPointBuf = new CPoint [ m_PointNum ] ;
}
for ( int ii = 0 ; ii < ptNum ; ii + + )
{
m_pPointBuf [ ii ] = pXyDC - > GetScreen ( PtsVec [ ii ] . x0 , PtsVec [ ii ] . y0 ) ; //m_HeadPtArr[ii].x0,m_HeadPtArr[ii].y0);
}
CBrush brush , * pbrush ;
brush . CreateSolidBrush ( RGB ( 160 , 192 , 255 ) ) ;
CDC * pCDC = pXyDC - > GetDC ( ) ;
pbrush = pCDC - > SelectObject ( & brush ) ;
pCDC - > Polygon ( m_pPointBuf , ptNum ) ;
pCDC - > SelectObject ( pbrush ) ;
}
double CItemSingleWell : : GetWellProjecttionAngle ( CWellPole * pWellObj )
{
double angle = 0 ;
typedef struct _JXTraceStruct //б <> <D0B1> <EFBFBD> <EFBFBD> <EFBFBD> ݽṹ
{
double xs ; //<2F> <> б <EFBFBD> <D0B1>
double xj ; //<2F> <> б <EFBFBD> <D0B1>
double zfwj ; //<2F> 淽λ<E6B7BD> <CEBB>
double x ; //ͶӰ<CDB6> <D3B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
double y ; //ͶӰ<CDB6> <D3B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
} JXTraceStruct ;
JXTraceStruct jx , jx1 ;
//CArray <JXTraceStruct,JXTraceStruct> JxArray;;//<2F> <> б <EFBFBD> <D0B1> <EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> ű<EFBFBD> <C5B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <C8AB> ԭʼ <D4AD> <CABC> <EFBFBD> <EFBFBD>
std : : vector < JXTraceStruct > JxArray ;
Struct_InclinedWell incWellStruct ;
INCLINEDWELLSTRUCTLIST : : iterator it = pWellObj - > m_InclinedWellList . begin ( ) ;
for ( ; it ! = pWellObj - > m_InclinedWellList . end ( ) ; it + + )
{
incWellStruct = * it ;
jx . xs = incWellStruct . depth ;
jx . xj = incWellStruct . bevel ;
jx . zfwj = incWellStruct . azimuth ;
//JxArray.Add(jx);
JxArray . push_back ( jx ) ;
}
if ( JxArray . size ( ) > 0 /*.GetSize() >0*/ )
{
//sina1,cosa1=ǰһ <C7B0> <D2BB> <EFBFBD> 㾮б <E3BEAE> ǣ<EFBFBD> sina2,cosa2=<3D> <> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD> <EFBFBD> ,sinb1,cosb1=ǰһ <C7B0> <D2BB> <EFBFBD> 㷽λ<E3B7BD> <CEBB>
//,cosb2,sinb2,=<3D> <> һ <EFBFBD> 㷽λ<E3B7BD> <CEBB> ,cosb2b1=<3D> <> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> λ<EFBFBD> Ǽ<EFBFBD> ȥǰһ <C7B0> <D2BB> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB> ;
double sina1 , sina2 , cosa1 , cosa2 , cosb1 , cosb2 , sinb1 , sinb2 , cosb2b1 ;
double x3 , y3 , depV ; //<2F> <> <EFBFBD> 켣<EFBFBD> <ECBCA3>
x3 = y3 = 0 ;
double dx , dy , dh ; //<2F> <> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
int ii , num ;
double b1 , b2 ; //<2F> <> λ<EFBFBD> <CEBB> 1<EFBFBD> <31> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB> 2;
double ya ; //<2F> <> <EFBFBD> Ƚǣ<C8BD> ȫ<EFBFBD> <C8AB> λ<EFBFBD> <CEBB>
double tmpY , tmpY2 ;
depV = 0 ;
double tdmp ;
BOOL bAddFirst = FALSE ;
jx = JxArray [ 0 ] ;
if ( jx . xs > 0.000001 )
{ //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> 㲻<EFBFBD> Ǵ<EFBFBD> 0<EFBFBD> 㿪ʼ <E3BFAA> <CABC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԭʼ <D4AD> ĵ<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㡣
jx1 . xs = jx1 . x = jx1 . y = jx1 . zfwj = jx1 . xj = 0 ;
//JxArray.InsertAt(0,jx1);
JxArray . insert ( JxArray . begin ( ) , jx1 ) ;
bAddFirst = TRUE ;
}
else
{
jx . x = jx . y = 0 ;
JxArray [ 0 ] = jx ;
}
num = JxArray . size ( ) ; // JxArray.GetCount();
for ( ii = 1 ; ii < num ; ii + + )
{
jx = JxArray [ ii - 1 ] ;
jx1 = JxArray [ ii ] ;
if ( jx . xj < 0.0000001 & & jx1 . xj < 0.0000001 )
{
dx = 0 ; dy = 0 ; dh = jx1 . xs - jx . xs ;
}
else
{
b1 = jx . zfwj / 180 * PI ; b2 = jx1 . zfwj / 180 * PI ; ;
if ( jx . xj < 0.0000001 & & jx1 . xj > 0.0000001 ) //<2F> <> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> б <EFBFBD> <D0B1> Ϊ0ʱ<30> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ䷽λ<E4B7BD> <CEBB> ͬ<EFBFBD> ڶ<EFBFBD> <DAB6> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD>
b1 = b2 ;
if ( jx . xj > 0.0000001 & & jx1 . xj < 0.0000001 ) //<2F> <> <EFBFBD> <EFBFBD> 2<EFBFBD> <32> <EFBFBD> <EFBFBD> б <EFBFBD> <D0B1> Ϊ0ʱ<30> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ䷽λ<E4B7BD> <CEBB> ͬ<EFBFBD> <CDAC> 1<EFBFBD> <31> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD>
b2 = b1 ;
sina1 = sin ( jx . xj / 180 * PI ) ; cosa1 = cos ( jx . xj / 180 * PI ) ;
sina2 = sin ( jx1 . xj / 180 * PI ) ; cosa2 = cos ( jx1 . xj / 180 * PI ) ;
sinb1 = sin ( b1 ) ; cosb1 = cos ( b1 ) ;
sinb2 = sin ( b2 ) ; cosb2 = cos ( b2 ) ;
cosb2b1 = cos ( b2 - b1 ) ;
tdmp = cosa1 * cosa2 + sina1 * sina2 * cosb2b1 ;
if ( tdmp > 1 )
tdmp = 1 ;
if ( tdmp < - 1 )
tdmp = - 1 ;
ya = acos ( tdmp ) ; //acos<6F> <73> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1<EFBFBD> <31> -1֮<31> <D6AE>
//tmpY = tan(Ya/2)/ya;
if ( ya < 0.0000001 )
tmpY = 0.5 ;
else if ( ya < 0.00001 )
{
tmpY2 = tmpY * tmpY ;
tmpY = 0.5 + tmpY2 / 24 + tmpY2 * tmpY2 / 240 + 17 * tmpY2 * tmpY2 * tmpY2 / 40320 ; //<2F> ݼ<EFBFBD> <DDBC> <EFBFBD>
}
else
{
tmpY = tan ( ya / 2 ) / ya ;
}
dy = ( jx1 . xs - jx . xs ) * ( sina1 * cosb1 + sina2 * cosb2 ) * tmpY ;
dx = ( jx1 . xs - jx . xs ) * ( sina1 * sinb1 + sina2 * sinb2 ) * tmpY ;
dh = ( jx1 . xs - jx . xs ) * ( cosa1 + cosa2 ) * tmpY ;
}
depV = depV + dh ;
//jx1.depV = depV;
x3 = x3 + dx ;
y3 = y3 + dy ;
jx1 . x = x3 ;
jx1 . y = y3 ;
JxArray [ ii ] = jx1 ;
}
int firstid = 0 ;
if ( bAddFirst )
{
firstid = 1 ;
}
double k ;
BOOL bleft = FALSE ;
double xh , yh , xt , yt ;
xh = JxArray [ firstid ] . x ; yh = JxArray [ firstid ] . y ;
xt = JxArray [ JxArray . size ( ) - 1 ] . x ; yt = JxArray [ JxArray . size ( ) - 1 ] . y ;
//JxArray.RemoveAt(0);
if ( ! ( abs ( xh - xt ) < 0.00001 & & abs ( yh - yt ) < 0.00001 ) )
{ //<2F> <> ͷ<EFBFBD> ; <EFBFBD> βλ<CEB2> <CEBB> һ <EFBFBD> <D2BB> <EFBFBD> Ͳ<EFBFBD> <CDB2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˡ<EFBFBD>
if ( abs ( xh - xt ) < 0.00001 )
{ //<2F> <> ֱ
if ( yh > yt )
bleft = FALSE ;
else
bleft = TRUE ;
k = 999999.99999 ;
angle = 0 ;
}
else if ( abs ( yh - yt ) < 0.00001 )
{ //ˮƽ
k = 0 ;
if ( xh > xt )
bleft = FALSE ;
else
bleft = TRUE ;
angle = 90 ;
}
else
{
k = - 1 * ( yh - yt ) / ( xh - xt ) ; //ע<> <D7A2> K<EFBFBD> ļ<EFBFBD> <C4BC> 㣬<EFBFBD> <E3A3AC> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> £<EFBFBD> y<EFBFBD> <79> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ġ<EFBFBD>
if ( k < 0 )
{
if ( xh < xt )
{
bleft = TRUE ;
}
else
{
bleft = FALSE ;
}
}
else
{
if ( xh < xt )
{
bleft = FALSE ;
}
else
{
bleft = TRUE ;
}
}
double tmpa ;
tmpa = atan ( - 1 / k ) ;
if ( tmpa > 0 )
{
if ( bleft )
tmpa = 360 - tmpa * 180 / PI ;
else
tmpa = 180 - tmpa * 180 / PI ;
}
else
{
if ( bleft )
tmpa = - tmpa * 180 / PI ;
else
tmpa = 180 - tmpa * 180 / PI ;
}
angle = 90 + tmpa ;
//k = -1.0*(xh -xt)/(yh-yt); //<2F> <> ʼ <EFBFBD> ӽǷ<D3BD> <C7B7> <EFBFBD> ,<2C> 뾮<EFBFBD> <EBBEAE> ʼ <EFBFBD> <CABC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߴ <EFBFBD> ֱ
}
}
}
return angle ;
}
//void CItemSingleWell::AddWellIntervals(CXTPPropertyGridItem* pParentItem)
//{
// //CCustomItemButton* pItemButton = new CCustomItemButton(IDS_STR_WELLDEPTHSETUP, GetOwner(),"");
// //pItemButton->SetFlags(xtpGridItemHasExpandButton/*|xtpGridItemHasEdit*/);
// //pParentItem->AddChildItem(pItemButton);
// //CPropertyGridItemAdd ItemAdd(NULL);
// //CString strTitle;
// //strTitle.LoadString(IDS_STR_WELL_INTERVAL);
// //if(m_pWell)
// //{
// // CString strDepth;
// // CString tmpStr;
// // CXTPPropertyGridItem *pGridItem,*pItem1;
// // if(m_pWell->GetIntervalVec()->size()>0)
// // {
// // for(int ii = 0; ii< m_pWell->GetIntervalVec()->size(); ii++)
// // {
// // tmpStr.Format("%s%d",strTitle,ii+1);
// // pGridItem = pParentItem->AddChildItem(new CXTPPropertyGridItemCategory(tmpStr));
// // ItemAdd.SetItem(pGridItem);
// // pItem1 = ItemAdd.AddItemDouble(IDS_STR_WELL_TOPDEPTH,m_pWell->GetIntervalTop(ii));
// // pItem1->SetReadOnly(TRUE);
// // pItem1 = ItemAdd.AddItemDouble(IDS_STR_WELL_ENDDEPTH,m_pWell->GetIntervalBottom(ii));
// // pItem1->SetReadOnly(TRUE);
// // pGridItem->Expand();
// // if(!strDepth.IsEmpty())
// // strDepth += ";";
// // tmpStr.Format("%g-%g", m_pWell->GetIntervalTop(ii),m_pWell->GetIntervalBottom(ii));
// // strDepth += tmpStr;
// // }
// // }
// // else
// // {
// // tmpStr.Format("%s%d",strTitle,1);
// // pGridItem = pParentItem->AddChildItem(new CXTPPropertyGridItemCategory(tmpStr));
// // ItemAdd.SetItem(pGridItem);
// // pItem1 = ItemAdd.AddItemDouble(IDS_STR_WELL_TOPDEPTH,m_pWell->m_fSdep);
// // pItem1->SetReadOnly(TRUE);
// // pItem1 = ItemAdd.AddItemDouble(IDS_STR_WELL_ENDDEPTH,m_pWell->m_fEdep);
// // pItem1->SetReadOnly(TRUE);
// // pGridItem->Expand();
// // strDepth.Format("%g-%g", m_pWell->m_fSdep, m_pWell->m_fEdep);
// // }
// // pItemButton->SetValue(strDepth);
// //}
//}
CWellPole * CItemSingleWell : : GetWellObject ( )
{
CWellPoleDoc * pDoc = ( CWellPoleDoc * ) ( GetView ( ) - > m_pDoc ) ;
return pDoc - > GetWellPole ( ) ;
}
void CItemSingleWell : : SetReUnDoAction ( BOOL bNoSaveData , UINT actionType , CWellBaseObj * pWellBase )
{
CItemWellBase : : SetReUnDoAction ( bNoSaveData , actionType ) ;
m_pWell = GetWellObject ( ) ;
}
void CItemSingleWell : : CancelSelection ( void )
{
CItemWellBase : : CancelSelection ( ) ;
if ( m_pWell ! = NULL )
{
m_pWell - > ClearCurveSegmentObj ( ) ;
}
m_pWell = NULL ;
}
BOOL CItemSingleWell : : IsAddFaultPoint ( )
{
return m_bAddFaultPoint ;
}
BOOL CItemSingleWell : : IsEnableAddFaultPoint ( )
{
BOOL b = FALSE ;
if ( m_pItemSelected )
{
if ( m_pItemSelected - > GetType ( ) = = ITEM_TRACK )
{
return TRUE ;
}
}
return b ;
}
void CItemSingleWell : : SetAddFaultPoint ( )
{
if ( m_bAddFaultPoint )
m_bAddFaultPoint = FALSE ;
else
m_bAddFaultPoint = TRUE ;
if ( m_pItemSelected )
{
if ( m_pItemSelected - > GetType ( ) = = ITEM_TRACK )
{
CItemTrack * pItemTrack = ( CItemTrack * ) m_pItemSelected ;
pItemTrack - > m_bAddFaultPoint = m_bAddFaultPoint ;
}
}
}
}