00001 /************************************************************** ggt-head beg 00002 * 00003 * GGT: Generic Graphics Toolkit 00004 * 00005 * Original Authors: 00006 * Allen Bierbaum 00007 * 00008 * ----------------------------------------------------------------- 00009 * File: $RCSfile: AABoxOps.h,v $ 00010 * Date modified: $Date: 2003/03/17 02:14:48 $ 00011 * Version: $Revision: 1.5 $ 00012 * ----------------------------------------------------------------- 00013 * 00014 *********************************************************** ggt-head end */ 00015 /*************************************************************** ggt-cpr beg 00016 * 00017 * GGT: The Generic Graphics Toolkit 00018 * Copyright (C) 2001,2002 Allen Bierbaum 00019 * 00020 * This library is free software; you can redistribute it and/or 00021 * modify it under the terms of the GNU Lesser General Public 00022 * License as published by the Free Software Foundation; either 00023 * version 2.1 of the License, or (at your option) any later version. 00024 * 00025 * This library is distributed in the hope that it will be useful, 00026 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00027 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00028 * Lesser General Public License for more details. 00029 * 00030 * You should have received a copy of the GNU Lesser General Public 00031 * License along with this library; if not, write to the Free Software 00032 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00033 * 00034 ************************************************************ ggt-cpr end */ 00035 #ifndef _GMTL_AABOXOPS_H_ 00036 #define _GMTL_AABOXOPS_H_ 00037 00038 #include <gmtl/AABox.h> 00039 #include <gmtl/VecOps.h> 00040 00041 namespace gmtl 00042 { 00043 00058 template< class DATA_TYPE > 00059 inline bool operator==( const AABox<DATA_TYPE>& b1, const AABox<DATA_TYPE>& b2 ) 00060 { 00061 return ( (b1.isEmpty() == b2.isEmpty()) && 00062 (b1.getMin() == b2.getMin()) && 00063 (b1.getMax() == b2.getMax()) ); 00064 } 00065 00075 template< class DATA_TYPE > 00076 inline bool operator!=( const AABox<DATA_TYPE>& b1, const AABox<DATA_TYPE>& b2 ) 00077 { 00078 return (! (b1 == b2)); 00079 } 00080 00092 template< class DATA_TYPE > 00093 inline bool isEqual( const AABox<DATA_TYPE>& b1, const AABox<DATA_TYPE>& b2, const DATA_TYPE& eps ) 00094 { 00095 gmtlASSERT( eps >= 0 ); 00096 return (b1.isEmpty() == b2.isEmpty()) && 00097 isEqual( b1.getMin(), b2.getMin(), eps ) && 00098 isEqual( b1.getMax(), b2.getMax(), eps ); 00099 } 00102 } 00103 00104 #endif 00105