www.pudn.com > MapDB.rar > MapDBDoc.h, change:2003-06-04,size:4602b


// MapDBDoc.h : interface of the CMapDBDoc class 
// 
///////////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_MAPDBDOC_H__C33872FC_9326_4831_912D_DDB595EBF851__INCLUDED_) 
#define AFX_MAPDBDOC_H__C33872FC_9326_4831_912D_DDB595EBF851__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include "mapobject.h" 
 
#define		GRIDCOUNT		64 
#define		NDCEXTENT		60000 
 
class CMapDBView; 
class CResultDlg; 
 
 
class CMapDBDoc : public CDocument 
{ 
protected: // create from serialization only 
	CMapDBDoc(); 
	DECLARE_DYNCREATE(CMapDBDoc) 
 
//	MapDB 
public: 
	CString		m_maptitle; 
	CString		m_mapid; 
	CString		m_mapscale; 
	CString		m_mapproject; 
	CString		m_mapcoords; 
	CString		m_mapaltitude; 
	CString		m_mapAttributes; 
	CTime		m_mapdate; 
 
	CMapDWordToDWord	m_maptitles; 
	CMapDWordToDWord	m_mapobjids; 
 
	BitsArray	m_objsel; 
	BitsArray	m_titlesel; 
 
	BitsArray	m_objidx; 
	BitsArray	m_titleidx; 
	BitsArray	m_grididx; 
 
	CMapObjectArray m_mapobjs; 
 
// Attributes 
public: 
	CSize m_sizePhoto; 
	CSize m_sizeDraw; 
	LPBITMAPINFO m_lpbiText; 
	BITMAPFILEHEADER header; 
	BITMAPINFOHEADER infoheader; 
	unsigned char * m_text; 
	CBitmap * m_pbitmap; 
	CBitmap	m_bitmap; 
	CDC m_dc; 
 
	CString	m_usrfile; 
	CString	m_xyfile; 
	CString	m_domfile; 
 
	CMPointArray m_normalpts; 
	CMPointArray m_controlpts; 
	CMPointArray m_schemapts; 
 
	double m_transx[6]; 
	double m_transy[6]; 
	double m_xo,m_yo,m_kx,m_ky; 
	double m_xmin,m_ymin,m_xmax,m_ymax; 
	double m_sxo,m_syo,m_ksx,m_ksy; 
	CPoint m_selpt[2]; 
	BOOL   m_bSelQuery; 
	BOOL   m_bShowQuery; 
protected: 
	bool m_bInited; 
	CString m_version; 
	CResultDlg * m_querylist; 
 
// Operations 
public: 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CMapDBDoc) 
	public: 
	virtual BOOL OnNewDocument(); 
	virtual void Serialize(CArchive& ar); 
	virtual BOOL OnOpenDocument(LPCTSTR lpszPathName); 
	virtual BOOL OnSaveDocument(LPCTSTR lpszPathName); 
	virtual void DeleteContents(); 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	BOOL GetImage(CString strFile); 
	void SetCenter(CPoint pt); 
	void QuitSel(); 
	void ShowQuery(BOOL bShow = TRUE); 
	CMapDBView * GetView(); 
	void QueryPos(); 
	void QueryAll(); 
	void GetGridRect(BOOL grid[GRIDCOUNT][GRIDCOUNT],CRect &rect); 
	void GetGrid(long x0,long y0,BOOL grid[GRIDCOUNT][GRIDCOUNT]); 
	void GetGrid(long x0,long y0,long x1,long y1,BOOL grid[GRIDCOUNT][GRIDCOUNT]); 
	BOOL GetGrid(CMapObject * obj,BOOL grid[GRIDCOUNT][GRIDCOUNT]); 
	void QueryGrid(); 
	void GetIndexs(); 
	void GetGridIdx(); 
	void GetTitleIdx(); 
	void GetObjIdx(); 
	int  GetByte(DWORD bits); 
	void Grid2NDC(long r,long c,long &x0,long &y0,long &x1,long &y1); 
	void NDC2Grid(long x,long y,long &r,long &c); 
	void DC2NDC(long r,long c,long &x,long &y); 
	void NDC2DC(long xn,long yn,long &r,long &c); 
	void NDC2WC(long xn,long  yn,double &x,double &y); 
	void WC2NDC(double x,double y,long &xn,long &yn); 
	void UWC2WC(double xi,double yi,double &x,double &y); 
	void Release(); 
	void GetScreenCoord(); 
	void GetGridCoord(); 
	void GetTransCoord(); 
	BOOL GetTransform(); 
	void TransCoord(); 
	BOOL LoadXY(CString xyFile); 
	BOOL LoadVector(CString usrFile); 
	double GetRate(); 
	void SetImage(); 
	inline bool IsInited()	{	return m_bInited;	} 
	BOOL LoadImage(CString imgFile); 
	BOOL ImportUsr(); 
	virtual ~CMapDBDoc(); 
#ifdef _DEBUG 
	virtual void AssertValid() const; 
	virtual void Dump(CDumpContext& dc) const; 
#endif 
 
// Generated message map functions 
protected: 
	//{{AFX_MSG(CMapDBDoc) 
	afx_msg void OnImportUsr(); 
	afx_msg void OnUpdateImportUsr(CCmdUI* pCmdUI); 
	afx_msg void OnQueryId(); 
	afx_msg void OnUpdateQueryId(CCmdUI* pCmdUI); 
	afx_msg void OnQueryTitle(); 
	afx_msg void OnUpdateQueryTitle(CCmdUI* pCmdUI); 
	afx_msg void OnQueryGrid(); 
	afx_msg void OnUpdateQueryGrid(CCmdUI* pCmdUI); 
	afx_msg void OnQueryall(); 
	afx_msg void OnUpdateQueryall(CCmdUI* pCmdUI); 
	afx_msg void OnRefresh(); 
	afx_msg void OnQueryResult(); 
	afx_msg void OnUpdateQueryResult(CCmdUI* pCmdUI); 
	afx_msg void OnUpdateZoomin(CCmdUI* pCmdUI); 
	afx_msg void OnUpdateZoomout(CCmdUI* pCmdUI); 
	afx_msg void OnUpdateZoomOriginal(CCmdUI* pCmdUI); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_MAPDBDOC_H__C33872FC_9326_4831_912D_DDB595EBF851__INCLUDED_)