All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
caf::SRVector3D Class Reference

A 3-vector with more efficient storage than TVector3. More...

#include <SRVector3D.h>

Public Member Functions

 SRVector3D ()
 
virtual ~SRVector3D ()
 
 SRVector3D (float x, float y, float z)
 
 SRVector3D (const TVector3 &v)
 Easy conversion from TVector3. More...
 
void SetXYZ (float x, float y, float z)
 
 operator TVector3 () const
 Easy conversion back to TVector3. More...
 
void SetX (float _x)
 
void SetY (float _y)
 
void SetZ (float _z)
 
float X () const
 
float Y () const
 
float Z () const
 
float Mag2 () const
 
float Mag () const
 
float Dot (const SRVector3D &v) const
 
SRVector3D Unit () const
 

Public Attributes

float x
 
float y
 
float z
 

Detailed Description

A 3-vector with more efficient storage than TVector3.

Definition at line 16 of file SRVector3D.h.

Constructor & Destructor Documentation

caf::SRVector3D::SRVector3D ( )

Definition at line 12 of file SRVector3D.cxx.

12  :
13  x(std::numeric_limits<float>::signaling_NaN()),
14  y(std::numeric_limits<float>::signaling_NaN()),
15  z(std::numeric_limits<float>::signaling_NaN())
16  {
17  }
caf::SRVector3D::~SRVector3D ( )
virtual

Definition at line 29 of file SRVector3D.cxx.

30  {
31  }
caf::SRVector3D::SRVector3D ( float  x,
float  y,
float  z 
)

Definition at line 19 of file SRVector3D.cxx.

19  :
20  x(_x), y(_y), z(_z)
21  {
22  }
caf::SRVector3D::SRVector3D ( const TVector3 &  v)

Easy conversion from TVector3.

Definition at line 24 of file SRVector3D.cxx.

24  :
25  x(v.X()), y(v.Y()), z(v.Z())
26  {
27  }

Member Function Documentation

float caf::SRVector3D::Dot ( const SRVector3D v) const
inline

Definition at line 45 of file SRVector3D.h.

45 {return x*v.x + y*v.y + z*v.z;}
float caf::SRVector3D::Mag ( ) const
inline

Definition at line 44 of file SRVector3D.h.

44 {return sqrt(Mag2());}
float Mag2() const
Definition: SRVector3D.h:43
float caf::SRVector3D::Mag2 ( ) const
inline

Definition at line 43 of file SRVector3D.h.

43 {return x*x+y*y+z*z;}
caf::SRVector3D::operator TVector3 ( ) const

Easy conversion back to TVector3.

Definition at line 40 of file SRVector3D.cxx.

41  {
42  return TVector3(x, y, z);
43  }
void caf::SRVector3D::SetX ( float  _x)
inline

Definition at line 32 of file SRVector3D.h.

32 {x = _x;}
void caf::SRVector3D::SetXYZ ( float  x,
float  y,
float  z 
)

Definition at line 33 of file SRVector3D.cxx.

34  {
35  x = _x;
36  y = _y;
37  z = _z;
38  }
void caf::SRVector3D::SetY ( float  _y)
inline

Definition at line 33 of file SRVector3D.h.

33 {y = _y;}
void caf::SRVector3D::SetZ ( float  _z)
inline

Definition at line 34 of file SRVector3D.h.

34 {z = _z;}
SRVector3D caf::SRVector3D::Unit ( ) const
inline

Definition at line 46 of file SRVector3D.h.

47  {
48  const float m = Mag();
49  return SRVector3D(x/m, y/m, z/m);
50  }
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
float Mag() const
Definition: SRVector3D.h:44
float caf::SRVector3D::X ( ) const
inline

Definition at line 36 of file SRVector3D.h.

36 {return x;}
float caf::SRVector3D::Y ( ) const
inline

Definition at line 37 of file SRVector3D.h.

37 {return y;}
float caf::SRVector3D::Z ( ) const
inline

Definition at line 38 of file SRVector3D.h.

38 {return z;}

Member Data Documentation

float caf::SRVector3D::x

Definition at line 53 of file SRVector3D.h.

float caf::SRVector3D::y

Definition at line 54 of file SRVector3D.h.

float caf::SRVector3D::z

Definition at line 55 of file SRVector3D.h.


The documentation for this class was generated from the following files: