Geant4-11
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Static Private Attributes | Friends
G4TheMTRayTracer Class Reference

#include <G4TheMTRayTracer.hh>

Inheritance diagram for G4TheMTRayTracer:
G4TheRayTracer

Public Member Functions

 G4TheMTRayTracer (G4VFigureFileMaker *figMaker=0, G4VRTScanner *scanner=0)
 
G4double GetAttenuationLength () const
 
G4Colour GetBackgroundColour () const
 
G4bool GetDistortion () const
 
G4ThreeVector GetEyePosition () const
 
G4VFigureFileMaker * GetFigureFileMaker ()
 
G4double GetHeadAngle () const
 
G4ThreeVector GetLightDirection () const
 
G4int GetNColumn () const
 
G4int GetNRow () const
 
G4VRTScanner * GetScanner ()
 
G4ThreeVector GetTargetPosition () const
 
G4ThreeVector GetUpVector () const
 
G4double GetViewSpan () const
 
void SetAttenuationLength (G4double val)
 
void SetBackgroundColour (const G4Colour &val)
 
void SetDistortion (G4bool val)
 
void SetEyePosition (const G4ThreeVector &val)
 
void SetFigureFileMaker (G4VFigureFileMaker *figMaker)
 
void SetHeadAngle (G4double val)
 
void SetLightDirection (const G4ThreeVector &val)
 
void SetNColumn (G4int val)
 
void SetNRow (G4int val)
 
void SetScanner (G4VRTScanner *scanner)
 
void SetTargetPosition (const G4ThreeVector &val)
 
void SetUpVector (const G4ThreeVector &val)
 
void SetViewSpan (G4double val)
 
virtual void Trace (const G4String &fileName)
 
virtual ~G4TheMTRayTracer ()
 

Static Public Member Functions

static G4TheMTRayTracer * Instance ()
 
static G4TheMTRayTracer * Instance (G4VFigureFileMaker *figMaker, G4VRTScanner *scanner)
 

Protected Member Functions

G4Colour Attenuate (G4RayTrajectoryPoint *point, const G4Colour &sourceCol)
 
virtual G4bool CreateBitMap ()
 
void CreateFigureFile (const G4String &fileName)
 
G4bool GenerateColour (G4Event *anEvent)
 
G4Colour GetMixedColour (const G4Colour &surfCol, const G4Colour &transCol, G4double weight=0.5)
 
G4Colour GetSurfaceColour (G4RayTrajectoryPoint *point)
 
virtual void RestoreUserActions ()
 
virtual void StoreUserActions ()
 
G4bool ValidColour (const G4VisAttributes *visAtt)
 

Protected Attributes

G4bool antialiasingOn
 
G4double attenuationLength
 
G4Colour backgroundColour
 
unsigned char * colorB
 
unsigned char * colorG
 
unsigned char * colorR
 
G4bool distortionOn
 
G4ThreeVector eyeDirection
 
G4ThreeVector eyePosition
 
G4double headAngle
 
G4ThreeVector lightDirection
 
G4int nColumn
 
G4int nRow
 
G4Colour rayColour
 
G4ThreeVector targetPosition
 
G4EventManager * theEventManager
 
G4RTMessenger * theMessenger
 
G4RayShooter * theRayShooter
 
G4UserEventAction * theRayTracerEventAction
 
G4UserStackingAction * theRayTracerStackingAction
 
G4RTSteppingAction * theRayTracerSteppingAction
 
G4RTTrackingAction * theRayTracerTrackingAction
 
G4RTRunAction * theRTRunAction
 
G4RTWorkerInitialization * theRTWorkerInitialization
 
G4UserEventAction * theUserEventAction
 
const G4UserRunAction * theUserRunAction
 
G4UserStackingAction * theUserStackingAction
 
G4UserSteppingAction * theUserSteppingAction
 
G4UserTrackingAction * theUserTrackingAction
 
const G4UserWorkerInitialization * theUserWorkerInitialization
 
G4ThreeVector up
 
G4double viewSpan
 

Static Protected Attributes

static G4VFigureFileMaker * theFigMaker = 0
 
static G4VRTScanner * theScanner = 0
 

Static Private Attributes

static G4TheMTRayTracer * theInstance = nullptr
 

Friends

class G4RayTracerViewer
 
class G4RTPrimaryGeneratorAction
 
class G4RTRun
 

Detailed Description

Definition at line 70 of file G4TheMTRayTracer.hh.

Constructor & Destructor Documentation

◆ G4TheMTRayTracer()

G4TheMTRayTracer::G4TheMTRayTracer ( G4VFigureFileMaker *  figMaker = 0,
G4VRTScanner *  scanner = 0 
)

Definition at line 51 of file G4TheMTRayTracer.cc.

53: G4TheRayTracer(figMaker,scanner)
54{
55 if(!theInstance)
56 { theInstance = this; }
57 else
58 { G4Exception("G4TheMTRayTracer::G4TheMTRayTracer","VisRayTracer00100",
59 FatalException,"G4TheMTRayTracer has to be a singleton.");}
64}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
G4RTWorkerInitialization * theRTWorkerInitialization
const G4UserWorkerInitialization * theUserWorkerInitialization
const G4UserRunAction * theUserRunAction
G4RTRunAction * theRTRunAction
static G4TheMTRayTracer * theInstance
G4TheRayTracer(G4VFigureFileMaker *figMaker=0, G4VRTScanner *scanner=0)

References FatalException, G4Exception(), theInstance, theRTRunAction, theRTWorkerInitialization, theUserRunAction, and theUserWorkerInitialization.

Referenced by Instance().

◆ ~G4TheMTRayTracer()

G4TheMTRayTracer::~G4TheMTRayTracer ( )
virtual

Definition at line 83 of file G4TheMTRayTracer.cc.

84{
86 {
89 }
91 {
92 delete theRTRunAction;
94 }
95}

References theRTRunAction, and theRTWorkerInitialization.

Member Function Documentation

◆ Attenuate()

G4Colour G4TheRayTracer::Attenuate ( G4RayTrajectoryPoint *  point,
const G4Colour &  sourceCol 
)
protectedinherited

Definition at line 394 of file G4TheRayTracer.cc.

396{
397 const G4VisAttributes* preAtt = point->GetPreStepAtt();
398
399 G4bool visible = ValidColour(preAtt);
400 if(!visible) return sourceCol;
401
402 G4Colour objCol = preAtt->GetColour();
403 G4double stepRed = objCol.GetRed();
404 G4double stepGreen = objCol.GetGreen();
405 G4double stepBlue = objCol.GetBlue();
406 G4double stepAlpha = objCol.GetAlpha();
407 G4double stepLength = point->GetStepLength();
408
409 G4double attenuationFuctor;
410 if(stepAlpha > 0.9999999){ stepAlpha = 0.9999999; } // patch to the next line
411 attenuationFuctor = -stepAlpha/(1.0-stepAlpha)*stepLength/attenuationLength;
412
413 G4double KtRed = std::exp((1.0-stepRed)*attenuationFuctor);
414 G4double KtGreen = std::exp((1.0-stepGreen)*attenuationFuctor);
415 G4double KtBlue = std::exp((1.0-stepBlue)*attenuationFuctor);
416 if(KtRed>1.0){KtRed=1.0;}
417 if(KtGreen>1.0){KtGreen=1.0;}
418 if(KtBlue>1.0){KtBlue=1.0;}
419 return G4Colour(sourceCol.GetRed()*KtRed,
420 sourceCol.GetGreen()*KtGreen,sourceCol.GetBlue()*KtBlue);
421}
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
G4double GetBlue() const
Definition: G4Colour.hh:154
G4double GetAlpha() const
Definition: G4Colour.hh:155
G4double GetRed() const
Definition: G4Colour.hh:152
G4double GetGreen() const
Definition: G4Colour.hh:153
G4double GetStepLength() const
const G4VisAttributes * GetPreStepAtt() const
G4double attenuationLength
G4bool ValidColour(const G4VisAttributes *visAtt)
const G4Colour & GetColour() const

References G4TheRayTracer::attenuationLength, G4Colour::GetAlpha(), G4Colour::GetBlue(), G4VisAttributes::GetColour(), G4Colour::GetGreen(), G4RayTrajectoryPoint::GetPreStepAtt(), G4Colour::GetRed(), G4RayTrajectoryPoint::GetStepLength(), and G4TheRayTracer::ValidColour().

Referenced by G4TheRayTracer::GenerateColour().

◆ CreateBitMap()

G4bool G4TheMTRayTracer::CreateBitMap ( )
protectedvirtual

Reimplemented from G4TheRayTracer.

Definition at line 170 of file G4TheMTRayTracer.cc.

171{
173 visMan->IgnoreStateChanges(true);
175
177
178 // Keep, then switch off any printing requests
179 auto runVerbosity = mrm->GetVerboseLevel();
180 auto runPrintProgress = mrm->GetPrintProgress();
181 G4UImanager::GetUIpointer()->ApplyCommand("/run/verbose 0");
182 G4UImanager::GetUIpointer()->ApplyCommand("/run/printProgress 0");
183
184 // Event loop
185 G4int nEvent = nRow*nColumn;
188 G4String str = "/run/beamOn " + G4UIcommand::ConvertToString(nEvent);
190
191 // Restore printing requests
192 str = "/run/verbose " + G4UIcommand::ConvertToString(runVerbosity);
194 str = "/run/printProgress " + G4UIcommand::ConvertToString(runPrintProgress);
196
198 visMan->IgnoreStateChanges(false);
199
200 const G4RTRun* theRun = static_cast<const G4RTRun*>(mrm->GetCurrentRun());
201 if(!theRun) return false;
202
203 G4THitsMap<G4Colour>* colMap = theRun->GetMap();
204 auto itr = colMap->GetMap()->cbegin();
205 for(;itr!=colMap->GetMap()->cend();++itr)
206 {
207 G4int key = itr->first;
208 G4Colour* col = itr->second;
209 colorR[key] = (unsigned char)(G4int(255*col->GetRed()));
210 colorG[key] = (unsigned char)(G4int(255*col->GetGreen()));
211 colorB[key] = (unsigned char)(G4int(255*col->GetBlue()));
212 }
213
215 G4int iRow, iColumn;
216 while (theScanner->Coords(iRow,iColumn))
217 {
218 G4int iCoord = iRow * nColumn + iColumn;
219 theScanner->Draw(colorR[iCoord],colorG[iCoord],colorB[iCoord]);
220 }
221
222 return true;
223}
int G4int
Definition: G4Types.hh:85
G4THitsMap< G4Colour > * GetMap() const
Definition: G4RTRun.hh:63
static G4MTRunManager * GetMTMasterRunManager()
const G4Run * GetCurrentRun() const
G4int GetPrintProgress()
G4int GetVerboseLevel() const
virtual void StoreUserActions()
virtual void RestoreUserActions()
static G4VRTScanner * theScanner
unsigned char * colorG
unsigned char * colorR
unsigned char * colorB
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:445
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:485
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
virtual void Initialize(G4int nRow, G4int nColumn)=0
virtual void Draw(unsigned char red, unsigned char green, unsigned char blue)
Definition: G4VRTScanner.hh:70
virtual G4bool Coords(G4int &iRow, G4int &iColumn)=0
Map_t * GetMap() const
Definition: G4THitsMap.hh:155
virtual void IgnoreStateChanges(G4bool)
static G4VVisManager * GetConcreteInstance()

References G4UImanager::ApplyCommand(), G4TheRayTracer::colorB, G4TheRayTracer::colorG, G4TheRayTracer::colorR, G4UIcommand::ConvertToString(), G4VRTScanner::Coords(), G4VRTScanner::Draw(), G4Colour::GetBlue(), G4VVisManager::GetConcreteInstance(), G4RunManager::GetCurrentRun(), G4Colour::GetGreen(), G4VTHitsMap< T, Map_t >::GetMap(), G4RTRun::GetMap(), G4RunManagerFactory::GetMTMasterRunManager(), G4RunManager::GetPrintProgress(), G4Colour::GetRed(), G4UImanager::GetUIpointer(), G4RunManager::GetVerboseLevel(), G4VVisManager::IgnoreStateChanges(), G4VRTScanner::Initialize(), G4TheRayTracer::nColumn, G4TheRayTracer::nRow, RestoreUserActions(), StoreUserActions(), and G4TheRayTracer::theScanner.

Referenced by Trace().

◆ CreateFigureFile()

void G4TheRayTracer::CreateFigureFile ( const G4String &  fileName)
protectedinherited

Definition at line 302 of file G4TheRayTracer.cc.

303{
304 //G4cout << nColumn << " " << nRow << G4endl;
306}
static G4VFigureFileMaker * theFigMaker
virtual void CreateFigureFile(const G4String &fileName, int nColumn, int nRow, unsigned char *colorR, unsigned char *colorG, unsigned char *colorB)=0

References G4TheRayTracer::colorB, G4TheRayTracer::colorG, G4TheRayTracer::colorR, G4VFigureFileMaker::CreateFigureFile(), G4TheRayTracer::nColumn, G4TheRayTracer::nRow, and G4TheRayTracer::theFigMaker.

Referenced by Trace(), and G4TheRayTracer::Trace().

◆ GenerateColour()

G4bool G4TheRayTracer::GenerateColour ( G4Event *  anEvent)
protectedinherited

Definition at line 308 of file G4TheRayTracer.cc.

309{
310 G4TrajectoryContainer * trajectoryContainer = anEvent->GetTrajectoryContainer();
311
312 G4RayTrajectory* trajectory = (G4RayTrajectory*)( (*trajectoryContainer)[0] );
313 if(!trajectory) return false;
314
315 G4int nPoint = trajectory->GetPointEntries();
316 if(nPoint==0) return false;
317
318 G4Colour initialColour(backgroundColour);
319 if( trajectory->GetPointC(nPoint-1)->GetPostStepAtt() )
320 { initialColour = GetSurfaceColour(trajectory->GetPointC(nPoint-1)); }
321 rayColour = Attenuate(trajectory->GetPointC(nPoint-1),initialColour);
322
323 for(G4int i=nPoint-2;i>=0;--i)
324 {
325 G4Colour surfaceColour = GetSurfaceColour(trajectory->GetPointC(i));
326 G4double weight = 1.0 - surfaceColour.GetAlpha();
327 G4Colour mixedColour = GetMixedColour(rayColour,surfaceColour,weight);
328 rayColour = Attenuate(trajectory->GetPointC(i),mixedColour);
329 }
330
331 return true;
332}
G4TrajectoryContainer * GetTrajectoryContainer() const
Definition: G4Event.hh:160
const G4VisAttributes * GetPostStepAtt() const
virtual int GetPointEntries() const
G4RayTrajectoryPoint * GetPointC(G4int i) const
G4Colour Attenuate(G4RayTrajectoryPoint *point, const G4Colour &sourceCol)
G4Colour backgroundColour
G4Colour GetSurfaceColour(G4RayTrajectoryPoint *point)
G4Colour GetMixedColour(const G4Colour &surfCol, const G4Colour &transCol, G4double weight=0.5)

References G4TheRayTracer::Attenuate(), G4TheRayTracer::backgroundColour, G4Colour::GetAlpha(), G4TheRayTracer::GetMixedColour(), G4RayTrajectory::GetPointC(), G4RayTrajectory::GetPointEntries(), G4RayTrajectoryPoint::GetPostStepAtt(), G4TheRayTracer::GetSurfaceColour(), G4Event::GetTrajectoryContainer(), and G4TheRayTracer::rayColour.

Referenced by G4TheRayTracer::CreateBitMap().

◆ GetAttenuationLength()

G4double G4TheRayTracer::GetAttenuationLength ( ) const
inlineinherited

Definition at line 181 of file G4TheRayTracer.hh.

181{ return attenuationLength; }

References G4TheRayTracer::attenuationLength.

Referenced by G4RTMessenger::GetCurrentValue().

◆ GetBackgroundColour()

G4Colour G4TheRayTracer::GetBackgroundColour ( ) const
inlineinherited

Definition at line 185 of file G4TheRayTracer.hh.

185{ return backgroundColour; }

References G4TheRayTracer::backgroundColour.

Referenced by G4RTMessenger::GetCurrentValue().

◆ GetDistortion()

G4bool G4TheRayTracer::GetDistortion ( ) const
inlineinherited

Definition at line 183 of file G4TheRayTracer.hh.

183{ return distortionOn; }

References G4TheRayTracer::distortionOn.

Referenced by G4RTMessenger::GetCurrentValue().

◆ GetEyePosition()

G4ThreeVector G4TheRayTracer::GetEyePosition ( ) const
inlineinherited

Definition at line 169 of file G4TheRayTracer.hh.

169{ return eyePosition; }
G4ThreeVector eyePosition

References G4TheRayTracer::eyePosition.

Referenced by G4RTMessenger::GetCurrentValue().

◆ GetFigureFileMaker()

G4VFigureFileMaker * G4TheRayTracer::GetFigureFileMaker ( )
inlineinherited

Definition at line 116 of file G4TheRayTracer.hh.

116{return theFigMaker;}

References G4TheRayTracer::theFigMaker.

◆ GetHeadAngle()

G4double G4TheRayTracer::GetHeadAngle ( ) const
inlineinherited

Definition at line 177 of file G4TheRayTracer.hh.

177{ return headAngle; }

References G4TheRayTracer::headAngle.

Referenced by G4RTMessenger::GetCurrentValue().

◆ GetLightDirection()

G4ThreeVector G4TheRayTracer::GetLightDirection ( ) const
inlineinherited

Definition at line 173 of file G4TheRayTracer.hh.

173{ return lightDirection; }
G4ThreeVector lightDirection

References G4TheRayTracer::lightDirection.

Referenced by G4RTMessenger::GetCurrentValue().

◆ GetMixedColour()

G4Colour G4TheRayTracer::GetMixedColour ( const G4Colour &  surfCol,
const G4Colour &  transCol,
G4double  weight = 0.5 
)
protectedinherited

Definition at line 334 of file G4TheRayTracer.cc.

336{
337 G4double red = weight*surfCol.GetRed() + (1.-weight)*transCol.GetRed();
338 G4double green = weight*surfCol.GetGreen() + (1.-weight)*transCol.GetGreen();
339 G4double blue = weight*surfCol.GetBlue() + (1.-weight)*transCol.GetBlue();
340 G4double alpha = weight*surfCol.GetAlpha() + (1.-weight)*transCol.GetAlpha();
341 return G4Colour(red,green,blue,alpha);
342}
static const G4double alpha

References alpha, G4Colour::GetAlpha(), G4Colour::GetBlue(), G4Colour::GetGreen(), and G4Colour::GetRed().

Referenced by G4TheRayTracer::GenerateColour(), and G4TheRayTracer::GetSurfaceColour().

◆ GetNColumn()

G4int G4TheRayTracer::GetNColumn ( ) const
inlineinherited

Definition at line 165 of file G4TheRayTracer.hh.

165{ return nColumn; }

References G4TheRayTracer::nColumn.

Referenced by G4RTMessenger::GetCurrentValue(), and G4RayTracerViewer::SetView().

◆ GetNRow()

G4int G4TheRayTracer::GetNRow ( ) const
inlineinherited

Definition at line 167 of file G4TheRayTracer.hh.

167{ return nRow; }

References G4TheRayTracer::nRow.

Referenced by G4RTMessenger::GetCurrentValue().

◆ GetScanner()

G4VRTScanner * G4TheRayTracer::GetScanner ( )
inlineinherited

Definition at line 121 of file G4TheRayTracer.hh.

121{return theScanner;}

References G4TheRayTracer::theScanner.

Referenced by G4RayTracerXViewer::Initialise().

◆ GetSurfaceColour()

G4Colour G4TheRayTracer::GetSurfaceColour ( G4RayTrajectoryPoint *  point)
protectedinherited

Definition at line 344 of file G4TheRayTracer.cc.

345{
346 const G4VisAttributes* preAtt = point->GetPreStepAtt();
347 const G4VisAttributes* postAtt = point->GetPostStepAtt();
348
349 G4bool preVis = ValidColour(preAtt);
350 G4bool postVis = ValidColour(postAtt);
351
352 G4Colour transparent(1.,1.,1.,0.);
353
354 if(!preVis&&!postVis) return transparent;
355
357
358 G4Colour preCol(1.,1.,1.);
359 G4Colour postCol(1.,1.,1.);
360
361 if(preVis)
362 {
363 const G4Colour& preAttColour = preAtt->GetColour();
364 G4double brill = (1.0-(-lightDirection).dot(normal))/2.0;
365 G4double red = preAttColour.GetRed();
366 G4double green = preAttColour.GetGreen();
367 G4double blue = preAttColour.GetBlue();
368 preCol = G4Colour
369 (red*brill,green*brill,blue*brill,preAttColour.GetAlpha());
370 }
371 else
372 { preCol = transparent; }
373
374 if(postVis)
375 {
376 const G4Colour& postAttColour = postAtt->GetColour();
377 G4double brill = (1.0-(-lightDirection).dot(-normal))/2.0;
378 G4double red = postAttColour.GetRed();
379 G4double green = postAttColour.GetGreen();
380 G4double blue = postAttColour.GetBlue();
381 postCol = G4Colour
382 (red*brill,green*brill,blue*brill,postAttColour.GetAlpha());
383 }
384 else
385 { postCol = transparent; }
386
387 if(!preVis) return postCol;
388 if(!postVis) return preCol;
389
390 G4double weight = 0.5;
391 return GetMixedColour(preCol,postCol,weight);
392}
G4ThreeVector GetSurfaceNormal() const
static double normal(HepRandomEngine *eptr)
Definition: RandPoisson.cc:79

References G4Colour::GetAlpha(), G4Colour::GetBlue(), G4VisAttributes::GetColour(), G4Colour::GetGreen(), G4TheRayTracer::GetMixedColour(), G4RayTrajectoryPoint::GetPostStepAtt(), G4RayTrajectoryPoint::GetPreStepAtt(), G4Colour::GetRed(), G4RayTrajectoryPoint::GetSurfaceNormal(), G4TheRayTracer::lightDirection, CLHEP::normal(), and G4TheRayTracer::ValidColour().

Referenced by G4TheRayTracer::GenerateColour().

◆ GetTargetPosition()

G4ThreeVector G4TheRayTracer::GetTargetPosition ( ) const
inlineinherited

Definition at line 171 of file G4TheRayTracer.hh.

171{ return targetPosition; }
G4ThreeVector targetPosition

References G4TheRayTracer::targetPosition.

Referenced by G4RTMessenger::GetCurrentValue().

◆ GetUpVector()

G4ThreeVector G4TheRayTracer::GetUpVector ( ) const
inlineinherited

Definition at line 175 of file G4TheRayTracer.hh.

175{ return up; }
G4ThreeVector up

References G4TheRayTracer::up.

◆ GetViewSpan()

G4double G4TheRayTracer::GetViewSpan ( ) const
inlineinherited

Definition at line 179 of file G4TheRayTracer.hh.

179{ return viewSpan; }

References G4TheRayTracer::viewSpan.

Referenced by G4RTMessenger::GetCurrentValue().

◆ Instance() [1/2]

G4TheMTRayTracer * G4TheMTRayTracer::Instance ( void  )
static

Definition at line 66 of file G4TheMTRayTracer.cc.

67{
68 if (theInstance) return theInstance;
69 else return new G4TheMTRayTracer;
70}
G4TheMTRayTracer(G4VFigureFileMaker *figMaker=0, G4VRTScanner *scanner=0)

References G4TheMTRayTracer(), and theInstance.

◆ Instance() [2/2]

G4TheMTRayTracer * G4TheMTRayTracer::Instance ( G4VFigureFileMaker *  figMaker,
G4VRTScanner *  scanner 
)
static

Definition at line 72 of file G4TheMTRayTracer.cc.

74{
75 if (theInstance) {
76 theFigMaker=figMaker;
77 theScanner=scanner;
78 return theInstance;
79 }
80 else return new G4TheMTRayTracer(figMaker,scanner);
81}

References G4TheMTRayTracer(), G4TheRayTracer::theFigMaker, theInstance, and G4TheRayTracer::theScanner.

◆ RestoreUserActions()

void G4TheMTRayTracer::RestoreUserActions ( )
protectedvirtual

◆ SetAttenuationLength()

void G4TheRayTracer::SetAttenuationLength ( G4double  val)
inlineinherited

Definition at line 180 of file G4TheRayTracer.hh.

180{ attenuationLength = val; }

References G4TheRayTracer::attenuationLength.

Referenced by G4RTMessenger::SetNewValue().

◆ SetBackgroundColour()

void G4TheRayTracer::SetBackgroundColour ( const G4Colour &  val)
inlineinherited

Definition at line 184 of file G4TheRayTracer.hh.

184{ backgroundColour = val; }

References G4TheRayTracer::backgroundColour.

Referenced by G4RayTracerViewer::SetView().

◆ SetDistortion()

void G4TheRayTracer::SetDistortion ( G4bool  val)
inlineinherited

Definition at line 182 of file G4TheRayTracer.hh.

182{ distortionOn = val; }

References G4TheRayTracer::distortionOn.

Referenced by G4RTMessenger::SetNewValue().

◆ SetEyePosition()

void G4TheRayTracer::SetEyePosition ( const G4ThreeVector &  val)
inlineinherited

Definition at line 168 of file G4TheRayTracer.hh.

168{ eyePosition = val; }

References G4TheRayTracer::eyePosition.

Referenced by G4RTMessenger::SetNewValue(), and G4RayTracerViewer::SetView().

◆ SetFigureFileMaker()

void G4TheRayTracer::SetFigureFileMaker ( G4VFigureFileMaker *  figMaker)
inlineinherited

Definition at line 112 of file G4TheRayTracer.hh.

115 { theFigMaker = figMaker; }

References G4TheRayTracer::theFigMaker.

◆ SetHeadAngle()

void G4TheRayTracer::SetHeadAngle ( G4double  val)
inlineinherited

Definition at line 176 of file G4TheRayTracer.hh.

176{ headAngle = val; }

References G4TheRayTracer::headAngle.

Referenced by G4RTMessenger::SetNewValue().

◆ SetLightDirection()

void G4TheRayTracer::SetLightDirection ( const G4ThreeVector &  val)
inlineinherited

◆ SetNColumn()

void G4TheRayTracer::SetNColumn ( G4int  val)
inlineinherited

Definition at line 164 of file G4TheRayTracer.hh.

164{ nColumn = val; }

References G4TheRayTracer::nColumn.

Referenced by G4RayTracerViewer::Initialise(), and G4RTMessenger::SetNewValue().

◆ SetNRow()

void G4TheRayTracer::SetNRow ( G4int  val)
inlineinherited

Definition at line 166 of file G4TheRayTracer.hh.

166{ nRow = val; }

References G4TheRayTracer::nRow.

Referenced by G4RayTracerViewer::Initialise(), and G4RTMessenger::SetNewValue().

◆ SetScanner()

void G4TheRayTracer::SetScanner ( G4VRTScanner *  scanner)
inlineinherited

Definition at line 117 of file G4TheRayTracer.hh.

120 { theScanner = scanner; }

References G4TheRayTracer::theScanner.

◆ SetTargetPosition()

void G4TheRayTracer::SetTargetPosition ( const G4ThreeVector &  val)
inlineinherited

Definition at line 170 of file G4TheRayTracer.hh.

170{ targetPosition = val; }

References G4TheRayTracer::targetPosition.

Referenced by G4RTMessenger::SetNewValue(), and G4RayTracerViewer::SetView().

◆ SetUpVector()

void G4TheRayTracer::SetUpVector ( const G4ThreeVector &  val)
inlineinherited

Definition at line 174 of file G4TheRayTracer.hh.

174{ up = val; }

References G4TheRayTracer::up.

Referenced by G4RayTracerViewer::SetView().

◆ SetViewSpan()

void G4TheRayTracer::SetViewSpan ( G4double  val)
inlineinherited

Definition at line 178 of file G4TheRayTracer.hh.

178{ viewSpan = val; }

References G4TheRayTracer::viewSpan.

Referenced by G4RTMessenger::SetNewValue().

◆ StoreUserActions()

void G4TheMTRayTracer::StoreUserActions ( )
protectedvirtual

◆ Trace()

void G4TheMTRayTracer::Trace ( const G4String &  fileName)
virtual

Reimplemented from G4TheRayTracer.

Definition at line 97 of file G4TheMTRayTracer.cc.

98{
100 G4ApplicationState currentState = theStateMan->GetCurrentState();
101 if(currentState!=G4State_Idle)
102 {
103 G4cerr << "Illegal application state <" << theStateMan->GetStateString(currentState)
104 << "> - Trace() ignored. " << G4endl;
105 return;
106 }
107
108 if(!theFigMaker)
109 {
110 G4cerr << "Figure file maker class is not specified - Trace() ignored." << G4endl;
111 return;
112 }
113
115 G4int storeTrajectory = UI->GetCurrentIntValue("/tracking/storeTrajectory");
116 UI->ApplyCommand("/tracking/storeTrajectory 1");
117
119 eyeDirection = tmpVec.unit();
120 G4int nPixel = nColumn*nRow;
121 colorR = new unsigned char[nPixel];
122 colorG = new unsigned char[nPixel];
123 colorB = new unsigned char[nPixel];
124 unsigned char defR = (unsigned char)(G4int(255*backgroundColour.GetRed()));
125 unsigned char defG = (unsigned char)(G4int(255*backgroundColour.GetGreen()));
126 unsigned char defB = (unsigned char)(G4int(255*backgroundColour.GetBlue()));
127 for(G4int ii=0;ii<nPixel;++ii)
128 {
129 colorR[ii] = defR;
130 colorG[ii] = defG;
131 colorB[ii] = defB;
132 }
133
134 G4bool succeeded = CreateBitMap();
135 if(succeeded)
136 { CreateFigureFile(fileName); }
137 else
138 { G4cerr << "Could not create figure file" << G4endl;
139 G4cerr << "You might set the eye position outside of the world volume" << G4endl; }
140
141 G4String str = "/tracking/storeTrajectory " + G4UIcommand::ConvertToString(storeTrajectory);
142 UI->ApplyCommand(str);
143
144 delete [] colorR;
145 delete [] colorG;
146 delete [] colorB;
147}
G4ApplicationState
@ G4State_Idle
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
const G4ApplicationState & GetCurrentState() const
G4String GetStateString(const G4ApplicationState &aState) const
static G4StateManager * GetStateManager()
virtual G4bool CreateBitMap()
G4ThreeVector eyeDirection
void CreateFigureFile(const G4String &fileName)
G4int GetCurrentIntValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:231

References G4UImanager::ApplyCommand(), G4TheRayTracer::backgroundColour, G4TheRayTracer::colorB, G4TheRayTracer::colorG, G4TheRayTracer::colorR, G4UIcommand::ConvertToString(), CreateBitMap(), G4TheRayTracer::CreateFigureFile(), G4TheRayTracer::eyeDirection, G4TheRayTracer::eyePosition, G4cerr, G4endl, G4State_Idle, G4Colour::GetBlue(), G4UImanager::GetCurrentIntValue(), G4StateManager::GetCurrentState(), G4Colour::GetGreen(), G4Colour::GetRed(), G4StateManager::GetStateManager(), G4StateManager::GetStateString(), G4UImanager::GetUIpointer(), G4TheRayTracer::nColumn, G4TheRayTracer::nRow, G4TheRayTracer::targetPosition, G4TheRayTracer::theFigMaker, and CLHEP::Hep3Vector::unit().

◆ ValidColour()

G4bool G4TheRayTracer::ValidColour ( const G4VisAttributes *  visAtt)
protectedinherited

Definition at line 423 of file G4TheRayTracer.cc.

424{
425 G4bool val = true;
426 if(!visAtt)
427 { val = false; }
428 else if(!(visAtt->IsVisible()))
429 { val = false; }
430 else if(visAtt->IsForceDrawingStyle()
432 { val = false; }
433 return val;
434}
G4bool IsVisible() const
ForcedDrawingStyle GetForcedDrawingStyle() const
G4bool IsForceDrawingStyle() const

References G4VisAttributes::GetForcedDrawingStyle(), G4VisAttributes::IsForceDrawingStyle(), G4VisAttributes::IsVisible(), and G4VisAttributes::wireframe.

Referenced by G4TheRayTracer::Attenuate(), and G4TheRayTracer::GetSurfaceColour().

Friends And Related Function Documentation

◆ G4RayTracerViewer

friend class G4RayTracerViewer
friend

Definition at line 74 of file G4TheMTRayTracer.hh.

◆ G4RTPrimaryGeneratorAction

friend class G4RTPrimaryGeneratorAction
friend

Definition at line 72 of file G4TheMTRayTracer.hh.

◆ G4RTRun

friend class G4RTRun
friend

Definition at line 73 of file G4TheMTRayTracer.hh.

Field Documentation

◆ antialiasingOn

G4bool G4TheRayTracer::antialiasingOn
protectedinherited

Definition at line 158 of file G4TheRayTracer.hh.

Referenced by G4TheRayTracer::G4TheRayTracer().

◆ attenuationLength

G4double G4TheRayTracer::attenuationLength
protectedinherited

◆ backgroundColour

G4Colour G4TheRayTracer::backgroundColour
protectedinherited

◆ colorB

unsigned char* G4TheRayTracer::colorB
protectedinherited

◆ colorG

unsigned char* G4TheRayTracer::colorG
protectedinherited

◆ colorR

unsigned char* G4TheRayTracer::colorR
protectedinherited

◆ distortionOn

G4bool G4TheRayTracer::distortionOn
protectedinherited

◆ eyeDirection

G4ThreeVector G4TheRayTracer::eyeDirection
protectedinherited

◆ eyePosition

G4ThreeVector G4TheRayTracer::eyePosition
protectedinherited

◆ headAngle

G4double G4TheRayTracer::headAngle
protectedinherited

◆ lightDirection

G4ThreeVector G4TheRayTracer::lightDirection
protectedinherited

◆ nColumn

G4int G4TheRayTracer::nColumn
protectedinherited

◆ nRow

G4int G4TheRayTracer::nRow
protectedinherited

◆ rayColour

G4Colour G4TheRayTracer::rayColour
protectedinherited

◆ targetPosition

G4ThreeVector G4TheRayTracer::targetPosition
protectedinherited

◆ theEventManager

G4EventManager* G4TheRayTracer::theEventManager
protectedinherited

◆ theFigMaker

G4VFigureFileMaker * G4TheRayTracer::theFigMaker = 0
staticprotectedinherited

◆ theInstance

G4TheMTRayTracer * G4TheMTRayTracer::theInstance = nullptr
staticprivate

◆ theMessenger

G4RTMessenger* G4TheRayTracer::theMessenger
protectedinherited

◆ theRayShooter

G4RayShooter* G4TheRayTracer::theRayShooter
protectedinherited

◆ theRayTracerEventAction

G4UserEventAction* G4TheRayTracer::theRayTracerEventAction
protectedinherited

◆ theRayTracerStackingAction

G4UserStackingAction* G4TheRayTracer::theRayTracerStackingAction
protectedinherited

◆ theRayTracerSteppingAction

G4RTSteppingAction* G4TheRayTracer::theRayTracerSteppingAction
protectedinherited

◆ theRayTracerTrackingAction

G4RTTrackingAction* G4TheRayTracer::theRayTracerTrackingAction
protectedinherited

◆ theRTRunAction

G4RTRunAction* G4TheMTRayTracer::theRTRunAction
protected

Definition at line 116 of file G4TheMTRayTracer.hh.

Referenced by G4TheMTRayTracer(), StoreUserActions(), and ~G4TheMTRayTracer().

◆ theRTWorkerInitialization

G4RTWorkerInitialization* G4TheMTRayTracer::theRTWorkerInitialization
protected

Definition at line 114 of file G4TheMTRayTracer.hh.

Referenced by G4TheMTRayTracer(), StoreUserActions(), and ~G4TheMTRayTracer().

◆ theScanner

G4VRTScanner * G4TheRayTracer::theScanner = 0
staticprotectedinherited

◆ theUserEventAction

G4UserEventAction* G4TheRayTracer::theUserEventAction
protectedinherited

◆ theUserRunAction

const G4UserRunAction* G4TheMTRayTracer::theUserRunAction
protected

Definition at line 115 of file G4TheMTRayTracer.hh.

Referenced by G4TheMTRayTracer(), RestoreUserActions(), and StoreUserActions().

◆ theUserStackingAction

G4UserStackingAction* G4TheRayTracer::theUserStackingAction
protectedinherited

◆ theUserSteppingAction

G4UserSteppingAction* G4TheRayTracer::theUserSteppingAction
protectedinherited

◆ theUserTrackingAction

G4UserTrackingAction* G4TheRayTracer::theUserTrackingAction
protectedinherited

◆ theUserWorkerInitialization

const G4UserWorkerInitialization* G4TheMTRayTracer::theUserWorkerInitialization
protected

Definition at line 113 of file G4TheMTRayTracer.hh.

Referenced by G4TheMTRayTracer(), RestoreUserActions(), and StoreUserActions().

◆ up

G4ThreeVector G4TheRayTracer::up
protectedinherited

◆ viewSpan

G4double G4TheRayTracer::viewSpan
protectedinherited

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