Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DAWNFILESceneHandler Class Reference

#include <G4DAWNFILESceneHandler.hh>

+ Inheritance diagram for G4DAWNFILESceneHandler:

Public Member Functions

 G4DAWNFILESceneHandler (G4DAWNFILE &system, const G4String &name="")
 
virtual ~G4DAWNFILESceneHandler ()
 
void AddPrimitive (const G4Polyline &line)
 
void AddPrimitive (const G4Polyhedron &p)
 
void AddPrimitive (const G4Text &)
 
void AddPrimitive (const G4Circle &)
 
void AddPrimitive (const G4Square &)
 
void BeginPrimitives (const G4Transform3D &objectTransformation)
 
void EndPrimitives ()
 
void AddSolid (const G4Box &box)
 
void AddSolid (const G4Cons &cons)
 
void AddSolid (const G4Tubs &tubs)
 
void AddSolid (const G4Trd &trd)
 
void AddSolid (const G4Trap &trap)
 
void AddSolid (const G4Sphere &sphere)
 
void AddSolid (const G4Para &para)
 
void AddSolid (const G4Torus &torus)
 
void AddSolid (const G4VSolid &solid)
 
void ClearTransientStore ()
 
void FRBeginModeling ()
 
void FREndModeling ()
 
G4bool FRIsInModeling ()
 
G4bool IsSavingG4Prim (void)
 
void BeginSavingG4Prim (void)
 
void EndSavingG4Prim (void)
 
void SetG4PrimFileName ()
 
G4DAWNFILEGetSystem ()
 
void SendBoundingBox (void)
 
const char * GetG4PrimFileName ()
 
void SendStr (const char *char_string)
 
void SendStrInt (const char *char_string, G4int ival)
 
void SendStrInt3 (const char *char_string, G4int ival1, G4int ival2, G4int ival3)
 
void SendStrInt4 (const char *char_string, G4int ival1, G4int ival2, G4int ival3, G4int ival4)
 
void SendStrDouble (const char *char_string, G4double dval)
 
void SendStrDouble2 (const char *char_string, G4double dval1, G4double dval2)
 
void SendStrDouble3 (const char *char_string, G4double dval1, G4double dval2, G4double dval3)
 
void SendStrDouble4 (const char *char_string, G4double dval1, G4double dval2, G4double dval3, G4double dval4)
 
void SendStrDouble5 (const char *char_string, G4double dval1, G4double dval2, G4double dval3, G4double dval4, G4double dval5)
 
void SendStrDouble6 (const char *char_string, G4double dval1, G4double dval2, G4double dval3, G4double dval4, G4double dval5, G4double dval6)
 
void SendStrDouble7 (const char *char_string, G4double dval1, G4double dval2, G4double dval3, G4double dval4, G4double dval5, G4double dval6, G4double dval7)
 
void SendStrDouble11 (const char *char_string, G4double dval1, G4double dval2, G4double dval3, G4double dval4, G4double dval5, G4double dval6, G4double dval7, G4double dval8, G4double dval9, G4double dval10, G4double dval11)
 
void SendIntDouble3 (G4int ival, G4double dval1, G4double dval2, G4double dval3)
 
void SendInt3Str (G4int ival1, G4int ival2, G4int ival3, const char *char_string)
 
void SendInt4Str (G4int ival1, G4int ival2, G4int ival3, G4int ival4, const char *char_string)
 
void SendStrDouble3Str (const char *char_string1, G4double dval1, G4double dval2, G4double dval3, const char *char_string2)
 
void SendStrDouble6Str (const char *char_string1, G4double dval1, G4double dval2, G4double dval3, G4double dval4, G4double dval5, G4double dval6, const char *char_string2)
 
void SendInt (G4int val)
 
void SendDouble (G4double val)
 
virtual void AddPrimitive (const G4Polymarker &)
 
virtual void AddPrimitive (const G4Plotter &)
 
virtual void AddSolid (const G4Orb &)
 
virtual void AddSolid (const G4Ellipsoid &)
 
virtual void AddSolid (const G4Polycone &)
 
virtual void AddSolid (const G4Polyhedra &)
 
virtual void AddSolid (const G4TessellatedSolid &)
 
- Public Member Functions inherited from G4VSceneHandler
 G4VSceneHandler (G4VGraphicsSystem &system, G4int id, const G4String &name="")
 
virtual ~G4VSceneHandler ()
 
virtual void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
virtual void PostAddSolid ()
 
virtual void AddCompound (const G4VTrajectory &)
 
virtual void AddCompound (const G4VHit &)
 
virtual void AddCompound (const G4VDigi &)
 
virtual void AddCompound (const G4THitsMap< G4double > &)
 
virtual void AddCompound (const G4THitsMap< G4StatDouble > &)
 
virtual void AddCompound (const G4Mesh &)
 
virtual void BeginModeling ()
 
virtual void EndModeling ()
 
virtual void BeginPrimitives2D (const G4Transform3D &objectTransformation=G4Transform3D())
 
virtual void EndPrimitives2D ()
 
virtual const G4VisExtentGetExtent () const
 
const G4StringGetName () const
 
G4int GetSceneHandlerId () const
 
G4int GetViewCount () const
 
G4VGraphicsSystemGetGraphicsSystem () const
 
G4SceneGetScene () const
 
const G4ViewerListGetViewerList () const
 
G4VModelGetModel () const
 
G4VViewerGetCurrentViewer () const
 
G4bool GetMarkForClearingTransientStore () const
 
G4bool IsReadyForTransients () const
 
G4bool GetTransientsDrawnThisEvent () const
 
G4bool GetTransientsDrawnThisRun () const
 
const G4Transform3DGetObjectTransformation () const
 
void SetName (const G4String &)
 
void SetCurrentViewer (G4VViewer *)
 
virtual void SetScene (G4Scene *)
 
G4ViewerListSetViewerList ()
 
void SetModel (G4VModel *)
 
void SetMarkForClearingTransientStore (G4bool)
 
void SetTransientsDrawnThisEvent (G4bool)
 
void SetTransientsDrawnThisRun (G4bool)
 
void SetObjectTransformation (const G4Transform3D &)
 
const G4ColourGetColour ()
 
const G4ColourGetColor ()
 
const G4ColourGetColour (const G4Visible &)
 
const G4ColourGetColor (const G4Visible &)
 
const G4ColourGetTextColour (const G4Text &)
 
const G4ColourGetTextColor (const G4Text &)
 
G4double GetLineWidth (const G4VisAttributes *)
 
G4ViewParameters::DrawingStyle GetDrawingStyle (const G4VisAttributes *)
 
G4int GetNumberOfCloudPoints (const G4VisAttributes *) const
 
G4bool GetAuxEdgeVisible (const G4VisAttributes *)
 
G4int GetNoOfSides (const G4VisAttributes *)
 
G4double GetMarkerSize (const G4VMarker &, MarkerSizeType &)
 
G4double GetMarkerDiameter (const G4VMarker &, MarkerSizeType &)
 
G4double GetMarkerRadius (const G4VMarker &, MarkerSizeType &)
 
G4ModelingParametersCreateModelingParameters ()
 
void DrawEvent (const G4Event *)
 
void DrawEndOfRunModels ()
 
template<class T >
void AddSolidT (const T &solid)
 
template<class T >
void AddSolidWithAuxiliaryEdges (const T &solid)
 
G4int IncrementViewCount ()
 
virtual void ClearStore ()
 
void AddViewerToList (G4VViewer *pView)
 
void RemoveViewerFromList (G4VViewer *pView)
 
- Public Member Functions inherited from G4VGraphicsScene
 G4VGraphicsScene ()
 
virtual ~G4VGraphicsScene ()
 

Friends

class G4DAWNFILEViewer
 

Additional Inherited Members

- Public Types inherited from G4VSceneHandler
enum  MarkerSizeType { world , screen }
 
- Protected Member Functions inherited from G4VSceneHandler
virtual void ProcessScene ()
 
virtual void RequestPrimitives (const G4VSolid &solid)
 
virtual G4DisplacedSolidCreateSectionSolid ()
 
virtual G4DisplacedSolidCreateCutawaySolid ()
 
void LoadAtts (const G4Visible &, G4AttHolder *)
 
void StandardSpecialMeshRendering (const G4Mesh &)
 
void Draw3DRectMeshAsDots (const G4Mesh &)
 
void Draw3DRectMeshAsSurfaces (const G4Mesh &)
 
void DrawTetMeshAsDots (const G4Mesh &)
 
void DrawTetMeshAsSurfaces (const G4Mesh &)
 
G4ThreeVector GetPointInBox (const G4ThreeVector &pos, G4double halfX, G4double halfY, G4double halfZ) const
 
G4ThreeVector GetPointInTet (const std::vector< G4ThreeVector > &vertices) const
 
- Protected Attributes inherited from G4VSceneHandler
G4VGraphicsSystemfSystem
 
const G4int fSceneHandlerId
 
G4String fName
 
G4int fViewCount
 
G4ViewerList fViewerList
 
G4VViewerfpViewer
 
G4ScenefpScene
 
G4bool fMarkForClearingTransientStore
 
G4bool fReadyForTransients
 
G4bool fTransientsDrawnThisEvent
 
G4bool fTransientsDrawnThisRun
 
G4bool fProcessingSolid
 
G4bool fProcessing2D
 
G4VModelfpModel
 
G4Transform3D fObjectTransformation
 
G4int fNestingDepth
 
const G4VisAttributesfpVisAttribs
 
const G4Transform3D fIdentityTransformation
 

Detailed Description

Definition at line 44 of file G4DAWNFILESceneHandler.hh.

Constructor & Destructor Documentation

◆ G4DAWNFILESceneHandler()

G4DAWNFILESceneHandler::G4DAWNFILESceneHandler ( G4DAWNFILE & system,
const G4String & name = "" )

Definition at line 77 of file G4DAWNFILESceneHandler.cc.

79 : G4VSceneHandler(system, fSceneIdCount++, name)
80 , fSystem(system)
81 , fPrimDest()
82 , FRflag_in_modeling(false)
83 , flag_saving_g4_prim(false)
84 , COMMAND_BUF_SIZE(G4FRofstream::SEND_BUFMAX)
85 , fPrec(9)
86 , fPrec2(16)
87{
88 // g4.prim filename and its directory
89 if(std::getenv("G4DAWNFILE_DEST_DIR") == NULL)
90 {
91 strcpy(fG4PrimDestDir, ""); // output dir
92 strcpy(fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME); // filename
93 }
94 else
95 {
96 strcpy(fG4PrimDestDir, std::getenv("G4DAWNFILE_DEST_DIR")); // output dir
97 strcpy(fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME); // filename
98 }
99
100 // maximum number of g4.prim files in the dest directory
101 fMaxFileNum = FR_MAX_FILE_NUM; // initialization
102 if(std::getenv("G4DAWNFILE_MAX_FILE_NUM") != NULL)
103 {
104 sscanf(std::getenv("G4DAWNFILE_MAX_FILE_NUM"), "%d", &fMaxFileNum);
105 }
106 else
107 {
108 fMaxFileNum = FR_MAX_FILE_NUM;
109 }
110 if(fMaxFileNum < 1)
111 {
112 fMaxFileNum = 1;
113 }
114
115 //----- precision control
116 if(std::getenv("G4DAWNFILE_PRECISION") != NULL)
117 {
118 sscanf(std::getenv("G4DAWNFILE_PRECISION"), "%d", &fPrec);
119 }
120 else
121 {
122 fPrec = 9;
123 }
124 fPrec2 = fPrec + 7;
125}
const int FR_MAX_FILE_NUM
const char DEFAULT_G4PRIM_FILE_NAME[]
G4VSceneHandler(G4VGraphicsSystem &system, G4int id, const G4String &name="")

◆ ~G4DAWNFILESceneHandler()

G4DAWNFILESceneHandler::~G4DAWNFILESceneHandler ( )
virtual

Definition at line 128 of file G4DAWNFILESceneHandler.cc.

129{
130#if defined DEBUG_FR_SCENE
132 G4cout << "***** ~G4DAWNFILESceneHandler" << G4endl;
133#endif
134 if(fPrimDest.IsOpen())
135 {
136 //----- End of modeling
137 // !EndModeling, !DrawAll, !CloseDevice,
138 // close g4.prim
140 }
141}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4bool IsOpen()
static Verbosity GetVerbosity()

Member Function Documentation

◆ AddPrimitive() [1/7]

void G4DAWNFILESceneHandler::AddPrimitive ( const G4Circle & )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [2/7]

void G4VSceneHandler::AddPrimitive ( const G4Plotter & )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 193 of file G4VSceneHandler.cc.

512 {
513 G4warn << "WARNING: Plotter not implemented for " << fSystem.GetName() << G4endl;
514 G4warn << " Open a plotter-aware graphics system or remove plotter with" << G4endl;
515 G4warn << " /vis/scene/removeModel Plotter" << G4endl;
516}
#define G4warn
Definition G4Scene.cc:41
const G4String & GetName() const

◆ AddPrimitive() [3/7]

void G4DAWNFILESceneHandler::AddPrimitive ( const G4Polyhedron & p)
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [4/7]

void G4DAWNFILESceneHandler::AddPrimitive ( const G4Polyline & line)
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [5/7]

void G4VSceneHandler::AddPrimitive ( const G4Polymarker & polymarker)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 191 of file G4VSceneHandler.cc.

469 {
470 switch (polymarker.GetMarkerType()) {
471 default:
473 {
474 G4Circle dot (polymarker);
475 dot.SetWorldSize (0.);
476 dot.SetScreenSize (0.1); // Very small circle.
477 for (std::size_t iPoint = 0; iPoint < polymarker.size (); ++iPoint) {
478 dot.SetPosition (polymarker[iPoint]);
479 AddPrimitive (dot);
480 }
481 }
482 break;
484 {
485 G4Circle circle (polymarker); // Default circle
486 for (std::size_t iPoint = 0; iPoint < polymarker.size (); ++iPoint) {
487 circle.SetPosition (polymarker[iPoint]);
488 AddPrimitive (circle);
489 }
490 }
491 break;
493 {
494 G4Square square (polymarker); // Default square
495 for (std::size_t iPoint = 0; iPoint < polymarker.size (); ++iPoint) {
496 square.SetPosition (polymarker[iPoint]);
497 AddPrimitive (square);
498 }
499 }
500 break;
501 }
502}
void AddPrimitive(const G4Polyline &line)
MarkerType GetMarkerType() const

◆ AddPrimitive() [6/7]

void G4DAWNFILESceneHandler::AddPrimitive ( const G4Square & )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [7/7]

void G4DAWNFILESceneHandler::AddPrimitive ( const G4Text & )
virtual

Implements G4VSceneHandler.

◆ AddSolid() [1/14]

void G4DAWNFILESceneHandler::AddSolid ( const G4Box & box)
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [2/14]

void G4DAWNFILESceneHandler::AddSolid ( const G4Cons & cons)
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [3/14]

void G4VSceneHandler::AddSolid ( const G4Ellipsoid & ellipsoid)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 110 of file G4VSceneHandler.cc.

305 {
306 AddSolidWithAuxiliaryEdges (ellipsoid);
307}
void AddSolidWithAuxiliaryEdges(const T &solid)

◆ AddSolid() [4/14]

void G4VSceneHandler::AddSolid ( const G4Orb & orb)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 101 of file G4VSceneHandler.cc.

277 {
279}

◆ AddSolid() [5/14]

void G4DAWNFILESceneHandler::AddSolid ( const G4Para & para)
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [6/14]

void G4VSceneHandler::AddSolid ( const G4Polycone & polycone)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 111 of file G4VSceneHandler.cc.

309 {
310 AddSolidT (polycone);
311}
void AddSolidT(const T &solid)

◆ AddSolid() [7/14]

void G4VSceneHandler::AddSolid ( const G4Polyhedra & polyhedra)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 112 of file G4VSceneHandler.cc.

313 {
314 AddSolidT (polyhedra);
315}

◆ AddSolid() [8/14]

void G4DAWNFILESceneHandler::AddSolid ( const G4Sphere & sphere)
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [9/14]

void G4VSceneHandler::AddSolid ( const G4TessellatedSolid & tess)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 113 of file G4VSceneHandler.cc.

317 {
318 AddSolidT (tess);
319}

◆ AddSolid() [10/14]

void G4DAWNFILESceneHandler::AddSolid ( const G4Torus & torus)
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [11/14]

void G4DAWNFILESceneHandler::AddSolid ( const G4Trap & trap)
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [12/14]

void G4DAWNFILESceneHandler::AddSolid ( const G4Trd & trd)
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [13/14]

void G4DAWNFILESceneHandler::AddSolid ( const G4Tubs & tubs)
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [14/14]

void G4DAWNFILESceneHandler::AddSolid ( const G4VSolid & solid)
virtual

Reimplemented from G4VSceneHandler.

◆ BeginPrimitives()

void G4DAWNFILESceneHandler::BeginPrimitives ( const G4Transform3D & objectTransformation)
virtual

Reimplemented from G4VSceneHandler.

◆ BeginSavingG4Prim()

void G4DAWNFILESceneHandler::BeginSavingG4Prim ( void )

Definition at line 216 of file G4DAWNFILESceneHandler.cc.

217{
218#if defined DEBUG_FR_SCENE
220 G4cout << "***** BeginSavingG4Prim (called)\n";
221#endif
222
223 if(!IsSavingG4Prim())
224 {
225#if defined DEBUG_FR_SCENE
227 {
228 G4cout << "***** (started) ";
229 G4cout << "(open g4.prim, ##)" << G4endl;
230 }
231#endif
232 SetG4PrimFileName(); // result set to fG4PrimFileName
233 fPrimDest.Open(fG4PrimFileName);
234
236 flag_saving_g4_prim = true;
237 }
238}
const char FR_G4_PRIM_HEADER[]
Definition G4FRConst.hh:37
void SendStr(const char *char_string)
void Open(const char *filename)

Referenced by FRBeginModeling().

◆ ClearTransientStore()

void G4DAWNFILESceneHandler::ClearTransientStore ( )
virtual

Reimplemented from G4VSceneHandler.

◆ EndPrimitives()

void G4DAWNFILESceneHandler::EndPrimitives ( )
virtual

Reimplemented from G4VSceneHandler.

◆ EndSavingG4Prim()

void G4DAWNFILESceneHandler::EndSavingG4Prim ( void )

Definition at line 240 of file G4DAWNFILESceneHandler.cc.

241{
242#if defined DEBUG_FR_SCENE
244 G4cout << "***** EndSavingG4Prim (called)\n";
245#endif
246
247 if(IsSavingG4Prim())
248 {
249#if defined DEBUG_FR_SCENE
251 G4cout << "***** (started) (close g4.prim)" << G4endl;
252#endif
253 fPrimDest.Close();
254 flag_saving_g4_prim = false;
255 }
256}

◆ FRBeginModeling()

void G4DAWNFILESceneHandler::FRBeginModeling ( void )

Definition at line 259 of file G4DAWNFILESceneHandler.cc.

260{
261 if(!FRIsInModeling())
262 {
263#if defined DEBUG_FR_SCENE
265 G4cout
266 << "***** G4DAWNFILESceneHandler::FRBeginModeling (called & started)"
267 << G4endl;
268#endif
269
270 //----- Send saving command and heading comment
272
273 //----- Send bounding box command
275
276 //----- send SET_CAMERA command
277#if defined DEBUG_FR_SCENE
279 G4cout << "***** (!SetCamera in FRBeginModeling())" << G4endl;
280#endif
282
283 //----- open device
284#if defined DEBUG_FR_SCENE
286 G4cout << "***** (!OpenDevice in FRBeginModeling())" << G4endl;
287#endif
289
290 //----- begin sending primitives
291#if defined DEBUG_FR_SCENE
293 G4cout << "***** (!BeginModeling in FRBeginModeling())" << G4endl;
294#endif
296 FRflag_in_modeling = true;
297
298 } // if
299}
const char FR_OPEN_DEVICE[]
Definition G4FRConst.hh:45
const char FR_BEGIN_MODELING[]
Definition G4FRConst.hh:63
const char FR_SET_CAMERA[]
Definition G4FRConst.hh:44
void SendBoundingBox(void)

Referenced by G4DAWNFILEViewer::ClearView(), and G4DAWNFILEViewer::DrawView().

◆ FREndModeling()

void G4DAWNFILESceneHandler::FREndModeling ( )

◆ FRIsInModeling()

G4bool G4DAWNFILESceneHandler::FRIsInModeling ( )
inline

Definition at line 80 of file G4DAWNFILESceneHandler.hh.

80{ return FRflag_in_modeling; }

Referenced by FRBeginModeling(), and G4DAWNFILEViewer::ShowView().

◆ GetG4PrimFileName()

const char * G4DAWNFILESceneHandler::GetG4PrimFileName ( )
inline

Definition at line 89 of file G4DAWNFILESceneHandler.hh.

89{ return fG4PrimFileName; }

Referenced by G4DAWNFILEViewer::G4DAWNFILEViewer(), and G4DAWNFILEViewer::ShowView().

◆ GetSystem()

G4DAWNFILE & G4DAWNFILESceneHandler::GetSystem ( )
inline

Definition at line 87 of file G4DAWNFILESceneHandler.hh.

87{ return fSystem; }

◆ IsSavingG4Prim()

G4bool G4DAWNFILESceneHandler::IsSavingG4Prim ( void )
inline

Definition at line 82 of file G4DAWNFILESceneHandler.hh.

82{ return flag_saving_g4_prim; }

Referenced by BeginSavingG4Prim(), and EndSavingG4Prim().

◆ SendBoundingBox()

void G4DAWNFILESceneHandler::SendBoundingBox ( void )

Referenced by FRBeginModeling().

◆ SendDouble()

void G4DAWNFILESceneHandler::SendDouble ( G4double val)

◆ SendInt()

void G4DAWNFILESceneHandler::SendInt ( G4int val)

◆ SendInt3Str()

void G4DAWNFILESceneHandler::SendInt3Str ( G4int ival1,
G4int ival2,
G4int ival3,
const char * char_string )

◆ SendInt4Str()

void G4DAWNFILESceneHandler::SendInt4Str ( G4int ival1,
G4int ival2,
G4int ival3,
G4int ival4,
const char * char_string )

◆ SendIntDouble3()

void G4DAWNFILESceneHandler::SendIntDouble3 ( G4int ival,
G4double dval1,
G4double dval2,
G4double dval3 )

◆ SendStr()

void G4DAWNFILESceneHandler::SendStr ( const char * char_string)

◆ SendStrDouble()

void G4DAWNFILESceneHandler::SendStrDouble ( const char * char_string,
G4double dval )

◆ SendStrDouble11()

void G4DAWNFILESceneHandler::SendStrDouble11 ( const char * char_string,
G4double dval1,
G4double dval2,
G4double dval3,
G4double dval4,
G4double dval5,
G4double dval6,
G4double dval7,
G4double dval8,
G4double dval9,
G4double dval10,
G4double dval11 )

◆ SendStrDouble2()

void G4DAWNFILESceneHandler::SendStrDouble2 ( const char * char_string,
G4double dval1,
G4double dval2 )

◆ SendStrDouble3()

void G4DAWNFILESceneHandler::SendStrDouble3 ( const char * char_string,
G4double dval1,
G4double dval2,
G4double dval3 )

◆ SendStrDouble3Str()

void G4DAWNFILESceneHandler::SendStrDouble3Str ( const char * char_string1,
G4double dval1,
G4double dval2,
G4double dval3,
const char * char_string2 )

◆ SendStrDouble4()

void G4DAWNFILESceneHandler::SendStrDouble4 ( const char * char_string,
G4double dval1,
G4double dval2,
G4double dval3,
G4double dval4 )

◆ SendStrDouble5()

void G4DAWNFILESceneHandler::SendStrDouble5 ( const char * char_string,
G4double dval1,
G4double dval2,
G4double dval3,
G4double dval4,
G4double dval5 )

◆ SendStrDouble6()

void G4DAWNFILESceneHandler::SendStrDouble6 ( const char * char_string,
G4double dval1,
G4double dval2,
G4double dval3,
G4double dval4,
G4double dval5,
G4double dval6 )

◆ SendStrDouble6Str()

void G4DAWNFILESceneHandler::SendStrDouble6Str ( const char * char_string1,
G4double dval1,
G4double dval2,
G4double dval3,
G4double dval4,
G4double dval5,
G4double dval6,
const char * char_string2 )

◆ SendStrDouble7()

void G4DAWNFILESceneHandler::SendStrDouble7 ( const char * char_string,
G4double dval1,
G4double dval2,
G4double dval3,
G4double dval4,
G4double dval5,
G4double dval6,
G4double dval7 )

◆ SendStrInt()

void G4DAWNFILESceneHandler::SendStrInt ( const char * char_string,
G4int ival )

◆ SendStrInt3()

void G4DAWNFILESceneHandler::SendStrInt3 ( const char * char_string,
G4int ival1,
G4int ival2,
G4int ival3 )

◆ SendStrInt4()

void G4DAWNFILESceneHandler::SendStrInt4 ( const char * char_string,
G4int ival1,
G4int ival2,
G4int ival3,
G4int ival4 )

◆ SetG4PrimFileName()

void G4DAWNFILESceneHandler::SetG4PrimFileName ( )

Definition at line 144 of file G4DAWNFILESceneHandler.cc.

145{
146 // g4_0000.prim, g4_0001.prim, ..., g4_MAX_FILE_INDEX.prim
147 const int MAX_FILE_INDEX = fMaxFileNum - 1;
148
149 // dest directory (null if no environmental variables is set)
150 strcpy(fG4PrimFileName, fG4PrimDestDir);
151
152 // create full path name (default)
153 strcat(fG4PrimFileName, DEFAULT_G4PRIM_FILE_NAME);
154
155 // Automatic updation of file names
156 for(int i = 0; i < fMaxFileNum; i++)
157 {
158 // Message in the final execution
159 if(i == MAX_FILE_INDEX)
160 {
162 {
163 G4cout << "===========================================" << G4endl;
164 G4cout << "WARNING MESSAGE from DAWNFILE driver: " << G4endl;
165 G4cout << " This file name is the final one in the " << G4endl;
166 G4cout << " automatic updation of the output file name." << G4endl;
167 G4cout << " You may overwrite existing files, i.e. " << G4endl;
168 G4cout << " g4_XXXX.prim and g4_XXXX.eps " << G4endl;
169 G4cout << "===========================================" << G4endl;
170 }
171 }
172
173 // re-determine file name as G4DAWNFILE_DEST_DIR/g4_XXXX.prim
174 std::ostringstream filename;
175 filename << fG4PrimDestDir << G4PRIM_FILE_HEADER << std::setw(4)
176 << std::setfill('0') << i << ".prim";
177 strncpy(fG4PrimFileName, filename.str().c_str(),
178 sizeof(fG4PrimFileName) - 1);
179 fG4PrimFileName[sizeof(fG4PrimFileName) - 1] = '\0';
180
181 // check validity of the file name
182 std::ifstream fin;
183 fin.open(fG4PrimFileName);
184 if(!fin)
185 {
186 // new file
187 fin.close();
188 break;
189 }
190 else
191 {
192 // already exists (try next)
193 fin.close();
194 }
195
196 } // for
197
198 G4cout << "=========================================== " << G4endl;
199 G4cout << "Output file: " << fG4PrimFileName << G4endl;
200 G4cout << "Destination directory (current dir if NULL): " << fG4PrimDestDir
201 << G4endl;
202 G4cout << "Maximal number of files in the destination directory: "
203 << fMaxFileNum << G4endl;
204 G4cout << "Note: " << G4endl;
205 G4cout << " * The maximal number is customizable as: " << G4endl;
206 G4cout << " % setenv G4DAWNFILE_MAX_FILE_NUM number " << G4endl;
207 G4cout << " * The destination directory is customizable as:" << G4endl;
208 G4cout << " % setenv G4DAWNFILE_DEST_DIR dir_name/ " << G4endl;
209 G4cout << " ** Do not forget \"/\" at the end of the " << G4endl;
210 G4cout << " dir_name, e.g. \"./tmp/\". " << G4endl;
211 G4cout << "=========================================== " << G4endl;
212
213} // G4DAWNFILESceneHandler::SetG4PrimFileName()
const char G4PRIM_FILE_HEADER[]

Referenced by BeginSavingG4Prim().

Friends And Related Symbol Documentation

◆ G4DAWNFILEViewer

friend class G4DAWNFILEViewer
friend

Definition at line 46 of file G4DAWNFILESceneHandler.hh.


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