Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Direction_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 : Direction_2.fw
37 // file : include/CGAL/Direction_2.h
38 // package : _2 (3.6)
39 // revision : 3.6
40 // revision_date : 30 Jul 2000
41 // author(s) : Stefan Schirra
42 //
43 //
44 // coordinator : MPI, Saarbruecken (<Stefan.Schirra>)
45 // email : contact@cgal.org
46 // www : http://www.cgal.org
47 //
48 // ======================================================================
49 
50 
51 #ifndef CGAL_DIRECTION_2_H
52 #define CGAL_DIRECTION_2_H
53 
54 #ifndef CGAL_REP_CLASS_DEFINED
55 #error no representation class defined
56 #endif // CGAL_REP_CLASS_DEFINED
57 
58 #ifdef CGAL_HOMOGENEOUS_H
59 #ifndef CGAL_DIRECTIONH2_H
60 #include <CGAL/DirectionH2.h>
61 #endif // CGAL_DIRECTIONH2_H
62 #endif // CGAL_HOMOGENEOUS_H
63 
64 #ifdef CGAL_CARTESIAN_H
65 #ifndef CGAL_DIRECTIONC2_H
66 #include <CGAL/Cartesian/Direction_2.h>
67 #endif // CGAL_DIRECTIONC2_H
68 #endif // CGAL_CARTESIAN_H
69 
70 #ifdef CGAL_SIMPLE_CARTESIAN_H
72 #endif // CGAL_SIMPLE_CARTESIAN_H
73 
74 
75 #ifndef CGAL_VECTOR_2_H
76 #include <CGAL/Vector_2.h>
77 #endif // CGAL_VECTOR_2_H
78 
80 
81 template <class R_>
82 class Direction_2 : public R_::Direction_2_base
83 {
84 public:
85  typedef R_ R;
86  typedef typename R::RT RT;
87  typedef typename R::FT FT;
88  typedef typename R::Vector_2_base RVector_2;
89  typedef typename R::Direction_2_base RDirection_2;
90  // typedef typename R::Aff_transformation_2 Aff_transformation_2;
91 
93  {}
94 
95  Direction_2(const CGAL::Direction_2<R> &d)
96  : RDirection_2((const RDirection_2&)d)
97  {}
98 
99 
101  : RDirection_2(d)
102  {}
103 
104 
106  : RDirection_2(v)
107  {}
108 
109  Direction_2(const RT &x, const RT &y)
110  : RDirection_2(x,y)
111  {}
112 
113  bool
114  operator==(const CGAL::Direction_2<R> &d) const
115  { return RDirection_2::operator==(d); }
116 
117  bool
118  operator!=(const CGAL::Direction_2<R> &d) const
119  { return !(*this == d); }
120 
121  bool
122  operator>=(const CGAL::Direction_2<R> &d) const
123  { return RDirection_2::operator>=(d); }
124 
125  bool
126  operator<=(const CGAL::Direction_2<R> &d) const
127  { return RDirection_2::operator<=(d); }
128 
129  bool
130  operator>(const CGAL::Direction_2<R> &d) const
131  { return RDirection_2::operator>(d); }
132 
133  bool
134  operator<(const CGAL::Direction_2<R> &d) const
135  { return RDirection_2::operator<(d); }
136 
137  bool
138  counterclockwise_in_between(const CGAL::Direction_2<R> &d1,
139  const CGAL::Direction_2<R> &d2) const
140  { return RDirection_2::counterclockwise_in_between(d1,d2); }
141 
142  CGAL::Vector_2<R>
143  vector() const
144  { return (CGAL::Vector_2<R>)RDirection_2::to_vector(); }
145 
146  CGAL::Vector_2<R>
147  to_vector() const
148  { return (CGAL::Vector_2<R>)RDirection_2::to_vector(); }
149 
150  CGAL::Direction_2<R>
151  transform(const CGAL::Aff_transformation_2<R> &t) const
152  { return RDirection_2::transform(t); }
153 
154  CGAL::Direction_2<R>
155  operator-() const
156  { return RDirection_2::operator-(); }
157 
158  RT
159  delta(int i) const
160  { return RDirection_2::delta(i); }
161 
162  RT
163  dx() const
164  { return RDirection_2::dx(); }
165 
166  RT
167  dy() const
168  { return RDirection_2::dy(); }
169 };
170 
171 
172 #ifndef NO_OSTREAM_INSERT_DIRECTION_2
173 template < class R >
174 std::ostream &
175 operator<<(std::ostream &os, const Direction_2<R> &d)
176 {
177  typedef typename R::Direction_2_base RDirection_2;
178  return os << (const RDirection_2&)d;
179 }
180 
181 #endif // NO_OSTREAM_INSERT_DIRECTION_2
182 
183 #ifndef NO_ISTREAM_EXTRACT_DIRECTION_2
184 template < class R >
185 std::istream &
186 operator>>(std::istream &is, Direction_2<R> &p)
187 {
188  typedef typename R::Direction_2_base RDirection_2;
189  return is >> (RDirection_2&)p;
190 }
191 #endif // NO_ISTREAM_EXTRACT_DIRECTION_2
192 
193 
195 
196 
197 #endif // CGAL_DIRECTION_2_H
CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE bool operator==(const Origin &o, const Point_2< R > &p)
Definition: Point_2.h:239
Direction_2(const RVector_2 &v)
Definition: Direction_2.h:105
const NT & d
void int int REAL REAL * y
Definition: read.cpp:74
NT dx
CGAL::Vector_2< R > vector() const
Definition: Direction_2.h:143
bool operator>(const CGAL::Direction_2< R > &d) const
Definition: Direction_2.h:130
Direction_2(const RDirection_2 &d)
Definition: Direction_2.h:100
bool counterclockwise_in_between(const CGAL::Direction_2< R > &d1, const CGAL::Direction_2< R > &d2) const
Definition: Direction_2.h:138
RT dx() const
Definition: Direction_2.h:163
R::Direction_2_base RDirection_2
Definition: Direction_2.h:89
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
Direction_2(const RT &x, const RT &y)
Definition: Direction_2.h:109
Direction_2(const CGAL::Direction_2< R > &d)
Definition: Direction_2.h:95
CGAL::Direction_2< R > transform(const CGAL::Aff_transformation_2< R > &t) const
Definition: Direction_2.h:151
bool operator!=(const CGAL::Direction_2< R > &d) const
Definition: Direction_2.h:118
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
RT dy() const
Definition: Direction_2.h:167
RT delta(int i) const
Definition: Direction_2.h:159
bool operator==(const CGAL::Direction_2< R > &d) const
Definition: Direction_2.h:114
R::Vector_2_base RVector_2
Definition: Direction_2.h:88
CGAL::Direction_2< R > operator-() const
Definition: Direction_2.h:155
bool operator>=(const CGAL::Direction_2< R > &d) const
Definition: Direction_2.h:122
NT dy
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
std::istream & operator>>(std::istream &is, CGAL::Aff_transformation_2< R > &t)
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
CGAL::Vector_2< R > to_vector() const
Definition: Direction_2.h:147
Point_2< R > operator-(const Origin &o, const Vector_2< R > &v)