www.pudn.com > Map_OpenGL.rar > Map_InFoView.cpp


// Map_InFoView.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "Map_OpenGL.h" 
#include "Map_InFoView.h" 
#include "Map_OpenGLDoc.h" 
#include "Map_Tool.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CMap_InFoView 
 
IMPLEMENT_DYNCREATE(CMap_InFoView, CView) 
 
CMap_InFoView::CMap_InFoView() 
{ 
} 
 
CMap_InFoView::~CMap_InFoView() 
{ 
} 
 
 
BEGIN_MESSAGE_MAP(CMap_InFoView, CView) 
	//{{AFX_MSG_MAP(CMap_InFoView) 
	ON_WM_CREATE() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CMap_InFoView drawing 
 
void CMap_InFoView::OnDraw(CDC* pDC) 
{ 
	CDocument* pDoc = GetDocument(); 
	ASSERT(pDoc); 
 
	if(CMap_Tool::map_select==Map_binarydem) 
	{ 
		ShowDemInfo(pDC); 
	} 
	if(CMap_Tool::map_select==Map_texttin) 
	{ 
		ShowTininfo(pDC); 
	} 
 
 
	// TODO: add draw code here 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CMap_InFoView diagnostics 
 
#ifdef _DEBUG 
void CMap_InFoView::AssertValid() const 
{ 
	CView::AssertValid(); 
} 
 
void CMap_InFoView::Dump(CDumpContext& dc) const 
{ 
	CView::Dump(dc); 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CMap_InFoView message handlers 
 
int CMap_InFoView::OnCreate(LPCREATESTRUCT lpCreateStruct)  
{ 
	if (CView::OnCreate(lpCreateStruct) == -1) 
		return -1; 
	 
	// TODO: Add your specialized creation code here 
	 
	return 0; 
} 
 
void CMap_InFoView::ShowDemInfo(CDC* pDC) 
{ 
	CMap_OpenGLDoc* pDoc=GetDocument(); 
	ASSERT(pDoc); 
 
	s_showleft.Format("最左值:%f",pDoc->m_binarydem.m_showleft); 
	s_showright.Format("最右值:%f",pDoc->m_binarydem.m_showright); 
	s_showtop.Format("最上值:%f",pDoc->m_binarydem.m_showtop); 
	s_showbottom.Format("最下值:%f",pDoc->m_binarydem.m_showbottom); 
 
	s_maxheight.Format("最大高程:%f",pDoc->m_binarydem.m_maxheight); 
	s_minheight.Format("最小高程:%f",pDoc->m_binarydem.m_minheight); 
	 
	s_sizeofx.Format("横向间距:%f",pDoc->m_binarydem.m_sizeofx); 
	s_sizeofy.Format("纵向间距:%f",pDoc->m_binarydem.m_sizeofy); 
 
	s_numx.Format("横向网格:%d",pDoc->m_binarydem.m_demx); 
	s_numy.Format("纵向网格:%d",pDoc->m_binarydem.m_demy); 
	s_realdistance.Format("实际间距:%f",pDoc->m_binarydem.m_realdistance); 
 
	pDC->TextOut(1,1,"数据信息:"); 
	pDC->TextOut(1,30,s_showleft); 
	pDC->TextOut(1,50,s_showright); 
	pDC->TextOut(1,70,s_showtop); 
	pDC->TextOut(1,90,s_showbottom); 
 
	pDC->TextOut(1,120,s_maxheight); 
	pDC->TextOut(1,140,s_minheight); 
 
	pDC->TextOut(1,170,s_numx); 
	pDC->TextOut(1,190,s_numy); 
 
	pDC->TextOut(1,220,s_sizeofx); 
	pDC->TextOut(1,240,s_sizeofy); 
	pDC->TextOut(1,260,s_realdistance);	 
} 
 
 
void CMap_InFoView::ShowTininfo(CDC* pDC) 
{ 
	CMap_OpenGLDoc* pDoc=GetDocument(); 
	ASSERT(pDoc); 
 
	s_showleft.Format("最左值:%f",pDoc->m_tindate.m_tinleft); 
	s_showright.Format("最右值:%f",pDoc->m_tindate.m_tinright); 
	s_showtop.Format("最上值:%f",pDoc->m_tindate.m_tintop); 
	s_showbottom.Format("最下值:%f",pDoc->m_tindate.m_tinbottom); 
 
	s_maxheight.Format("最大高程:%f",pDoc->m_tindate.m_MaxHeight); 
	s_minheight.Format("最小高程:%f",pDoc->m_tindate.m_MinHeight); 
 
	s_tringlenumber.Format("三角形个数:%d",pDoc->m_tindate.m_triangenumber); 
	s_dotnumber.Format("点的个数:%d",pDoc->m_tindate.m_dotnumber); 
 
	pDC->TextOut(1,1,"数据信息:"); 
	pDC->TextOut(1,30,s_showleft); 
	pDC->TextOut(1,50,s_showright); 
	pDC->TextOut(1,70,s_showtop); 
	pDC->TextOut(1,90,s_showbottom); 
 
	pDC->TextOut(1,120,s_maxheight); 
	pDC->TextOut(1,140,s_minheight); 
 
	pDC->TextOut(1,170,s_dotnumber); 
	pDC->TextOut(1,190,s_tringlenumber); 
}