wfmath  1.0.3
A math library for the Worldforge system.
polygon_intersect.h
1 // polygon_funcs.h (Polygon<> intersection functions)
2 //
3 // The WorldForge Project
4 // Copyright (C) 2002 The WorldForge Project
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 //
20 // For information about WorldForge and its authors, please contact
21 // the Worldforge Web Site at http://www.worldforge.org.
22 //
23 
24 // Author: Ron Steinke
25 // Created: 2002-2-20
26 
27 #ifndef WFMATH_POLYGON_INTERSECT_H
28 #define WFMATH_POLYGON_INTERSECT_H
29 
30 #include <wfmath/axisbox.h>
31 #include <wfmath/ball.h>
32 #include <wfmath/polygon.h>
33 #include <wfmath/intersect.h>
34 #include <wfmath/error.h>
35 
36 
37 // FIXME Work is needed on this code. At very least the following notes
38 // from the original author apply:
39 // "The Intersect() and Contains() functions involving WFMath::Polygon<>"
40 // "are still under development, and probably shouldn't be used yet."
41 
42 namespace WFMath {
43 
44 
45 template<>
46 bool Intersect(const Polygon<2>& r, const Point<2>& p, bool proper);
47 template<>
48 bool Contains(const Point<2>& p, const Polygon<2>& r, bool proper);
49 
50 template<>
51 bool Intersect(const Polygon<2>& p, const AxisBox<2>& b, bool proper);
52 template<>
53 bool Contains(const Polygon<2>& p, const AxisBox<2>& b, bool proper);
54 template<>
55 bool Contains(const AxisBox<2>& b, const Polygon<2>& p, bool proper);
56 
57 template<>
58 bool Intersect(const Polygon<2>& p, const Ball<2>& b, bool proper);
59 template<>
60 bool Contains(const Polygon<2>& p, const Ball<2>& b, bool proper);
61 template<>
62 bool Contains(const Ball<2>& b, const Polygon<2>& p, bool proper);
63 
64 template<>
65 bool Intersect(const Polygon<2>& p, const Segment<2>& s, bool proper);
66 template<>
67 bool Contains(const Polygon<2>& p, const Segment<2>& s, bool proper);
68 template<>
69 bool Contains(const Segment<2>& s, const Polygon<2>& p, bool proper);
70 
71 template<>
72 bool Intersect(const Polygon<2>& p, const RotBox<2>& r, bool proper);
73 template<>
74 bool Contains(const Polygon<2>& p, const RotBox<2>& r, bool proper);
75 template<>
76 bool Contains(const RotBox<2>& r, const Polygon<2>& p, bool proper);
77 
78 template<>
79 bool Intersect(const Polygon<2>& p1, const Polygon<2>& p2, bool proper);
80 template<>
81 bool Contains(const Polygon<2>& outer, const Polygon<2>& inner, bool proper);
82 
83 } // namespace WFMath
84 
85 #endif // WFMATH_POLYGON_INTERSECT_H
Generic library namespace.
Definition: shape.h:41