Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ray_2.h
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // Copyright (c) 1999 The CGAL Consortium
4 
5 // This software and related documentation is part of the Computational
6 // Geometry Algorithms Library (CGAL).
7 // This software and documentation is provided "as-is" and without warranty
8 // of any kind. In no event shall the CGAL Consortium be liable for any
9 // damage of any kind.
10 //
11 // Every use of CGAL requires a license.
12 //
13 // Academic research and teaching license
14 // - For academic research and teaching purposes, permission to use and copy
15 // the software and its documentation is hereby granted free of charge,
16 // provided that it is not a component of a commercial product, and this
17 // notice appears in all copies of the software and related documentation.
18 //
19 // Commercial licenses
20 // - A commercial license is available through Algorithmic Solutions, who also
21 // markets LEDA (http://www.algorithmic-solutions.de).
22 // - Commercial users may apply for an evaluation license by writing to
23 // Algorithmic Solutions (contact@algorithmic-solutions.com).
24 //
25 // The CGAL Consortium consists of Utrecht University (The Netherlands),
26 // ETH Zurich (Switzerland), Free University of Berlin (Germany),
27 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
28 // (Germany), Max-Planck-Institute Saarbrucken (Germany), RISC Linz (Austria),
29 // and Tel-Aviv University (Israel).
30 //
31 // ----------------------------------------------------------------------
32 //
33 // release : CGAL-2.2
34 // release_date : 2000, September 30
35 //
36 // source : Ray_2.fw
37 // file : include/CGAL/Ray_2.h
38 // package : _2 (3.6)
39 // revision : 3.6
40 // revision_date : 30 Jul 2000
41 // author(s) : Andreas Fabri
42 //
43 // coordinator : MPI, Saarbruecken (<Stefan.Schirra>)
44 // email : contact@cgal.org
45 // www : http://www.cgal.org
46 //
47 // ======================================================================
48 
49 
50 #ifndef CGAL_RAY_2_H
51 #define CGAL_RAY_2_H
52 
53 #ifndef CGAL_REP_CLASS_DEFINED
54 #error no representation class defined
55 #endif // CGAL_REP_CLASS_DEFINED
56 
57 #ifndef CGAL_SEGMENT_2_H
58 #include <CGAL/Segment_2.h>
59 #endif // CGAL_SEGMENT_2_H
60 
61 #ifdef CGAL_HOMOGENEOUS_H
62 #ifndef CGAL_RAYH2_H
63 #include <CGAL/RayH2.h>
64 #endif // CGAL_RAYH2_H
65 #endif // CGAL_HOMOGENEOUS_H
66 
67 #ifdef CGAL_CARTESIAN_H
68 #ifndef CGAL_RAYC2_H
69 #include <CGAL/Cartesian/Ray_2.h>
70 #endif // CGAL_RAYC2_H
71 #endif // CGAL_CARTESIAN_H
72 
73 #ifdef CGAL_SIMPLE_CARTESIAN_H
75 #endif // CGAL_SIMPLE_CARTESIAN_H
76 
77 
79 
80 template <class R_>
81 class Ray_2 : public R_::Ray_2_base
82 {
83 public:
84  typedef R_ R;
85  typedef typename R::RT RT;
86  typedef typename R::FT FT;
87  typedef typename R::Ray_2_base RRay_2;
88 
90  : RRay_2()
91  {}
92 
94  {}
95 
96  Ray_2(const CGAL::Ray_2<R> &r)
97  : RRay_2((const RRay_2&)r)
98  {
99 
100  }
101 
102  Ray_2(const RRay_2& r)
103  : RRay_2(r)
104  {
105 
106  }
107 
108  Ray_2(const CGAL::Point_2<R> &sp,
109  const CGAL::Point_2<R> &secondp)
110  : RRay_2(sp, secondp)
111  {}
112 
113  Ray_2(const CGAL::Point_2<R> &sp,
114  const CGAL::Direction_2<R> &d)
115  : RRay_2(sp, d)
116  {}
117 
118 
119  bool operator==(const CGAL::Ray_2<R> &r) const
120  { return RRay_2::operator==(r); }
121 
122  bool operator!=(const CGAL::Ray_2<R> &r) const
123  { return !(*this == r); }
124 
125  CGAL::Point_2<R> start() const
126  { return RRay_2::start(); }
127 
128  CGAL::Point_2<R> source() const
129  { return RRay_2::source(); }
130 
131  CGAL::Point_2<R> second_point() const
132  { return RRay_2::second_point(); }
133 
134  CGAL::Point_2<R> point(int i) const
135  { return RRay_2::point(i); }
136 
137  CGAL::Direction_2<R> direction() const
138  { return RRay_2::direction(); }
139 
140  CGAL::Line_2<R> supporting_line() const
141  { return RRay_2::supporting_line(); }
142 
143  CGAL::Ray_2<R> opposite() const
144  { return RRay_2::opposite(); }
145 
146  CGAL::Ray_2<R> transform(const CGAL::Aff_transformation_2<R> &t) const
147  { return RRay_2::transform(t); }
148 
149  bool is_horizontal() const
150  { return RRay_2::is_horizontal(); }
151 
152  bool is_vertical() const
153  { return RRay_2::is_vertical(); }
154 
155  bool is_degenerate() const
156  { return RRay_2::is_degenerate(); }
157 
158  bool has_on(const CGAL::Point_2<R> &p) const
159  { return RRay_2::has_on(p); }
160 
161  bool collinear_has_on(const CGAL::Point_2<R> &p) const
162  { return RRay_2::collinear_has_on(p); }
163 
164 };
165 
166 #ifndef NO_OSTREAM_INSERT_RAY_2
167 template < class R >
168 std::ostream &
169 operator<<(std::ostream &os, const Ray_2<R> &r)
170 {
171  typedef typename R::Ray_2_base RRay_2;
172  return os << (const RRay_2&)r;
173 }
174 #endif // NO_OSTREAM_INSERT_RAY_2
175 
176 #ifndef NO_ISTREAM_EXTRACT_RAY_2
177 template < class R >
178 std::istream &
179 operator>>(std::istream &is, Ray_2<R> &r)
180 {
181  typedef typename R::Ray_2_base RRay_2;
182  return is >> (RRay_2&)r;
183 }
184 #endif // NO_ISTREAM_EXTRACT_RAY_2
185 
187 
188 
189 #endif // CGAL_RAY_2_H
CGAL::Point_2< R > point(int i) const
Definition: Ray_2.h:134
CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE bool operator==(const Origin &o, const Point_2< R > &p)
Definition: Point_2.h:239
bool is_degenerate() const
Definition: Ray_2.h:155
const NT & d
Ray_2(const CGAL::Ray_2< R > &r)
Definition: Ray_2.h:96
bool is_horizontal() const
Definition: Ray_2.h:149
bool is_vertical() const
Definition: Ray_2.h:152
CGAL::Point_2< R > start() const
Definition: Ray_2.h:125
R::Ray_2_base RRay_2
Definition: Ray_2.h:87
bool operator!=(const CGAL::Ray_2< R > &r) const
Definition: Ray_2.h:122
bool collinear_has_on(const CGAL::Point_2< R > &p) const
Definition: Ray_2.h:161
R::FT FT
Definition: Ray_2.h:86
Ray_2(const CGAL::Point_2< R > &sp, const CGAL::Direction_2< R > &d)
Definition: Ray_2.h:113
blockLoc i
Definition: read.cpp:79
Ray_2(const RRay_2 &r)
Definition: Ray_2.h:102
Ray_2()
Definition: Ray_2.h:89
bool has_on(const CGAL::Point_2< R > &p) const
Definition: Ray_2.h:158
CGAL::Direction_2< R > direction() const
Definition: Ray_2.h:137
CGAL::Ray_2< R > transform(const CGAL::Aff_transformation_2< R > &t) const
Definition: Ray_2.h:146
CGAL::Ray_2< R > opposite() const
Definition: Ray_2.h:143
CGAL_BEGIN_NAMESPACE T opposite(const T &t)
CGAL::Point_2< R > source() const
Definition: Ray_2.h:128
R::RT RT
Definition: Ray_2.h:85
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
std::istream & operator>>(std::istream &is, CGAL::Aff_transformation_2< R > &t)
CGAL::Point_2< R > second_point() const
Definition: Ray_2.h:131
bool operator==(const CGAL::Ray_2< R > &r) const
Definition: Ray_2.h:119
R_ R
Definition: Ray_2.h:84
CGAL::Line_2< R > supporting_line() const
Definition: Ray_2.h:140
Ray_2(const CGAL::Point_2< R > &sp, const CGAL::Point_2< R > &secondp)
Definition: Ray_2.h:108
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
~Ray_2()
Definition: Ray_2.h:93