Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Line_2_Line_2_intersection.h File Reference
#include <CGAL/Line_2.h>
#include <CGAL/Point_2.h>
#include <CGAL/utils.h>
#include <CGAL/number_utils.h>
#include <CGAL/Object.h>
Include dependency graph for Line_2_Line_2_intersection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Line_2_Line_2_pair< R >
 

Functions

template<class R >
bool do_intersect (const Line_2< R > &p1, const Line_2< R > &p2)
 
template<class R >
CGAL_END_NAMESPACE
CGAL_BEGIN_NAMESPACE Object 
intersection (const Line_2< R > &line1, const Line_2< R > &line2)
 
template<class R , class POINT , class RT >
CGAL_END_NAMESPACE
CGAL_BEGIN_NAMESPACE bool 
construct_if_finite (POINT &pt, RT x, RT y, RT w, R &)
 

Function Documentation

CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE bool construct_if_finite ( POINT &  pt,
RT  x,
RT  y,
RT  w,
R &   
)

Definition at line 165 of file Line_2_Line_2_intersection.h.

References CGAL_kernel_precondition, and is_finite().

Referenced by Line_2_Line_2_pair< R >::intersection_type().

166 {
167  typedef typename R::FT FT;
169  && ::CGAL::is_finite(y)
170  && w != RT(0));
171 
172  if (!::CGAL::is_finite(FT(x)/FT(w)) || !::CGAL::is_finite(FT(y)/FT(w)))
173  return false;
174  pt = POINT(x, y, w);
175  return true;
176 }
void int int REAL REAL * y
Definition: read.cpp:74
void int int REAL * x
Definition: read.cpp:74
bool is_finite(double d)
Definition: double.h:190
#define CGAL_kernel_precondition(EX)

Here is the call graph for this function:

Here is the caller graph for this function:

bool do_intersect ( const Line_2< R > &  p1,
const Line_2< R > &  p2 
)
inline

Definition at line 123 of file Line_2_Line_2_intersection.h.

Referenced by Overlay::intersect_link_helper().

126 {
127  typedef Line_2_Line_2_pair<R> pair_t;
128  pair_t pair(&p1, &p2);
129  return pair.intersection_type() != pair_t::NO;
130 }

Here is the caller graph for this function:

CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE Object intersection ( const Line_2< R > &  line1,
const Line_2< R > &  line2 
)

Definition at line 140 of file Line_2_Line_2_intersection.h.

Referenced by main(), and Intersect::operator()().

141 {
142  typedef Line_2_Line_2_pair<R> is_t;
143  is_t linepair(&line1, &line2);
144  switch (linepair.intersection_type()) {
145  case is_t::NO:
146  default:
147  return Object();
148  case is_t::POINT: {
149  Point_2<R> pt;
150  linepair.intersection(pt);
151  return Object(new Wrapper< Point_2<R> >(pt));
152  }
153  case is_t::LINE:
154  return Object(new Wrapper< Line_2<R> >(line1));
155  }
156 }

Here is the caller graph for this function: