Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Aff_transformation_3.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_3.fw
37 // file : include/CGAL/Aff_transformation_3.h
38 // package : _3 (3.7)
39 // revision : 3.7
40 // revision_date : 16 Aug 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_3_H
52 #define CGAL_AFF_TRANSFORMATION_3_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_PLANE_TRANSFORM_IN_AT)
60 #define CGAL_NO_PLANE_TRANSFORM_IN_AT
61 #endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1
62 
63 #ifdef CGAL_HOMOGENEOUS_H
64 #include <CGAL/Aff_transformationH3.h>
65 #endif // CGAL_HOMOGENEOUS_H
66 
67 #ifdef CGAL_CARTESIAN_H
68 #include <CGAL/Cartesian/Aff_transformation_3.h>
69 #endif // CGAL_CARTESIAN_H
70 
71 #ifdef CGAL_SIMPLE_CARTESIAN_H
73 #endif // CGAL_SIMPLE_CARTESIAN_H
74 
75 
76 #include <CGAL/Point_3.h>
77 #include <CGAL/Vector_3.h>
78 #include <CGAL/Direction_3.h>
79 #include <CGAL/Plane_3.h>
80 
82 
83 template <class R_>
84 class Aff_transformation_3 : public R_::Aff_transformation_3_base
85 {
86 public:
87  typedef R_ R;
88  typedef typename R::RT RT;
89  typedef typename R::FT FT;
90  typedef typename R::Plane_3_base RPlane_3;
91  typedef typename R::Aff_transformation_3_base RAff_transformation_3;
92 
93  // default constructor
95  {}
96 
97  // copy constructor
98  Aff_transformation_3(const CGAL::Aff_transformation_3<R>& t)
100  {}
101 
102  // up cast constructor
105  {}
106 
107  // identity:
109  : RAff_transformation_3(tag)
110  {}
111 
112  // translation:
114  const CGAL::Vector_3<R>& v)
115  : RAff_transformation_3(tag, v)
116  {}
117 
118  // scaling:
120  const RT& s,
121  const RT& w= RT(1) )
122  : RAff_transformation_3(tag, s, w)
123  {}
124 
125  // the general case:
127  const RT& m11, const RT& m12, const RT& m13, const RT& m14,
128  const RT& m21, const RT& m22, const RT& m23, const RT& m24,
129  const RT& m31, const RT& m32, const RT& m33, const RT& m34,
130  const RT& w= RT(1) )
131  : RAff_transformation_3(m11, m12, m13, m14,
132  m21, m22, m23, m24,
133  m31, m32, m33, m34,
134  w)
135  {}
137  const RT& m11, const RT& m12, const RT& m13,
138  const RT& m21, const RT& m22, const RT& m23,
139  const RT& m31, const RT& m32, const RT& m33,
140  const RT& w = RT(1) )
141  : RAff_transformation_3(m11, m12, m13,
142  m21, m22, m23,
143  m31, m32, m33,
144  w)
145  {}
146  // dtor
148  {}
149  // transformations
150  CGAL::Point_3<R> transform(const CGAL::Point_3<R>& p) const
151  { return RAff_transformation_3::transform(p); }
152  CGAL::Point_3<R> operator()(const CGAL::Point_3<R>& p) const
153  { return RAff_transformation_3::transform(p); }
154  CGAL::Vector_3<R> transform(const CGAL::Vector_3<R>& v) const
155  { return RAff_transformation_3::transform(v); }
156  CGAL::Vector_3<R> operator()(const CGAL::Vector_3<R>& v) const
157  { return RAff_transformation_3::transform(v); }
158  CGAL::Direction_3<R> transform(const CGAL::Direction_3<R>& d) const
159  { return RAff_transformation_3::transform(d); }
160  CGAL::Direction_3<R> operator()(const CGAL::Direction_3<R>& d) const
161  { return RAff_transformation_3::transform(d); }
162 #ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT
163  CGAL::Plane_3<R> transform(const CGAL::Plane_3<R>& pl) const
164  { return RAff_transformation_3::transform(pl); }
165 #else
166  CGAL::Plane_3<R>
167  transform(const CGAL::Plane_3<R>& pl) const
168  {
169  return
170  (( const RPlane_3& )pl).transform( (const RAff_transformation_3& )(*this) );
171  }
172 #endif // CGAL_NO_PLANE_TRANSFORM_IN_AT
173  CGAL::Plane_3<R> operator()(const CGAL::Plane_3<R>& pl) const
174  { return transform(pl); }
175  // further members
176  CGAL::Aff_transformation_3<R>
177  inverse() const
178  { return RAff_transformation_3::inverse(); }
179  bool is_even() const
180  { return RAff_transformation_3::is_even(); }
181  bool is_odd() const
182  { return !is_even(); }
183  // access
184  FT cartesian(int i, int j) const
185  { return RAff_transformation_3::cartesian(i,j); }
186  RT homogeneous(int i, int j) const
187  { return RAff_transformation_3::homogeneous(i,j); }
188  FT m(int i, int j) const
189  { return RAff_transformation_3::m(i,j); }
190  RT hm(int i, int j) const
191  { return RAff_transformation_3::hm(i,j); }
192  // composition
193  CGAL::Aff_transformation_3<R>
194  operator*(const CGAL::Aff_transformation_3<R>& t) const
195  {
196  return
197  static_cast<const RAff_transformation_3&>(*this) *
198  static_cast<const RAff_transformation_3&>(t) ;
199  }
200 };
201 
202 // I/O operators
203 #ifndef NO_OSTREAM_INSERT_AFF_TRANSFORMATION_3
204 template < class R >
205 std::ostream&
206 operator<<(std::ostream& os, const CGAL::Aff_transformation_3<R>& t)
207 {
208  typedef typename R::Aff_transformation_3_base RAff_transformation_3;
209  return os << static_cast<const RAff_transformation_3&>(t);
210 }
211 #endif // NO_OSTREAM_INSERT_AFF_TRANSFORMATION_3
212 
213 #ifndef NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_3
214 template < class R >
215 std::istream&
216 operator>>(std::istream& is, CGAL::Aff_transformation_3<R>& t)
217 {
218  typedef typename R::Aff_transformation_3_base RAff_transformation_3;
219  return is >> static_cast<const RAff_transformation_3&>(t);
220 }
221 #endif // NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_3
222 
224 
225 
226 #endif // CGAL_AFF_TRANSFORMATION_3_H
CGAL::Direction_3< R > operator()(const CGAL::Direction_3< R > &d) const
Aff_transformation_3(const CGAL::Aff_transformation_3< R > &t)
const NT & d
Aff_transformation_3(const Translation tag, const CGAL::Vector_3< R > &v)
Aff_transformation_3(const RT &m11, const RT &m12, const RT &m13, const RT &m14, const RT &m21, const RT &m22, const RT &m23, const RT &m24, const RT &m31, const RT &m32, const RT &m33, const RT &m34, const RT &w=RT(1))
CGAL::Aff_transformation_3< R > inverse() const
Aff_transformation_3(const Identity_transformation &tag)
double s
Definition: blastest.C:80
CGAL::Plane_3< R > transform(const CGAL::Plane_3< R > &pl) const
CGAL::Vector_3< R > operator()(const CGAL::Vector_3< R > &v) const
CGAL::Point_3< R > transform(const CGAL::Point_3< R > &p) const
CGAL::Plane_3< R > operator()(const CGAL::Plane_3< R > &pl) const
Aff_transformation_3(const RT &m11, const RT &m12, const RT &m13, const RT &m21, const RT &m22, const RT &m23, const RT &m31, const RT &m32, const RT &m33, const RT &w=RT(1))
*********************************************************************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
R::Aff_transformation_3_base RAff_transformation_3
Aff_transformation_3(const RAff_transformation_3 &t)
CGAL::Vector_3< R > transform(const CGAL::Vector_3< R > &v) const
Aff_transformation_3(const Scaling tag, const RT &s, const RT &w=RT(1))
FT cartesian(int i, int j) const
blockLoc i
Definition: read.cpp:79
CGAL::Direction_3< R > transform(const CGAL::Direction_3< R > &d) const
CGAL::Point_3< R > operator()(const CGAL::Point_3< R > &p) const
FT m(int i, int j) const
RT homogeneous(int i, int j) const
RT hm(int i, int j) const
j indices j
Definition: Indexing.h:6
#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::Aff_transformation_3< R > operator*(const CGAL::Aff_transformation_3< R > &t) const