intersect_decls.h

00001 // intersect_decls.h (Declarations for "friend" intersection functions)
00002 //
00003 //  The WorldForge Project
00004 //  Copyright (C) 2002  The WorldForge Project
00005 //
00006 //  This program is free software; you can redistribute it and/or modify
00007 //  it under the terms of the GNU General Public License as published by
00008 //  the Free Software Foundation; either version 2 of the License, or
00009 //  (at your option) any later version.
00010 //
00011 //  This program is distributed in the hope that it will be useful,
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //  GNU General Public License for more details.
00015 //
00016 //  You should have received a copy of the GNU General Public License
00017 //  along with this program; if not, write to the Free Software
00018 //  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 //
00020 //  For information about WorldForge and its authors, please contact
00021 //  the Worldforge Web Site at http://www.worldforge.org.
00022 //
00023 
00024 // Author: Ron Steinke
00025 
00026 #ifndef WFMATH_INTERSECT_DECLS_H
00027 #define WFMATH_INTERSECT_DECLS_H
00028 
00029 #include <wfmath/const.h>
00030 
00031 namespace WFMath {
00032 
00033 // Some Intersect and Contains helper functions
00034 
00035 inline bool _Less(CoordType x1, CoordType x2, bool proper)
00036 {
00037   return !proper ? x1 < x2 : x1 <= x2;
00038 }
00039 
00040 inline bool _LessEq(CoordType x1, CoordType x2, bool proper)
00041 {
00042   return !proper ? x1 <= x2 : x1 < x2;
00043 }
00044 
00045 inline bool _Greater(CoordType x1, CoordType x2, bool proper)
00046 {
00047   return !proper ? x1 > x2 : x1 >= x2;
00048 }
00049 
00050 inline bool _GreaterEq(CoordType x1, CoordType x2, bool proper)
00051 {
00052   return !proper ? x1 >= x2 : x1 > x2;
00053 }
00054 
00055 template<const int dim> class Point;
00056 template<const int dim> class AxisBox;
00057 template<const int dim> class Ball;
00058 template<const int dim> class Segment;
00059 template<const int dim> class RotBox;
00060 template<const int dim> class Polygon;
00061 
00062 template<const int dim>
00063 bool Intersect(const AxisBox<dim>& b, const Point<dim>& p, bool proper);
00064 template<const int dim>
00065 bool Contains(const Point<dim>& p, const AxisBox<dim>& b, bool proper);
00066 
00067 template<const int dim>
00068 bool Intersect(const Ball<dim>& b, const Point<dim>& p, bool proper);
00069 template<const int dim>
00070 bool Contains(const Point<dim>& p, const Ball<dim>& b, bool proper);
00071 
00072 template<const int dim>
00073 bool Intersect(const Segment<dim>& s, const Point<dim>& p, bool proper);
00074 template<const int dim>
00075 bool Contains(const Point<dim>& p, const Segment<dim>& s, bool proper);
00076 
00077 template<const int dim>
00078 bool Intersect(const RotBox<dim>& r, const Point<dim>& p, bool proper);
00079 template<const int dim>
00080 bool Contains(const Point<dim>& p, const RotBox<dim>& r, bool proper);
00081 
00082 template<const int dim>
00083 bool Intersect(const AxisBox<dim>& b1, const AxisBox<dim>& b2, bool proper);
00084 template<const int dim>
00085 bool Contains(const AxisBox<dim>& outer, const AxisBox<dim>& inner, bool proper);
00086 
00087 template<const int dim>
00088 bool Intersect(const Ball<dim>& b, const AxisBox<dim>& a, bool proper);
00089 template<const int dim>
00090 bool Contains(const Ball<dim>& b, const AxisBox<dim>& a, bool proper);
00091 template<const int dim>
00092 bool Contains(const AxisBox<dim>& a, const Ball<dim>& b, bool proper);
00093 
00094 template<const int dim>
00095 bool Intersect(const Segment<dim>& s, const AxisBox<dim>& b, bool proper);
00096 template<const int dim>
00097 bool Contains(const Segment<dim>& s, const AxisBox<dim>& b, bool proper);
00098 template<const int dim>
00099 bool Contains(const AxisBox<dim>& b, const Segment<dim>& s, bool proper);
00100 
00101 template<const int dim>
00102 bool Intersect(const RotBox<dim>& r, const AxisBox<dim>& b, bool proper);
00103 template<const int dim>
00104 bool Contains(const RotBox<dim>& r, const AxisBox<dim>& b, bool proper);
00105 template<const int dim>
00106 bool Contains(const AxisBox<dim>& b, const RotBox<dim>& r, bool proper);
00107 
00108 template<const int dim>
00109 bool Intersect(const Ball<dim>& b1, const Ball<dim>& b2, bool proper);
00110 template<const int dim>
00111 bool Contains(const Ball<dim>& outer, const Ball<dim>& inner, bool proper);
00112 
00113 template<const int dim>
00114 bool Intersect(const Segment<dim>& s, const Ball<dim>& b, bool proper);
00115 template<const int dim>
00116 bool Contains(const Ball<dim>& b, const Segment<dim>& s, bool proper);
00117 template<const int dim>
00118 bool Contains(const Segment<dim>& s, const Ball<dim>& b, bool proper);
00119 
00120 template<const int dim>
00121 bool Intersect(const RotBox<dim>& r, const Ball<dim>& b, bool proper);
00122 template<const int dim>
00123 bool Contains(const RotBox<dim>& r, const Ball<dim>& b, bool proper);
00124 template<const int dim>
00125 bool Contains(const Ball<dim>& b, const RotBox<dim>& r, bool proper);
00126 
00127 template<const int dim>
00128 bool Intersect(const Segment<dim>& s1, const Segment<dim>& s2, bool proper);
00129 template<const int dim>
00130 bool Contains(const Segment<dim>& s1, const Segment<dim>& s2, bool proper);
00131 
00132 template<const int dim>
00133 bool Intersect(const RotBox<dim>& r, const Segment<dim>& s, bool proper);
00134 template<const int dim>
00135 bool Contains(const RotBox<dim>& r, const Segment<dim>& s, bool proper);
00136 template<const int dim>
00137 bool Contains(const Segment<dim>& s, const RotBox<dim>& r, bool proper);
00138 
00139 template<const int dim>
00140 bool Intersect(const RotBox<dim>& r1, const RotBox<dim>& r2, bool proper);
00141 template<const int dim>
00142 bool Contains(const RotBox<dim>& outer, const RotBox<dim>& inner, bool proper);
00143 
00144 template<const int dim>
00145 bool Intersect(const Polygon<dim>& r, const Point<dim>& p, bool proper);
00146 template<const int dim>
00147 bool Contains(const Point<dim>& p, const Polygon<dim>& r, bool proper);
00148 
00149 template<const int dim>
00150 bool Intersect(const Polygon<dim>& p, const AxisBox<dim>& b, bool proper);
00151 template<const int dim>
00152 bool Contains(const Polygon<dim>& p, const AxisBox<dim>& b, bool proper);
00153 template<const int dim>
00154 bool Contains(const AxisBox<dim>& b, const Polygon<dim>& p, bool proper);
00155 
00156 template<const int dim>
00157 bool Intersect(const Polygon<dim>& p, const Ball<dim>& b, bool proper);
00158 template<const int dim>
00159 bool Contains(const Polygon<dim>& p, const Ball<dim>& b, bool proper);
00160 template<const int dim>
00161 bool Contains(const Ball<dim>& b, const Polygon<dim>& p, bool proper);
00162 
00163 template<const int dim>
00164 bool Intersect(const Polygon<dim>& r, const Segment<dim>& s, bool proper);
00165 template<const int dim>
00166 bool Contains(const Polygon<dim>& p, const Segment<dim>& s, bool proper);
00167 template<const int dim>
00168 bool Contains(const Segment<dim>& s, const Polygon<dim>& p, bool proper);
00169 
00170 template<const int dim>
00171 bool Intersect(const Polygon<dim>& p, const RotBox<dim>& r, bool proper);
00172 template<const int dim>
00173 bool Contains(const Polygon<dim>& p, const RotBox<dim>& r, bool proper);
00174 template<const int dim>
00175 bool Contains(const RotBox<dim>& r, const Polygon<dim>& p, bool proper);
00176 
00177 template<const int dim>
00178 bool Intersect(const Polygon<dim>& p1, const Polygon<dim>& p2, bool proper);
00179 template<const int dim>
00180 bool Contains(const Polygon<dim>& outer, const Polygon<dim>& inner, bool proper);
00181 
00182 } // namespace WFMath
00183 
00184 #endif  // WFMATH_INTERSECT_DECLS_H

Generated on Mon Jul 23 16:08:46 2007 for WFMath by  doxygen 1.5.2