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

#include <G4VRML1FileSceneHandler.hh>

+ Inheritance diagram for G4VRML1FileSceneHandler:

Public Member Functions

 G4VRML1FileSceneHandler (G4VRML1File &system, const G4String &name="")
 
virtual ~G4VRML1FileSceneHandler ()
 
void AddSolid (const G4Box &)
 
void AddSolid (const G4Cons &)
 
void AddSolid (const G4Tubs &)
 
void AddSolid (const G4Trd &)
 
void AddSolid (const G4Trap &)
 
void AddSolid (const G4Sphere &)
 
void AddSolid (const G4Para &)
 
void AddSolid (const G4Torus &)
 
void AddSolid (const G4Polycone &polycone)
 
void AddSolid (const G4Polyhedra &polyhedra)
 
void AddSolid (const G4VSolid &)
 
void AddCompound (const G4VTrajectory &traj)
 
void AddCompound (const G4VHit &hit)
 
void AddCompound (const G4VDigi &digi)
 
void AddCompound (const G4THitsMap< G4double > &hits)
 
void BeginPrimitives (const G4Transform3D &objectTransformation)
 
void EndPrimitives ()
 
void AddPrimitive (const G4Polyline &)
 
void AddPrimitive (const G4Polyhedron &)
 
void AddPrimitive (const G4NURBS &)
 
void AddPrimitive (const G4Text &)
 
void AddPrimitive (const G4Circle &)
 
void AddPrimitive (const G4Square &)
 
void AddPrimitive (const G4Polymarker &polymarker)
 
void AddPrimitive (const G4Scale &scale)
 
void ClearTransientStore ()
 
void BeginModeling ()
 
void EndModeling ()
 
void VRMLBeginModeling ()
 
void VRMLEndModeling ()
 
void connectPort ()
 
void closePort ()
 
- 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 AddSolid (const G4Box &)
 
virtual void AddSolid (const G4Cons &)
 
virtual void AddSolid (const G4Tubs &)
 
virtual void AddSolid (const G4Trd &)
 
virtual void AddSolid (const G4Trap &)
 
virtual void AddSolid (const G4Sphere &)
 
virtual void AddSolid (const G4Para &)
 
virtual void AddSolid (const G4Torus &)
 
virtual void AddSolid (const G4Polycone &)
 
virtual void AddSolid (const G4Polyhedra &)
 
virtual void AddSolid (const G4VSolid &)
 
virtual void AddCompound (const G4VTrajectory &)
 
virtual void AddCompound (const G4VHit &)
 
virtual void AddCompound (const G4VDigi &)
 
virtual void AddCompound (const G4THitsMap< G4double > &)
 
virtual void BeginModeling ()
 
virtual void EndModeling ()
 
virtual void BeginPrimitives (const G4Transform3D &objectTransformation)
 
virtual void EndPrimitives ()
 
virtual void BeginPrimitives2D (const G4Transform3D &objectTransformation)
 
virtual void EndPrimitives2D ()
 
virtual void AddPrimitive (const G4Polyline &)=0
 
virtual void AddPrimitive (const G4Scale &)
 
virtual void AddPrimitive (const G4Text &)=0
 
virtual void AddPrimitive (const G4Circle &)=0
 
virtual void AddPrimitive (const G4Square &)=0
 
virtual void AddPrimitive (const G4Polymarker &)
 
virtual void AddPrimitive (const G4Polyhedron &)=0
 
virtual void AddPrimitive (const G4NURBS &)=0
 
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 G4Visible &)
 
const G4ColourGetColor (const G4Visible &)
 
const G4ColourGetTextColour (const G4Text &)
 
const G4ColourGetTextColor (const G4Text &)
 
G4double GetLineWidth (const G4VisAttributes *)
 
G4ViewParameters::DrawingStyle GetDrawingStyle (const G4VisAttributes *)
 
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 ()
 
G4int IncrementViewCount ()
 
virtual void ClearStore ()
 
virtual void ClearTransientStore ()
 
void AddViewerToList (G4VViewer *pView)
 
void RemoveViewerFromList (G4VViewer *pView)
 
- Public Member Functions inherited from G4VGraphicsScene
 G4VGraphicsScene ()
 
virtual ~G4VGraphicsScene ()
 
virtual void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &visAttribs)=0
 
virtual void PostAddSolid ()=0
 
virtual void AddSolid (const G4Box &)=0
 
virtual void AddSolid (const G4Cons &)=0
 
virtual void AddSolid (const G4Tubs &)=0
 
virtual void AddSolid (const G4Trd &)=0
 
virtual void AddSolid (const G4Trap &)=0
 
virtual void AddSolid (const G4Sphere &)=0
 
virtual void AddSolid (const G4Para &)=0
 
virtual void AddSolid (const G4Torus &)=0
 
virtual void AddSolid (const G4Polycone &)=0
 
virtual void AddSolid (const G4Polyhedra &)=0
 
virtual void AddSolid (const G4VSolid &)=0
 
virtual void AddCompound (const G4VTrajectory &)=0
 
virtual void AddCompound (const G4VHit &)=0
 
virtual void AddCompound (const G4VDigi &)=0
 
virtual void AddCompound (const G4THitsMap< G4double > &)=0
 
virtual void BeginPrimitives (const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void EndPrimitives ()=0
 
virtual void BeginPrimitives2D (const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void EndPrimitives2D ()=0
 
virtual void AddPrimitive (const G4Polyline &)=0
 
virtual void AddPrimitive (const G4Scale &)=0
 
virtual void AddPrimitive (const G4Text &)=0
 
virtual void AddPrimitive (const G4Circle &)=0
 
virtual void AddPrimitive (const G4Square &)=0
 
virtual void AddPrimitive (const G4Polymarker &)=0
 
virtual void AddPrimitive (const G4Polyhedron &)=0
 
virtual void AddPrimitive (const G4NURBS &)=0
 

Friends

class G4VRML1FileViewer
 

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 G4VSolidCreateSectionSolid ()
 
virtual G4VSolidCreateCutawaySolid ()
 
void LoadAtts (const G4Visible &, G4AttHolder *)
 
- 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 45 of file G4VRML1FileSceneHandler.hh.

Constructor & Destructor Documentation

◆ G4VRML1FileSceneHandler()

G4VRML1FileSceneHandler::G4VRML1FileSceneHandler ( G4VRML1File system,
const G4String name = "" 
)

Definition at line 74 of file G4VRML1FileSceneHandler.cc.

74 :
75 G4VSceneHandler(system, fSceneIdCount++, name),
76 fSystem(system),
77 fDest() ,
78 fFlagDestOpen( false )
79{
80 fCurrentDEF = "";
81 strcpy(fVRMLFileName, "");
82
83 if ( getenv( VRMLFILE_DEST_DIR ) == NULL ) {
84 strcpy( fVRMLFileDestDir, "" );
85 } else {
86 strcpy( fVRMLFileDestDir, getenv( VRMLFILE_DEST_DIR ) );
87 }
88
89 // maximum number of g4.wrl files in the dest directory
90 fMaxFileNum = DEFAULT_MAX_WRL_FILE_NUM ; // initialization
91 if ( getenv( "G4VRMLFILE_MAX_FILE_NUM" ) != NULL ) {
92
93 sscanf( getenv("G4VRMLFILE_MAX_FILE_NUM"), "%d", &fMaxFileNum ) ;
94
95 } else {
96 fMaxFileNum = DEFAULT_MAX_WRL_FILE_NUM ;
97 }
98 if( fMaxFileNum < 1 ) { fMaxFileNum = 1; }
99
100}
const int DEFAULT_MAX_WRL_FILE_NUM
const char VRMLFILE_DEST_DIR[]

◆ ~G4VRML1FileSceneHandler()

G4VRML1FileSceneHandler::~G4VRML1FileSceneHandler ( )
virtual

Definition at line 103 of file G4VRML1FileSceneHandler.cc.

104{
105#if defined DEBUG_FR_SCENE
107 G4cout << "***** ~G4VRML1FileSceneHandler" << G4endl;
108#endif
110}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static Verbosity GetVerbosity()

Member Function Documentation

◆ AddCompound() [1/4]

void G4VRML1FileSceneHandler::AddCompound ( const G4THitsMap< G4double > &  hits)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 77 of file G4VRML1FileSceneHandler.hh.

77 {
79 }
virtual void AddCompound(const G4VTrajectory &)

◆ AddCompound() [2/4]

void G4VRML1FileSceneHandler::AddCompound ( const G4VDigi digi)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 74 of file G4VRML1FileSceneHandler.hh.

74 {
76 }

◆ AddCompound() [3/4]

void G4VRML1FileSceneHandler::AddCompound ( const G4VHit hit)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 71 of file G4VRML1FileSceneHandler.hh.

71 {
73 }

◆ AddCompound() [4/4]

void G4VRML1FileSceneHandler::AddCompound ( const G4VTrajectory traj)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 68 of file G4VRML1FileSceneHandler.hh.

68 {
70 }

◆ AddPrimitive() [1/8]

void G4VRML1FileSceneHandler::AddPrimitive ( const G4Circle )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [2/8]

void G4VRML1FileSceneHandler::AddPrimitive ( const G4NURBS )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [3/8]

void G4VRML1FileSceneHandler::AddPrimitive ( const G4Polyhedron )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [4/8]

void G4VRML1FileSceneHandler::AddPrimitive ( const G4Polyline )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [5/8]

void G4VRML1FileSceneHandler::AddPrimitive ( const G4Polymarker polymarker)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 90 of file G4VRML1FileSceneHandler.hh.

91 { G4VSceneHandler::AddPrimitive (polymarker); }
virtual void AddPrimitive(const G4Polyline &)=0

◆ AddPrimitive() [6/8]

void G4VRML1FileSceneHandler::AddPrimitive ( const G4Scale scale)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 92 of file G4VRML1FileSceneHandler.hh.

◆ AddPrimitive() [7/8]

void G4VRML1FileSceneHandler::AddPrimitive ( const G4Square )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [8/8]

void G4VRML1FileSceneHandler::AddPrimitive ( const G4Text )
virtual

Implements G4VSceneHandler.

◆ AddSolid() [1/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4Box )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [2/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4Cons )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [3/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4Para )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [4/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4Polycone polycone)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 61 of file G4VRML1FileSceneHandler.hh.

61 {
63 }
virtual void AddSolid(const G4Box &)

◆ AddSolid() [5/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4Polyhedra polyhedra)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 64 of file G4VRML1FileSceneHandler.hh.

64 {
65 G4VSceneHandler::AddSolid (polyhedra);
66 }

◆ AddSolid() [6/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4Sphere )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [7/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4Torus )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [8/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4Trap )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [9/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4Trd )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [10/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4Tubs )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [11/11]

void G4VRML1FileSceneHandler::AddSolid ( const G4VSolid )
virtual

Reimplemented from G4VSceneHandler.

◆ BeginModeling()

void G4VRML1FileSceneHandler::BeginModeling ( )
virtual

Reimplemented from G4VSceneHandler.

◆ BeginPrimitives()

void G4VRML1FileSceneHandler::BeginPrimitives ( const G4Transform3D objectTransformation)
virtual

Reimplemented from G4VSceneHandler.

◆ ClearTransientStore()

void G4VRML1FileSceneHandler::ClearTransientStore ( )
virtual

Reimplemented from G4VSceneHandler.

◆ closePort()

void G4VRML1FileSceneHandler::closePort ( )

Definition at line 182 of file G4VRML1FileSceneHandler.cc.

183{
184 char command[256] ;
185 char viewer [256] ;
186 strcpy( viewer, NO_VRML_VIEWER ); // initialization
187 if( getenv( ENV_VRML_VIEWER ) ) {
188 strcpy( viewer, getenv( ENV_VRML_VIEWER ) ) ;
189 }
190
191 // close VRML file
192 fDest.close(); fFlagDestOpen = false ;
194 G4cout << "*** VRML 1.0 File " << fVRMLFileName << " is generated." << G4endl;
195
196
197 // Invoke viewer
198
199 if ( !strcmp(viewer, NO_VRML_VIEWER )) {
201 G4cout << "MESSAGE from VRML1FILE driver:" << G4endl;
202 G4cout << " Set an environmental variable " ;
204 G4cout << " if you want to visualize the generated VRML file" << G4endl;
205 G4cout << " automatically. For example, " << G4endl;
206 G4cout << " setenv " << ENV_VRML_VIEWER << " vrweb " << G4endl;
207 }
208 } else {
209 sprintf( command, "%s %s", viewer, fVRMLFileName );
210 (void) system( command );
211 }
212}
const char NO_VRML_VIEWER[]
const char ENV_VRML_VIEWER[]

◆ connectPort()

void G4VRML1FileSceneHandler::connectPort ( )

Definition at line 120 of file G4VRML1FileSceneHandler.cc.

121{
122 // g4_00.wrl, g4_01.wrl, ..., g4_MAX_FILE_INDEX.wrl
123 const int MAX_FILE_INDEX = fMaxFileNum - 1 ;
124
125 // dest directory (null if no environmental variables is set)
126 strcpy ( fVRMLFileName, fVRMLFileDestDir) ;
127
128 // create (full) path name (default)
129 strcat ( fVRMLFileName, DEFAULT_WRL_FILE_NAME );
130
131 // Determine VRML file name
132 for( int i = 0 ; i < fMaxFileNum ; i++) {
133
134 // Message in the final execution
135 if( i == MAX_FILE_INDEX )
136 {
138 G4cout << "===========================================" << G4endl;
139 G4cout << "WARNING MESSAGE from VRML1FILE driver: " << G4endl;
140 G4cout << " This file name is the final one in the " << G4endl;
141 G4cout << " automatic updation of the output file name." << G4endl;
142 G4cout << " You may overwrite existing files, i.e. " << G4endl;
143 G4cout << " g4_XX.wrl. " << G4endl;
144 G4cout << "===========================================" << G4endl;
145 }
146 }
147
148 // re-determine file name as G4VRMLFILE_DEST_DIR/g4_XX.wrl
149 if( i >= 0 && i <= 9 ) {
150 sprintf( fVRMLFileName, "%s%s%s%d.wrl" , fVRMLFileDestDir, WRL_FILE_HEADER, "0", i );
151 } else {
152 sprintf( fVRMLFileName, "%s%s%d.wrl" , fVRMLFileDestDir, WRL_FILE_HEADER, i );
153 }
154
155 // check validity of the file name
156 std::ifstream fin ;
157 fin.open(fVRMLFileName) ;
158 if(!fin) {
159 // new file
160 fin.close();
161 break;
162 } else {
163 // already exists (try next)
164 fin.close();
165 }
166
167
168 } // for
169
170 // open a VRML 1.0 file with determined file name
172 G4cout << "===========================================" << G4endl;
173 G4cout << "Output VRML 1.0 file: " << fVRMLFileName << G4endl;
174 G4cout << "Maximum number of files in the destination directory: " << fMaxFileNum << G4endl;
175 G4cout << " (Customizable with the environment variable: G4VRMLFILE_MAX_FILE_NUM) " << G4endl;
176 G4cout << "===========================================" << G4endl;
177 }
178 fDest.open(fVRMLFileName) ; fFlagDestOpen = true ;
179}
const char DEFAULT_WRL_FILE_NAME[]
const char WRL_FILE_HEADER[]

◆ EndModeling()

void G4VRML1FileSceneHandler::EndModeling ( )
virtual

Reimplemented from G4VSceneHandler.

◆ EndPrimitives()

void G4VRML1FileSceneHandler::EndPrimitives ( )
virtual

Reimplemented from G4VSceneHandler.

◆ VRMLBeginModeling()

void G4VRML1FileSceneHandler::VRMLBeginModeling ( )

◆ VRMLEndModeling()

void G4VRML1FileSceneHandler::VRMLEndModeling ( )

Friends And Related Function Documentation

◆ G4VRML1FileViewer

friend class G4VRML1FileViewer
friend

Definition at line 47 of file G4VRML1FileSceneHandler.hh.


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