Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Vector3D.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id:$
3 // ---------------------------------------------------------------------------
4 //
5 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
6 //
7 // History:
8 // 09.09.96 E.Chernyaev - initial version
9 // 12.06.01 E.Chernyaev - CLHEP-1.7: introduction of BasicVector3D to decouple
10 // the functionality from CLHEP::Hep3Vector
11 // 01.04.03 E.Chernyaev - CLHEP-1.9: template version
12 //
13 
14 #ifndef HEP_VECTOR3D_H
15 #define HEP_VECTOR3D_H
16 
17 #include <iosfwd>
20 
21 namespace HepGeom {
22 
23  class Transform3D;
24 
33  template<class T>
34  class Vector3D : public BasicVector3D<T> {};
35 
42  template<>
43  class Vector3D<float> : public BasicVector3D<float> {
44  public:
47  Vector3D() {}
48 
51  Vector3D(float x1, float y1, float z1) : BasicVector3D<float>(x1,y1,z1) {}
52 
55  explicit Vector3D(const float * a)
56  : BasicVector3D<float>(a[0],a[1],a[2]) {}
57 
60  Vector3D(const Vector3D<float> & v) : BasicVector3D<float>(v) {}
61 
64  Vector3D(const BasicVector3D<float> & v) : BasicVector3D<float>(v) {}
65 
68  ~Vector3D() {}
69 
73  set(v.x(),v.y(),v.z()); return *this;
74  }
75 
79  set(v.x(),v.y(),v.z()); return *this;
80  }
81 
84  Vector3D<float> & transform(const Transform3D & m);
85  };
86 
91  Vector3D<float>
92  operator*(const Transform3D & m, const Vector3D<float> & v);
93 
100  template<>
101  class Vector3D<double> : public BasicVector3D<double> {
102  public:
105  Vector3D() {}
106 
109  Vector3D(double x1, double y1, double z1) : BasicVector3D<double>(x1,y1,z1) {}
110 
113  explicit Vector3D(const float * a)
114  : BasicVector3D<double>(a[0],a[1],a[2]) {}
115 
118  explicit Vector3D(const double * a)
119  : BasicVector3D<double>(a[0],a[1],a[2]) {}
120 
123  Vector3D(const Vector3D<double> & v) : BasicVector3D<double>(v) {}
124 
127  Vector3D(const BasicVector3D<float> & v) : BasicVector3D<double>(v) {}
128 
132 
136 
143  : BasicVector3D<double>(v.x(),v.y(),v.z()) {}
144 
150  operator CLHEP::Hep3Vector () const { return CLHEP::Hep3Vector(x(),y(),z()); }
151 
155  set(v.x(),v.y(),v.z()); return *this;
156  }
157 
161  set(v.x(),v.y(),v.z()); return *this;
162  }
163 
167  set(v.x(),v.y(),v.z()); return *this;
168  }
169 
172  Vector3D<double> & transform(const Transform3D & m);
173  };
174 
179  Vector3D<double>
180  operator*(const Transform3D & m, const Vector3D<double> & v);
181 
182 } /* namespace HepGeom */
183 
184 #endif /* HEP_VECTOR3D_H */
Vector3D(const CLHEP::Hep3Vector &v)
Definition: Vector3D.h:142
void set(T x1, T y1, T z1)
Vector3D< double > & operator=(const Vector3D< double > &v)
Definition: Vector3D.h:154
Vector3D(const double *a)
Definition: Vector3D.h:118
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
Vector3D(const float *a)
Definition: Vector3D.h:55
Vector3D(const BasicVector3D< double > &v)
Definition: Vector3D.h:131
Vector3D< float > & operator=(const BasicVector3D< float > &v)
Definition: Vector3D.h:78
Vector3D(const Vector3D< double > &v)
Definition: Vector3D.h:123
Vector3D(double x1, double y1, double z1)
Definition: Vector3D.h:109
Vector3D(const float *a)
Definition: Vector3D.h:113
static constexpr double m
Definition: G4SIunits.hh:129
Vector3D< double > & operator=(const BasicVector3D< double > &v)
Definition: Vector3D.h:166
tuple v
Definition: test.py:18
Vector3D< float > & operator=(const Vector3D< float > &v)
Definition: Vector3D.h:72
Vector3D(const BasicVector3D< float > &v)
Definition: Vector3D.h:127
Vector3D(float x1, float y1, float z1)
Definition: Vector3D.h:51
Normal3D< float > operator*(const Transform3D &m, const Normal3D< float > &v)
Definition: Normal3D.cc:24
Vector3D< double > & operator=(const BasicVector3D< float > &v)
Definition: Vector3D.h:160
Vector3D(const BasicVector3D< float > &v)
Definition: Vector3D.h:64
Vector3D(const Vector3D< float > &v)
Definition: Vector3D.h:60