Transformation.cc
Go to the documentation of this file.
1 
9 #include <utl/config.h>
10 #include <utl/Transformation.h>
11 #include <CLHEP/Geometry/Transform3D.h>
12 #include <utl/Point.h>
13 #include <utl/Vector.h>
14 #include <utl/AxialVector.h>
15 
16 using namespace utl;
17 
18 
20  : fTransformation(),
21  fCoordinateSystem(CoordinateSystem::GetRootCoordinateSystem())
22 {
23 }
24 
25 
27  const CoordinateSystemPtr& theCoordinateSystem)
28  : fTransformation(theMatrix),
29  fCoordinateSystem(theCoordinateSystem)
30 {
31 }
32 
33 
36  const CoordinateSystemPtr& theCS)
37 {
38  return Transformation(theTrafo, theCS);
39 }
40 
41 
42 void
44  const
45 {
46  HepGeom::Transform3D t(fCoordinateSystem->GetTransformationTo(newCoordinateSystem).fTransform);
47  HepGeom::Transform3D tInv(fCoordinateSystem->GetInverseTransformationTo(newCoordinateSystem).fTransform);
48 
49  fTransformation = t * fTransformation * tInv;
50  fCoordinateSystem = newCoordinateSystem;
51 }
52 
53 
54 double
56  const
57 {
58  theTransformation.TransformTo(fCoordinateSystem);
59  return fTransformation.Distance(theTransformation.fTransformation);
60 }
61 
62 
63 template<typename V>
64 V
66  const
67 {
68  rhs.TransformTo(fCoordinateSystem);
69  return V(fTransformation.fTransform * rhs.fVector,
71 }
72 
73 
74 template
75 Point
76 TransformationPolicy::operator*<Point>(const Point&) const;
77 
78 template
79 Vector
80 TransformationPolicy::operator*<Vector>(const Vector&) const;
81 
82 template
84 TransformationPolicy::operator*<AxialVector>(const AxialVector&) const;
85 
86 
89 {
90  rhs.TransformTo(fCoordinateSystem);
92  return *this;
93 }
94 
95 
96 // Configure (x)emacs for this file ...
97 // Local Variables:
98 // mode:c++
99 // compile-command: "make -C .. -k"
100 // End:
constexpr double V
Definition: AugerUnits.h:233
Point object.
Definition: Point.h:32
TransformerConstructor< TransformationPolicy > Transformation
TransformationPolicy & operator*=(const TransformationPolicy &rhs)
Constructors for Transformer classes.
CoordinateSystemPtr fCoordinateSystem
TransformationMatrix fTransformation
Transformations matrices for afine transformations.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
double Distance(const TransformationMatrix &second) const
Distance between transformations (useful for testing)
static type FromTransformation(const TransformationMatrix &theTrafo, const CoordinateSystemPtr &theCS)
Generic factory for post-processing.
double Distance(const TransformationPolicy &theTransformation) const
Metric on space of transformations.
TransformationPolicy()
The default constructor creates the id in the root coordinate system.
void UncheckedTransformTo(const CoordinateSystemPtr &newCoordinateSystem) const
Vector object.
Definition: Vector.h:30
V operator*(const V &rhs) const
AxialVector object.
Definition: AxialVector.h:30
InternalTransform fTransform
The concrete transformation object.

, generated on Tue Sep 26 2023.