GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
CartesianCoordinateSystem.h
1 #ifndef CARTESIANCOORDINATESYSTEM_h
2 #define CARTESIANCOORDINATESYSTEM_h
3 
4 #include "ICoordinateSystem.h"
5 #include "CLHEP/Vector/Rotation.h"
6 
7 
8 namespace gear{
9 
12 
13 
14  public:
15 
16  CartesianCoordinateSystem( CLHEP::Hep3Vector T , CLHEP::HepRotation R ): _T(T), _R(R) {
17 
18  _R_inv = _R.inverse();
19 
20  }
21 
23  virtual CLHEP::Hep3Vector getLocalPoint( CLHEP::Hep3Vector globalPoint ) const;
24 
26  virtual CLHEP::Hep3Vector getGlobalPoint( CLHEP::Hep3Vector localPoint ) const;
27 
29  virtual CLHEP::Hep3Vector const* getOrigin() const { return &_T; }
30 
33  CLHEP::HepRotation const* getR() const { return &_R;}
34 
36  CLHEP::Hep3Vector getLocalXAxis(){ return _R * CLHEP::Hep3Vector(1,0,0); }
37  CLHEP::Hep3Vector getLocalYAxis(){ return _R * CLHEP::Hep3Vector(0,1,0); }
38  CLHEP::Hep3Vector getLocalZAxis(){ return _R * CLHEP::Hep3Vector(0,0,1); }
39 
40  private:
41 
43  CLHEP::Hep3Vector _T{};
44 
48  CLHEP::HepRotation _R{};
49  CLHEP::HepRotation _R_inv{};
50  };
51 
52 } // end of gear namespace
53 
54 #endif
55 
virtual CLHEP::Hep3Vector getGlobalPoint(CLHEP::Hep3Vector localPoint) const
Cartesian coordinate system class.
virtual CLHEP::Hep3Vector const * getOrigin() const
An abstract base class for coordinate systems.
virtual CLHEP::Hep3Vector getLocalPoint(CLHEP::Hep3Vector globalPoint) const
CLHEP::HepRotation const * getR() const