⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 meanlinearray.cpp

📁 对测井数据显示、编辑、处理
💻 CPP
字号:
// MeanLineArray.cpp: implementation of the CMeanLineArray class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "WellDataProcess.h"
#include "MeanLineArray.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMeanLineArray::CMeanLineArray()
{

}

CMeanLineArray::~CMeanLineArray()
{

}
int CMeanLineArray::AddMeanLineUnit(COLORREF color, float fMeanValue, int nStartPos, int nEndPos, int nXPos)
{
	CMeanLineUnit* pLineUnit = new CMeanLineUnit;
	pLineUnit->SetEndPos(nEndPos);
	pLineUnit->SetMeanLineColor(color);
	pLineUnit->SetMeanValue(fMeanValue);
	pLineUnit->SetStartPos(nStartPos);
	pLineUnit->SetXPos(nXPos);
	
	return Add(pLineUnit);
}

void CMeanLineArray::Draw(CDC *pDC)
{
	int nCount = GetSize();
	int x1, y1, y2, x2;
	
	for (int i=0;i<nCount;i++)
	{
		(*this)[i]->Draw (pDC);
		
		CPen pen;
		CPen *pOrgPen;
		COLORREF color = (*this)[i]->GetMeanLineColor();
		pen.CreatePen(PS_SOLID, 2, color);
		pOrgPen = pDC->SelectObject(&pen); 
		x1 = (*this)[i]->GetXPos();
		y1 = (*this)[i]->GetEndPos();;
		pDC->MoveTo(x1, y1); 
		if((i + 1) != nCount)
		{
			x2 = (*this)[i+1]->GetXPos();
			y2 = (*this)[i+1]->GetStartPos();
		    pDC->LineTo(x2, y2);
		}
		pDC->SelectObject(pOrgPen); 
	}
	
	
}

CMeanLineUnit* CMeanLineArray::HitTest(CPoint point)
{
	int nCount = GetSize();
	int i;
	for(i = 0; i < nCount; i ++)
	{
		(*this)[i]->m_bSelect = FALSE;
	}
	for (i=0;i<nCount;i++)
	{
		if ((*this)[i]->HitTest (point))
			return (*this)[i];
	}

	return NULL;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -