// ViewWindowInfo.h: interface for the ViewWindowInfo class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_VIEWWINDOWINFO_H__6F859A94_B5E7_4FFA_A3A7_D607323A5BE8__INCLUDED_)
#define AFX_VIEWWINDOWINFO_H__6F859A94_B5E7_4FFA_A3A7_D607323A5BE8__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include<Stuff\Stuff.hpp>
using namespace Stuff;
class ViewWindowInfo  
{
protected:
	CSize	ClientArea,BitmapArea;
	Point3D ZoomFact,Pan,MapSize,MapOrg;
	Scalar	ZoneSize,TileSize;
	float 
			ViewSizeX,
			ViewSizeY,
			HalfViewSizeX,
			HalfViewSizeY,
			SourcePixs_Per_MeterX,
			SourcePixs_Per_MeterY,
			DestPixs_Per_MeterX,
			DestPixs_Per_MeterY,
			MeterX_Per_DestPixs,
			MeterY_Per_DestPixs,
			DestPixs_Per_SourcePixsX,
			DestPixs_Per_SourcePixsY,
			MapRatio,ClientRatio;

	

	void CalcConstants();
public:
	ViewWindowInfo();
	void SetClientArea(CSize &rct);	
	void SetBitmapArea(CSize &rct);	
	void SetPan(Point3D &pnt);
	void OffsetPan(Point3D &pnt);
	void SetZoom(float zf);
	void MultiplyZoom(float zf);
	void SetMapSize(Point3D msze);
	void GetViewLimits(Point3D *min,Point3D *max);
	void SetViewLimits(Point3D min,Point3D max);
	bool GetBltRects(CRect *drct,CRect *srct);
	void SetZoneSize(Scalar pnt) {ZoneSize=pnt;}
	void SetTileSize(Scalar pnt) {TileSize=pnt;}
	Scalar GetZoneSize() {return ZoneSize;}
	Scalar GetTileSize() {return TileSize;}
	void SetPan(CPoint &pnt);
	void OffsetPan(CSize &pnt);
	void CorrectViewBounds();

	Point3D GetMapSize() {return MapSize;}
	Point3D GetMapOrg()  {return MapOrg;}
	Point3D ScreenToData(CPoint &pnt);
	CPoint  DataToScreen(const Point3D &pnt);
	CSize GetClientSize() {return ClientArea;}
	Scalar GetMapRatio() {return MapRatio;}

	virtual ~ViewWindowInfo();

};

#endif // !defined(AFX_VIEWWINDOWINFO_H__6F859A94_B5E7_4FFA_A3A7_D607323A5BE8__INCLUDED_)
