TransformerConstructor.cc
Go to the documentation of this file.
1 
10 #include <utl/TransformerConstructor.h>
11 #include <utl/CoordinateSystem.h>
12 #include <utl/Transformation.h>
13 #include <utl/Point.h>
14 #include <utl/Vector.h>
15 #include <utl/TransformationMatrix.h>
16 #include <boost/tuple/tuple.hpp>
17 
18 using namespace utl;
19 
20 
21 template<typename Policy>
24  const CoordinateSystemPtr& theCS)
25  : Policy(theTransformation, theCS)
26 {
27 }
28 
29 
30 template<typename Policy>
32 {
33 }
34 
35 
36 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
37  * Factory functions
38  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
39 
40 template<typename Policy>
41 typename Policy::type
44  const CoordinateSystemPtr& theCS)
45 {
46  return Policy::FromTransformation(theTrafo, theCS);
47 }
48 
49 
50 template<typename Policy>
51 typename Policy::type
53 Translation(const Vector& theTranslation,
54  const CoordinateSystemPtr& theCS)
55 {
56  double x, y, z;
57  boost::tie(x, y, z) = theTranslation.GetCoordinates(theCS);
59 
60  return Policy::FromTransformation(t, theCS);
61 }
62 
63 
64 template<typename Policy>
65 typename Policy::type
67 Rotation(const double angle,
68  const Vector& theAxis,
69  const CoordinateSystemPtr& theCS)
70 {
71  double x, y, z;
72  boost::tie(x, y, z) = theAxis.GetCoordinates(theCS);
74 
75  return Policy::FromTransformation(t, theCS);
76 }
77 
78 
79 template<typename Policy>
80 typename Policy::type
82 RotationX(const double angle, const CoordinateSystemPtr& theCS)
83 {
85 
86  return Policy::FromTransformation(t, theCS);
87 }
88 
89 
90 template<typename Policy>
91 typename Policy::type
93 RotationY(const double angle, const CoordinateSystemPtr& theCS)
94 {
96 
97  return Policy::FromTransformation(t, theCS);
98 }
99 
100 
101 template<typename Policy>
102 typename Policy::type
104 RotationZ(const double angle, const CoordinateSystemPtr& theCS)
105 {
107 
108  return Policy::FromTransformation(t, theCS);
109 }
110 
111 
112 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
113  * Template instantiations
114  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
115 
116 namespace utl {
120 };
121 
122 // Configure (x)emacs for this file ...
123 // Local Variables:
124 // mode:c++
125 // compile-command: "make -C .. -k"
126 // End:
static TransformationMatrix RotationX(const double angle)
Rotation by angle about X axis.
static Policy::type Rotation(const double angle, const Vector &theAxis, const CoordinateSystemPtr &theCS)
Construct from general rotation about axis.
Constructors for Transformer classes.
static TransformationMatrix Rotation(const double angle, const double x, const double y, const double z)
Rotation by angle about axis given by three components.
Transformations matrices for afine transformations.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
static TransformationMatrix Translation(const double x, const double y, const double z)
Translation.
static Policy::type RotationY(const double angle, const CoordinateSystemPtr &theCS)
Construct from rotation about Y axis.
TransformerConstructor(const TransformationMatrix &theTransformation, const CoordinateSystemPtr &theCS)
static Policy::type RotationZ(const double angle, const CoordinateSystemPtr &theCS)
Construct from rotation about Z axis.
static Policy::type Translation(const Vector &theTranslation, const CoordinateSystemPtr &theCS)
Construct from translation by vector.
Vector object.
Definition: Vector.h:30
static Policy::type FromTransformation(const TransformationMatrix &theTrafo, const CoordinateSystemPtr &theCS)
Construct from transformation matrix.
static TransformationMatrix RotationZ(const double angle)
Rotation by angle about Z axis.
~TransformerConstructor()
Destructor - should be virtual for base classes.
static Policy::type RotationX(const double angle, const CoordinateSystemPtr &theCS)
Construct from rotation about X axis.
static TransformationMatrix RotationY(const double angle)
Rotation by angle about Y axis.

, generated on Tue Sep 26 2023.