Geant4-11
Vector3D.h
Go to the documentation of this file.
1// -*- C++ -*-
2// ---------------------------------------------------------------------------
3//
4// This file is a part of the CLHEP - a Class Library for High Energy Physics.
5//
6// History:
7// 09.09.96 E.Chernyaev - initial version
8// 12.06.01 E.Chernyaev - CLHEP-1.7: introduction of BasicVector3D to decouple
9// the functionality from CLHEP::Hep3Vector
10// 01.04.03 E.Chernyaev - CLHEP-1.9: template version
11//
12
13#ifndef HEP_VECTOR3D_H
14#define HEP_VECTOR3D_H
15
16#include <iosfwd>
19
20namespace HepGeom {
21
22 class Transform3D;
23
32 template<class T>
33 class Vector3D : public BasicVector3D<T> {};
34
41 template<>
42 class Vector3D<float> : public BasicVector3D<float> {
43 public:
46 Vector3D() = default;
47
50 Vector3D(float x1, float y1, float z1) : BasicVector3D<float>(x1,y1,z1) {}
51
54 explicit Vector3D(const float * a)
55 : BasicVector3D<float>(a[0],a[1],a[2]) {}
56
59 Vector3D(const Vector3D<float> &) = default;
60
64
68
71 ~Vector3D() = default;
72
76
81 return *this;
82 }
83
87
91 };
92
98 operator*(const Transform3D & m, const Vector3D<float> & v);
99
106 template<>
107 class Vector3D<double> : public BasicVector3D<double> {
108 public:
111 Vector3D() = default;
112
115 Vector3D(double x1, double y1, double z1) : BasicVector3D<double>(x1,y1,z1) {}
116
119 explicit Vector3D(const float * a)
120 : BasicVector3D<double>(a[0],a[1],a[2]) {}
121
124 explicit Vector3D(const double * a)
125 : BasicVector3D<double>(a[0],a[1],a[2]) {}
126
129 Vector3D(const Vector3D<double> &) = default;
130
134
137 Vector3D(const BasicVector3D<float> & v) : BasicVector3D<double>(v) {}
138
142
145 ~Vector3D() = default;
146
153 : BasicVector3D<double>(v.x(),v.y(),v.z()) {}
154
160 operator CLHEP::Hep3Vector () const { return CLHEP::Hep3Vector(x(),y(),z()); }
161
165
170 return *this;
171 }
172
177 return *this;
178 }
179
183
187 };
188
194 operator*(const Transform3D & m, const Vector3D<double> & v);
195
196} /* namespace HepGeom */
197
198#endif /* HEP_VECTOR3D_H */
static constexpr double m
Definition: G4SIunits.hh:109
BasicVector3D< T > & operator=(const BasicVector3D< T > &)=default
Vector3D(const CLHEP::Hep3Vector &v)
Definition: Vector3D.h:152
Vector3D(Vector3D< double > &&)=default
Vector3D< double > & operator=(const Vector3D< double > &)=default
Vector3D(const BasicVector3D< double > &v)
Definition: Vector3D.h:141
Vector3D< double > & operator=(const BasicVector3D< float > &v)
Definition: Vector3D.h:168
Vector3D(const BasicVector3D< float > &v)
Definition: Vector3D.h:137
Vector3D< double > & operator=(Vector3D< double > &&)=default
Vector3D(const double *a)
Definition: Vector3D.h:124
Vector3D< double > & operator=(const BasicVector3D< double > &v)
Definition: Vector3D.h:175
Vector3D(const float *a)
Definition: Vector3D.h:119
Vector3D(double x1, double y1, double z1)
Definition: Vector3D.h:115
Vector3D(const Vector3D< double > &)=default
Vector3D(float x1, float y1, float z1)
Definition: Vector3D.h:50
Vector3D< float > & operator=(const BasicVector3D< float > &v)
Definition: Vector3D.h:79
Vector3D(const BasicVector3D< float > &v)
Definition: Vector3D.h:67
Vector3D< float > & operator=(Vector3D< float > &&)=default
Vector3D(const float *a)
Definition: Vector3D.h:54
Vector3D< float > & operator=(const Vector3D< float > &)=default
Vector3D(const Vector3D< float > &)=default
Vector3D(Vector3D< float > &&)=default
G4bool transform(G4String &input, const G4String &type)
Normal3D< float > operator*(const Transform3D &m, const Normal3D< float > &v)
Definition: Normal3D.cc:23