www.pudn.com > DEM_TDS.rar > PointAttribData.cpp, change:2007-05-30,size:1474b


// PointAttribData.cpp: implementation of the PointAttribData class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "DEM.h" 
#include "PointAttribData.h" 
#include "MainFrm.h" 
#include "DEMView.h" 
#include "ChildFrm.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
PointAttribData::PointAttribData() 
{ 
 
} 
 
PointAttribData::~PointAttribData() 
{ 
 
} 
 
bool PointAttribData::UpDataPoint(CPoint point) 
{ 
	CMainFrame *pMainFrm=(CMainFrame *)AfxGetMainWnd(); 
	CMDIChildWnd *pChild = pMainFrm->MDIGetActive(); 
	CDEMView *pView=(CDEMView*)pChild->GetActiveView(); 
 
	if(!pView->draw_3D) 
	{ 
		point=pView->mapview.GetPointNumber(point); 
		point.y=pView->demdata->SizeY-1-point.y; 
	} 
	if(point.x<0||point.x>=pView->demdata->Col-1||point.y<0||point.y>=pView->demdata->Row-1)return false; 
	Row=point.x;Col=point.y;ZoomH=pView->demdata->data[Col][Row]; 
	X=pView->demdata->X0+point.x*pView->demdata->DX; 
	Y=pView->demdata->Y0+point.y*pView->demdata->DY; 
	H=(float)ZoomH/(float)pView->demdata->Hzoom; 
	R=GetRValue(pView->demdata->color[Col][Row]); 
	G=GetGValue(pView->demdata->color[Col][Row]); 
	B=GetBValue(pView->demdata->color[Col][Row]); 
 
	return true; 
}