Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
HepGeom Namespace Reference

Classes

class  BasicVector3D
 
class  Normal3D
 
class  Normal3D< double >
 
class  Normal3D< float >
 
class  Plane3D
 
class  Point3D
 
class  Point3D< double >
 
class  Point3D< float >
 
class  Reflect3D
 
class  ReflectX3D
 
class  ReflectY3D
 
class  ReflectZ3D
 
class  Rotate3D
 
class  RotateX3D
 
class  RotateY3D
 
class  RotateZ3D
 
class  Scale3D
 
class  ScaleX3D
 
class  ScaleY3D
 
class  ScaleZ3D
 
class  Transform3D
 
class  Translate3D
 
class  TranslateX3D
 
class  TranslateY3D
 
class  TranslateZ3D
 
class  Vector3D
 
class  Vector3D< double >
 
class  Vector3D< float >
 

Function Documentation

◆ operator*() [1/6]

Normal3D< double > HepGeom::operator* ( const Transform3D m,
const Normal3D< double > &  v 
)
related

Definition at line 50 of file Normal3D.cc.

50 {
51 double vx = v.x(), vy = v.y(), vz = v.z();
52 double xx = m.xx(), xy = m.xy(), xz = m.xz();
53 double yx = m.yx(), yy = m.yy(), yz = m.yz();
54 double zx = m.zx(), zy = m.zy(), zz = m.zz();
55 return Normal3D<double>
56 ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
57 (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
58 (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
59 }
double zz() const
Definition: Transform3D.h:276
double yz() const
Definition: Transform3D.h:267
double xy() const
Definition: Transform3D.h:255
double zx() const
Definition: Transform3D.h:270
double yx() const
Definition: Transform3D.h:261
double zy() const
Definition: Transform3D.h:273
double xx() const
Definition: Transform3D.h:252
double yy() const
Definition: Transform3D.h:264
double xz() const
Definition: Transform3D.h:258

◆ operator*() [2/6]

Normal3D< float > HepGeom::operator* ( const Transform3D m,
const Normal3D< float > &  v 
)
related

Definition at line 24 of file Normal3D.cc.

24 {
25 double vx = v.x(), vy = v.y(), vz = v.z();
26 double xx = m.xx(), xy = m.xy(), xz = m.xz();
27 double yx = m.yx(), yy = m.yy(), yz = m.yz();
28 double zx = m.zx(), zy = m.zy(), zz = m.zz();
29 return Normal3D<float>
30 ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
31 (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
32 (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
33 }

◆ operator*() [3/6]

Point3D< double > HepGeom::operator* ( const Transform3D m,
const Point3D< double > &  v 
)
related

Definition at line 41 of file Point3D.cc.

41 {
42 double vx = v.x(), vy = v.y(), vz = v.z();
43 return Point3D<double>
44 (m.xx()*vx + m.xy()*vy + m.xz()*vz + m.dx(),
45 m.yx()*vx + m.yy()*vy + m.yz()*vz + m.dy(),
46 m.zx()*vx + m.zy()*vy + m.zz()*vz + m.dz());
47 }
double dy() const
Definition: Transform3D.h:282
double dz() const
Definition: Transform3D.h:285
double dx() const
Definition: Transform3D.h:279

◆ operator*() [4/6]

Point3D< float > HepGeom::operator* ( const Transform3D m,
const Point3D< float > &  v 
)
related

Definition at line 21 of file Point3D.cc.

21 {
22 double vx = v.x(), vy = v.y(), vz = v.z();
23 return Point3D<float>
24 (m.xx()*vx + m.xy()*vy + m.xz()*vz + m.dx(),
25 m.yx()*vx + m.yy()*vy + m.yz()*vz + m.dy(),
26 m.zx()*vx + m.zy()*vy + m.zz()*vz + m.dz());
27 }

◆ operator*() [5/6]

Vector3D< double > HepGeom::operator* ( const Transform3D m,
const Vector3D< double > &  v 
)
related

Definition at line 41 of file Vector3D.cc.

41 {
42 double vx = v.x(), vy = v.y(), vz = v.z();
43 return Vector3D<double>
44 (m.xx()*vx + m.xy()*vy + m.xz()*vz,
45 m.yx()*vx + m.yy()*vy + m.yz()*vz,
46 m.zx()*vx + m.zy()*vy + m.zz()*vz);
47 }

◆ operator*() [6/6]

Vector3D< float > HepGeom::operator* ( const Transform3D m,
const Vector3D< float > &  v 
)
related

Definition at line 21 of file Vector3D.cc.

21 {
22 double vx = v.x(), vy = v.y(), vz = v.z();
23 return Vector3D<float>
24 (m.xx()*vx + m.xy()*vy + m.xz()*vz,
25 m.yx()*vx + m.yy()*vy + m.yz()*vz,
26 m.zx()*vx + m.zy()*vy + m.zz()*vz);
27 }

◆ operator<<() [1/4]

std::ostream & HepGeom::operator<< ( std::ostream &  os,
const BasicVector3D< double > &  a 
)
related

Definition at line 262 of file BasicVector3D.cc.

264 {
265 return os << "(" << a.x() << "," << a.y() << "," << a.z() << ")";
266 }

◆ operator<<() [2/4]

std::ostream & HepGeom::operator<< ( std::ostream &  os,
const BasicVector3D< float > &  a 
)
related

Definition at line 106 of file BasicVector3D.cc.

108 {
109 return os << "(" << a.x() << "," << a.y() << "," << a.z() << ")";
110 }

◆ operator<<() [3/4]

std::ostream & HepGeom::operator<< ( std::ostream &  os,
const Plane3D< double > &  p 
)
related

Definition at line 28 of file Plane3D.cc.

29 {
30 return os
31 << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
32 }
T d() const
Definition: Plane3D.h:86
T b() const
Definition: Plane3D.h:80
T c() const
Definition: Plane3D.h:83
T a() const
Definition: Plane3D.h:77

◆ operator<<() [4/4]

std::ostream & HepGeom::operator<< ( std::ostream &  os,
const Plane3D< float > &  p 
)
related

Definition at line 21 of file Plane3D.cc.

22 {
23 return os
24 << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
25 }

◆ operator>>() [1/2]

std::istream & HepGeom::operator>> ( std::istream &  is,
BasicVector3D< double > &  a 
)
related

Definition at line 270 of file BasicVector3D.cc.

271 {
272 // Required format is ( a, b, c ) that is, three numbers, preceded by
273 // (, followed by ), and separated by commas. The three numbers are
274 // taken as x, y, z.
275
276 double x, y, z;
277 char c;
278
279 is >> std::ws >> c;
280 // ws is defined to invoke eatwhite(istream & )
281 // see (Stroustrup gray book) page 333 and 345.
282 if (is.fail() || c != '(' ) {
283 std::cerr
284 << "Could not find required opening parenthesis "
285 << "in input of a BasicVector3D<double>"
286 << std::endl;
287 return is;
288 }
289
290 is >> x >> std::ws >> c;
291 if (is.fail() || c != ',' ) {
292 std::cerr
293 << "Could not find x value and required trailing comma "
294 << "in input of a BasicVector3D<double>"
295 << std::endl;
296 return is;
297 }
298
299 is >> y >> std::ws >> c;
300 if (is.fail() || c != ',' ) {
301 std::cerr
302 << "Could not find y value and required trailing comma "
303 << "in input of a BasicVector3D<double>"
304 << std::endl;
305 return is;
306 }
307
308 is >> z >> std::ws >> c;
309 if (is.fail() || c != ')' ) {
310 std::cerr
311 << "Could not find z value and required close parenthesis "
312 << "in input of a BasicVector3D<double>"
313 << std::endl;
314 return is;
315 }
316
317 a.setX(x);
318 a.setY(y);
319 a.setZ(z);
320 return is;
321 }

◆ operator>>() [2/2]

std::istream & HepGeom::operator>> ( std::istream &  is,
BasicVector3D< float > &  a 
)
related

Definition at line 114 of file BasicVector3D.cc.

115 {
116 // Required format is ( a, b, c ) that is, three numbers, preceded by
117 // (, followed by ), and separated by commas. The three numbers are
118 // taken as x, y, z.
119
120 float x, y, z;
121 char c;
122
123 is >> std::ws >> c;
124 // ws is defined to invoke eatwhite(istream & )
125 // see (Stroustrup gray book) page 333 and 345.
126 if (is.fail() || c != '(' ) {
127 std::cerr
128 << "Could not find required opening parenthesis "
129 << "in input of a BasicVector3D<float>"
130 << std::endl;
131 return is;
132 }
133
134 is >> x >> std::ws >> c;
135 if (is.fail() || c != ',' ) {
136 std::cerr
137 << "Could not find x value and required trailing comma "
138 << "in input of a BasicVector3D<float>"
139 << std::endl;
140 return is;
141 }
142
143 is >> y >> std::ws >> c;
144 if (is.fail() || c != ',' ) {
145 std::cerr
146 << "Could not find y value and required trailing comma "
147 << "in input of a BasicVector3D<float>"
148 << std::endl;
149 return is;
150 }
151
152 is >> z >> std::ws >> c;
153 if (is.fail() || c != ')' ) {
154 std::cerr
155 << "Could not find z value and required close parenthesis "
156 << "in input of a BasicVector3D<float>"
157 << std::endl;
158 return is;
159 }
160
161 a.setX(x);
162 a.setY(y);
163 a.setZ(z);
164 return is;
165 }