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

#include <G4GMocrenFileViewer.hh>

Inheritance diagram for G4GMocrenFileViewer:
Collaboration 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 ()
 
void RefreshView ()
 
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
 
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
 
G4bool fNeedKernelVisit
 

Detailed Description

Definition at line 43 of file G4GMocrenFileViewer.hh.

Constructor & Destructor Documentation

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 {
67  // Set a g4.gdd-file viewer
68  std::strncpy( kG4GddViewer, "gMocren", 8);
69  if( getenv( "G4GMocrenFile_VIEWER" ) != NULL ) {
70  char * env = getenv( "G4GMocrenFile_VIEWER" );
71  int len = std::strlen(env);
72  if(len >= 32) {
73  G4Exception("G4GMocrenFileViewer::G4GMocrenFileViewer(*)",
74  "gMocren1000", FatalException,
75  "Invalid length of string set in G4GMocrenFile_VIEWER");
76  }
77  std::strncpy( kG4GddViewer, env, len);
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, std::strlen(kG4GddViewer));
89  std::strncat( kG4GddViewerInvocation, " ", 1);
90  const char * gddfname = kSceneHandler.GetGddFileName();
91  int len = std::strlen(gddfname);
92  if(len >= 64) {
93  G4Exception("G4GMocrenFileViewer::G4GMocrenFileViewer(*)",
94  "gMocren1001", FatalException,
95  "Invalid length of the GDD file name");
96  }
97  std::strncat( kG4GddViewerInvocation, gddfname, len );
98  }
99 
100 }
const XML_Char int len
Definition: expat.h:262
const XML_Char * name
Definition: expat.h:151
G4VViewer(G4VSceneHandler &, G4int id, const G4String &name="")
Definition: G4VViewer.cc:46
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Here is the call graph for this function:

G4GMocrenFileViewer::~G4GMocrenFileViewer ( )
virtual

Definition at line 103 of file G4GMocrenFileViewer.cc.

104 {}

Member Function Documentation

void G4GMocrenFileViewer::ClearView ( void  )
virtual

Implements G4VViewer.

Definition at line 120 of file G4GMocrenFileViewer.cc.

121 {
122  if(GFDEBUG)
124  G4cout << "***** G4GMocrenFileViewer::ClearView (): No effects " << G4endl;
125 
126  //if(kSceneHandler.kGddDest) {
127  //kSceneHandler.kGddDest.close();
128  // Re-open with same filename...
129  //kSceneHandler.kGddDest.open(kSceneHandler.kGddFileName);
130  kSceneHandler.kFlagInModeling = false;
131  kSceneHandler.GFBeginModeling();
132  //}
133 }
G4GLOB_DLL std::ostream G4cout
static Verbosity GetVerbosity()
const G4bool GFDEBUG
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4GMocrenFileViewer::DrawView ( )
virtual

Implements G4VViewer.

Definition at line 137 of file G4GMocrenFileViewer.cc.

138 {
139  if(GFDEBUG)
141  G4cout << "***** G4GMocrenFileViewer::DrawView () " << G4endl;
142 
143  //-----
144  kSceneHandler.GFBeginModeling() ;
145 
146  //----- Always visit G4 kernel
147  NeedKernelVisit ();
148 
149  //----- Draw
151 
152 } // G4GMocrenFileViewer::DrawView ()
G4GLOB_DLL std::ostream G4cout
static Verbosity GetVerbosity()
void NeedKernelVisit()
Definition: G4VViewer.cc:78
const G4bool GFDEBUG
#define G4endl
Definition: G4ios.hh:61
void ProcessView()
Definition: G4VViewer.cc:105

Here is the call graph for this function:

const char* G4GMocrenFileViewer::GetG4GddViewer ( )
inline

Definition at line 58 of file G4GMocrenFileViewer.hh.

58 { return kG4GddViewer;}
const char* G4GMocrenFileViewer::GetG4GddViewerInvocation ( )
inline

Definition at line 59 of file G4GMocrenFileViewer.hh.

59 { return kG4GddViewerInvocation;}
void G4GMocrenFileViewer::SetView ( )
virtual

Implements G4VViewer.

Definition at line 107 of file G4GMocrenFileViewer.cc.

108 {
109  if(GFDEBUG)
111  G4cout << "***** G4GMocrenFileViewer::SetView(): No effects" << G4endl;
112 
113  // Do nothing, since DAWN is running as a different process.
114  // SendViewParameters () will do this job instead.
115 }
G4GLOB_DLL std::ostream G4cout
static Verbosity GetVerbosity()
const G4bool GFDEBUG
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4GMocrenFileViewer::ShowView ( void  )
virtual

Reimplemented from G4VViewer.

Definition at line 157 of file G4GMocrenFileViewer.cc.

158 {
159  if(GFDEBUG)
161  G4cout << "***** G4GMocrenFileViewer::ShowView () " << G4endl;
162 
163  if( kSceneHandler.GFIsInModeling() )
164  {
165  //----- End of modeling
166  // !EndModeling, !DrawAll, !CloseDevice,
167  // close g4.gdd
168  kSceneHandler.GFEndModeling();
169 
170  //----- Output DAWN GUI file
171  //SendViewParameters();
172 
173  //----- string for viewer invocation
174  if ( !strcmp( kG4GddViewer, "NONE" ) ) {
175 
176  kG4GddViewerInvocation[0] = '\0';
177  //std::strcpy( kG4GddViewerInvocation, "" );
178  } else {
179 
180  std::strncpy( kG4GddViewerInvocation, kG4GddViewer, std::strlen(kG4GddViewer));
181  std::strncat( kG4GddViewerInvocation, " ", 1);
182  const char * gddfname = kSceneHandler.GetGddFileName();
183  int len = std::strlen(gddfname);
184  if(len >= 64) {
185  G4Exception("G4GMocrenFileViewer::ShowView()",
186  "gMocren1002", FatalException,
187  "Invalid length of the GDD file name");
188  }
189  std::strncat( kG4GddViewerInvocation, gddfname, len);
190  }
191 
192  }
193 
194 } // G4GMocrenFileViewer::ShowView()
const XML_Char int len
Definition: expat.h:262
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static Verbosity GetVerbosity()
const G4bool GFDEBUG
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:


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