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

#include <G4GMocrenFileViewer.hh>

+ Inheritance diagram for G4GMocrenFileViewer:

Public Member Functions

 G4GMocrenFileViewer (G4GMocrenFileSceneHandler &scene, G4GMocrenMessenger &messenger, const G4String &name="")
 
virtual ~G4GMocrenFileViewer ()
 
void SetView ()
 
void ClearView ()
 
void DrawView ()
 
void ShowView ()
 
const char * GetG4GddViewer ()
 
const char * GetG4GddViewerInvocation ()
 
- Public Member Functions inherited from G4VViewer
 G4VViewer (G4VSceneHandler &, G4int id, const G4String &name="")
 
virtual ~G4VViewer ()
 
virtual void Initialise ()
 
virtual void ResetView ()
 
virtual void SetView ()=0
 
virtual void ClearView ()=0
 
virtual void DrawView ()=0
 
void RefreshView ()
 
virtual void ShowView ()
 
virtual void FinishView ()
 
std::vector< G4ThreeVectorComputeFlyThrough (G4Vector3D *)
 
const G4StringGetName () const
 
const G4StringGetShortName () const
 
void SetName (const G4String &)
 
G4int GetViewId () const
 
G4VSceneHandlerGetSceneHandler () const
 
const G4ViewParametersGetViewParameters () const
 
const G4ViewParametersGetDefaultViewParameters () const
 
G4double GetKernelVisitElapsedTimeSeconds () const
 
virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers () const
 
void SetViewParameters (const G4ViewParameters &vp)
 
void SetDefaultViewParameters (const G4ViewParameters &vp)
 
const G4VisAttributesGetApplicableVisAttributes (const G4VisAttributes *) const
 
void SetNeedKernelVisit (G4bool need)
 
void NeedKernelVisit ()
 
void ProcessView ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4VViewer
void SetTouchable (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath)
 
void TouchableSetVisibility (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, G4bool visibility)
 
void TouchableSetColour (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, const G4Colour &)
 
- Protected Attributes inherited from G4VViewer
G4VSceneHandlerfSceneHandler
 
G4int fViewId
 
G4String fName
 
G4String fShortName
 
G4ViewParameters fVP
 
G4ViewParameters fDefaultVP
 
G4double fKernelVisitElapsedTimeSeconds = 999.
 
G4bool fNeedKernelVisit
 

Detailed Description

Definition at line 42 of file G4GMocrenFileViewer.hh.

Constructor & Destructor Documentation

◆ G4GMocrenFileViewer()

G4GMocrenFileViewer::G4GMocrenFileViewer ( G4GMocrenFileSceneHandler scene,
G4GMocrenMessenger messenger,
const G4String name = "" 
)

Definition at line 60 of file G4GMocrenFileViewer.cc.

63 : G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
64 kSceneHandler (sceneHandler)
65{
66 // Set a g4.gdd-file viewer
67 std::strncpy( kG4GddViewer, "gMocren", 8);
68 if( std::getenv( "G4GMocrenFile_VIEWER" ) != NULL ) {
69 char * env = std::getenv( "G4GMocrenFile_VIEWER" );
70 G4int len = (G4int)std::strlen(env);
71 if(len >= 32) {
72 G4Exception("G4GMocrenFileViewer::G4GMocrenFileViewer(*)",
73 "gMocren1000", FatalException,
74 "Invalid length of string set in G4GMocrenFile_VIEWER");
75 }
76 std::strncpy( kG4GddViewer, env, sizeof(kG4GddViewer) - 1);
77 kG4GddViewer[sizeof(kG4GddViewer) - 1] = '\0';
78 //std::strcpy( kG4GddViewer, getenv( "G4GMocrenFile_VIEWER" ) ) ;
79 }
80
81 // string for viewer invocation
82 if ( !std::strcmp( kG4GddViewer, "NONE" ) ) {
83
84 //std::strcpy( kG4GddViewerInvocation, "" );
85 kG4GddViewerInvocation[0] = '\0';
86 } else {
87
88 std::strncpy( kG4GddViewerInvocation, kG4GddViewer,
89 sizeof(kG4GddViewerInvocation) - 1);
90 kG4GddViewerInvocation[sizeof(kG4GddViewerInvocation) - 1] = '\0';
91 G4int n = sizeof(kG4GddViewerInvocation)
92 - (G4int)std::strlen(kG4GddViewerInvocation) - 1;
93 std::strncat( kG4GddViewerInvocation, " ", n);
94 const char * gddfname = kSceneHandler.GetGddFileName();
95 G4int len = (G4int)std::strlen(gddfname);
96 if(len >= 64) {
97 G4Exception("G4GMocrenFileViewer::G4GMocrenFileViewer(*)",
98 "gMocren1001", FatalException,
99 "Invalid length of the GDD file name");
100 }
101 n = sizeof(kG4GddViewerInvocation)
102 - (G4int)std::strlen(kG4GddViewerInvocation) - 1;
103 std::strncat( kG4GddViewerInvocation, gddfname, n);
104 }
105
106}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
int G4int
Definition: G4Types.hh:85

◆ ~G4GMocrenFileViewer()

G4GMocrenFileViewer::~G4GMocrenFileViewer ( )
virtual

Definition at line 109 of file G4GMocrenFileViewer.cc.

110{}

Member Function Documentation

◆ ClearView()

void G4GMocrenFileViewer::ClearView ( void  )
virtual

Implements G4VViewer.

Definition at line 126 of file G4GMocrenFileViewer.cc.

127{
128 if(GFDEBUG) {
130 G4cout << "***** G4GMocrenFileViewer::ClearView (): No effects " << G4endl;
131 }
132 }
133 //if(kSceneHandler.kGddDest) {
134 //kSceneHandler.kGddDest.close();
135 // Re-open with same filename...
136 //kSceneHandler.kGddDest.open(kSceneHandler.kGddFileName);
137 kSceneHandler.kFlagInModeling = false;
138 kSceneHandler.GFBeginModeling();
139 //}
140}
const G4bool GFDEBUG
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static Verbosity GetVerbosity()

◆ DrawView()

void G4GMocrenFileViewer::DrawView ( )
virtual

Implements G4VViewer.

Definition at line 144 of file G4GMocrenFileViewer.cc.

145{
146 if(GFDEBUG)
148 G4cout << "***** G4GMocrenFileViewer::DrawView () " << G4endl;
149
150 //-----
151 kSceneHandler.GFBeginModeling() ;
152
153 //----- Always visit G4 kernel
155
156 //----- Draw
158
159} // G4GMocrenFileViewer::DrawView ()
void ProcessView()
Definition: G4VViewer.cc:107
void NeedKernelVisit()
Definition: G4VViewer.cc:80

◆ GetG4GddViewer()

const char * G4GMocrenFileViewer::GetG4GddViewer ( )
inline

Definition at line 57 of file G4GMocrenFileViewer.hh.

57{ return kG4GddViewer;}

◆ GetG4GddViewerInvocation()

const char * G4GMocrenFileViewer::GetG4GddViewerInvocation ( )
inline

Definition at line 58 of file G4GMocrenFileViewer.hh.

58{ return kG4GddViewerInvocation;}

◆ SetView()

void G4GMocrenFileViewer::SetView ( )
virtual

Implements G4VViewer.

Definition at line 113 of file G4GMocrenFileViewer.cc.

114{
115 if(GFDEBUG)
117 G4cout << "***** G4GMocrenFileViewer::SetView(): No effects" << G4endl;
118
119 // Do nothing, since DAWN is running as a different process.
120 // SendViewParameters () will do this job instead.
121}

◆ ShowView()

void G4GMocrenFileViewer::ShowView ( void  )
virtual

Reimplemented from G4VViewer.

Definition at line 164 of file G4GMocrenFileViewer.cc.

165{
166 if(GFDEBUG)
168 G4cout << "***** G4GMocrenFileViewer::ShowView () " << G4endl;
169
170 if( kSceneHandler.GFIsInModeling() )
171 {
172 //----- End of modeling
173 // !EndModeling, !DrawAll, !CloseDevice,
174 // close g4.gdd
175 kSceneHandler.GFEndModeling();
176
177 //----- Output DAWN GUI file
178 //SendViewParameters();
179
180 //----- string for viewer invocation
181 if ( !strcmp( kG4GddViewer, "NONE" ) ) {
182
183 kG4GddViewerInvocation[0] = '\0';
184 //std::strcpy( kG4GddViewerInvocation, "" );
185 } else {
186
187 std::strncpy( kG4GddViewerInvocation, kG4GddViewer,
188 sizeof(kG4GddViewerInvocation) - 1);
189 kG4GddViewerInvocation[sizeof(kG4GddViewerInvocation) - 1] = '\0';
190 G4int n = sizeof(kG4GddViewerInvocation)
191 - (G4int)std::strlen(kG4GddViewerInvocation) - 1;
192 std::strncat( kG4GddViewerInvocation, " ", n);
193 const char * gddfname = kSceneHandler.GetGddFileName();
194 G4int len = (G4int)std::strlen(gddfname);
195 if(len >= 64) {
196 G4Exception("G4GMocrenFileViewer::ShowView()",
197 "gMocren1002", FatalException,
198 "Invalid length of the GDD file name");
199 }
200 n = sizeof(kG4GddViewerInvocation)
201 - (G4int)std::strlen(kG4GddViewerInvocation) - 1;
202 std::strncat( kG4GddViewerInvocation, gddfname, n);
203 }
204
205 }
206
207} // G4GMocrenFileViewer::ShowView()

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