Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4TheRayTracer Class Reference

#include <G4TheRayTracer.hh>

Inheritance diagram for G4TheRayTracer:
Collaboration diagram for G4TheRayTracer:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

G4RayShootertheRayShooter
 
G4VFigureFileMakertheFigMaker
 
G4RTMessengertheMessenger
 
G4VRTScannertheScanner
 
G4EventManagertheEventManager
 
G4UserEventActiontheUserEventAction
 
G4UserStackingActiontheUserStackingAction
 
G4UserTrackingActiontheUserTrackingAction
 
G4UserSteppingActiontheUserSteppingAction
 
G4UserEventActiontheRayTracerEventAction
 
G4UserStackingActiontheRayTracerStackingAction
 
G4RTTrackingActiontheRayTracerTrackingAction
 
G4RTSteppingActiontheRayTracerSteppingAction
 
unsigned char * colorR
 
unsigned char * colorG
 
unsigned char * colorB
 
G4int nColumn
 
G4int nRow
 
G4ThreeVector eyePosition
 
G4ThreeVector targetPosition
 
G4ThreeVector eyeDirection
 
G4ThreeVector lightDirection
 
G4ThreeVector up
 
G4double headAngle
 
G4double viewSpan
 
G4double attenuationLength
 
G4bool distortionOn
 
G4bool antialiasingOn
 
G4Colour rayColour
 
G4Colour backgroundColour
 

Detailed Description

Definition at line 72 of file G4TheRayTracer.hh.

Constructor & Destructor Documentation

G4TheRayTracer::G4TheRayTracer ( G4VFigureFileMaker figMaker = 0,
G4VRTScanner scanner = 0 
)

Definition at line 58 of file G4TheRayTracer.cc.

60 {
61  theFigMaker = figMaker;
63  theScanner = scanner;
74  colorR = 0;
75  colorG = 0;
76  colorB = 0;
77 
80 
81  nColumn = 640;
82  nRow = 640;
83 
84  eyePosition = G4ThreeVector(1.*m,1.*m,1.*m);
85  targetPosition = G4ThreeVector(0.,0.,0.);
86  lightDirection = G4ThreeVector(-0.1,-0.2,-0.3).unit();
87  up = G4ThreeVector(0,1,0);
88  viewSpan = 5.0*deg;
89  headAngle = 0.;
90  attenuationLength = 1.0*m;
91 
92  distortionOn = false;
93  antialiasingOn = false;
94 
95  backgroundColour = G4Colour(1.,1.,1.);
96 }
CLHEP::Hep3Vector G4ThreeVector
G4ThreeVector targetPosition
G4UserStackingAction * theRayTracerStackingAction
G4UserStackingAction * theUserStackingAction
G4RTSteppingAction * theRayTracerSteppingAction
G4UserTrackingAction * theUserTrackingAction
G4RayShooter * theRayShooter
G4UserSteppingAction * theUserSteppingAction
static G4RTMessenger * GetInstance(G4TheRayTracer *p1)
G4VRTScanner * theScanner
G4UserEventAction * theUserEventAction
unsigned char * colorR
G4ThreeVector lightDirection
static constexpr double m
Definition: G4SIunits.hh:129
G4ThreeVector up
G4EventManager * theEventManager
G4RTTrackingAction * theRayTracerTrackingAction
G4VFigureFileMaker * theFigMaker
Hep3Vector unit() const
unsigned char * colorB
G4UserEventAction * theRayTracerEventAction
static G4EventManager * GetEventManager()
G4Colour backgroundColour
G4ThreeVector eyePosition
static constexpr double deg
Definition: G4SIunits.hh:152
G4double attenuationLength
G4RTMessenger * theMessenger
unsigned char * colorG

Here is the call graph for this function:

G4TheRayTracer::~G4TheRayTracer ( )
virtual

Definition at line 98 of file G4TheRayTracer.cc.

99 {
100  delete theRayShooter;
103  delete theMessenger;
104  delete theScanner;
105  delete theFigMaker;
106 }
G4RTSteppingAction * theRayTracerSteppingAction
G4RayShooter * theRayShooter
G4VRTScanner * theScanner
G4RTTrackingAction * theRayTracerTrackingAction
G4VFigureFileMaker * theFigMaker
G4RTMessenger * theMessenger

Member Function Documentation

G4Colour G4TheRayTracer::Attenuate ( G4RayTrajectoryPoint point,
const G4Colour sourceCol 
)
protected

Definition at line 393 of file G4TheRayTracer.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4TheRayTracer::CreateBitMap ( )
protectedvirtual

Reimplemented in G4TheMTRayTracer.

Definition at line 191 of file G4TheRayTracer.cc.

192 {
193  G4int iEvent = 0;
194  G4double stepAngle = viewSpan/100.;
195  G4double viewSpanX = stepAngle*nColumn;
196  G4double viewSpanY = stepAngle*nRow;
197  G4bool succeeded;
198 
200  visMan->IgnoreStateChanges(true);
201 
202 // Confirm process(es) of Geantino is initialized
203  G4VPhysicalVolume* pWorld =
205  GetNavigatorForTracking()->GetWorldVolume();
208  G4ProcessVector* pVector
210  for (G4int j=0; j < pVector->size(); ++j) {
211  (*pVector)[j]->BuildPhysicsTable(*(G4Geantino::GeantinoDefinition()));
212  }
213 
214 // Close geometry and set the application state
216  geomManager->OpenGeometry();
217  geomManager->CloseGeometry(1,0);
218 
219  G4ThreeVector center(0,0,0);
222  navigator->LocateGlobalPointAndSetup(center,0,false);
223 
225  theStateMan->SetNewState(G4State_GeomClosed);
226 
227 // Event loop
228  theScanner->Initialize(nRow,nColumn);
229  G4int iRow, iColumn;
230  while (theScanner->Coords(iRow,iColumn)) {
231  G4int iCoord = iRow * nColumn + iColumn;
232  G4double dRow = 0, dColumn = 0; // Antialiasing increments.
233  G4Event* anEvent = new G4Event(iEvent++);
234  G4double angleX = -(viewSpanX/2. - (iColumn+dColumn)*stepAngle);
235  G4double angleY = viewSpanY/2. - (iRow+dRow)*stepAngle;
236  G4ThreeVector rayDirection;
237  if(distortionOn)
238  {
239  rayDirection = G4ThreeVector(-std::tan(angleX)/std::cos(angleY),std::tan(angleY)/std::cos(angleX),1.0);
240  }
241  else
242  {
243  rayDirection = G4ThreeVector(-std::tan(angleX),std::tan(angleY),1.0);
244  }
245  G4double cp = std::cos(eyeDirection.phi());
246  G4double sp = std::sqrt(1.-cp*cp);
247  G4double ct = std::cos(eyeDirection.theta());
248  G4double st = std::sqrt(1.-ct*ct);
249  G4double gamma = std::atan2(ct*cp*up.x()+ct*sp*up.y()-st*up.z(), -sp*up.x()+cp*up.y());
250  rayDirection.rotateZ(-gamma);
251  rayDirection.rotateZ(headAngle);
252  rayDirection.rotateUz(eyeDirection);
253  G4ThreeVector rayPosition(eyePosition);
254  G4bool interceptable = true;
255  // Check if rayPosition is in the world.
256  EInside whereisit =
257  pWorld->GetLogicalVolume()->GetSolid()->Inside(rayPosition);
258  if (whereisit != kInside) {
259  // It's outside the world, so move it inside.
260  G4double outsideDistance =
261  pWorld->GetLogicalVolume()->GetSolid()->
262  DistanceToIn(rayPosition,rayDirection);
263  if (outsideDistance != kInfinity) {
264  // Borrowing from geometry, where 1e-8 < epsilon < 1e-3, in
265  // absolute/internal length units, is used for ensuring good
266  // behaviour, choose to add 0.001 to ensure rayPosition is
267  // definitely inside the world volume (JA 16/9/2005)...
268  rayPosition = rayPosition+(outsideDistance+0.001)*rayDirection;
269  }
270  else {
271  interceptable = false;
272  }
273  }
274  if (interceptable) {
275  theRayShooter->Shoot(anEvent,rayPosition,rayDirection.unit());
277  succeeded = GenerateColour(anEvent);
278  colorR[iCoord] = (unsigned char)(int(255*rayColour.GetRed()));
279  colorG[iCoord] = (unsigned char)(int(255*rayColour.GetGreen()));
280  colorB[iCoord] = (unsigned char)(int(255*rayColour.GetBlue()));
281  } else { // Ray does not intercept world at all.
282  // Store background colour...
283  colorR[iCoord] = (unsigned char)(int(255*backgroundColour.GetRed()));
284  colorG[iCoord] = (unsigned char)(int(255*backgroundColour.GetGreen()));
285  colorB[iCoord] = (unsigned char)(int(255*backgroundColour.GetBlue()));
286  succeeded = true;
287  }
288 
289  theScanner->Draw(colorR[iCoord],colorG[iCoord],colorB[iCoord]);
290 
291  delete anEvent;
292  if(!succeeded) return false;
293  }
294 
295  theStateMan->SetNewState(G4State_Idle);
296  visMan->IgnoreStateChanges(false);
297  return true;
298 }
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
void UpdateMaterialList(G4VPhysicalVolume *currentWorld=0)
static const G4double kInfinity
Definition: geomdefs.hh:42
CLHEP::Hep3Vector G4ThreeVector
double x() const
static G4VVisManager * GetConcreteInstance()
G4RayShooter * theRayShooter
G4Navigator * GetNavigatorForTracking() const
G4VSolid * GetSolid() const
virtual G4bool Coords(G4int &iRow, G4int &iColumn)=0
G4double GetBlue() const
Definition: G4Colour.hh:141
G4VRTScanner * theScanner
G4ThreeVector eyeDirection
int G4int
Definition: G4Types.hh:78
double z() const
static G4RegionStore * GetInstance()
unsigned char * colorR
static G4StateManager * GetStateManager()
virtual void Draw(unsigned char red, unsigned char green, unsigned char blue)
Definition: G4VRTScanner.hh:71
G4bool SetNewState(G4ApplicationState requestedState)
G4double GetRed() const
Definition: G4Colour.hh:139
virtual void IgnoreStateChanges(G4bool)
virtual void Initialize(G4int nRow, G4int nColumn)=0
virtual EInside Inside(const G4ThreeVector &p) const =0
bool G4bool
Definition: G4Types.hh:79
G4double GetGreen() const
Definition: G4Colour.hh:140
Hep3Vector & rotateUz(const Hep3Vector &)
Definition: ThreeVector.cc:38
G4ThreeVector up
Hep3Vector & rotateZ(double)
Definition: ThreeVector.cc:110
tuple navigator
Definition: write_gdml.py:35
double phi() const
static G4GeometryManager * GetInstance()
double theta() const
static G4TransportationManager * GetTransportationManager()
G4EventManager * theEventManager
G4int size() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4LogicalVolume * GetLogicalVolume() const
void Shoot(G4Event *evt, G4ThreeVector vtx, G4ThreeVector direc)
Definition: G4RayShooter.cc:59
EInside
Definition: geomdefs.hh:58
G4ProcessManager * GetProcessManager() const
Hep3Vector unit() const
unsigned char * colorB
double y() const
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
Definition: G4Navigator.cc:125
void OpenGeometry(G4VPhysicalVolume *vol=0)
void ProcessOneEvent(G4Event *anEvent)
void UpdateCoupleTable(G4VPhysicalVolume *currentWorld)
G4Colour backgroundColour
double G4double
Definition: G4Types.hh:76
G4ThreeVector eyePosition
G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false, G4VPhysicalVolume *vol=0)
G4bool GenerateColour(G4Event *anEvent)
static const G4double cp
G4ProcessVector * GetProcessList() const
unsigned char * colorG

Here is the call graph for this function:

Here is the caller graph for this function:

void G4TheRayTracer::CreateFigureFile ( const G4String fileName)
protected

Definition at line 300 of file G4TheRayTracer.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4TheRayTracer::GenerateColour ( G4Event anEvent)
protected

Definition at line 306 of file G4TheRayTracer.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4TheRayTracer::GetAttenuationLength ( ) const
inline

Definition at line 182 of file G4TheRayTracer.hh.

182 { return attenuationLength; }
G4double attenuationLength

Here is the caller graph for this function:

G4Colour G4TheRayTracer::GetBackgroundColour ( ) const
inline

Definition at line 186 of file G4TheRayTracer.hh.

186 { return backgroundColour; }
G4Colour backgroundColour

Here is the caller graph for this function:

G4bool G4TheRayTracer::GetDistortion ( ) const
inline

Definition at line 184 of file G4TheRayTracer.hh.

184 { return distortionOn; }

Here is the caller graph for this function:

G4ThreeVector G4TheRayTracer::GetEyePosition ( ) const
inline

Definition at line 170 of file G4TheRayTracer.hh.

170 { return eyePosition; }
G4ThreeVector eyePosition

Here is the caller graph for this function:

G4VFigureFileMaker* G4TheRayTracer::GetFigureFileMaker ( )
inline

Definition at line 117 of file G4TheRayTracer.hh.

117 {return theFigMaker;}
G4VFigureFileMaker * theFigMaker
G4double G4TheRayTracer::GetHeadAngle ( ) const
inline

Definition at line 178 of file G4TheRayTracer.hh.

178 { return headAngle; }

Here is the caller graph for this function:

G4ThreeVector G4TheRayTracer::GetLightDirection ( ) const
inline

Definition at line 174 of file G4TheRayTracer.hh.

174 { return lightDirection; }
G4ThreeVector lightDirection

Here is the caller graph for this function:

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

Definition at line 333 of file G4TheRayTracer.cc.

334 {
335  G4double red = weight*surfCol.GetRed() + (1.-weight)*transCol.GetRed();
336  G4double green = weight*surfCol.GetGreen() + (1.-weight)*transCol.GetGreen();
337  G4double blue = weight*surfCol.GetBlue() + (1.-weight)*transCol.GetBlue();
338  G4double alpha = weight*surfCol.GetAlpha() + (1.-weight)*transCol.GetAlpha();
339  return G4Colour(red,green,blue,alpha);
340 }
G4double GetAlpha() const
Definition: G4Colour.hh:142
Definition: test07.cc:36
G4double GetBlue() const
Definition: G4Colour.hh:141
Definition: test07.cc:36
G4double GetRed() const
Definition: G4Colour.hh:139
G4double GetGreen() const
Definition: G4Colour.hh:140
double G4double
Definition: G4Types.hh:76
static const G4double alpha

Here is the call graph for this function:

Here is the caller graph for this function:

G4int G4TheRayTracer::GetNColumn ( ) const
inline

Definition at line 166 of file G4TheRayTracer.hh.

166 { return nColumn; }

Here is the caller graph for this function:

G4int G4TheRayTracer::GetNRow ( ) const
inline

Definition at line 168 of file G4TheRayTracer.hh.

168 { return nRow; }

Here is the caller graph for this function:

G4VRTScanner* G4TheRayTracer::GetScanner ( )
inline

Definition at line 122 of file G4TheRayTracer.hh.

122 {return theScanner;}
G4VRTScanner * theScanner
G4Colour G4TheRayTracer::GetSurfaceColour ( G4RayTrajectoryPoint point)
protected

Definition at line 342 of file G4TheRayTracer.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4ThreeVector G4TheRayTracer::GetTargetPosition ( ) const
inline

Definition at line 172 of file G4TheRayTracer.hh.

172 { return targetPosition; }
G4ThreeVector targetPosition

Here is the caller graph for this function:

G4ThreeVector G4TheRayTracer::GetUpVector ( ) const
inline

Definition at line 176 of file G4TheRayTracer.hh.

176 { return up; }
G4ThreeVector up
G4double G4TheRayTracer::GetViewSpan ( ) const
inline

Definition at line 180 of file G4TheRayTracer.hh.

180 { return viewSpan; }

Here is the caller graph for this function:

void G4TheRayTracer::RestoreUserActions ( )
protectedvirtual

Reimplemented in G4TheMTRayTracer.

Definition at line 175 of file G4TheRayTracer.cc.

176 {
181 
183  if(theSDMan)
184  { theSDMan->Activate("/",true); }
185 }
G4UserStackingAction * theUserStackingAction
G4UserTrackingAction * theUserTrackingAction
G4UserSteppingAction * theUserSteppingAction
G4UserEventAction * theUserEventAction
void Activate(G4String dName, G4bool activeFlag)
Definition: G4SDManager.cc:121
G4EventManager * theEventManager
void SetUserAction(G4UserEventAction *userAction)
static G4SDManager * GetSDMpointerIfExist()
Definition: G4SDManager.cc:49

Here is the call graph for this function:

Here is the caller graph for this function:

void G4TheRayTracer::SetAttenuationLength ( G4double  val)
inline

Definition at line 181 of file G4TheRayTracer.hh.

181 { attenuationLength = val; }
G4double attenuationLength

Here is the caller graph for this function:

void G4TheRayTracer::SetBackgroundColour ( const G4Colour val)
inline

Definition at line 185 of file G4TheRayTracer.hh.

185 { backgroundColour = val; }
G4Colour backgroundColour

Here is the caller graph for this function:

void G4TheRayTracer::SetDistortion ( G4bool  val)
inline

Definition at line 183 of file G4TheRayTracer.hh.

183 { distortionOn = val; }

Here is the caller graph for this function:

void G4TheRayTracer::SetEyePosition ( const G4ThreeVector val)
inline

Definition at line 169 of file G4TheRayTracer.hh.

169 { eyePosition = val; }
G4ThreeVector eyePosition

Here is the caller graph for this function:

void G4TheRayTracer::SetFigureFileMaker ( G4VFigureFileMaker figMaker)
inline

Definition at line 113 of file G4TheRayTracer.hh.

116  { theFigMaker = figMaker; }
G4VFigureFileMaker * theFigMaker
void G4TheRayTracer::SetHeadAngle ( G4double  val)
inline

Definition at line 177 of file G4TheRayTracer.hh.

177 { headAngle = val; }

Here is the caller graph for this function:

void G4TheRayTracer::SetLightDirection ( const G4ThreeVector val)
inline

Definition at line 173 of file G4TheRayTracer.hh.

173 { lightDirection = val.unit(); }
G4ThreeVector lightDirection
Hep3Vector unit() const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4TheRayTracer::SetNColumn ( G4int  val)
inline

Definition at line 165 of file G4TheRayTracer.hh.

165 { nColumn = val; }

Here is the caller graph for this function:

void G4TheRayTracer::SetNRow ( G4int  val)
inline

Definition at line 167 of file G4TheRayTracer.hh.

167 { nRow = val; }

Here is the caller graph for this function:

void G4TheRayTracer::SetScanner ( G4VRTScanner scanner)
inline

Definition at line 118 of file G4TheRayTracer.hh.

121  { theScanner = scanner; }
G4VRTScanner * theScanner
void G4TheRayTracer::SetTargetPosition ( const G4ThreeVector val)
inline

Definition at line 171 of file G4TheRayTracer.hh.

171 { targetPosition = val; }
G4ThreeVector targetPosition

Here is the caller graph for this function:

void G4TheRayTracer::SetUpVector ( const G4ThreeVector val)
inline

Definition at line 175 of file G4TheRayTracer.hh.

175 { up = val; }
G4ThreeVector up

Here is the caller graph for this function:

void G4TheRayTracer::SetViewSpan ( G4double  val)
inline

Definition at line 179 of file G4TheRayTracer.hh.

179 { viewSpan = val; }

Here is the caller graph for this function:

void G4TheRayTracer::StoreUserActions ( )
protectedvirtual

Reimplemented in G4TheMTRayTracer.

Definition at line 151 of file G4TheRayTracer.cc.

152 {
157 
160 
165 
167  if(theSDMan)
168  { theSDMan->Activate("/",false); }
169 
171  theGeomMan->OpenGeometry();
172  theGeomMan->CloseGeometry(true);
173 }
G4UserStackingAction * theRayTracerStackingAction
G4UserStackingAction * theUserStackingAction
G4RTSteppingAction * theRayTracerSteppingAction
G4UserTrackingAction * theUserTrackingAction
G4UserSteppingAction * theUserSteppingAction
G4UserEventAction * GetUserEventAction()
G4UserEventAction * theUserEventAction
void Activate(G4String dName, G4bool activeFlag)
Definition: G4SDManager.cc:121
G4UserSteppingAction * GetUserSteppingAction()
static G4GeometryManager * GetInstance()
G4EventManager * theEventManager
G4RTTrackingAction * theRayTracerTrackingAction
void SetUserAction(G4UserEventAction *userAction)
G4UserTrackingAction * GetUserTrackingAction()
G4UserEventAction * theRayTracerEventAction
void OpenGeometry(G4VPhysicalVolume *vol=0)
G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false, G4VPhysicalVolume *vol=0)
G4UserStackingAction * GetUserStackingAction()
static G4SDManager * GetSDMpointerIfExist()
Definition: G4SDManager.cc:49

Here is the call graph for this function:

Here is the caller graph for this function:

void G4TheRayTracer::Trace ( const G4String fileName)
virtual

Reimplemented in G4TheMTRayTracer.

Definition at line 108 of file G4TheRayTracer.cc.

109 {
111  G4ApplicationState currentState = theStateMan->GetCurrentState();
112  if(currentState!=G4State_Idle)
113  {
114  G4cerr << "Illegal application state - Trace() ignored." << G4endl;
115  return;
116  }
117 
118  if(!theFigMaker)
119  {
120  G4cerr << "Figure file maker class is not specified - Trace() ignored." << G4endl;
121  return;
122  }
123 
125  G4int storeTrajectory = UI->GetCurrentIntValue("/tracking/storeTrajectory");
126  if(storeTrajectory==0) UI->ApplyCommand("/tracking/storeTrajectory 1");
127 
128 
130  eyeDirection = tmpVec.unit();
131  colorR = new unsigned char[nColumn*nRow];
132  colorG = new unsigned char[nColumn*nRow];
133  colorB = new unsigned char[nColumn*nRow];
134 
136  G4bool succeeded = CreateBitMap();
137  if(succeeded)
138  { CreateFigureFile(fileName); }
139  else
140  { G4cerr << "Could not create figure file" << G4endl;
141  G4cerr << "You might set the eye position outside of the world volume" << G4endl; }
143 
144  if(storeTrajectory==0) UI->ApplyCommand("/tracking/storeTrajectory 0");
145 
146  delete [] colorR;
147  delete [] colorG;
148  delete [] colorB;
149 }
virtual void StoreUserActions()
G4ThreeVector targetPosition
virtual void RestoreUserActions()
void CreateFigureFile(const G4String &fileName)
G4ThreeVector eyeDirection
int G4int
Definition: G4Types.hh:78
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
unsigned char * colorR
static G4StateManager * GetStateManager()
bool G4bool
Definition: G4Types.hh:79
virtual G4bool CreateBitMap()
G4ApplicationState GetCurrentState() const
G4int GetCurrentIntValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:233
G4VFigureFileMaker * theFigMaker
Hep3Vector unit() const
unsigned char * colorB
#define G4endl
Definition: G4ios.hh:61
G4ThreeVector eyePosition
G4ApplicationState
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
G4GLOB_DLL std::ostream G4cerr
unsigned char * colorG

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4TheRayTracer::ValidColour ( const G4VisAttributes visAtt)
protected

Definition at line 421 of file G4TheRayTracer.cc.

422 {
423  G4bool val = true;
424  if(!visAtt)
425  { val = false; }
426  else if(!(visAtt->IsVisible()))
427  { val = false; }
428  else if(visAtt->IsForceDrawingStyle()
430  { val = false; }
431  return val;
432 }
G4bool IsVisible() const
bool G4bool
Definition: G4Types.hh:79
G4bool IsForceDrawingStyle() const
ForcedDrawingStyle GetForcedDrawingStyle() const

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

G4bool G4TheRayTracer::antialiasingOn
protected

Definition at line 159 of file G4TheRayTracer.hh.

G4double G4TheRayTracer::attenuationLength
protected

Definition at line 156 of file G4TheRayTracer.hh.

G4Colour G4TheRayTracer::backgroundColour
protected

Definition at line 162 of file G4TheRayTracer.hh.

unsigned char* G4TheRayTracer::colorB
protected

Definition at line 144 of file G4TheRayTracer.hh.

unsigned char* G4TheRayTracer::colorG
protected

Definition at line 143 of file G4TheRayTracer.hh.

unsigned char* G4TheRayTracer::colorR
protected

Definition at line 142 of file G4TheRayTracer.hh.

G4bool G4TheRayTracer::distortionOn
protected

Definition at line 158 of file G4TheRayTracer.hh.

G4ThreeVector G4TheRayTracer::eyeDirection
protected

Definition at line 151 of file G4TheRayTracer.hh.

G4ThreeVector G4TheRayTracer::eyePosition
protected

Definition at line 149 of file G4TheRayTracer.hh.

G4double G4TheRayTracer::headAngle
protected

Definition at line 154 of file G4TheRayTracer.hh.

G4ThreeVector G4TheRayTracer::lightDirection
protected

Definition at line 152 of file G4TheRayTracer.hh.

G4int G4TheRayTracer::nColumn
protected

Definition at line 146 of file G4TheRayTracer.hh.

G4int G4TheRayTracer::nRow
protected

Definition at line 147 of file G4TheRayTracer.hh.

G4Colour G4TheRayTracer::rayColour
protected

Definition at line 161 of file G4TheRayTracer.hh.

G4ThreeVector G4TheRayTracer::targetPosition
protected

Definition at line 150 of file G4TheRayTracer.hh.

G4EventManager* G4TheRayTracer::theEventManager
protected

Definition at line 130 of file G4TheRayTracer.hh.

G4VFigureFileMaker* G4TheRayTracer::theFigMaker
protected

Definition at line 126 of file G4TheRayTracer.hh.

G4RTMessenger* G4TheRayTracer::theMessenger
protected

Definition at line 127 of file G4TheRayTracer.hh.

G4RayShooter* G4TheRayTracer::theRayShooter
protected

Definition at line 125 of file G4TheRayTracer.hh.

G4UserEventAction* G4TheRayTracer::theRayTracerEventAction
protected

Definition at line 137 of file G4TheRayTracer.hh.

G4UserStackingAction* G4TheRayTracer::theRayTracerStackingAction
protected

Definition at line 138 of file G4TheRayTracer.hh.

G4RTSteppingAction* G4TheRayTracer::theRayTracerSteppingAction
protected

Definition at line 140 of file G4TheRayTracer.hh.

G4RTTrackingAction* G4TheRayTracer::theRayTracerTrackingAction
protected

Definition at line 139 of file G4TheRayTracer.hh.

G4VRTScanner* G4TheRayTracer::theScanner
protected

Definition at line 128 of file G4TheRayTracer.hh.

G4UserEventAction* G4TheRayTracer::theUserEventAction
protected

Definition at line 132 of file G4TheRayTracer.hh.

G4UserStackingAction* G4TheRayTracer::theUserStackingAction
protected

Definition at line 133 of file G4TheRayTracer.hh.

G4UserSteppingAction* G4TheRayTracer::theUserSteppingAction
protected

Definition at line 135 of file G4TheRayTracer.hh.

G4UserTrackingAction* G4TheRayTracer::theUserTrackingAction
protected

Definition at line 134 of file G4TheRayTracer.hh.

G4ThreeVector G4TheRayTracer::up
protected

Definition at line 153 of file G4TheRayTracer.hh.

G4double G4TheRayTracer::viewSpan
protected

Definition at line 155 of file G4TheRayTracer.hh.


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