Geant4 9.6.0
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 ()
 
const G4StringGetName () const
 
const G4StringGetShortName () const
 
void SetName (const G4String &)
 
G4int GetViewId () const
 
G4VSceneHandlerGetSceneHandler () const
 
const G4ViewParametersGetViewParameters () const
 
const G4ViewParametersGetDefaultViewParameters () 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 Attributes inherited from G4VViewer
G4VSceneHandlerfSceneHandler
 
G4int fViewId
 
G4String fName
 
G4String fShortName
 
G4ViewParameters fVP
 
G4ViewParameters fDefaultVP
 
G4bool fNeedKernelVisit
 

Detailed Description

Definition at line 43 of file G4GMocrenFileViewer.hh.

Constructor & Destructor Documentation

◆ G4GMocrenFileViewer()

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

Definition at line 61 of file G4GMocrenFileViewer.cc.

64 : G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
65 kSceneHandler (sceneHandler),
66 kMessenger(messenger)
67{
68 // Set a g4.gdd-file viewer
69 std::strncpy( kG4GddViewer, "gMocren", 7);
70 if( getenv( "G4GMocrenFile_VIEWER" ) != NULL ) {
71 char * env = getenv( "G4GMocrenFile_VIEWER" );
72 std::strncpy( kG4GddViewer, env, std::strlen(env));
73 //std::strcpy( kG4GddViewer, getenv( "G4GMocrenFile_VIEWER" ) ) ;
74 }
75
76 // string for viewer invocation
77 if ( !std::strcmp( kG4GddViewer, "NONE" ) ) {
78
79 //std::strcpy( kG4GddViewerInvocation, "" );
80 kG4GddViewerInvocation[0] = '\0';
81 } else {
82
83 std::strncpy( kG4GddViewerInvocation, kG4GddViewer, std::strlen(kG4GddViewer));
84 std::strncat( kG4GddViewerInvocation, " ", 1);
85 const char * gddfname = kSceneHandler.GetGddFileName();
86 std::strncat( kG4GddViewerInvocation, gddfname, std::strlen(gddfname) );
87 }
88
89}

◆ ~G4GMocrenFileViewer()

G4GMocrenFileViewer::~G4GMocrenFileViewer ( )
virtual

Definition at line 92 of file G4GMocrenFileViewer.cc.

93{}

Member Function Documentation

◆ ClearView()

void G4GMocrenFileViewer::ClearView ( void  )
virtual

Implements G4VViewer.

Definition at line 109 of file G4GMocrenFileViewer.cc.

110{
111 if(GFDEBUG)
113 G4cout << "***** G4GMocrenFileViewer::ClearView (): No effects " << G4endl;
114
115 //if(kSceneHandler.kGddDest) {
116 //kSceneHandler.kGddDest.close();
117 // Re-open with same filename...
118 //kSceneHandler.kGddDest.open(kSceneHandler.kGddFileName);
119 kSceneHandler.kFlagInModeling = false;
120 kSceneHandler.GFBeginModeling();
121 //}
122}
const G4bool GFDEBUG
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static Verbosity GetVerbosity()

◆ DrawView()

void G4GMocrenFileViewer::DrawView ( )
virtual

Implements G4VViewer.

Definition at line 126 of file G4GMocrenFileViewer.cc.

127{
128 if(GFDEBUG)
130 G4cout << "***** G4GMocrenFileViewer::DrawView () " << G4endl;
131
132 //-----
133 kSceneHandler.GFBeginModeling() ;
134
135 //----- Always visit G4 kernel
137
138 //----- Draw
140
141} // G4GMocrenFileViewer::DrawView ()
void ProcessView()
Definition: G4VViewer.cc:115
void NeedKernelVisit()
Definition: G4VViewer.cc:86

◆ GetG4GddViewer()

const char * G4GMocrenFileViewer::GetG4GddViewer ( )
inline

Definition at line 58 of file G4GMocrenFileViewer.hh.

58{ return kG4GddViewer;}

◆ GetG4GddViewerInvocation()

const char * G4GMocrenFileViewer::GetG4GddViewerInvocation ( )
inline

Definition at line 59 of file G4GMocrenFileViewer.hh.

59{ return kG4GddViewerInvocation;}

◆ SetView()

void G4GMocrenFileViewer::SetView ( )
virtual

Implements G4VViewer.

Definition at line 96 of file G4GMocrenFileViewer.cc.

97{
98 if(GFDEBUG)
100 G4cout << "***** G4GMocrenFileViewer::SetView(): No effects" << G4endl;
101
102 // Do nothing, since DAWN is running as a different process.
103 // SendViewParameters () will do this job instead.
104}

◆ ShowView()

void G4GMocrenFileViewer::ShowView ( void  )
virtual

Reimplemented from G4VViewer.

Definition at line 146 of file G4GMocrenFileViewer.cc.

147{
148 if(GFDEBUG)
150 G4cout << "***** G4GMocrenFileViewer::ShowView () " << G4endl;
151
152 if( kSceneHandler.GFIsInModeling() )
153 {
154 //----- End of modeling
155 // !EndModeling, !DrawAll, !CloseDevice,
156 // close g4.gdd
157 kSceneHandler.GFEndModeling();
158
159 //----- Output DAWN GUI file
160 //SendViewParameters();
161
162 //----- string for viewer invocation
163 if ( !strcmp( kG4GddViewer, "NONE" ) ) {
164
165 kG4GddViewerInvocation[0] = '\0';
166 //std::strcpy( kG4GddViewerInvocation, "" );
167 } else {
168
169 std::strncpy( kG4GddViewerInvocation, kG4GddViewer, std::strlen(kG4GddViewer));
170 std::strncat( kG4GddViewerInvocation, " ", 1);
171 const char * gddfname = kSceneHandler.GetGddFileName();
172 std::strncat( kG4GddViewerInvocation, gddfname, std::strlen(gddfname));
173 }
174
175 }
176
177} // G4GMocrenFileViewer::ShowView()

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