#include <G4RTSteppingAction.hh>
Inheritance diagram for G4RTSteppingAction:
Public Member Functions | |
G4RTSteppingAction () | |
virtual | ~G4RTSteppingAction () |
virtual void | UserSteppingAction (const G4Step *) |
void | SetIgnoreTransparency (G4bool val) |
G4bool | GetIgnoreTransparency () const |
Definition at line 52 of file G4RTSteppingAction.hh.
G4RTSteppingAction::G4RTSteppingAction | ( | ) |
virtual G4RTSteppingAction::~G4RTSteppingAction | ( | ) | [inline, virtual] |
G4bool G4RTSteppingAction::GetIgnoreTransparency | ( | ) | const [inline] |
Definition at line 66 of file G4RTSteppingAction.hh.
Referenced by G4RTMessenger::GetCurrentValue().
void G4RTSteppingAction::SetIgnoreTransparency | ( | G4bool | val | ) | [inline] |
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 }