//
//	Copyright © 2005 Nemetschek North America 
//	All Rights Reserved.
//
// Created by Vladislav Stanev

#pragma once

namespace VWFC
{
	namespace Math
	{
		class VWCube
		{
		public:
			// construction
								VWCube();
								VWCube(const VWPoint3D& minPoint, const VWPoint3D& maxPoint);
								VWCube(const VWPoint3D& minPt, double cx, double cy, double cz);
								VWCube(const VWCube& src);
								~VWCube();

			VWCube&				operator=(const VWCube& src);

			void				Clear();
			void				SetCube(const VWPoint3D& minPoint, const VWPoint3D& maxPoint);
			void				SetCube(const VWPoint3D& minPt, double cx, double cy, double cz);

			bool				IsEmpty() const;
			double				GetWidth() const;
			double				GetDepth() const;
			double				GetHeight() const;
			const VWPoint3D&	GetMinPoint() const;
			const VWPoint3D&	GetMaxPoint() const;

			void				Unite(double x, double y, double z);
			void				Unite(const VWPoint3D& pt);
			void				Unite(const VWPolygon2D& poly);
			void				Unite(const VWPolygon3D& poly);
			void				Unite(const VWCube& cube);

			bool				IsPtInside(double x, double y, double z) const;
			bool				IsPtInside(const VWPoint3D& pt) const;

		protected:
			bool			bEmpty;
			VWPoint3D		m_maxPoint;
			VWPoint3D		m_minPoint;
		};
	}
}