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

#include <G4VisCommandsTouchable.hh>

Inheritance diagram for G4VisCommandsTouchable:
Collaboration diagram for G4VisCommandsTouchable:

Public Member Functions

 G4VisCommandsTouchable ()
 
virtual ~G4VisCommandsTouchable ()
 
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 38 of file G4VisCommandsTouchable.hh.

Constructor & Destructor Documentation

G4VisCommandsTouchable::G4VisCommandsTouchable ( )

Definition at line 37 of file G4VisCommandsTouchable.cc.

38 {
39  fpCommandDump = new G4UIcmdWithoutParameter("/vis/touchable/dump",this);
40  fpCommandDump->SetGuidance("Dump touchable attributes.");
41  fpCommandDump->SetGuidance
42  ("Use \"/vis/set/touchable\" to set current touchable.");
43  fpCommandDump->SetGuidance
44  ("Use \"/vis/touchable/set\" to set attributes.");
45 }
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161

Here is the call graph for this function:

G4VisCommandsTouchable::~G4VisCommandsTouchable ( )
virtual

Definition at line 47 of file G4VisCommandsTouchable.cc.

47  {
48  delete fpCommandDump;
49 }

Member Function Documentation

G4String G4VisCommandsTouchable::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 51 of file G4VisCommandsTouchable.cc.

51  {
52  return "";
53 }
void G4VisCommandsTouchable::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 56 of file G4VisCommandsTouchable.cc.

57 {
59 
60  G4TransportationManager* transportationManager =
62 
63  size_t nWorlds = transportationManager->GetNoWorlds();
64 
65  G4VPhysicalVolume* world = *(transportationManager->GetWorldsIterator());
66  if (!world) {
67  if (verbosity >= G4VisManager::errors) {
68  G4cerr <<
69  "ERROR: G4VisCommandsTouchable::SetNewValue:"
70  "\n No world. Maybe the geometry has not yet been defined."
71  "\n Try \"/run/initialize\""
72  << G4endl;
73  }
74  return;
75  }
76 
77  if (command == fpCommandDump)
78  {
79  G4bool found = false;
80  std::vector<G4VPhysicalVolume*>::iterator iterWorld =
81  transportationManager->GetWorldsIterator();
82  for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
83  G4PhysicalVolumeModel pvModel (*iterWorld); // Unlimited depth.
84  G4ModelingParameters mp; // Default - no culling.
85  pvModel.SetModelingParameters (&mp);
87  pvModel.DescribeYourselfTo (dumpScene); // Initiate dump.
88  if (dumpScene.IsFound()) found = true;
89  }
90  if (!found) {
91  G4cout << "Touchable not found." << G4endl;
92  }
93  return;
94 
95  } else {
96 
97  if (verbosity >= G4VisManager::errors) {
98  G4cerr <<
99  "ERROR: G4VisCommandsTouchable::SetNewValue: unrecognised command."
100  << G4endl;
101  }
102  return;
103  }
104 }
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
static G4TransportationManager * GetTransportationManager()
static Verbosity GetVerbosity()
size_t GetNoWorlds() const
#define G4endl
Definition: G4ios.hh:61
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: