Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Aff_transformation_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 : Aff_transformation_2.fw
37 // file : include/CGAL/Aff_transformation_2.h
38 // package : _2 (3.6)
39 // revision : 3.6
40 // revision_date : 30 Jul 2000
41 // author(s) : Andreas Fabri
42 // Stefan Schirra
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_AFF_TRANSFORMATION_2_H
52 #define CGAL_AFF_TRANSFORMATION_2_H
53 
54 #ifndef CGAL_REP_CLASS_DEFINED
55 #error no representation class defined
56 #endif // CGAL_REP_CLASS_DEFINED
57 
58 #if defined(CGAL_CFG_INCOMPLETE_TYPE_BUG_1) && \
59  !defined(CGAL_NO_LINE_TRANSFORM_IN_AT)
60 #define CGAL_NO_LINE_TRANSFORM_IN_AT
61 #endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1
62 
63 #ifndef CGAL_LINE_2_H
64 #include <CGAL/Line_2.h>
65 #endif // CGAL_LINE_2_H
66 
67 #ifdef CGAL_HOMOGENEOUS_H
68 #ifndef CGAL_AFF_TRANSFORMATIONH2_H
69 #include <CGAL/Aff_transformationH2.h>
70 #endif // CGAL_AFF_TRANSFORMATIONH2_H
71 #endif // CGAL_HOMOGENEOUS_H
72 
73 #ifdef CGAL_CARTESIAN_H
74 #ifndef CGAL_AFF_TRANSFORMATIONC2_H
75 #include <CGAL/Cartesian/Aff_transformation_2.h>
76 #endif // CGAL_AFF_TRANSFORMATIONC2_H
77 #endif // CGAL_CARTESIAN_H
78 
79 #ifdef CGAL_SIMPLE_CARTESIAN_H
81 #endif // CGAL_SIMPLE_CARTESIAN_H
82 
83 
85 
86 template <class R_>
87 class Aff_transformation_2 : public R_::Aff_transformation_2_base
88 {
89 public:
90  typedef R_ R;
91  typedef typename R::RT RT;
92  typedef typename R::FT FT;
93  typedef typename R::Line_2_base RLine_2;
94  typedef typename R::Direction_2_base RDirection_2;
95  typedef typename R::Aff_transformation_2_base RAff_transformation_2;
96 
97  // default constructor
100  {}
101 
102  // copy constructor
103  Aff_transformation_2(const CGAL::Aff_transformation_2<R> &t)
105  {}
106 
107  // up cast constructor
110  {}
111 
112  // Identity:
114  : RAff_transformation_2(tag)
115  {}
116 
117  // Translation:
119  const CGAL::Vector_2<R> &v)
120  : RAff_transformation_2(tag, v)
121  {}
122 
123  // Rational Rotation:
125  const CGAL::Direction_2<R> &d,
126  const RT &num,
127  const RT &den = RT(1))
128  : RAff_transformation_2(tag, RDirection_2(d), num, den)
129  {}
130 
132  const RT &sin,
133  const RT &cos,
134  const RT &den = RT(1))
135  : RAff_transformation_2(tag, sin, cos, den)
136  {}
137 
138  // Reflection:
140  const CGAL::Line_2<R>& l )
141  : RAff_transformation_2(tag, l)
142  {}
143 
144 
145  // Scaling:
147  const RT &s,
148  const RT &w= RT(1))
149  : RAff_transformation_2(tag, s, w)
150  {}
151 
152  // The general case:
154  const RT & m12,
155  const RT & m13,
156 
157  const RT & m21,
158  const RT & m22,
159  const RT & m23,
160 
161  const RT &w= RT(1))
162  : RAff_transformation_2(m11, m12, m13,
163  m21, m22, m23,
164  w)
165  {}
166 
167  Aff_transformation_2(const RT & m11, const RT & m12,
168  const RT & m21, const RT & m22,
169  const RT &w = RT(1))
170  : RAff_transformation_2(m11, m12,
171  m21, m22,
172  w)
173  {}
174 
176  {}
177 
178  CGAL::Point_2<R> transform(const CGAL::Point_2<R> &p) const
179  { return RAff_transformation_2::transform(p); }
180 
181  CGAL::Point_2<R> operator()(const CGAL::Point_2<R> &p) const
182  { return transform(p); }
183 
184  CGAL::Vector_2<R> transform(const CGAL::Vector_2<R> &v) const
185  { return RAff_transformation_2::transform(v); }
186 
187  CGAL::Vector_2<R> operator()(const CGAL::Vector_2<R> &v) const
188  { return transform(v); }
189 
190  CGAL::Direction_2<R> transform(const CGAL::Direction_2<R> &d) const
191  { return RAff_transformation_2::transform(d); }
192 
193  CGAL::Direction_2<R> operator()(const CGAL::Direction_2<R> &d) const
194  { return transform(d); }
195 
196  CGAL::Line_2<R> transform(const CGAL::Line_2<R> &l) const
197  {
198 #ifndef CGAL_NO_LINE_TRANSFORM_IN_AT
199  return RAff_transformation_2::transform(l);
200 #else
201  return
202  ((const RLine_2&)l).transform((const RAff_transformation_2&)(*this));
203 #endif // CGAL_NO_LINE_TRANSFORM_IN_AT
204  }
205 
206  CGAL::Line_2<R> operator()(const CGAL::Line_2<R> &l) const
207  { return transform(l); }
208 
209 
210  CGAL::Aff_transformation_2<R>
211  inverse() const
212  { return RAff_transformation_2::inverse(); }
213 
214  bool is_even() const
215  { return RAff_transformation_2::is_even(); }
216 
217  bool is_odd() const
218  { return !is_even(); }
219 
220  CGAL::Aff_transformation_2<R>
221  operator*(const CGAL::Aff_transformation_2<R> &t) const
222  { return RAff_transformation_2::operator*(t); }
223 
224  FT cartesian(int i, int j) const
225  { return RAff_transformation_2::cartesian(i,j); }
226  RT homogeneous(int i, int j) const
227  { return RAff_transformation_2::homogeneous(i,j); }
228  FT m(int i, int j) const
229  { return RAff_transformation_2::m(i,j); }
230  RT hm(int i, int j) const
231  { return RAff_transformation_2::hm(i,j); }
232 
233 };
234 
235 #ifndef NO_OSTREAM_INSERT_AFF_TRANSFORMATION_2
236 template < class R >
237 std::ostream &
238 operator<<(std::ostream &os, const CGAL::Aff_transformation_2<R> &t)
239 {
240  typedef typename R::Aff_transformation_2_base RAff_transformation_2;
241  return os << (const RAff_transformation_2&)t;
242 }
243 #endif // NO_OSTREAM_INSERT_AFF_TRANSFORMATION_2
244 
245 #ifndef NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_2
246 template < class R >
247 std::istream &
248 operator>>(std::istream &is, CGAL::Aff_transformation_2<R> &t)
249 {
250  typedef typename R::Aff_transformation_2_base RAff_transformation_2;
251  return is >> (RAff_transformation_2&)t;
252 }
253 #endif // NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_2
254 
256 
257 
258 #endif // CGAL_AFF_TRANSFORMATION_2_H
Aff_transformation_2(const RT &m11, const RT &m12, const RT &m13, const RT &m21, const RT &m22, const RT &m23, const RT &w=RT(1))
FT m(int i, int j) const
Aff_transformation_2(const RAff_transformation_2 &t)
Vector_3< T > operator*(T t, const Vector_3< T > &v)
Definition: mapbasic.h:139
const NT & d
RT hm(int i, int j) const
CGAL::Line_2< R > transform(const CGAL::Line_2< R > &l) const
double s
Definition: blastest.C:80
RT homogeneous(int i, int j) const
Aff_transformation_2(const RT &m11, const RT &m12, const RT &m21, const RT &m22, const RT &w=RT(1))
NT & den
Aff_transformation_2(const Identity_transformation tag)
*********************************************************************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
Aff_transformation_2(const Scaling tag, const RT &s, const RT &w=RT(1))
NT & sin
CGAL::Vector_2< R > transform(const CGAL::Vector_2< R > &v) const
R::Aff_transformation_2_base RAff_transformation_2
Aff_transformation_2(const Rotation tag, const CGAL::Direction_2< R > &d, const RT &num, const RT &den=RT(1))
blockLoc i
Definition: read.cpp:79
CGAL::Point_2< R > transform(const CGAL::Point_2< R > &p) const
CGAL::Direction_2< R > transform(const CGAL::Direction_2< R > &d) const
CGAL::Aff_transformation_2< R > operator*(const CGAL::Aff_transformation_2< R > &t) const
Aff_transformation_2(const Translation tag, const CGAL::Vector_2< R > &v)
CGAL::Line_2< R > operator()(const CGAL::Line_2< R > &l) const
j indices j
Definition: Indexing.h:6
CGAL::Point_2< R > operator()(const CGAL::Point_2< R > &p) const
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
std::istream & operator>>(std::istream &is, CGAL::Aff_transformation_2< R > &t)
Aff_transformation_2(const CGAL::Aff_transformation_2< R > &t)
Aff_transformation_2(const Reflection tag, const CGAL::Line_2< R > &l)
FT cartesian(int i, int j) const
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
NT & cos
CGAL::Vector_2< R > operator()(const CGAL::Vector_2< R > &v) const
CGAL::Direction_2< R > operator()(const CGAL::Direction_2< R > &d) const
CGAL::Aff_transformation_2< R > inverse() const
Aff_transformation_2(const Rotation tag, const RT &sin, const RT &cos, const RT &den=RT(1))
R::Direction_2_base RDirection_2