Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VisCommandSetTouchable Class Reference

#include <G4VisCommandsSet.hh>

Inheritance diagram for G4VisCommandSetTouchable:
Collaboration diagram for G4VisCommandSetTouchable:

Public Member Functions

 G4VisCommandSetTouchable ()
 
virtual ~G4VisCommandSetTouchable ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
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 ()
 
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 101 of file G4VisCommandsSet.hh.

Constructor & Destructor Documentation

G4VisCommandSetTouchable::G4VisCommandSetTouchable ( )

Definition at line 309 of file G4VisCommandsSet.cc.

310 {
311  G4bool omitable;
312  G4UIparameter* parameter;
313  fpCommand = new G4UIcommand("/vis/set/touchable", this);
314  fpCommand->SetGuidance
315  ("Defines touchable for future \"/vis/touchable/set/\" commands.");
316  fpCommand->SetGuidance
317  ("Please provide a list of space-separated physical volume names and"
318  "\ncopy number pairs starting at the world volume, e.g:"
319  "\n /vis/set/touchable World 0 Envelope 0 Shape1 0"
320  "\n(To get list of touchables, use \"/vis/drawTree\")"
321  "\n(To save, use \"/vis/viewer/save\")");
322  parameter = new G4UIparameter ("list", 's', omitable = false);
323  parameter->SetGuidance
324  ("List of physical volume names and copy number pairs");
325  fpCommand->SetParameter (parameter);
326 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
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:

G4VisCommandSetTouchable::~G4VisCommandSetTouchable ( )
virtual

Definition at line 328 of file G4VisCommandsSet.cc.

329 {
330  delete fpCommand;
331 }

Member Function Documentation

G4String G4VisCommandSetTouchable::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 333 of file G4VisCommandsSet.cc.

334 {
335  return G4String();
336 }
void G4VisCommandSetTouchable::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 338 of file G4VisCommandsSet.cc.

339 {
341 
342  G4ModelingParameters::PVNameCopyNoPath currentTouchablePath;
343 
344  // Algorithm from Josuttis p.476.
345  G4String::size_type iBegin, iEnd;
346  iBegin = newValue.find_first_not_of(' ');
347  while (iBegin != G4String::npos) {
348  iEnd = newValue.find_first_of(' ',iBegin);
349  if (iEnd == G4String::npos) {
350  iEnd = newValue.length();
351  }
352  G4String name(newValue.substr(iBegin,iEnd-iBegin));
353  iBegin = newValue.find_first_not_of(' ',iEnd);
354  if (iBegin == G4String::npos) {
355  if (verbosity >= G4VisManager::warnings) {
356  G4cout <<
357  "WARNING: G4VisCommandSetTouchable::SetNewValue"
358  "\n A pair not found. (Did you have an even number of parameters?)"
359  "\n Command ignored."
360  << G4endl;
361  return;
362  }
363  }
364  iEnd = newValue.find_first_of(' ',iBegin);
365  if (iEnd == G4String::npos) {
366  iEnd = newValue.length();
367  }
368  G4int copyNo;
369  std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
370  if (!(iss >> copyNo)) {
371  if (verbosity >= G4VisManager::warnings) {
372  G4cout <<
373  "WARNING: G4VisCommandSetTouchable::SetNewValue"
374  "\n Error reading copy number - it was not numeric?"
375  "\n Command ignored."
376  << G4endl;
377  return;
378  }
379  }
380  currentTouchablePath.push_back
382  iBegin = newValue.find_first_not_of(' ',iEnd);
383  }
384 
385  fCurrentTouchablePath = currentTouchablePath;
386 
387  if (verbosity >= G4VisManager::confirmations) {
389  << G4endl;
390  }
391 }
const XML_Char * name
Definition: expat.h:151
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
std::vector< PVNameCopyNo > PVNameCopyNoPath
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
static G4VisManager * fpVisManager

Here is the call graph for this function:


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