#pragma once
#include "McDbEntity.h"

//:Ignore

class  McDbViewportImp;
class ARXDLL McDbViewport  : public McDbEntity 
{
public:
	McDbViewport(void);
	virtual ~McDbViewport(void);

	MCDB_DECLARE_MEMBERS(McDbViewport);

	virtual Mdesk::Boolean    worldDraw(McGiWorldDraw* mode);

	virtual Mcad::ErrorStatus dwgOutFields(McDbDwgFiler* pFiler) const;
	virtual Mcad::ErrorStatus dwgInFields(McDbDwgFiler* pFiler);

	double            height() const;
	Mcad::ErrorStatus setHeight(double);

	double            width() const;
	Mcad::ErrorStatus setWidth(double);

	McGePoint3d       centerPoint() const;
	Mcad::ErrorStatus setCenterPoint(const McGePoint3d&);


	McGePoint3d       viewTarget() const;
	Mcad::ErrorStatus setViewTarget(const McGePoint3d&); 

	McGeVector3d      viewDirection() const;
	Mcad::ErrorStatus setViewDirection(const McGeVector3d&);


	double            viewHeight() const;
	Mcad::ErrorStatus setViewHeight(double ht);

	McGePoint2d       viewCenter() const;
	Mcad::ErrorStatus setViewCenter(const McGePoint2d& pt);

	double            twistAngle() const;
	Mcad::ErrorStatus setTwistAngle(double);


	bool              isNonRectClipOn() const;
	Mcad::ErrorStatus setNonRectClipOn();
	Mcad::ErrorStatus setNonRectClipOff();

	McDbObjectId      nonRectClipEntityId() const;
	Mcad::ErrorStatus setNonRectClipEntityId(McDbObjectId);

	void getUcs(McGePoint3d& origin, 
		McGeVector3d& xAxis, 
		McGeVector3d& yAxis) const;

	void setUcs(McGePoint3d origin, 
		McGeVector3d xAxis, 
		McGeVector3d yAxis);

	virtual Mcad::ErrorStatus   getGeomExtents(McDbExtents& extents, bool roughCalculation = true) const;



	//
	McGePoint2d snapBasePoint() const;

	void setSnapBasePoint(
		const McGePoint2d& snapBasePoint); 


	McGeVector2d snapIncrement() const;

	void setSnapIncrement(
		const McGeVector2d& snapIncrement);


	McGeVector2d gridIncrement() const;


	void setGridIncrement(
		const McGeVector2d& gridIncrement);


	
	double lensLength() const;


	void setLensLength(
		double lensLength);

	
	bool isFrontClipOn() const;

	
	void setFrontClipOn();

	
	void setFrontClipOff();


	
	bool isBackClipOn() const;

	
	void setBackClipOn();


	void setBackClipOff();


	bool isFrontClipAtEyeOn() const;


	void setFrontClipAtEyeOn();


	void setFrontClipAtEyeOff();


	double frontClipDistance() const;


	void setFrontClipDistance(
		double frontClipDistance);

	
	double backClipDistance() const;


	void setBackClipDistance(
		double backClipDistance);

	
	bool isPerspectiveOn() const;

	
	void setPerspectiveOn();


	void setPerspectiveOff();

	
	bool isUcsFollowModeOn() const;


	void setUcsFollowModeOn();


	void setUcsFollowModeOff();

	bool isUcsIconVisible() const;

	
	void setUcsIconVisible();


	void setUcsIconInvisible();


	bool isUcsIconAtOrigin() const;

	
	void setUcsIconAtOrigin();

	void setUcsIconAtCorner();


	bool isFastZoomOn() const;

	void setFastZoomOn();

	
	void setFastZoomOff();


	int circleSides() const;


	void setCircleSides(
		int circleSides);


	bool isSnapOn() const;


	void setSnapOn();

	
	void setSnapOff();


	bool isSnapIsometric() const;


	void setSnapIsometric();


	void setSnapStandard();


	double snapAngle() const;


	void setSnapAngle(
		double snapAngle);


	bool isGridOn() const;

	
	void setGridOn();

	
	void setGridOff();


	bool hiddenLinesRemoved() const;


	void showHiddenLines();


	void removeHiddenLines();


	bool isLocked() const;

	
	void setLocked();


	void setUnlocked();


	bool isOn() const;

	
	void setOn();

	
	void setOff();

	LPCMSTR plotStyleSheet() const;


	void setPlotStyleSheet(
		LPCMSTR plotStyleSheetName);

	void setRenderMode(
		McDb::RenderMode renderMode);


	McDb::RenderMode renderMode() const;


	double              brightness() const;
	void                setBrightness(double);

	
	double              contrast() const;
	void                setContrast(double);


	bool                isValid() const;

	void                setIsValid(bool isValid);

	double				customScale() const;

	void				setCustomScale(double customScale);


	Mdesk::Boolean    getEntitys(McDbObjectIdArray& aryId, bool isCrossingSelect = false);

	McGeMatrix3d getLayoutToModelCoordMatrix();

	enum StandardScaleType
	{
		kScaleToFit,  // Scaled to Fit
		kCustomScale, // Scale is not a standard scale
		k1_1,         // 1:1
		k1_2,         // 1:2
		k1_4,         // 1:4
		k1_8,         // 1:8
		k1_10,        // 1:10
		k1_16,        // 1:16
		k1_20,        // 1:20
		k1_30,        // 1:30
		k1_40,        // 1:40
		k1_50,        // 1:50
		k1_100,       // 1:100
		k2_1,         // 2:1
		k4_1,         // 4:1
		k8_1,         // 8:1
		k10_1,        // 10:1
		k100_1,       // 100:1
		k1_128in_1ft, // 1/128"= 1'
		k1_64in_1ft,  // 1/64"= 1'
		k1_32in_1ft,  // 1/32"= 1'
		k1_16in_1ft,  // 1/16"= 1'
		k3_32in_1ft,  // 3/32"= 1'
		k1_8in_1ft,   // 1/8" = 1'
		k3_16in_1ft,  // 3/16"= 1'
		k1_4in_1ft,   // 1/4" = 1'
		k3_8in_1ft,   // 3/8" = 1'
		k1_2in_1ft,   // 1/2" = 1'
		k3_4in_1ft,   // 3/4" = 1'
		k1in_1ft,     // 1" = 1'
		k3in_1ft,     // 3" = 1'
		k6in_1ft,     // 6" = 1'
		k1ft_1ft      // 1' = 1'
	};

	McDbViewport::StandardScaleType standardScale() const;

	void setStandardScale(
		const McDbViewport::StandardScaleType standardScale);

	McGePoint3d LayoutToModelCoord(McGePoint3d pt);
public:

	inline McDbViewportImp* getViewportImp() const {
		return (McDbViewportImp*)m_pImp;
	}
};

//:End Ignore