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

#include <DirectionS2.h>

Public Member Functions

 DirectionS2 ()
 
 DirectionS2 (const VectorS2< FT > &v)
 
 DirectionS2 (const FT &x, const FT &y)
 
bool operator== (const DirectionS2< FT > &d) const
 
bool operator!= (const DirectionS2< FT > &d) const
 
bool operator>= (const DirectionS2< FT > &d) const
 
bool operator<= (const DirectionS2< FT > &d) const
 
bool operator> (const DirectionS2< FT > &d) const
 
bool operator< (const DirectionS2< FT > &d) const
 
bool counterclockwise_in_between (const DirectionS2< FT > &d1, const DirectionS2< FT > &d2) const
 
VectorS2< FT > vector () const
 
DirectionS2< FT > perpendicular (const Orientation &o) const
 
DirectionS2< FT > transform (const Aff_transformationS2< FT > &t) const
 
DirectionS2< FT > operator- () const
 
FT delta (int i) const
 
FT dx () const
 
FT dy () const
 

Public Attributes

FT e0
 
FT e1
 

Detailed Description

template<class FT>
class DirectionS2< FT >

Definition at line 59 of file DirectionS2.h.

Constructor & Destructor Documentation

Definition at line 94 of file DirectionS2.h.

94 {}
CGAL_KERNEL_CTOR_INLINE DirectionS2 ( const FT &  x,
const FT &  y 
)

Definition at line 103 of file DirectionS2.h.

References x, and y.

104 { e0 = x; e1 = y; }
void int int REAL REAL * y
Definition: read.cpp:74
void int int REAL * x
Definition: read.cpp:74

Member Function Documentation

CGAL_KERNEL_INLINE bool counterclockwise_in_between ( const DirectionS2< FT > &  d1,
const DirectionS2< FT > &  d2 
) const

Definition at line 161 of file DirectionS2.h.

163 {
164  if ( d1 < *this)
165  {
166  return ( *this < d2 )||( d2 <= d1 );
167  }
168  else
169  {
170  return ( *this < d2 )&&( d2 <= d1 );
171  }
172 }
CGAL_KERNEL_INLINE FT delta ( int  i) const

Definition at line 207 of file DirectionS2.h.

References CGAL_kernel_precondition, dx, and dy.

208 {
209  CGAL_kernel_precondition( ( i == 0 ) || ( i == 1 ) );
210  return (i==0) ? dx() : dy();
211 }
FT dx() const
Definition: DirectionS2.h:217
blockLoc i
Definition: read.cpp:79
FT dy() const
Definition: DirectionS2.h:223
#define CGAL_kernel_precondition(EX)
FT dx ( ) const
inline

Definition at line 217 of file DirectionS2.h.

Referenced by LineS2< FT >::LineS2(), DirectionS2< FT >::operator<(), and DirectionS2< FT >::operator==().

218 { return e0; }

Here is the caller graph for this function:

FT dy ( ) const
inline

Definition at line 223 of file DirectionS2.h.

Referenced by LineS2< FT >::LineS2(), DirectionS2< FT >::operator<(), and DirectionS2< FT >::operator==().

224 { return e1; }

Here is the caller graph for this function:

bool operator!= ( const DirectionS2< FT > &  d) const
inline

Definition at line 119 of file DirectionS2.h.

References d.

120 { return !( *this == d ); }
const NT & d
DirectionS2< FT > operator- ( ) const
inline

Definition at line 199 of file DirectionS2.h.

References dx, and dy.

200 { return DirectionS2<FT>(-dx(), -dy()); }
FT dx() const
Definition: DirectionS2.h:217
FT dy() const
Definition: DirectionS2.h:223
CGAL_KERNEL_MEDIUM_INLINE bool operator< ( const DirectionS2< FT > &  d) const

Definition at line 125 of file DirectionS2.h.

References dx, DirectionS2< FT >::dx(), dy, and DirectionS2< FT >::dy().

126 {
127  int quadrant_this = (dx() >= FT(0)) ? ((dy() >= FT(0))?1:4)
128  : ((dy() >= FT(0))?2:3);
129  int quadrant_d = (d.dx() >= FT(0)) ? ((d.dy() >= FT(0))?1:4)
130  : ((d.dy() >= FT(0))?2:3);
131 
132  if(quadrant_this < quadrant_d)
133  return true;
134  else if (quadrant_this > quadrant_d)
135  return false;
136  else
137  return dy() * d.dx() < d.dy() * dx();
138 }
FT dx() const
Definition: DirectionS2.h:217
FT dy() const
Definition: DirectionS2.h:223

Here is the call graph for this function:

CGAL_KERNEL_INLINE bool operator<= ( const DirectionS2< FT > &  d) const

Definition at line 155 of file DirectionS2.h.

156 { return (*this < d) || (d == *this) ; }
bool operator== ( const DirectionS2< FT > &  d) const

Definition at line 108 of file DirectionS2.h.

References CGAL_NTS, dx, DirectionS2< FT >::dx(), dy, DirectionS2< FT >::dy(), and sign().

109 {
110 // Use a S2 predicate for that ?
111  return (CGAL_NTS sign(dx()) == CGAL_NTS sign(d.dx()))
112  && (CGAL_NTS sign(dy()) == CGAL_NTS sign(d.dy()))
113  && (dy()*d.dx() == d.dy()*dx());
114 }
static SURF_BEGIN_NAMESPACE double sign(double x)
FT dx() const
Definition: DirectionS2.h:217
FT dy() const
Definition: DirectionS2.h:223
#define CGAL_NTS

Here is the call graph for this function:

CGAL_KERNEL_INLINE bool operator> ( const DirectionS2< FT > &  d) const

Definition at line 143 of file DirectionS2.h.

144 { return d < *this ; }
CGAL_KERNEL_INLINE bool operator>= ( const DirectionS2< FT > &  d) const

Definition at line 149 of file DirectionS2.h.

150 { return (d < *this) || (d == *this) ; }
CGAL_KERNEL_MEDIUM_INLINE DirectionS2< FT > perpendicular ( const Orientation o) const

Definition at line 183 of file DirectionS2.h.

References CGAL_kernel_precondition, COLLINEAR, COUNTERCLOCKWISE, dx, and dy.

184 {
186  if (o == COUNTERCLOCKWISE)
187  return DirectionS2<FT>(-dy(), dx());
188  else
189  return DirectionS2<FT>(dy(), -dx());
190 }
const Orientation COUNTERCLOCKWISE
Definition: enum.h:70
FT dx() const
Definition: DirectionS2.h:217
FT dy() const
Definition: DirectionS2.h:223
const Orientation COLLINEAR
Definition: enum.h:72
#define CGAL_kernel_precondition(EX)
CGAL_KERNEL_INLINE DirectionS2< FT > transform ( const Aff_transformationS2< FT > &  t) const

Definition at line 194 of file DirectionS2.h.

References Aff_transformationS2< FT >::transform().

195 { return t.transform(*this); }
PointS2< FT > transform(const PointS2< FT > &p) const

Here is the call graph for this function:

VectorS2< FT > vector ( ) const
inline

Definition at line 177 of file DirectionS2.h.

Referenced by RayS2< FT >::RayS2(), Rotation_repS2< FT >::Rotation_repS2(), Aff_transformation_repS2< FT >::transform(), and Rotation_repS2< FT >::transform().

178 { return VectorS2<FT>(*this); }

Here is the caller graph for this function:

Member Data Documentation

FT e0

Definition at line 87 of file DirectionS2.h.

Referenced by VectorS2< FT >::hx(), VectorS2< FT >::VectorS2(), and VectorS2< FT >::x().

FT e1

Definition at line 88 of file DirectionS2.h.

Referenced by VectorS2< FT >::hy(), VectorS2< FT >::VectorS2(), and VectorS2< FT >::y().


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