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

#include <G4VisCommandsViewer.hh>

Inheritance diagram for G4VisCommandViewerList:
Collaboration diagram for G4VisCommandViewerList:

Public Member Functions

 G4VisCommandViewerList ()
 
virtual ~G4VisCommandViewerList ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommandViewer
 G4VVisCommandViewer ()
 
virtual ~G4VVisCommandViewer ()
 
- 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 G4VVisCommandViewer
void SetViewParameters (G4VViewer *, const G4ViewParameters &)
 
void RefreshIfRequired (G4VViewer *)
 
- 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 209 of file G4VisCommandsViewer.hh.

Constructor & Destructor Documentation

G4VisCommandViewerList::G4VisCommandViewerList ( )

Definition at line 1200 of file G4VisCommandsViewer.cc.

1200  {
1201  G4bool omitable;
1202  fpCommand = new G4UIcommand ("/vis/viewer/list", this);
1203  fpCommand -> SetGuidance ("Lists viewers(s).");
1204  fpCommand -> SetGuidance
1205  ("See \"/vis/verbose\" for definition of verbosity.");
1206  G4UIparameter* parameter;
1207  parameter = new G4UIparameter("viewer-name", 's',
1208  omitable = true);
1209  parameter -> SetDefaultValue ("all");
1210  fpCommand -> SetParameter (parameter);
1211  parameter = new G4UIparameter ("verbosity", 's',
1212  omitable = true);
1213  parameter -> SetDefaultValue ("warnings");
1214  fpCommand -> SetParameter (parameter);
1215 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandViewerList::~G4VisCommandViewerList ( )
virtual

Definition at line 1217 of file G4VisCommandsViewer.cc.

1217  {
1218  delete fpCommand;
1219 }

Member Function Documentation

G4String G4VisCommandViewerList::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 1221 of file G4VisCommandsViewer.cc.

1221  {
1222  return "";
1223 }
void G4VisCommandViewerList::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 1225 of file G4VisCommandsViewer.cc.

1225  {
1226  G4String name, verbosityString;
1227  std::istringstream is (newValue);
1228  is >> name >> verbosityString;
1229  G4String shortName = fpVisManager -> ViewerShortName (name);
1230  G4VisManager::Verbosity verbosity =
1231  fpVisManager->GetVerbosityValue(verbosityString);
1232 
1233  const G4VViewer* currentViewer = fpVisManager -> GetCurrentViewer ();
1234  G4String currentViewerShortName;
1235  if (currentViewer) {
1236  currentViewerShortName = currentViewer -> GetShortName ();
1237  }
1238  else {
1239  currentViewerShortName = "none";
1240  }
1241 
1242  const G4SceneHandlerList& sceneHandlerList =
1243  fpVisManager -> GetAvailableSceneHandlers ();
1244  G4int nHandlers = sceneHandlerList.size ();
1245  G4bool found = false;
1246  G4bool foundCurrent = false;
1247  for (int iHandler = 0; iHandler < nHandlers; iHandler++) {
1248  G4VSceneHandler* sceneHandler = sceneHandlerList [iHandler];
1249  const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
1250  G4cout
1251  << "Scene handler \"" << sceneHandler -> GetName () << "\" ("
1252  << sceneHandler->GetGraphicsSystem()->GetNickname() << ')';
1253  const G4Scene* pScene = sceneHandler -> GetScene ();
1254  if (pScene) {
1255  G4cout << ", scene \"" << pScene -> GetName () << "\"";
1256  }
1257  G4cout << ':';
1258  G4int nViewers = viewerList.size ();
1259  if (nViewers == 0) {
1260  G4cout << "\n No viewers for this scene handler." << G4endl;
1261  }
1262  else {
1263  for (int iViewer = 0; iViewer < nViewers; iViewer++) {
1264  const G4VViewer* thisViewer = viewerList [iViewer];
1265  G4String thisName = thisViewer -> GetName ();
1266  G4String thisShortName = thisViewer -> GetShortName ();
1267  if (name != "all") {
1268  if (thisShortName != shortName) continue;
1269  }
1270  found = true;
1271  G4cout << "\n ";
1272  if (thisShortName == currentViewerShortName) {
1273  foundCurrent = true;
1274  G4cout << "(current)";
1275  }
1276  else {
1277  G4cout << " ";
1278  }
1279  G4cout << " viewer \"" << thisName << "\"";
1280  if (verbosity >= G4VisManager::parameters) {
1281  G4cout << "\n " << *thisViewer;
1282  }
1283  }
1284  }
1285  G4cout << G4endl;
1286  }
1287 
1288  if (!foundCurrent) {
1289  G4cout << "No valid current viewer - please create or select one."
1290  << G4endl;
1291  }
1292 
1293  if (!found) {
1294  G4cout << "No viewers";
1295  if (name != "all") {
1296  G4cout << " of name \"" << name << "\"";
1297  }
1298  G4cout << " found." << G4endl;
1299  }
1300 }
const XML_Char * name
Definition: expat.h:151
int G4int
Definition: G4Types.hh:78
static Verbosity GetVerbosityValue(const G4String &)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4VGraphicsSystem * GetGraphicsSystem() const
const G4String & GetNickname() const
#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: