Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Normal3D.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_NORMAL3D_H
15 #define HEP_NORMAL3D_H
16 
17 #include <iosfwd>
20 
21 namespace HepGeom {
22 
23  class Transform3D;
24 
33  template<class T>
34  class Normal3D : public BasicVector3D<T> {};
35 
42  template<>
43  class Normal3D<float> : public BasicVector3D<float> {
44  public:
47  Normal3D() {}
48 
51  Normal3D(float x1, float y1, float z1) : BasicVector3D<float>(x1,y1,z1) {}
52 
55  explicit Normal3D(const float * a)
56  : BasicVector3D<float>(a[0],a[1],a[2]) {}
57 
60  Normal3D(const Normal3D<float> & v) : BasicVector3D<float>(v) {}
61 
64  Normal3D(const BasicVector3D<float> & v) : BasicVector3D<float>(v) {}
65 
68  ~Normal3D() {}
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  Normal3D<float> & transform(const Transform3D & m);
85  };
86 
91  Normal3D<float>
92  operator*(const Transform3D & m, const Normal3D<float> & n);
93 
100  template<>
101  class Normal3D<double> : public BasicVector3D<double> {
102  public:
105  Normal3D() {}
106 
109  Normal3D(double x1, double y1, double z1) : BasicVector3D<double>(x1,y1,z1) {}
110 
113  explicit Normal3D(const float * a)
114  : BasicVector3D<double>(a[0],a[1],a[2]) {}
115 
118  explicit Normal3D(const double * a)
119  : BasicVector3D<double>(a[0],a[1],a[2]) {}
120 
123  Normal3D(const Normal3D<double> & v) : BasicVector3D<double>(v) {}
124 
127  Normal3D(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  Normal3D<double> & transform(const Transform3D & m);
173  };
174 
179  Normal3D<double>
180  operator*(const Transform3D & m, const Normal3D<double> & n);
181 
182 } /* namespace HepGeom */
183 
184 #endif /* HEP_NORMAL3D_H */
Normal3D(const double *a)
Definition: Normal3D.h:118
void set(T x1, T y1, T z1)
Normal3D(const BasicVector3D< float > &v)
Definition: Normal3D.h:127
Normal3D< float > & operator=(const Normal3D< float > &v)
Definition: Normal3D.h:72
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
Normal3D(double x1, double y1, double z1)
Definition: Normal3D.h:109
Normal3D(const BasicVector3D< double > &v)
Definition: Normal3D.h:131
Normal3D< double > & operator=(const BasicVector3D< float > &v)
Definition: Normal3D.h:160
Normal3D(const float *a)
Definition: Normal3D.h:55
static constexpr double m
Definition: G4SIunits.hh:129
Normal3D(const Normal3D< float > &v)
Definition: Normal3D.h:60
const G4int n
Normal3D< double > & operator=(const BasicVector3D< double > &v)
Definition: Normal3D.h:166
tuple v
Definition: test.py:18
Normal3D(const float *a)
Definition: Normal3D.h:113
Normal3D(const CLHEP::Hep3Vector &v)
Definition: Normal3D.h:142
Normal3D(const Normal3D< double > &v)
Definition: Normal3D.h:123
Normal3D(const BasicVector3D< float > &v)
Definition: Normal3D.h:64
Normal3D(float x1, float y1, float z1)
Definition: Normal3D.h:51
Normal3D< double > & operator=(const Normal3D< double > &v)
Definition: Normal3D.h:154
Normal3D< float > & operator=(const BasicVector3D< float > &v)
Definition: Normal3D.h:78
Normal3D< float > operator*(const Transform3D &m, const Normal3D< float > &v)
Definition: Normal3D.cc:24