#pragma once

class McDbSpatialFilterImp;
#include "McDbObject.h"

class ARXDLL McDbFilter : public McDbObject
{
protected:
	McDbFilter(McDbObjectImp* pImp);

public:
	// -------------------------------------------------------------------------
	// Summary:
	// 		申明类型信息
	// -------------------------------------------------------------------------
	
	MCDB_DECLARE_MEMBERS(McDbFilter);

	// -------------------------------------------------------------------------
	// Summary:
	// 		构造函数
	// -------------------------------------------------------------------------
	McDbFilter(void);

	// -------------------------------------------------------------------------
	// Summary:
	// 		析构函数
	// -------------------------------------------------------------------------
	virtual ~McDbFilter(void);

	//:Ignore


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

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

	//:End Ignore
};


class ARXDLL McDbSpatialFilter : public McDbFilter
{
public:
	// -------------------------------------------------------------------------
	// Summary:
	// 		申明直线的类型信息
	// -------------------------------------------------------------------------
	MCDB_DECLARE_MEMBERS(McDbSpatialFilter);

	// -------------------------------------------------------------------------
	// Summary:
	// 		构造函数
	// -------------------------------------------------------------------------
	McDbSpatialFilter(void);

	// -------------------------------------------------------------------------
	// Summary:
	// 		析构函数
	// -------------------------------------------------------------------------
	virtual ~McDbSpatialFilter(void);

	//:Ignore

	McGeVector3d normal() const;
	virtual Mcad::ErrorStatus setNormal(const McGeVector3d& newVal);

	bool frontClipEnabled() const;
	virtual void setFrontClipEnabled(bool isFrontClipEnabled);

	bool backClipDistEnabled() const;
	virtual void setBackClipDistEnabled(bool isBackClipDistEnabled);

	double frontClipDist() const;
	virtual void setFrontClipDist(double dFrontClipDist);

	double backClipDist() const;
	virtual void setBackClipDist(double dBackClipDist);

	McGePoint3d origin() const;
	virtual void setOrigin(McGePoint3d ptOrigin);

	bool isEnabled() const;
	virtual void setEnable(bool isEnable);

	void boundary(McGePoint2dArray& points) const;
	virtual void setBoundary(const McGePoint2dArray& points);

	McGeMatrix3d inverseblockmat() const;
	virtual void setInverseblockmat(const McGeMatrix3d& mat);


	McGeMatrix3d clipboundmat() const;
	virtual void setClipboundmat(const McGeMatrix3d& mat);

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

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

	Mcad::ErrorStatus   transformBy(const McGeMatrix3d& xform);

	bool isFilterInverted() const;
	void setFilterInverted(bool bSet);

	//:End Ignore

	inline McDbSpatialFilterImp* getSpatialFilterImp() const {
		return (McDbSpatialFilterImp*)m_pImp;
	}
};