Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
predicates_on_pointsS3.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 // release : CGAL-2.2
33 // release_date : 2000, September 30
34 //
35 // source : webS3/S3.lw
36 // file : include/CGAL/SimpleCartesian/predicates_on_pointsS3.h
37 // package : S3 (1.6)
38 // revision : 1.6
39 // revision_date : 28 Jun 2000
40 // author(s) : Stefan Schirra
41 // based on code by
42 // Andreas Fabri and
43 // Herve Brönnimann
44 //
45 // coordinator : MPI, Saarbrücken
46 // email : contact@cgal.org
47 // www : http://www.cgal.org
48 //
49 // ======================================================================
50 
51 #ifndef CGAL_PREDICATES_ON_POINTSS3_H
52 #define CGAL_PREDICATES_ON_POINTSS3_H
53 
55 
57 
58 template < class FT >
61 {
62  return compare_lexicographically_xyzC3(p.x(),p.y(),p.z(),
63  q.x(),q.y(),q.z());
64 }
65 
66 template < class FT >
69 {
70  return compare_lexicographically_xyC2(p.x(),p.y(),
71  q.x(),q.y());
72 }
73 
74 template < class FT >
75 bool
77  const PointS3<FT>& q)
78 { return compare_lexicographically_xyz(p,q) != LARGER; }
79 
80 template < class FT >
81 bool
83 { return compare_lexicographically_xyz(p,q) == SMALLER; }
84 
85 template < class FT >
86 inline
87 bool
89 { return compare_lexicographically_xy(p,q) == SMALLER; }
90 
91 template < class FT >
92 inline
93 bool
94 x_equal(const PointS3<FT>& p, const PointS3<FT>& q)
95 { return p.x() == q.x(); }
96 
97 
98 template < class FT >
99 inline
100 bool
101 y_equal(const PointS3<FT>& p, const PointS3<FT>& q)
102 { return p.y() == q.y(); }
103 
104 template < class FT >
105 inline
106 bool
107 z_equal(const PointS3<FT>& p, const PointS3<FT>& q)
108 { return p.z() == q.z(); }
109 
110 template < class FT >
111 inline
112 bool
114 { return p.x() == q.x() && p.y() == q.y(); }
115 
116 template < class FT >
117 inline
118 bool
120 { return p.x() == q.x() && p.y() == q.y() && p.z() == q.z(); }
121 
122 template < class FT >
123 inline
126 { return CGAL_NTS compare(p.x(), q.x()); }
127 
128 
129 template < class FT >
130 inline
133 { return CGAL_NTS compare(p.y(), q.y()); }
134 
135 
136 template < class FT >
137 inline
140 { return CGAL_NTS compare(p.z(), q.z()); }
141 
142 template < class FT >
143 inline
144 bool
145 less_x(const PointS3<FT>& p, const PointS3<FT>& q)
146 { return p.x() < q.x(); }
147 
148 template < class FT >
149 inline
150 bool
151 less_y(const PointS3<FT>& p, const PointS3<FT>& q)
152 { return p.y() < q.y(); }
153 
154 template < class FT >
155 inline
156 bool
157 less_z(const PointS3<FT>& p, const PointS3<FT>& q)
158 { return p.z() < q.z(); }
159 
160 
161 template < class FT >
162 bool collinear(const PointS3<FT>& p,
163  const PointS3<FT>& q,
164  const PointS3<FT>& r)
165 {
166  return collinearC3(p.x(), p.y(), p.z(),
167  q.x(), q.y(), q.z(),
168  r.x(), r.y(), r.z());
169 }
170 
171 template < class FT >
172 inline
175  const PointS3<FT>& q,
176  const PointS3<FT>& r,
177  const PointS3<FT>& s)
178 {
179  return orientationC3(p.x(), p.y(), p.z(),
180  q.x(), q.y(), q.z(),
181  r.x(), r.y(), r.z(),
182  s.x(), s.y(), s.z());
183 }
184 
185 template < class FT >
186 inline
187 bool
189  const PointS3<FT>& q,
190  const PointS3<FT>& r,
191  const PointS3<FT>& s)
192 {
193  return orientation(p, q, r, s) == COLLINEAR;
194 }
195 
196 template < class FT>
197 inline
198 bool
200  const PointS3<FT>& q,
201  const PointS3<FT>& r,
202  const PointS3<FT>& s)
203 {
204  return orientation(p,q,r,s) == POSITIVE;
205 }
206 
207 template < class FT>
208 inline
209 bool
211  const PointS3<FT>& q,
212  const PointS3<FT>& r,
213  const PointS3<FT>& s)
214 {
215  return orientation(p,q,r,s) == NEGATIVE;
216 }
217 
218 template < class FT >
219 inline
220 bool
222  const PointS3<FT>& q,
223  const PointS3<FT>& r)
224 {
225  return (collinear(p, q, r)) ? collinear_are_ordered_along_line(p, q, r)
226  : false;
227 }
228 
229 template < class FT >
230 inline
231 bool
233  const PointS3<FT>& q,
234  const PointS3<FT>& r)
235 {
237  return collinear_are_ordered_along_lineC3(p.x(),p.y(),p.z(),
238  q.x(),q.y(),q.z(),
239  r.x(),r.y(),r.z());
240 }
241 
242 
243 template < class FT >
244 inline
245 bool
247  const PointS3<FT>& q,
248  const PointS3<FT>& r)
249 {
250  return (collinear(p, q, r))
252  : false;
253 }
254 
255 
256 template < class FT >
257 inline
258 bool
260  const PointS3<FT>& q,
261  const PointS3<FT>& r)
262 {
265  q.x(),q.y(),q.z(),
266  r.x(),r.y(),r.z());
267 }
268 
269 
270 template <class FT>
273  const PointS3<FT>& q,
274  const PointS3<FT>& r,
275  const PointS3<FT>& s)
276 {
279  return coplanar_orientationC3(p.x(), p.y(), p.z(),
280  q.x(), q.y(), q.z(),
281  r.x(), r.y(), r.z(),
282  s.x(), s.y(), s.z());
283 }
284 
285 
286 template <class FT >
289  const PointS3<FT>& q,
290  const PointS3<FT>& r,
291  const PointS3<FT>& s,
292  const PointS3<FT>& test)
293 {
294  return side_of_oriented_sphereC3(p.x(),p.y(),p.z(),
295  q.x(),q.y(),q.z(),
296  r.x(),r.y(),r.z(),
297  s.x(),s.y(),s.z(),
298  test.x(),test.y(),test.z());
299 }
300 
301 
302 template <class FT >
305  const PointS3<FT>& q,
306  const PointS3<FT>& r,
307  const PointS3<FT>& s,
308  const PointS3<FT>& test)
309 {
310  return side_of_bounded_sphereC3(p.x(),p.y(),p.z(),
311  q.x(),q.y(),q.z(),
312  r.x(),r.y(),r.z(),
313  s.x(),s.y(),s.z(),
314  test.x(),test.y(),test.z());
315 }
316 
317 
319 
320 #endif // CGAL_PREDICATES_ON_POINTSS3_H
CGAL_KERNEL_MEDIUM_INLINE Orientation orientationC3(const FT &px, const FT &py, const FT &pz, const FT &qx, const FT &qy, const FT &qz, const FT &rx, const FT &ry, const FT &rz, const FT &sx, const FT &sy, const FT &sz)
bool less_x(const PointS2< FT > &p, const PointS2< FT > &q)
Oriented_side side_of_oriented_sphere(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r, const PointS3< FT > &s, const PointS3< FT > &test)
Comparison_result compare_y(const Point_2< R > &p, const Point_2< R > &q)
Definition: enum.h:59
bool z_equal(const PointS3< FT > &p, const PointS3< FT > &q)
double s
Definition: blastest.C:80
bool coplanar(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r, const PointS3< FT > &s)
bool are_negative_oriented(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r, const PointS3< FT > &s)
bool equal_xy(const PointS2< FT > &p, const PointS2< FT > &q)
bool lexicographically_xy_smaller(const Point_2< R > &p, const Point_2< R > &q)
bool lexicographically_xyz_smaller(const PointS3< FT > &p, const PointS3< FT > &q)
bool equal_xyz(const PointS3< FT > &p, const PointS3< FT > &q)
CGAL_BEGIN_NAMESPACE Comparison_result compare_lexicographically_xyz(const PointS3< FT > &p, const PointS3< FT > &q)
CGAL_KERNEL_MEDIUM_INLINE bool collinear_are_strictly_ordered_along_lineC3(const FT &px, const FT &py, const FT &pz, const FT &qx, const FT &qy, const FT &qz, const FT &rx, const FT &ry, const FT &rz)
Definition: enum.h:96
bool lexicographically_xyz_smaller_or_equal(const PointS3< FT > &p, const PointS3< FT > &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_x(const Point_2< R > &p, const Point_2< R > &q)
Comparison_result compare_lexicographically_xyC2(const FT &px, const FT &py, const FT &qx, const FT &qy)
bool less_y(const PointS2< FT > &p, const PointS2< FT > &q)
Orientation coplanar_orientation(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r, const PointS3< FT > &s)
bool less_z(const PointS3< FT > &p, const PointS3< FT > &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)
Definition: enum.h:61
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)
Orientation orientation(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
CGAL_KERNEL_MEDIUM_INLINE bool collinearC3(const FT &px, const FT &py, const FT &pz, const FT &qx, const FT &qy, const FT &qz, const FT &rx, const FT &ry, const FT &rz)
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)
#define CGAL_kernel_exactness_precondition(EX)
Comparison_result
Definition: enum.h:94
CGAL_KERNEL_LARGE_INLINE Oriented_side side_of_oriented_sphereC3(const FT &px, const FT &py, const FT &pz, const FT &qx, const FT &qy, const FT &qz, const FT &rx, const FT &ry, const FT &rz, const FT &sx, const FT &sy, const FT &sz, const FT &tx, const FT &ty, const FT &tz)
CGAL_KERNEL_MEDIUM_INLINE bool collinear_are_ordered_along_lineC3(const FT &px, const FT &py, const FT &pz, const FT &qx, const FT &qy, const FT &qz, const FT &rx, const FT &ry, const FT &rz)
CGAL_BEGIN_NAMESPACE CGAL_KERNEL_MEDIUM_INLINE Comparison_result compare_lexicographically_xyzC3(const FT &px, const FT &py, const FT &pz, const FT &qx, const FT &qy, const FT &qz)
Bounded_side
Definition: enum.h:86
Definition: enum.h:98
bool are_positive_oriented(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r, const PointS3< FT > &s)
NT q
bool collinear_are_strictly_ordered_along_line(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
Comparison_result compare_lexicographically_xy(const Point_2< R > &p, const Point_2< R > &q)
CGAL_KERNEL_MEDIUM_INLINE Bounded_side side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz, const FT &qx, const FT &qy, const FT &qz, const FT &rx, const FT &ry, const FT &rz, const FT &sx, const FT &sy, const FT &sz, const FT &tx, const FT &ty, const FT &tz)
CGAL_KERNEL_MEDIUM_INLINE Orientation coplanar_orientationC3(const FT &qx, const FT &qy, const FT &qz, const FT &rx, const FT &ry, const FT &rz, const FT &sx, const FT &sy, const FT &sz, const FT &px, const FT &py, const FT &pz)
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
CGAL_KERNEL_INLINE Comparison_result compare(const NT &n1, const NT &n2)
Definition: number_utils.h:143
Comparison_result compare_z(const PointS3< FT > &p, const PointS3< FT > &q)
#define CGAL_NTS
const Orientation COLLINEAR
Definition: enum.h:72
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
Bounded_side side_of_bounded_sphere(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r, const PointS3< FT > &s, const PointS3< FT > &test)