Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RayS2< FT > Class Template Reference

#include <RayS2.h>

Public Member Functions

 RayS2 ()
 
 RayS2 (const PointS2< FT > &sp, const PointS2< FT > &secondp)
 
 RayS2 (const PointS2< FT > &sp, const DirectionS2< FT > &d)
 
bool operator== (const RayS2< FT > &r) const
 
bool operator!= (const RayS2< FT > &r) const
 
const PointS2< FT > & start () const
 
const PointS2< FT > & source () const
 
PointS2< FT > point (int i) const
 
PointS2< FT > second_point () const
 
DirectionS2< FT > direction () const
 
LineS2< FT > supporting_line () const
 
RayS2< FT > opposite () const
 
RayS2< FT > transform (const Aff_transformationS2< FT > &t) const
 
bool is_horizontal () const
 
bool is_vertical () const
 
bool is_degenerate () const
 
bool has_on (const PointS2< FT > &p) const
 
bool collinear_has_on (const PointS2< FT > &p) const
 

Public Attributes

PointS2< FT > s
 
PointS2< FT > t
 

Detailed Description

template<class FT>
class RayS2< FT >

Definition at line 60 of file RayS2.h.

Constructor & Destructor Documentation

RayS2 ( )
inline

Definition at line 63 of file RayS2.h.

63 {};
RayS2 ( const PointS2< FT > &  sp,
const PointS2< FT > &  secondp 
)
inline

Definition at line 64 of file RayS2.h.

65  : s(sp), t(secondp) {};
PointS2< FT > s
Definition: RayS2.h:92
PointS2< FT > t
Definition: RayS2.h:93
CGAL_KERNEL_CTOR_INLINE RayS2 ( const PointS2< FT > &  sp,
const DirectionS2< FT > &  d 
)

Definition at line 99 of file RayS2.h.

References s, and DirectionS2< FT >::vector().

100 { s = sp; t = sp + d.vector(); }
VectorS2< FT > vector() const
Definition: DirectionS2.h:177
PointS2< FT > s
Definition: RayS2.h:92
PointS2< FT > t
Definition: RayS2.h:93

Here is the call graph for this function:

Member Function Documentation

CGAL_KERNEL_MEDIUM_INLINE bool collinear_has_on ( const PointS2< FT > &  p) const

Definition at line 201 of file RayS2.h.

References compare_x(), compare_y(), LARGER, and SMALLER.

202 {
203  switch(compare_x(source(), second_point())){
204  case SMALLER:
205  return compare_x(source(), p) != LARGER;
206  case LARGER:
207  return compare_x(p, source()) != LARGER;
208  default:
209  switch(compare_y(source(), second_point())){
210  case SMALLER:
211  return compare_y(source(), p) != LARGER;
212  case LARGER:
213  return compare_y(p, source()) != LARGER;
214  default:
215  return true; // p == source()
216  }
217  }
218 }
Comparison_result compare_y(const Point_2< R > &p, const Point_2< R > &q)
Definition: enum.h:96
PointS2< FT > second_point() const
Definition: RayS2.h:128
Comparison_result compare_x(const Point_2< R > &p, const Point_2< R > &q)
const PointS2< FT > & source() const
Definition: RayS2.h:122
Definition: enum.h:98

Here is the call graph for this function:

DirectionS2< FT > direction ( ) const
inline

Definition at line 149 of file RayS2.h.

Referenced by RayS2< FT >::operator==().

150 { return DirectionS2<FT>( second_point() - source() ); }
PointS2< FT > second_point() const
Definition: RayS2.h:128
const PointS2< FT > & source() const
Definition: RayS2.h:122

Here is the caller graph for this function:

CGAL_KERNEL_INLINE bool has_on ( const PointS2< FT > &  p) const

Definition at line 191 of file RayS2.h.

References collinear().

192 {
193  return ( p == source()
194  || ( collinear(source(), p, second_point())
195  && ( DirectionS2<FT>(p - source()) == direction() )));
196 }
DirectionS2< FT > direction() const
Definition: RayS2.h:149
PointS2< FT > second_point() const
Definition: RayS2.h:128
const PointS2< FT > & source() const
Definition: RayS2.h:122
bool collinear(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)

Here is the call graph for this function:

CGAL_KERNEL_INLINE bool is_degenerate ( ) const

Definition at line 185 of file RayS2.h.

186 { return (source() == second_point()); }
PointS2< FT > second_point() const
Definition: RayS2.h:128
const PointS2< FT > & source() const
Definition: RayS2.h:122
CGAL_KERNEL_INLINE bool is_horizontal ( ) const

Definition at line 173 of file RayS2.h.

References y.

174 { return (source().y() == second_point().y()); }
void int int REAL REAL * y
Definition: read.cpp:74
PointS2< FT > second_point() const
Definition: RayS2.h:128
const PointS2< FT > & source() const
Definition: RayS2.h:122
CGAL_KERNEL_INLINE bool is_vertical ( ) const

Definition at line 179 of file RayS2.h.

References x.

180 { return (source().x() == second_point().x()); }
PointS2< FT > second_point() const
Definition: RayS2.h:128
const PointS2< FT > & source() const
Definition: RayS2.h:122
void int int REAL * x
Definition: read.cpp:74
bool operator!= ( const RayS2< FT > &  r) const

Definition at line 110 of file RayS2.h.

111 { return !(*this == r); }
CGAL_KERNEL_INLINE bool operator== ( const RayS2< FT > &  r) const

Definition at line 105 of file RayS2.h.

References RayS2< FT >::direction(), and RayS2< FT >::source().

106 { return ((source() == r.source()) && (direction() == r.direction()) ); }
DirectionS2< FT > direction() const
Definition: RayS2.h:149
const PointS2< FT > & source() const
Definition: RayS2.h:122

Here is the call graph for this function:

RayS2< FT > opposite ( ) const
inline

Definition at line 159 of file RayS2.h.

160 { return RayS2<FT>( source(), - direction() ); }
DirectionS2< FT > direction() const
Definition: RayS2.h:149
Definition: RayS2.h:60
const PointS2< FT > & source() const
Definition: RayS2.h:122
CGAL_KERNEL_INLINE PointS2< FT > point ( int  i) const

Definition at line 134 of file RayS2.h.

References CGAL_kernel_precondition, and s.

135 {
136  CGAL_kernel_precondition( i >= 0 );
137  if (i == 0)
138  return s;
139 
140  if (i == 1)
141  return t;
142 
143  return source() + FT(i) * (second_point() - source());
144 }
PointS2< FT > second_point() const
Definition: RayS2.h:128
const PointS2< FT > & source() const
Definition: RayS2.h:122
blockLoc i
Definition: read.cpp:79
PointS2< FT > s
Definition: RayS2.h:92
PointS2< FT > t
Definition: RayS2.h:93
#define CGAL_kernel_precondition(EX)
PointS2< FT > second_point ( ) const
inline

Definition at line 128 of file RayS2.h.

Referenced by LineS2< FT >::LineS2().

129 { return t; }
PointS2< FT > t
Definition: RayS2.h:93

Here is the caller graph for this function:

const PointS2< FT > & source ( ) const
inline

Definition at line 122 of file RayS2.h.

References s.

Referenced by RayS2< FT >::operator==().

123 { return s; }
PointS2< FT > s
Definition: RayS2.h:92

Here is the caller graph for this function:

const PointS2< FT > & start ( ) const
inline

Definition at line 116 of file RayS2.h.

References s.

Referenced by LineS2< FT >::LineS2().

117 { return s; }
PointS2< FT > s
Definition: RayS2.h:92

Here is the caller graph for this function:

LineS2< FT > supporting_line ( ) const
inline

Definition at line 154 of file RayS2.h.

155 { return LineS2<FT>(*this); }
Definition: LineS2.h:62
CGAL_KERNEL_INLINE RayS2< FT > transform ( const Aff_transformationS2< FT > &  t) const

Definition at line 166 of file RayS2.h.

References Aff_transformationS2< FT >::transform().

167 { return RayS2<FT>(t.transform(source()), t.transform(second_point())); }
PointS2< FT > second_point() const
Definition: RayS2.h:128
Definition: RayS2.h:60
const PointS2< FT > & source() const
Definition: RayS2.h:122
PointS2< FT > transform(const PointS2< FT > &p) const

Here is the call graph for this function:

Member Data Documentation

PointS2<FT> s

Definition at line 92 of file RayS2.h.

PointS2<FT> t

Definition at line 93 of file RayS2.h.


The documentation for this class was generated from the following file: