G4RTSteppingAction Class Reference

#include <G4RTSteppingAction.hh>

Inheritance diagram for G4RTSteppingAction:

G4UserSteppingAction

Public Member Functions

 G4RTSteppingAction ()
virtual ~G4RTSteppingAction ()
virtual void UserSteppingAction (const G4Step *)
void SetIgnoreTransparency (G4bool val)
G4bool GetIgnoreTransparency () const

Detailed Description

Definition at line 52 of file G4RTSteppingAction.hh.


Constructor & Destructor Documentation

G4RTSteppingAction::G4RTSteppingAction (  ) 

Definition at line 43 of file G4RTSteppingAction.cc.

00044 {
00045   ignoreTransparency=false;
00046 }

virtual G4RTSteppingAction::~G4RTSteppingAction (  )  [inline, virtual]

Definition at line 56 of file G4RTSteppingAction.hh.

00056 {;}


Member Function Documentation

G4bool G4RTSteppingAction::GetIgnoreTransparency (  )  const [inline]

Definition at line 66 of file G4RTSteppingAction.hh.

Referenced by G4RTMessenger::GetCurrentValue().

00067     { return ignoreTransparency; }

void G4RTSteppingAction::SetIgnoreTransparency ( G4bool  val  )  [inline]

Definition at line 64 of file G4RTSteppingAction.hh.

Referenced by G4RTMessenger::SetNewValue().

00065     { ignoreTransparency = val; }

void G4RTSteppingAction::UserSteppingAction ( const G4Step  )  [virtual]

Reimplemented from G4UserSteppingAction.

Definition at line 48 of file G4RTSteppingAction.cc.

References fStopAndKill, G4VViewer::GetApplicableVisAttributes(), G4VisAttributes::GetColour(), G4VisManager::GetCurrentViewer(), G4VisAttributes::GetForcedDrawingStyle(), G4VPhysicalVolume::GetLogicalVolume(), G4StepPoint::GetPhysicalVolume(), G4VisAttributes::IsForceDrawingStyle(), G4VisAttributes::IsVisible(), and G4VisAttributes::wireframe.

00049 {
00050   // Stop the ray particle if it reaches to the coloured volume with its alpha = 1
00051   // or coloured volume and the user request to ignore transparency
00052 
00053   G4StepPoint* fpStepPoint = aStep -> GetPostStepPoint();
00054   G4VPhysicalVolume* postVolume_phys=fpStepPoint->GetPhysicalVolume();
00055 
00056   if(!postVolume_phys) return;   // Reach to out of the world
00057 
00058   const G4LogicalVolume* postVolume_log = postVolume_phys->GetLogicalVolume();
00059   const G4VisAttributes* postVisAtt = postVolume_log -> GetVisAttributes();
00060   G4VisManager* visManager = G4VisManager::GetInstance();
00061   if(visManager) {
00062     G4VViewer* viewer = visManager->GetCurrentViewer();
00063     if (viewer) {
00064       postVisAtt = viewer->GetApplicableVisAttributes(postVisAtt);
00065     }
00066   }
00067   if((!postVisAtt) || (!(postVisAtt->IsVisible()))) return; // Invisible volume, continue tracking
00068 
00069   if((postVisAtt->IsForceDrawingStyle())
00070     &&(postVisAtt->GetForcedDrawingStyle()==G4VisAttributes::wireframe)) return;
00071                                           // Wire frame volume, continue tracking
00072 
00073   G4double postAlpha=(postVisAtt->GetColour()).GetAlpha();
00074 
00075   if(postAlpha==1.0 || ignoreTransparency) // Stop stepping
00076   { 
00077     G4Track* currentTrack = aStep -> GetTrack();
00078     currentTrack -> SetTrackStatus(fStopAndKill);
00079   }
00080 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:19 2013 for Geant4 by  doxygen 1.4.7