Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CGAL Namespace Reference

Namespaces

 NTS
 

Classes

class  Handle_for
 
class  Ref_counted
 
class  Wrapper
 
class  Object_base
 
class  Object
 

Functions

template<class NT >
bool is_zero (const NT &x)
 
template<class NT >
bool is_one (const NT &x)
 
template<class NT >
bool is_negative (const NT &x)
 
template<class NT >
bool is_positive (const NT &x)
 
template<class NT >
CGAL_KERNEL_INLINE Sign sign (const NT &x)
 
template<class NT >
CGAL_KERNEL_INLINE Sign lexicographical_sign (const NT &x, const NT &y)
 
template<class NT >
CGAL_KERNEL_INLINE NT abs (const NT &x)
 
template<class NT >
CGAL_KERNEL_INLINE
Comparison_result 
compare (const NT &n1, const NT &n2)
 
template<class NT >
NT square (const NT &n)
 
template<class T >
Object make_object (const T &t)
 
template<class T >
bool assign (T &t, const Object &o)
 
template<class PT >
bool seg_seg_do_intersect_crossing (PT const &p1, PT const &p2, PT const &p3, PT const &p4)
 
template<class PT >
bool seg_seg_do_intersect_contained (PT const &p1, PT const &p2, PT const &p3, PT const &p4)
 
template<class R >
bool do_intersect (const Segment_2< R > &seg1, const Segment_2< R > &seg2)
 

Function Documentation

CGAL_KERNEL_INLINE NT CGAL::abs ( const NT &  x)

Definition at line 130 of file number_utils.h.

References x.

131 {
132 #ifndef CGAL_NO_NTS_NAMESPACE
133  bool abs_is_obsolete__qualify_call_by_CGAL_NTS;
134 #endif // CGAL_NO_NTS_NAMESPACE
135  return (x < NT(0)) ? -x: x;
136 }
void int int REAL * x
Definition: read.cpp:74
bool CGAL::assign ( T &  t,
const Object &  o 
)

Definition at line 138 of file Object.h.

References Object::ptr.

Referenced by Assign::operator()().

139 {
140 # ifdef CGAL_CFG_DYNAMIC_CAST_BUG
141  Wrapper<T> instantiate_it;
142 # endif // CGAL_CFG_DYNAMIC_CAST_BUG
143  Wrapper<T>* wp = dynamic_cast<Wrapper<T>*>(o.ptr);
144  if ( wp == static_cast<Wrapper<T>*>(0) ) { return false; }
145  t = *(wp);
146  return true;
147 }

Here is the caller graph for this function:

CGAL_KERNEL_INLINE Comparison_result CGAL::compare ( const NT &  n1,
const NT &  n2 
)
bool CGAL::do_intersect ( const Segment_2< R > &  seg1,
const Segment_2< R > &  seg2 
)
inline

Definition at line 242 of file Segment_2_Segment_2_intersection.h.

References compare_lexicographically_xy(), EQUAL, LARGER, lexicographically_xy_smaller(), lexicographically_yx_smaller(), seg_seg_do_intersect_contained(), seg_seg_do_intersect_crossing(), SMALLER, Segment_2< R, T >::source(), and Segment_2< R, T >::target().

Referenced by Triangulation::is_diagonalie().

243 {
244  typename R::Point_2 const & A1 = seg1.source();
245  typename R::Point_2 const & A2 = seg1.target();
246  typename R::Point_2 const & B1 = seg2.source();
247  typename R::Point_2 const & B2 = seg2.target();
248  if (lexicographically_yx_smaller(A1,A2)) {
249  if (lexicographically_yx_smaller(B1,B2)) {
252  return false;
253  } else {
256  return false;
257  }
258  } else {
259  if (lexicographically_yx_smaller(B1,B2)) {
262  return false;
263  } else {
266  return false;
267  }
268  }
269  if (lexicographically_xy_smaller(A1,A2)) {
270  if (lexicographically_xy_smaller(B1,B2)) {
271  switch(compare_lexicographically_xy(A1,B1)) {
272  case SMALLER:
273  switch(compare_lexicographically_xy(A2,B1)) {
274  case SMALLER:
275  return false;
276  case EQUAL:
277  return true;
278  case LARGER:
279  switch(compare_lexicographically_xy(A2,B2)) {
280  case SMALLER:
281  return seg_seg_do_intersect_crossing(A1,A2,B1,B2);
282  case EQUAL:
283  return true;
284  case LARGER:
285  return seg_seg_do_intersect_contained(A1,A2,B1,B2);
286  }
287  }
288  case EQUAL:
289  return true;
290  case LARGER:
291  switch(compare_lexicographically_xy(B2,A1)) {
292  case SMALLER:
293  return false;
294  case EQUAL:
295  return true;
296  case LARGER:
297  switch(compare_lexicographically_xy(B2,A2)) {
298  case SMALLER:
299  return seg_seg_do_intersect_crossing(B1,B2,A1,A2);
300  case EQUAL:
301  return true;
302  case LARGER:
303  return seg_seg_do_intersect_contained(B1,B2,A1,A2);
304  }
305  }
306  }
307  } else {
308  switch(compare_lexicographically_xy(A1,B2)) {
309  case SMALLER:
310  switch(compare_lexicographically_xy(A2,B2)) {
311  case SMALLER:
312  return false;
313  case EQUAL:
314  return true;
315  case LARGER:
316  switch(compare_lexicographically_xy(A2,B1)) {
317  case SMALLER:
318  return seg_seg_do_intersect_crossing(A1,A2,B2,B1);
319  case EQUAL:
320  return true;
321  case LARGER:
322  return seg_seg_do_intersect_contained(A1,A2,B2,B1);
323  }
324  }
325  case EQUAL:
326  return true;
327  case LARGER:
328  switch(compare_lexicographically_xy(B1,A1)) {
329  case SMALLER:
330  return false;
331  case EQUAL:
332  return true;
333  case LARGER:
334  switch(compare_lexicographically_xy(B1,A2)) {
335  case SMALLER:
336  return seg_seg_do_intersect_crossing(B2,B1,A1,A2);
337  case EQUAL:
338  return true;
339  case LARGER:
340  return seg_seg_do_intersect_contained(B2,B1,A1,A2);
341  }
342  }
343  }
344  }
345  } else {
346  if (lexicographically_xy_smaller(B1,B2)) {
347  switch(compare_lexicographically_xy(A2,B1)) {
348  case SMALLER:
349  switch(compare_lexicographically_xy(A1,B1)) {
350  case SMALLER:
351  return false;
352  case EQUAL:
353  return true;
354  case LARGER:
355  switch(compare_lexicographically_xy(A1,B2)) {
356  case SMALLER:
357  return seg_seg_do_intersect_crossing(A2,A1,B1,B2);
358  case EQUAL:
359  return true;
360  case LARGER:
361  return seg_seg_do_intersect_contained(A2,A1,B1,B2);
362  }
363  }
364  case EQUAL:
365  return true;
366  case LARGER:
367  switch(compare_lexicographically_xy(B2,A2)) {
368  case SMALLER:
369  return false;
370  case EQUAL:
371  return true;
372  case LARGER:
373  switch(compare_lexicographically_xy(B2,A1)) {
374  case SMALLER:
375  return seg_seg_do_intersect_crossing(B1,B2,A2,A1);
376  case EQUAL:
377  return true;
378  case LARGER:
379  return seg_seg_do_intersect_contained(B1,B2,A2,A1);
380  }
381  }
382  }
383  } else {
384  switch(compare_lexicographically_xy(A2,B2)) {
385  case SMALLER:
386  switch(compare_lexicographically_xy(A1,B2)) {
387  case SMALLER:
388  return false;
389  case EQUAL:
390  return true;
391  case LARGER:
392  switch(compare_lexicographically_xy(A1,B1)) {
393  case SMALLER:
394  return seg_seg_do_intersect_crossing(A2,A1,B2,B1);
395  case EQUAL:
396  return true;
397  case LARGER:
398  return seg_seg_do_intersect_contained(A2,A1,B2,B1);
399  }
400  }
401  case EQUAL:
402  return true;
403  case LARGER:
404  switch(compare_lexicographically_xy(B1,A2)) {
405  case SMALLER:
406  return false;
407  case EQUAL:
408  return true;
409  case LARGER:
410  switch(compare_lexicographically_xy(B1,A1)) {
411  case SMALLER:
412  return seg_seg_do_intersect_crossing(B2,B1,A2,A1);
413  case EQUAL:
414  return true;
415  case LARGER:
416  return seg_seg_do_intersect_contained(B2,B1,A2,A1);
417  }
418  }
419  }
420  }
421  }
422  assert(false);
423  return false;
424 }
bool lexicographically_xy_smaller(const Point_2< R > &p, const Point_2< R > &q)
bool seg_seg_do_intersect_contained(PT const &p1, PT const &p2, PT const &p3, PT const &p4)
CGAL::Point_2< R > target() const
Definition: Segment_2.h:139
Definition: enum.h:96
bool seg_seg_do_intersect_crossing(PT const &p1, PT const &p2, PT const &p3, PT const &p4)
CGAL::Point_2< R > source() const
Definition: Segment_2.h:136
bool lexicographically_yx_smaller(const Point_2< R > &p, const Point_2< R > &q)
Definition: enum.h:98
Comparison_result compare_lexicographically_xy(const Point_2< R > &p, const Point_2< R > &q)
Definition: enum.h:97
SURF::Vector_2< Real > Point_2
Definition: rfc_basic.h:43

Here is the call graph for this function:

Here is the caller graph for this function:

bool CGAL::is_negative ( const NT &  x)
inline

Definition at line 86 of file number_utils.h.

Referenced by Is_negative< NT >::operator()().

87 {
88 #ifndef CGAL_NO_NTS_NAMESPACE
89  bool is_negative_is_obsolete__qualify_call_by_CGAL_NTS;
90 #endif // CGAL_NO_NTS_NAMESPACE
91  return x < NT(0);
92 }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

bool CGAL::is_one ( const NT &  x)
inline

Definition at line 75 of file number_utils.h.

Referenced by Is_one< NT >::operator()().

76 {
77 #ifndef CGAL_NO_NTS_NAMESPACE
78  bool is_one_is_obsolete__qualify_call_by_CGAL_NTS;
79 #endif // CGAL_NO_NTS_NAMESPACE
80  return x == NT(1);
81 }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

bool CGAL::is_positive ( const NT &  x)
inline

Definition at line 97 of file number_utils.h.

References x.

Referenced by Is_positive< NT >::operator()().

98 {
99 #ifndef CGAL_NO_NTS_NAMESPACE
100  bool is_positive_is_obsolete__qualify_call_by_CGAL_NTS;
101 #endif // CGAL_NO_NTS_NAMESPACE
102  return NT(0) < x;
103 }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

bool CGAL::is_zero ( const NT &  x)
inline

Definition at line 64 of file number_utils.h.

Referenced by Is_zero< NT >::operator()().

65 {
66 #ifndef CGAL_NO_NTS_NAMESPACE
67  bool is_zero_is_obsolete__qualify_call_by_CGAL_NTS;
68 #endif // CGAL_NO_NTS_NAMESPACE
69  return x == NT(0);
70 }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

CGAL_KERNEL_INLINE Sign CGAL::lexicographical_sign ( const NT &  x,
const NT &  y 
)

Definition at line 119 of file number_utils.h.

References sign().

Referenced by Lexicographical_sign< NT >::operator()().

120 {
121 #ifndef CGAL_NO_NTS_NAMESPACE
122  bool lexicographical_sign_is_obsolete__qualify_call_by_CGAL_NTS;
123 #endif // CGAL_NO_NTS_NAMESPACE
124  return (x == NT(0)) ? CGAL::sign(y) : CGAL::sign(x);
125 }
static SURF_BEGIN_NAMESPACE double sign(double x)
void int int REAL REAL * y
Definition: read.cpp:74
CGAL_KERNEL_INLINE Sign sign(const NT &x)
Definition: number_utils.h:108
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

Object CGAL::make_object ( const T &  t)

Definition at line 132 of file Object.h.

133 { return Object(new Wrapper< T >(t)); }
bool CGAL::seg_seg_do_intersect_contained ( PT const &  p1,
PT const &  p2,
PT const &  p3,
PT const &  p4 
)

Definition at line 224 of file Segment_2_Segment_2_intersection.h.

References COLLINEAR, LEFTTURN, leftturn(), orientation(), RIGHTTURN, and rightturn().

Referenced by do_intersect().

226 {
227  switch (orientation(p1,p2,p3)) {
228  case LEFTTURN:
229  return !leftturn(p1,p2,p4);
230  case RIGHTTURN:
231  return !rightturn(p1,p2,p4);
232  case COLLINEAR:
233  return true;
234  }
235  assert(false);
236  return false;
237 }
NT p1
const Orientation LEFTTURN
Definition: enum.h:66
bool rightturn(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)
bool leftturn(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
const Orientation RIGHTTURN
Definition: enum.h:67
const Orientation COLLINEAR
Definition: enum.h:72

Here is the call graph for this function:

Here is the caller graph for this function:

bool CGAL::seg_seg_do_intersect_crossing ( PT const &  p1,
PT const &  p2,
PT const &  p3,
PT const &  p4 
)

Definition at line 207 of file Segment_2_Segment_2_intersection.h.

References COLLINEAR, LEFTTURN, leftturn(), orientation(), RIGHTTURN, and rightturn().

Referenced by do_intersect().

209 {
210  switch (orientation(p1,p2,p3)) {
211  case LEFTTURN:
212  return !rightturn(p3,p4,p2);
213  case RIGHTTURN:
214  return !leftturn(p3,p4,p2);
215  case COLLINEAR:
216  return true;
217  }
218  assert(false);
219  return false;
220 }
NT p1
const Orientation LEFTTURN
Definition: enum.h:66
bool rightturn(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)
bool leftturn(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
const Orientation RIGHTTURN
Definition: enum.h:67
const Orientation COLLINEAR
Definition: enum.h:72

Here is the call graph for this function:

Here is the caller graph for this function:

CGAL_KERNEL_INLINE Sign CGAL::sign ( const NT &  x)

Definition at line 108 of file number_utils.h.

References NEGATIVE, POSITIVE, x, and ZERO.

Referenced by lexicographical_sign().

109 {
110 #ifndef CGAL_NO_NTS_NAMESPACE
111  bool sign_is_obsolete__qualify_call_by_CGAL_NTS;
112 #endif // CGAL_NO_NTS_NAMESPACE
113  return (x < NT(0)) ? NEGATIVE : (NT(0) < x) ? POSITIVE : ZERO;
114 }
Definition: enum.h:59
Definition: enum.h:61
void int int REAL * x
Definition: read.cpp:74
Definition: enum.h:60

Here is the caller graph for this function:

NT CGAL::square ( const NT &  n)
inline

Definition at line 158 of file number_utils.h.

References n.

159 {
160 #ifndef CGAL_NO_NTS_NAMESPACE
161  bool square_is_obsolete__qualify_call_by_CGAL_NTS;
162 #endif // CGAL_NO_NTS_NAMESPACE
163  return n*n;
164 }
const NT & n