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

#include <G4VisCommandsSet.hh>

+ Inheritance 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)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
- 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)
 
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
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentLineWidth = 1.
 
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath
 

Detailed Description

Definition at line 90 of file G4VisCommandsSet.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSetTouchable()

G4VisCommandSetTouchable::G4VisCommandSetTouchable ( )

Definition at line 273 of file G4VisCommandsSet.cc.

274{
275 G4bool omitable;
276 G4UIparameter* parameter;
277 fpCommand = new G4UIcommand("/vis/set/touchable", this);
278 fpCommand->SetGuidance
279 ("Defines touchable for future \"/vis/touchable/set/\" commands.");
280 fpCommand->SetGuidance
281 ("Please provide a list of space-separated physical volume names and"
282 "\ncopy number pairs starting at the world volume, e.g:"
283 "\n/vis/set/touchable World 0 Envelope 0 Shape1 0");
284 parameter = new G4UIparameter ("list", 's', omitable = false);
285 parameter->SetGuidance
286 ("List of physical volume names and copy number pairs");
287 fpCommand->SetParameter (parameter);
288}
bool G4bool
Definition: G4Types.hh:67
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:147
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void SetGuidance(const char *theGuidance)

◆ ~G4VisCommandSetTouchable()

G4VisCommandSetTouchable::~G4VisCommandSetTouchable ( )
virtual

Definition at line 290 of file G4VisCommandsSet.cc.

291{
292 delete fpCommand;
293}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSetTouchable::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 295 of file G4VisCommandsSet.cc.

296{
297 return G4String();
298}

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 300 of file G4VisCommandsSet.cc.

301{
303
304 G4ModelingParameters::PVNameCopyNoPath currentTouchablePath;
305
306 // Algorithm from Josuttis p.476.
307 G4String::size_type iBegin, iEnd;
308 iBegin = newValue.find_first_not_of(' ');
309 while (iBegin != G4String::npos) {
310 iEnd = newValue.find_first_of(' ',iBegin);
311 if (iEnd == G4String::npos) {
312 iEnd = newValue.length();
313 }
314 G4String name(newValue.substr(iBegin,iEnd-iBegin));
315 iBegin = newValue.find_first_not_of(' ',iEnd);
316 if (iBegin == G4String::npos) {
317 if (verbosity >= G4VisManager::warnings) {
318 G4cout <<
319 "WARNING: G4VisCommandSetTouchable::SetNewValue"
320 "\n A pair not found. (Did you have an even number of parameters?)"
321 "\n Command ignored."
322 << G4endl;
323 return;
324 }
325 }
326 iEnd = newValue.find_first_of(' ',iBegin);
327 if (iEnd == G4String::npos) {
328 iEnd = newValue.length();
329 }
330 G4int copyNo;
331 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
332 if (!(iss >> copyNo)) {
333 if (verbosity >= G4VisManager::warnings) {
334 G4cout <<
335 "WARNING: G4VisCommandSetTouchable::SetNewValue"
336 "\n Error reading copy number - it was not numeric?"
337 "\n Command ignored."
338 << G4endl;
339 return;
340 }
341 }
342 currentTouchablePath.push_back
344 iBegin = newValue.find_first_not_of(' ',iEnd);
345 }
346
347 fCurrentTouchablePath = currentTouchablePath;
348
349 if (verbosity >= G4VisManager::confirmations) {
351 << G4endl;
352 }
353}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
std::vector< PVNameCopyNo > PVNameCopyNoPath
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath
static G4VisManager * fpVisManager
static Verbosity GetVerbosity()

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