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

#include <SegmentS2.h>

Public Member Functions

 SegmentS2 ()
 
 SegmentS2 (const PointS2< FT > &sp, const PointS2< FT > &ep)
 
bool is_horizontal () const
 
bool is_vertical () const
 
bool has_on (const PointS2< FT > &p) const
 
bool collinear_has_on (const PointS2< FT > &p) const
 
bool operator== (const SegmentS2< FT > &s) const
 
bool operator!= (const SegmentS2< FT > &s) const
 
int id () const
 
const PointS2< FT > & start () const
 
const PointS2< FT > & end () const
 
const PointS2< FT > & source () const
 
const PointS2< FT > & target () const
 
PointS2< FT > min () const
 
PointS2< FT > max () const
 
PointS2< FT > vertex (int i) const
 
PointS2< FT > point (int i) const
 
PointS2< FT > operator[] (int i) const
 
FT squared_length () const
 
DirectionS2< FT > direction () const
 
LineS2< FT > supporting_line () const
 
SegmentS2< FT > opposite () const
 
SegmentS2< FT > transform (const Aff_transformationS2< FT > &t) const
 
bool is_degenerate () const
 
Bbox_2 bbox () const
 

Public Attributes

PointS2< FT > s
 
PointS2< FT > t
 

Detailed Description

template<class FT>
class SegmentS2< FT >

Definition at line 59 of file SegmentS2.h.

Constructor & Destructor Documentation

Definition at line 104 of file SegmentS2.h.

104 {}
CGAL_KERNEL_CTOR_INLINE SegmentS2 ( const PointS2< FT > &  sp,
const PointS2< FT > &  ep 
)

Definition at line 108 of file SegmentS2.h.

110  : s(sp), t(ep) {}
PointS2< FT > t
Definition: SegmentS2.h:99
PointS2< FT > s
Definition: SegmentS2.h:98

Member Function Documentation

CGAL_KERNEL_INLINE Bbox_2 bbox ( ) const

Definition at line 220 of file SegmentS2.h.

221 { return source().bbox() + target().bbox(); }
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147
CGAL_KERNEL_MEDIUM_INLINE bool collinear_has_on ( const PointS2< FT > &  p) const

Definition at line 289 of file SegmentS2.h.

References NTS::abs(), CGAL_kernel_exactness_precondition, CGAL_NTS, collinear(), PointS2< FT >::x(), x, PointS2< FT >::y(), and y.

290 {
292  if (CGAL_NTS abs(target().x()-source().x())
293  > CGAL_NTS abs(target().y()-source().y())) {
294  if (p.x() < source().x())
295  return (p.x() >= target().x());
296  if (p.x() <= target().x())
297  return true;
298  return (p.x() == source().x());
299  } else {
300  if (p.y() < source().y())
301  return (p.y() >= target().y());
302  if (p.y() <= target().y())
303  return true;
304  return (p.y() == source().y());
305  }
306 }
void int int REAL REAL * y
Definition: read.cpp:74
bool collinear(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
void int int REAL * x
Definition: read.cpp:74
#define CGAL_kernel_exactness_precondition(EX)
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
NT abs(const NT &x)
Definition: number_utils.h:130
const PointS2< FT > & target() const
Definition: SegmentS2.h:147
#define CGAL_NTS

Here is the call graph for this function:

CGAL_KERNEL_INLINE DirectionS2< FT > direction ( ) const

Definition at line 196 of file SegmentS2.h.

197 { return DirectionS2<FT>( target() - source() ); }
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147
const PointS2< FT > & end ( ) const
inline

Definition at line 134 of file SegmentS2.h.

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

135 { return t; }
PointS2< FT > t
Definition: SegmentS2.h:99

Here is the caller graph for this function:

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

Definition at line 273 of file SegmentS2.h.

References collinear().

274 {
275  return(( p == source() )
276  || ( p == target() )
277  || ( collinear(source(), p, target())
278  && ( DirectionS2<FT>(p - source())
279  !=
280  DirectionS2<FT>(p - target()))
281  )
282  );
283 }
bool collinear(const Point_2< R > &p, const Point_2< R > &q, const Point_2< R > &r)
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147

Here is the call graph for this function:

int id ( ) const
bool is_degenerate ( ) const
inline

Definition at line 226 of file SegmentS2.h.

227 { return (source() == target()); }
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147
CGAL_KERNEL_INLINE bool is_horizontal ( ) const

Definition at line 261 of file SegmentS2.h.

262 { return source().y() == target().y(); }
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147
CGAL_KERNEL_INLINE bool is_vertical ( ) const

Definition at line 267 of file SegmentS2.h.

268 { return source().x() == target().x(); }
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147
CGAL_KERNEL_INLINE PointS2< FT > max ( ) const

Definition at line 163 of file SegmentS2.h.

References lexicographically_xy_smaller().

164 {
166  : source();
167 }
bool lexicographically_xy_smaller(const Point_2< R > &p, const Point_2< R > &q)
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147

Here is the call graph for this function:

CGAL_KERNEL_INLINE PointS2< FT > min ( ) const

Definition at line 154 of file SegmentS2.h.

References lexicographically_xy_smaller().

155 {
157  : target();
158 }
bool lexicographically_xy_smaller(const Point_2< R > &p, const Point_2< R > &q)
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147

Here is the call graph for this function:

bool operator!= ( const SegmentS2< FT > &  s) const
inline

Definition at line 122 of file SegmentS2.h.

References s.

123 { return !(*this == s); }
PointS2< FT > s
Definition: SegmentS2.h:98
bool operator== ( const SegmentS2< FT > &  s) const
inline

Definition at line 116 of file SegmentS2.h.

References SegmentS2< FT >::source(), and SegmentS2< FT >::target().

117 { return ( (source() == s.source()) && (target() == s.target()) ); }
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147

Here is the call graph for this function:

PointS2< FT > operator[] ( int  i) const
inline

Definition at line 184 of file SegmentS2.h.

185 { return vertex(i); }
blockLoc i
Definition: read.cpp:79
PointS2< FT > vertex(int i) const
Definition: SegmentS2.h:172
SegmentS2< FT > opposite ( ) const
inline

Definition at line 208 of file SegmentS2.h.

209 { return SegmentS2<FT>(target(), source()); }
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147
CGAL_KERNEL_INLINE PointS2< FT > point ( int  i) const

Definition at line 178 of file SegmentS2.h.

179 { return (i%2 ==0) ? source() : target(); }
blockLoc i
Definition: read.cpp:79
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147
const PointS2< FT > & source ( ) const
inline

Definition at line 141 of file SegmentS2.h.

References s.

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

142 { return s; }
PointS2< FT > s
Definition: SegmentS2.h:98

Here is the caller graph for this function:

CGAL_KERNEL_INLINE FT squared_length ( ) const

Definition at line 190 of file SegmentS2.h.

References squared_distance().

191 { return squared_distance(source(), target()); }
FT squared_distance(const PointS3< FT > &p, const PointS3< FT > &q)
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147

Here is the call graph for this function:

const PointS2< FT > & start ( ) const
inline

Definition at line 128 of file SegmentS2.h.

References s.

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

129 { return s; }
PointS2< FT > s
Definition: SegmentS2.h:98

Here is the caller graph for this function:

LineS2< FT > supporting_line ( ) const
inline

Definition at line 202 of file SegmentS2.h.

203 { return LineS2<FT>(*this); }
Definition: LineS2.h:62
const PointS2< FT > & target ( ) const
inline

Definition at line 147 of file SegmentS2.h.

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

148 { return t; }
PointS2< FT > t
Definition: SegmentS2.h:99

Here is the caller graph for this function:

SegmentS2< FT > transform ( const Aff_transformationS2< FT > &  t) const
inline

Definition at line 214 of file SegmentS2.h.

References Aff_transformationS2< FT >::transform().

215 { return SegmentS2<FT>(t.transform(source()), t.transform(target())); }
PointS2< FT > transform(const PointS2< FT > &p) const
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147

Here is the call graph for this function:

CGAL_KERNEL_INLINE PointS2< FT > vertex ( int  i) const

Definition at line 172 of file SegmentS2.h.

173 { return (i%2 ==0) ? source() : target(); }
blockLoc i
Definition: read.cpp:79
const PointS2< FT > & source() const
Definition: SegmentS2.h:141
const PointS2< FT > & target() const
Definition: SegmentS2.h:147

Member Data Documentation

PointS2<FT> s

Definition at line 98 of file SegmentS2.h.

PointS2<FT> t

Definition at line 99 of file SegmentS2.h.


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