Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4TouchableHistory Class Reference

#include <G4TouchableHistory.hh>

Inheritance diagram for G4TouchableHistory:
G4VTouchable

Public Member Functions

 G4TouchableHistory (const G4NavigationHistory &history)
 
 G4TouchableHistory ()
 
 ~G4TouchableHistory ()
 
G4VPhysicalVolumeGetVolume (G4int depth=0) const
 
G4VSolidGetSolid (G4int depth=0) const
 
const G4ThreeVectorGetTranslation (G4int depth=0) const
 
const G4RotationMatrixGetRotation (G4int depth=0) const
 
G4int GetReplicaNumber (G4int depth=0) const
 
G4int GetHistoryDepth () const
 
G4int MoveUpHistory (G4int num_levels=1)
 
void UpdateYourself (G4VPhysicalVolume *pPhysVol, const G4NavigationHistory *history=0)
 
const G4NavigationHistoryGetHistory () const
 
voidoperator new (size_t)
 
void operator delete (void *aTH)
 
- Public Member Functions inherited from G4VTouchable
 G4VTouchable ()
 
virtual ~G4VTouchable ()
 
G4int GetCopyNumber (G4int depth=0) const
 

Detailed Description

Definition at line 53 of file G4TouchableHistory.hh.

Constructor & Destructor Documentation

G4TouchableHistory::G4TouchableHistory ( const G4NavigationHistory history)

Definition at line 47 of file G4TouchableHistory.cc.

References G4NavigationHistory::GetTopTransform(), and G4AffineTransform::Inverse().

48  : fhistory(history)
49 {
50  G4AffineTransform tf(fhistory.GetTopTransform().Inverse());
51  ftlate = tf.NetTranslation();
52  frot = tf.NetRotation();
53 }
G4AffineTransform Inverse() const
const G4AffineTransform & GetTopTransform() const
G4TouchableHistory::G4TouchableHistory ( )

Definition at line 38 of file G4TouchableHistory.cc.

References G4NavigationHistory::SetFirstEntry().

39  : frot(G4RotationMatrix()),
40  ftlate(G4ThreeVector(0.,0.,0.)),
41  fhistory()
42 {
43  G4VPhysicalVolume* pPhysVol=0;
44  fhistory.SetFirstEntry(pPhysVol);
45 }
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
void SetFirstEntry(G4VPhysicalVolume *pVol)
G4TouchableHistory::~G4TouchableHistory ( )

Definition at line 55 of file G4TouchableHistory.cc.

56 {
57 }

Member Function Documentation

const G4NavigationHistory* G4TouchableHistory::GetHistory ( ) const
inlinevirtual
G4int G4TouchableHistory::GetHistoryDepth ( ) const
inlinevirtual
G4int G4TouchableHistory::GetReplicaNumber ( G4int  depth = 0) const
inlinevirtual
const G4RotationMatrix * G4TouchableHistory::GetRotation ( G4int  depth = 0) const
virtual

Implements G4VTouchable.

Definition at line 80 of file G4TouchableHistory.cc.

References G4ThreadLocal, G4NavigationHistory::GetTransform(), and G4AffineTransform::NetRotation().

81 {
82  // The value returned will change at the next call
83  // Copy it if you want to use it!
84  //
85  static G4ThreadLocal G4RotationMatrix* rotM = 0;
86  if (!rotM ) { rotM = new G4RotationMatrix(); }
87 
88  if(depth==0)
89  {
90  return &frot;
91  }
92  else
93  {
94  *rotM = fhistory.GetTransform(CalculateHistoryIndex(depth)).NetRotation();
95  return rotM;
96  }
97 }
CLHEP::HepRotation G4RotationMatrix
#define G4ThreadLocal
Definition: tls.hh:52
G4RotationMatrix NetRotation() const
const G4AffineTransform & GetTransform(G4int n) const
G4VSolid* G4TouchableHistory::GetSolid ( G4int  depth = 0) const
inlinevirtual

Reimplemented from G4VTouchable.

const G4ThreeVector & G4TouchableHistory::GetTranslation ( G4int  depth = 0) const
virtual

Implements G4VTouchable.

Definition at line 60 of file G4TouchableHistory.cc.

References G4ThreadLocal, G4NavigationHistory::GetTransform(), and G4AffineTransform::NetTranslation().

61 {
62  // The value returned will change at the next call
63  // Copy it if you want to use it!
64  //
65  static G4ThreadLocal G4ThreeVector* ctrans = 0;
66  if ( !ctrans ) { ctrans = new G4ThreeVector; }
67  if(depth==0.0)
68  {
69  return ftlate;
70  }
71  else
72  {
73  *ctrans =
74  fhistory.GetTransform(CalculateHistoryIndex(depth)).NetTranslation();
75  return *ctrans;
76  }
77 }
CLHEP::Hep3Vector G4ThreeVector
G4ThreeVector NetTranslation() const
#define G4ThreadLocal
Definition: tls.hh:52
const G4AffineTransform & GetTransform(G4int n) const
G4VPhysicalVolume* G4TouchableHistory::GetVolume ( G4int  depth = 0) const
inlinevirtual
G4int G4TouchableHistory::MoveUpHistory ( G4int  num_levels = 1)
virtual
void G4TouchableHistory::operator delete ( void aTH)
inline
void* G4TouchableHistory::operator new ( size_t  )
inline
void G4TouchableHistory::UpdateYourself ( G4VPhysicalVolume pPhysVol,
const G4NavigationHistory history = 0 
)
virtual

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