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

#include <G4VisCommandsCompound.hh>

Inheritance diagram for G4VisCommandOpen:
Collaboration diagram for G4VisCommandOpen:

Public Member Functions

 G4VisCommandOpen ()
 
virtual ~G4VisCommandOpen ()
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommand
 G4VVisCommand ()
 
virtual ~G4VVisCommand ()
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
static const G4ColourGetCurrentColour ()
 
static G4double GetCurrentLineWidth ()
 
static const G4ColourGetCurrentTextColour ()
 
static G4Text::Layout GetCurrentTextLayout ()
 
static G4double GetCurrentTextSize ()
 
- Protected Member Functions inherited from G4VVisCommand
void UpdateVisManagerScene (const G4String &sceneName="")
 
- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Static Protected Member Functions inherited from G4VVisCommand
static G4String ConvertToString (G4double x, G4double y, const char *unitName)
 
static void ConvertToDoublePair (const G4String &paramString, G4double &xval, G4double &yval)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4int fErrorCode = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4double fCurrentLineWidth = 1.
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentTextSize = 12.
 
static
G4ModelingParameters::PVNameCopyNoPath 
fCurrentTouchablePath
 

Detailed Description

Definition at line 69 of file G4VisCommandsCompound.hh.

Constructor & Destructor Documentation

G4VisCommandOpen::G4VisCommandOpen ( )

Definition at line 248 of file G4VisCommandsCompound.cc.

248  {
249  G4bool omitable;
250  fpCommand = new G4UIcommand("/vis/open", this);
251  fpCommand->SetGuidance
252  ("Creates a scene handler ready for drawing.");
253  fpCommand->SetGuidance
254  ("The scene handler becomes current (the name is auto-generated).");
255  G4UIparameter* parameter;
256  parameter = new G4UIparameter("graphics-system-name", 's', omitable = false);
257  fpCommand->SetParameter(parameter);
258  parameter = new G4UIparameter("window-size-hint", 's', omitable = true);
259  parameter->SetGuidance
260  ("integer (pixels) for square window placed by window manager or"
261  " X-Windows-type geometry string, e.g. 600x600-100+100");
262  parameter->SetDefaultValue("600");
263  fpCommand->SetParameter(parameter);
264 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetDefaultValue(const char *theDefaultValue)
bool G4bool
Definition: G4Types.hh:79
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetGuidance(const char *theGuidance)

Here is the call graph for this function:

G4VisCommandOpen::~G4VisCommandOpen ( )
virtual

Definition at line 266 of file G4VisCommandsCompound.cc.

266  {
267  delete fpCommand;
268 }

Member Function Documentation

void G4VisCommandOpen::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 270 of file G4VisCommandsCompound.cc.

270  {
271  G4String systemName, windowSizeHint;
272  std::istringstream is(newValue);
273  is >> systemName >> windowSizeHint;
274  G4UImanager* UImanager = G4UImanager::GetUIpointer();
275  G4int keepVerbose = UImanager->GetVerboseLevel();
276  G4int newVerbose(0);
277  if (keepVerbose >= 2 ||
279  newVerbose = 2;
280  UImanager->SetVerboseLevel(newVerbose);
281  fErrorCode = UImanager->ApplyCommand(G4String("/vis/sceneHandler/create " + systemName));
282  if (fErrorCode == 0) {
283  UImanager->ApplyCommand(G4String("/vis/viewer/create ! ! " + windowSizeHint));
284  } else {
285  // Use set to get alphabetical order
286  std::set<G4String> candidates;
287  for (const auto gs: fpVisManager -> GetAvailableGraphicsSystems()) {
288  // Just list nicknames, but exclude FALLBACK nicknames
289  for (const auto& nickname: gs->GetNicknames()) {
290  if (!nickname.contains("FALLBACK")) {
291  candidates.insert(nickname);
292  }
293  }
294  }
295  G4cerr << "Candidates are:";
296  for (const auto& candidate: candidates) {
297  G4cerr << ' ' << candidate;
298  }
299  G4cerr << G4endl;
300  }
301  UImanager->SetVerboseLevel(keepVerbose);
302 }
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:227
int G4int
Definition: G4Types.hh:78
void SetVerboseLevel(G4int val)
Definition: G4UImanager.hh:225
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
static G4int fErrorCode
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager

Here is the call graph for this function:


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