Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Line_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 : Line_2.fw
37 // file : include/CGAL/Line_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_LINE_2_H
51 #define CGAL_LINE_2_H
52 
53 #ifndef CGAL_REP_CLASS_DEFINED
54 #error no representation class defined
55 #endif // CGAL_REP_CLASS_DEFINED
56 
57 #ifdef CGAL_HOMOGENEOUS_H
58 #ifndef CGAL_LINEH2_H
59 #include <CGAL/LineH2.h>
60 #endif // CGAL_LINEH2_H
61 #endif // CGAL_HOMOGENEOUS_H
62 
63 #ifdef CGAL_CARTESIAN_H
64 #ifndef CGAL_LINEC2_H
65 #include <CGAL/Cartesian/Line_2.h>
66 #endif // CGAL_LINEC2_H
67 #endif // CGAL_CARTESIAN_H
68 
69 #ifdef CGAL_SIMPLE_CARTESIAN_H
71 #endif // CGAL_SIMPLE_CARTESIAN_H
72 
73 
74 #ifndef CGAL_PREDICATES_ON_POINTS_2_H
76 #endif // CGAL_PREDICATES_ON_POINTS_2_H
77 #ifndef CGAL_VECTOR_2_H
78 #include <CGAL/Vector_2.h>
79 #endif // CGAL_VECTOR_2_H
80 
82 
83 template <class R_>
84 class Line_2 : public R_::Line_2_base
85 {
86 public:
87  typedef R_ R;
88  typedef typename R::RT RT;
89  typedef typename R::FT FT;
90  typedef typename R::Line_2_base RLine_2;
91 
93  : RLine_2()
94  {}
95 
97  {}
98 
99  Line_2(const CGAL::Line_2<R> &l)
100  : RLine_2((RLine_2&)l)
101  {}
102 
103  Line_2(const CGAL::Point_2<R> &p, const CGAL::Point_2<R> &q)
104  : RLine_2(p,q)
105  {}
106 
107  Line_2(const RT &a, const RT &b, const RT &c)
108  : RLine_2(a,b,c)
109  {}
110 
111 
112  Line_2(const RLine_2& l) // conversion impl -> interface class
113  : RLine_2(l)
114  {}
115 
116 
117  Line_2(const CGAL::Segment_2<R>& s)
118  : RLine_2(s)
119  {}
120 
121  Line_2(const CGAL::Ray_2<R>& r)
122  : RLine_2(r)
123  {}
124 
125  Line_2(const CGAL::Point_2<R> &p, const CGAL::Direction_2<R> &d)
126  : RLine_2(p,d)
127  {}
128 
129 
130  bool operator==(const CGAL::Line_2<R> &l) const
131  {
132  return RLine_2::operator==(l);
133  }
134 
135  bool operator!=(const CGAL::Line_2<R> &l) const
136  {
137  return !(*this == l);
138  }
139 
140  RT a() const
141  {
142  return RLine_2::a();
143  }
144 
145  RT b() const
146  {
147  return RLine_2::b();
148  }
149 
150  RT c() const
151  {
152  return RLine_2::c();
153  }
154 
155 
156  FT x_at_y(const FT &y) const
157  {
158  return RLine_2::x_at_y(y);
159  }
160 
161  FT y_at_x(const FT &x) const
162  {
163  return RLine_2::y_at_x(x);
164  }
165 
166  CGAL::Line_2<R> perpendicular(const CGAL::Point_2<R> &p) const
167  {
168  return RLine_2::perpendicular(p);
169  }
170 
171  CGAL::Line_2<R> opposite() const
172  {
173  return RLine_2::opposite();
174  }
175 
176  CGAL::Point_2<R> point(int i) const
177  {
178  return RLine_2::point(i);
179  }
180 
181  CGAL::Point_2<R> projection(const CGAL::Point_2<R> &p) const
182  {
183  return RLine_2::projection(p);
184  }
185 
186  CGAL::Point_2<R> point() const
187  {
188  return RLine_2::point();
189  }
190 
191  CGAL::Direction_2<R> direction() const
192  {
193 
194  return RLine_2::direction();
195  }
196 
197  Oriented_side oriented_side(const CGAL::Point_2<R> &p) const
198  {
199  return RLine_2::oriented_side(p);
200  }
201 
202  bool has_on(const CGAL::Point_2<R> &p) const
203  {
204  return RLine_2::has_on_boundary(p);
205  }
206 
207  bool has_on_boundary(const CGAL::Point_2<R> &p) const
208  {
209  return RLine_2::has_on_boundary(p);
210  }
211 
212  bool has_on_positive_side(const CGAL::Point_2<R> &p) const
213  {
214  return RLine_2::has_on_positive_side(p);
215  }
216 
217  bool has_on_negative_side(const CGAL::Point_2<R> &p) const
218  {
219  return RLine_2::has_on_negative_side(p);
220  }
221 
222  bool is_horizontal() const
223  {
224 
225  return RLine_2::is_horizontal();
226  }
227 
228  bool is_vertical() const
229  {
230 
231  return RLine_2::is_vertical();
232  }
233 
234  bool is_degenerate() const
235  {
236 
237  return RLine_2::is_degenerate();
238  }
239 
240  CGAL::Line_2<R> transform(const CGAL::Aff_transformation_2<R> &t) const
241  {
242  return RLine_2::transform(t);
243  }
244 };
245 
246 
247 
248 #ifndef NO_OSTREAM_INSERT_LINE_2
249 template < class R >
250 std::ostream &
251 operator<<(std::ostream &os, const Line_2<R> &l)
252 {
253  typedef typename R::Line_2_base RLine_2;
254  return os << (const RLine_2&)l;
255 }
256 #endif // NO_OSTREAM_INSERT_LINE_2
257 
258 #ifndef NO_ISTREAM_EXTRACT_LINE_2
259 template < class R >
260 std::istream &
261 operator>>(std::istream &is, Line_2<R> &p)
262 {
263  typedef typename R::Line_2_base RLine_2;
264  return is >> (RLine_2&)p;
265 }
266 #endif // NO_ISTREAM_EXTRACT_LINE_2
267 
268 
269 
271 
272 
273 #ifndef CGAL_SEGMENT_2_H
274 #include <CGAL/Segment_2.h>
275 #endif // CGAL_SEGMENT_2_H
276 #ifndef CGAL_RAY_2_H
277 #include <CGAL/Ray_2.h>
278 #endif // CGAL_RAY_2_H
279 
280 #endif // CGAL_LINE_2_H
CGAL::Point_2< R > projection(const CGAL::Point_2< R > &p) const
Definition: Line_2.h:181
CGAL::Line_2< R > perpendicular(const CGAL::Point_2< R > &p) const
Definition: Line_2.h:166
bool is_degenerate() const
Definition: Line_2.h:234
FT x_at_y(const FT &y) const
Definition: Line_2.h:156
CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE bool operator==(const Origin &o, const Point_2< R > &p)
Definition: Point_2.h:239
const NT & d
void int int REAL REAL * y
Definition: read.cpp:74
Line_2(const RT &a, const RT &b, const RT &c)
Definition: Line_2.h:107
CGAL::Point_2< R > point() const
Definition: Line_2.h:186
double s
Definition: blastest.C:80
bool is_vertical() const
Definition: Line_2.h:228
bool has_on_boundary(const CGAL::Point_2< R > &p) const
Definition: Line_2.h:207
Line_2(const CGAL::Line_2< R > &l)
Definition: Line_2.h:99
Line_2(const CGAL::Ray_2< R > &r)
Definition: Line_2.h:121
CGAL::Line_2< R > opposite() const
Definition: Line_2.h:171
bool operator!=(const CGAL::Line_2< R > &l) const
Definition: Line_2.h:135
CGAL::Direction_2< R > direction() const
Definition: Line_2.h:191
RT c() const
Definition: Line_2.h:150
bool has_on_positive_side(const CGAL::Point_2< R > &p) const
Definition: Line_2.h:212
Oriented_side
Definition: enum.h:78
Line_2(const CGAL::Point_2< R > &p, const CGAL::Direction_2< R > &d)
Definition: Line_2.h:125
R_ R
Definition: Line_2.h:87
R::Line_2_base RLine_2
Definition: Line_2.h:90
CGAL::Point_2< R > point(int i) const
Definition: Line_2.h:176
CGAL::Line_2< R > transform(const CGAL::Aff_transformation_2< R > &t) const
Definition: Line_2.h:240
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
Line_2(const CGAL::Segment_2< R > &s)
Definition: Line_2.h:117
R::RT RT
Definition: Line_2.h:88
Line_2(const RLine_2 &l)
Definition: Line_2.h:112
bool is_horizontal() const
Definition: Line_2.h:222
Line_2(const CGAL::Point_2< R > &p, const CGAL::Point_2< R > &q)
Definition: Line_2.h:103
bool operator==(const CGAL::Line_2< R > &l) const
Definition: Line_2.h:130
NT q
CGAL_BEGIN_NAMESPACE T opposite(const T &t)
CGAL_KERNEL_LARGE_INLINE PointS3< FT > projection(const PointS3< FT > &p, const PlaneS3< FT > &h)
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
bool has_on(const CGAL::Point_2< R > &p) const
Definition: Line_2.h:202
std::istream & operator>>(std::istream &is, CGAL::Aff_transformation_2< R > &t)
RT b() const
Definition: Line_2.h:145
Line_2()
Definition: Line_2.h:92
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
Oriented_side oriented_side(const CGAL::Point_2< R > &p) const
Definition: Line_2.h:197
FT y_at_x(const FT &x) const
Definition: Line_2.h:161
~Line_2()
Definition: Line_2.h:96
R::FT FT
Definition: Line_2.h:89
RT a() const
Definition: Line_2.h:140
bool has_on_negative_side(const CGAL::Point_2< R > &p) const
Definition: Line_2.h:217