Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
predicates_on_points_2.h
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // Copyright (c) 1999 The CGAL Consortium
4 
5 // This software and related documentation is part of the Computational
6 // Geometry Algorithms Library (CGAL).
7 // This software and documentation is provided "as-is" and without warranty
8 // of any kind. In no event shall the CGAL Consortium be liable for any
9 // damage of any kind.
10 //
11 // Every use of CGAL requires a license.
12 //
13 // Academic research and teaching license
14 // - For academic research and teaching purposes, permission to use and copy
15 // the software and its documentation is hereby granted free of charge,
16 // provided that it is not a component of a commercial product, and this
17 // notice appears in all copies of the software and related documentation.
18 //
19 // Commercial licenses
20 // - A commercial license is available through Algorithmic Solutions, who also
21 // markets LEDA (http://www.algorithmic-solutions.de).
22 // - Commercial users may apply for an evaluation license by writing to
23 // Algorithmic Solutions (contact@algorithmic-solutions.com).
24 //
25 // The CGAL Consortium consists of Utrecht University (The Netherlands),
26 // ETH Zurich (Switzerland), Free University of Berlin (Germany),
27 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
28 // (Germany), Max-Planck-Institute Saarbrucken (Germany), RISC Linz (Austria),
29 // and Tel-Aviv University (Israel).
30 //
31 // ----------------------------------------------------------------------
32 //
33 // release : CGAL-2.2
34 // release_date : 2000, September 30
35 //
36 // source : predicates_on_points_2.fw
37 // file : include/CGAL/predicates_on_points_2.h
38 // package : _2 (3.6)
39 // revision : 3.6
40 // revision_date : 30 Jul 2000
41 // author(s) : Andreas Fabri
42 // Stefan Schirra
43 //
44 // coordinator : MPI, Saarbruecken (<Stefan.Schirra>)
45 // email : contact@cgal.org
46 // www : http://www.cgal.org
47 //
48 // ======================================================================
49 
50 
51 #ifndef CGAL_PREDICATES_ON_POINTS_2_H
52 #define CGAL_PREDICATES_ON_POINTS_2_H
53 
54 #ifndef CGAL_REP_CLASS_DEFINED
55 #error no representation class defined
56 #endif // CGAL_REP_CLASS_DEFINED
57 
58 #ifdef CGAL_HOMOGENEOUS_H
59 #ifndef CGAL_PREDICATES_ON_POINTSH2_H
60 #include <CGAL/predicates_on_pointsH2.h>
61 #endif // CGAL_PREDICATES_ON_POINTSH2_H
62 #endif // CGAL_HOMOGENEOUS_H
63 
64 #ifdef CGAL_CARTESIAN_H
65 #ifndef CGAL_PREDICATES_ON_POINTSC2_H
66 #include <CGAL/Cartesian/predicates_on_points_2.h>
67 #endif // CGAL_PREDICATES_ON_POINTSC2_H
68 #endif // CGAL_CARTESIAN_H
69 
70 #ifdef CGAL_SIMPLE_CARTESIAN_H
72 #endif // CGAL_SIMPLE_CARTESIAN_H
73 
74 
75 #ifndef CGAL_POINT_2_H
76 #include <CGAL/Point_2.h>
77 #endif // CGAL_POINT_2_H
78 
80 
81 template < class R >
82 inline
83 bool x_equal(const Point_2<R>& p,
84  const Point_2<R>& q)
85 {
86  typedef typename R::Point_2_base RPoint_2;
87  return x_equal((const RPoint_2&)p, (const RPoint_2&)q);
88 }
89 
90 template < class R >
91 inline
92 bool y_equal(const Point_2<R>& p,
93  const Point_2<R>& q)
94 {
95  typedef typename R::Point_2_base RPoint_2;
96  return y_equal((const RPoint_2&)p, (const RPoint_2&)q);
97 }
98 
99 
100 template < class R >
101 inline
103  const Point_2<R>& q)
104 {
105  typedef typename R::Point_2_base RPoint_2;
106  return compare_x((const RPoint_2&)p, (const RPoint_2&)q);
107 }
108 
109 template < class R >
110 inline
112  const Point_2<R>& q)
113 {
114  typedef typename R::Point_2_base RPoint_2;
115  return compare_y((const RPoint_2&)p, (const RPoint_2&)q);
116 }
117 
118 template < class R >
119 inline
122  const Point_2<R>& q,
123  const Point_2<R>& r,
124  const Point_2<R>& s)
125 {
126  typedef typename R::Point_2_base RPoint_2;
127  return compare_deltax_deltay((const RPoint_2&)p,
128  (const RPoint_2&)q,
129  (const RPoint_2&)r,
130  (const RPoint_2&)s);
131 }
132 
133 template < class R >
134 inline
137  const Point_2<R>& q)
138 {
139  typedef typename R::Point_2_base RPoint_2;
140  return compare_lexicographically_xy((const RPoint_2&)p,
141  (const RPoint_2&)q);
142 }
143 
144 template < class R >
145 inline
146 bool
148  const Point_2<R>& q)
149 {
150  typedef typename R::Point_2_base RPoint_2;
151  return lexicographically_xy_smaller_or_equal((const RPoint_2&)p,
152  (const RPoint_2&)q);
153 }
154 
155 template < class R >
156 inline
157 bool
159  const Point_2<R>& q)
160 {
161  typedef typename R::Point_2_base RPoint_2;
162  return lexicographically_xy_smaller((const RPoint_2&)p,
163  (const RPoint_2&)q);
164 }
165 
166 template < class R >
167 inline
168 bool
170  const Point_2<R>& q)
171 {
172  typedef typename R::Point_2_base RPoint_2;
173  return !lexicographically_xy_smaller((const RPoint_2&)p,
174  (const RPoint_2&)q);
175 }
176 
177 template < class R >
178 inline
179 bool
181  const Point_2<R>& q)
182 {
183  typedef typename R::Point_2_base RPoint_2;
184  return !lexicographically_xy_smaller_or_equal((const RPoint_2&)p,
185  (const RPoint_2&)q);
186 }
187 
188 
189 template < class R >
190 inline
193  const Point_2<R>& q)
194 {
195  typedef typename R::Point_2_base RPoint_2;
196  return compare_lexicographically_yx((const RPoint_2&)p,
197  (const RPoint_2&)q);
198 }
199 
200 template < class R >
201 inline
202 bool
204  const Point_2<R>& q)
205 {
206  typedef typename R::Point_2_base RPoint_2;
207  return lexicographically_yx_smaller_or_equal((const RPoint_2&)p,
208  (const RPoint_2&)q);
209 }
210 
211 template < class R >
212 inline
213 bool
215  const Point_2<R>& q)
216 {
217  typedef typename R::Point_2_base RPoint_2;
218  return lexicographically_yx_smaller((const RPoint_2&)p,
219  (const RPoint_2&)q);
220 }
221 
222 template < class R >
223 inline
224 bool
226  const Point_2<R>& q)
227 {
228  typedef typename R::Point_2_base RPoint_2;
229  return !lexicographically_yx_smaller((const RPoint_2&)p,
230  (const RPoint_2&)q);
231 }
232 
233 template < class R >
234 inline
235 bool
237  const Point_2<R>& q)
238 {
239  typedef typename R::Point_2_base RPoint_2;
240  return !lexicographically_yx_smaller_or_equal((const RPoint_2&)p,
241  (const RPoint_2&)q);
242 }
243 
244 template < class R >
245 inline
246 bool
248  const Point_2<R>& q,
249  const Point_2<R>& r)
250 {
251  typedef typename R::Point_2_base RPoint_2;
252  return are_ordered_along_line((const RPoint_2&)p,
253  (const RPoint_2&)q,
254  (const RPoint_2&)r);
255 }
256 
257 template < class R >
258 inline
259 bool
261  const Point_2<R>& q,
262  const Point_2<R>& r)
263 {
264  typedef typename R::Point_2_base RPoint_2;
265  return collinear_are_ordered_along_line((const RPoint_2&)p,
266  (const RPoint_2&)q,
267  (const RPoint_2&)r);
268 }
269 
270 template < class R >
271 inline
272 bool
274  const Point_2<R>& q,
275  const Point_2<R>& r)
276 {
277  typedef typename R::Point_2_base RPoint_2;
278  return are_strictly_ordered_along_line((const RPoint_2&)p,
279  (const RPoint_2&)q,
280  (const RPoint_2&)r);
281 }
282 template < class R >
283 inline
284 bool
286  const Point_2<R>& q,
287  const Point_2<R>& r)
288 {
289  typedef typename R::Point_2_base RPoint_2;
290  return
292  (const RPoint_2&)q,
293  (const RPoint_2&)r);
294 }
295 template < class R >
296 inline
297 bool
299  const Point_2<R>& q,
300  const Point_2<R>& r)
301 {
302  typedef typename R::Point_2_base RPoint_2;
303  return (collinear((const RPoint_2&)p,
304  (const RPoint_2&)q,
305  (const RPoint_2&)r));
306 }
307 
308 template < class R >
309 inline
310 bool
312  const Point_2<R>& q,
313  const Point_2<R>& r)
314 {
315  typedef typename R::Point_2_base RPoint_2;
316  return leftturn((const RPoint_2&)p,
317  (const RPoint_2&)q,
318  (const RPoint_2&)r);
319 }
320 
321 template < class R >
322 inline
323 bool
325  const Point_2<R>& q,
326  const Point_2<R>& r)
327 {
328  typedef typename R::Point_2_base RPoint_2;
329  return rightturn((const RPoint_2&)p,
330  (const RPoint_2&)q,
331  (const RPoint_2&)r);
332 }
333 
334 template < class R >
335 inline
336 bool
337 rightturn(const Origin& o,
338  const Point_2<R>& q,
339  const Point_2<R>& r)
340 {
341  typedef typename R::Point_2_base RPoint_2;
342  return rightturn(o, (const RPoint_2&)q, (const RPoint_2&)r);
343 }
344 
345 template < class R >
346 inline
349  const Point_2<R>&q,
350  const Point_2<R>& r)
351 {
352  typedef typename R::Point_2_base RPoint_2;
353  return orientation((const RPoint_2&)p,
354  (const RPoint_2&)q,
355  (const RPoint_2&)r);
356 }
357 
358 template <class R >
359 inline
362  const Point_2<R>& q,
363  const Point_2<R>& r,
364  const Point_2<R>& test)
365 {
366  typedef typename R::Point_2_base RPoint_2;
367  return side_of_oriented_circle((const RPoint_2&)p,
368  (const RPoint_2&)q,
369  (const RPoint_2&)r,
370  (const RPoint_2&)test);
371 }
372 
373 template <class R >
374 inline
377  const Point_2<R>& q,
378  const Point_2<R>& r,
379  const Point_2<R>& test)
380 {
381  typedef typename R::Point_2_base RPoint_2;
382  return side_of_bounded_circle((const RPoint_2&)p,
383  (const RPoint_2&)q,
384  (const RPoint_2&)r,
385  (const RPoint_2&)test);
386 }
387 
389 
390 
391 #endif // CGAL_PREDICATES_ON_POINTS_2_H
Comparison_result compare_y(const Point_2< R > &p, const Point_2< R > &q)
bool lexicographically_xy_larger_or_equal(const Point_2< R > &p, const Point_2< R > &q)
double s
Definition: blastest.C:80
bool lexicographically_xy_larger(const Point_2< R > &p, const Point_2< R > &q)
bool lexicographically_xy_smaller(const Point_2< R > &p, const Point_2< R > &q)
bool lexicographically_yx_smaller_or_equal(const Point_2< R > &p, const Point_2< R > &q)
bool y_equal(const Point_2< R > &p, const Point_2< R > &q)
Sign
Definition: enum.h:57
Oriented_side
Definition: enum.h:78
Comparison_result compare_deltax_deltay(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r, const Point_2< R > &s)
bool rightturn(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
Comparison_result compare_x(const Point_2< R > &p, const Point_2< R > &q)
Oriented_side side_of_oriented_circle(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r, const Point_2< R > &test)
bool lexicographically_xy_smaller_or_equal(const Point_2< R > &p, const Point_2< R > &q)
bool are_ordered_along_line(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
bool collinear(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
void test(void)
Definition: flotsam.C:99
bool collinear_are_ordered_along_line(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
bool lexicographically_yx_smaller(const Point_2< R > &p, const Point_2< R > &q)
Orientation orientation(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
bool are_strictly_ordered_along_line(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
CGAL_BEGIN_NAMESPACE bool x_equal(const Point_2< R > &p, const Point_2< R > &q)
Comparison_result
Definition: enum.h:94
Bounded_side
Definition: enum.h:86
NT q
bool collinear_are_strictly_ordered_along_line(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
bool lexicographically_yx_larger_or_equal(const Point_2< R > &p, const Point_2< R > &q)
Comparison_result compare_lexicographically_xy(const Point_2< R > &p, const Point_2< R > &q)
Comparison_result compare_lexicographically_yx(const Point_2< R > &p, const Point_2< R > &q)
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
bool lexicographically_yx_larger(const Point_2< R > &p, const Point_2< R > &q)
bool leftturn(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
Bounded_side side_of_bounded_circle(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r, const Point_2< R > &test)