56   RefreshIfRequired(viewer);
 
   63   if (sceneHandler && sceneHandler->
GetScene()) {
 
   69     G4cout << 
"Issue /vis/viewer/refresh or flush to see effect." 
   80   fpCommand = 
new G4UIcommand (
"/vis/viewer/addCutawayPlane", 
this);
 
   81   fpCommand -> SetGuidance
 
   82     (
"Add cutaway plane to current viewer.");
 
   85   parameter  -> SetDefaultValue  (0);
 
   86   parameter  -> SetGuidance      (
"Coordinate of point on the plane.");
 
   89   parameter  -> SetDefaultValue  (0);
 
   90   parameter  -> SetGuidance      (
"Coordinate of point on the plane.");
 
   93   parameter  -> SetDefaultValue  (0);
 
   94   parameter  -> SetGuidance      (
"Coordinate of point on the plane.");
 
   97   parameter  -> SetDefaultValue  (
"m");
 
   98   parameter  -> SetGuidance      (
"Unit of point on the plane.");
 
  101   parameter  -> SetDefaultValue  (1);
 
  102   parameter  -> SetGuidance      (
"Component of plane normal.");
 
  105   parameter  -> SetDefaultValue  (0);
 
  106   parameter  -> SetGuidance      (
"Component of plane normal.");
 
  109   parameter  -> SetDefaultValue  (0);
 
  110   parameter  -> SetGuidance      (
"Component of plane normal.");
 
  130   "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities." 
  138   std::istringstream is (newValue);
 
  139   is >> x >> y >> z >> unit >> nx >> ny >> nz;
 
  141   x *= F; y *= F; z *= F;
 
  146     G4cout << 
"Cutaway planes for viewer \"" << viewer->
GetName() << 
"\" now:";
 
  148     for (
size_t i = 0; i < cutaways.size(); ++i)
 
  149       G4cout << 
"\n  " << i << 
": " << cutaways[i];
 
  160   fpCommand = 
new G4UIcommand (
"/vis/viewer/changeCutawayPlane", 
this);
 
  161   fpCommand -> SetGuidance(
"Change cutaway plane.");
 
  164   parameter  -> SetGuidance      (
"Index of plane: 0, 1, 2.");
 
  167   parameter  -> SetDefaultValue  (0);
 
  168   parameter  -> SetGuidance      (
"Coordinate of point on the plane.");
 
  171   parameter  -> SetDefaultValue  (0);
 
  172   parameter  -> SetGuidance      (
"Coordinate of point on the plane.");
 
  175   parameter  -> SetDefaultValue  (0);
 
  176   parameter  -> SetGuidance      (
"Coordinate of point on the plane.");
 
  179   parameter  -> SetDefaultValue  (
"m");
 
  180   parameter  -> SetGuidance      (
"Unit of point on the plane.");
 
  183   parameter  -> SetDefaultValue  (1);
 
  184   parameter  -> SetGuidance      (
"Component of plane normal.");
 
  187   parameter  -> SetDefaultValue  (0);
 
  188   parameter  -> SetGuidance      (
"Component of plane normal.");
 
  191   parameter  -> SetDefaultValue  (0);
 
  192   parameter  -> SetGuidance      (
"Component of plane normal.");
 
  212   "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities." 
  221   std::istringstream is (newValue);
 
  222   is >> index >> x >> y >> z >> unit >> nx >> ny >> nz;
 
  224   x *= F; y *= F; z *= F;
 
  230     G4cout << 
"Cutaway planes for viewer \"" << viewer->
GetName() << 
"\" now:";
 
  232     for (
size_t i = 0; i < cutaways.size(); ++i)
 
  233       G4cout << 
"\n  " << i << 
": " << cutaways[i];
 
  243   G4bool omitable, currentAsDefault;
 
  245   fpCommand -> SetGuidance (
"Clears viewer.");
 
  246   fpCommand -> SetGuidance 
 
  247     (
"By default, clears current viewer.  Specified viewer becomes current." 
  248      "\n\"/vis/viewer/list\" to see  possible viewer names.");
 
  249   fpCommand -> SetParameterName (
"viewer-name",
 
  251                  currentAsDefault = 
true);
 
  260   return viewer ? viewer -> GetName () : 
G4String(
"none");
 
  271       G4cout << 
"ERROR: Viewer \"" << clearName
 
  272          << 
"\" not found - \"/vis/viewer/list\" to see possibilities." 
  281     G4cout << 
"Viewer \"" << clearName << 
"\" cleared." << 
G4endl;
 
  290     (
"/vis/viewer/clearCutawayPlanes", 
this);
 
  291   fpCommand -> SetGuidance (
"Clear cutaway planes of current viewer.");
 
  310   "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities." 
  319     G4cout << 
"Cutaway planes for viewer \"" << viewer->
GetName()
 
  320        << 
"\" now cleared." << 
G4endl;
 
  329   G4bool omitable, currentAsDefault;
 
  331   fpCommand -> SetGuidance (
"Clears transients from viewer.");
 
  332   fpCommand -> SetGuidance 
 
  333   (
"By default, operates on current viewer.  Specified viewer becomes current." 
  334      "\n\"/vis/viewer/list\" to see  possible viewer names.");
 
  335   fpCommand -> SetParameterName (
"viewer-name",
 
  337                  currentAsDefault = 
true);
 
  346   return viewer ? viewer -> GetName () : 
G4String(
"none");
 
  357       G4cout << 
"ERROR: Viewer \"" << clearName
 
  358          << 
"\" not found - \"/vis/viewer/list\" to see possibilities." 
  369     G4cout << 
"Viewer \"" << clearName << 
"\" cleared of transients." 
  379   fpCommand = 
new G4UIcommand (
"/vis/viewer/clone", 
this);
 
  380   fpCommand -> SetGuidance (
"Clones viewer.");
 
  381   fpCommand -> SetGuidance 
 
  382     (
"By default, clones current viewer.  Clone becomes current." 
  383      "\nClone name, if not provided, is derived from the original name." 
  384      "\n\"/vis/viewer/list\" to see  possible viewer names.");
 
  386   parameter = 
new G4UIparameter (
"original-viewer-name", 
's', omitable = 
true);
 
  387   parameter -> SetCurrentAsDefault (
true);
 
  388   fpCommand -> SetParameter (parameter);
 
  389   parameter = 
new G4UIparameter (
"clone-name", 
's', omitable = 
true);
 
  390   parameter -> SetDefaultValue (
"none");
 
  391   fpCommand -> SetParameter (parameter);
 
  401   return "\"" + originalName + 
"\"";
 
  409   std::istringstream is (newValue);
 
  414   while (is.get(c) && c == 
' '){}
 
  416     while (is.get(c) && c != 
'"') {originalName += 
c;}
 
  420     while (is.get(c) && c != 
' ') {originalName += 
c;}
 
  426   if (!originalViewer) {
 
  428       G4cout << 
"ERROR: Viewer \"" << originalName
 
  429          << 
"\" not found - \"/vis/viewer/list\" to see possibilities." 
  434   originalName = originalViewer->
GetName();  
 
  436   while (is.get(c) && c == 
' '){}
 
  438     while (is.get(c) && c != 
'"') {cloneName += 
c;}
 
  442     while (is.get(c) && c != 
' ') {cloneName += 
c;}
 
  447   G4bool errorWhileNaming = 
false;
 
  448   if (cloneName == 
"none") {
 
  451       cloneName = originalName;
 
  452       std::ostringstream oss;
 
  453       oss << 
'-' << subID++;
 
  454       G4String::size_type lastDashPosition, nextSpacePosition;
 
  455       if ((lastDashPosition = cloneName.rfind(
'-')) !=  G4String::npos &&
 
  456       (nextSpacePosition = cloneName.find(
" ", lastDashPosition)) !=
 
  458     cloneName.insert(nextSpacePosition, oss.str());
 
  460     G4String::size_type spacePosition = cloneName.find(
' ');
 
  461     if (spacePosition != G4String::npos)
 
  462       cloneName.insert(spacePosition, oss.str());
 
  464       errorWhileNaming = 
true;
 
  466     } 
while (!errorWhileNaming && 
fpVisManager -> GetViewer (cloneName));
 
  469   if (errorWhileNaming) {
 
  471       G4cout << 
"ERROR: While naming clone viewer \"" << cloneName
 
  480       G4cout << 
"ERROR: Putative clone viewer \"" << cloneName
 
  481          << 
"\" already exists." 
  493   if (keepVerbose >= 2 ||
 
  499     (
G4String(
"/vis/viewer/create ! \"" + cloneName + 
"\" " + windowSizeHint));
 
  504     G4cout << 
"Viewer \"" << originalName << 
"\" cloned." << 
G4endl;
 
  505     G4cout << 
"Clone \"" << cloneName << 
"\" now current." << 
G4endl;
 
  514   fpCommand -> SetGuidance
 
  515   (
"Copy the camera-specific parameters from the specified viewer.");
 
  516   fpCommand -> SetGuidance
 
  517   (
"Note: To copy scene modifications - style, etc. - please use" 
  518    "\n\"/vis/viewer/set/all\"");
 
  519   fpCommand -> SetParameterName (
"from-viewer-name", omitable = 
false);
 
  535   if (!currentViewer) {
 
  538   "ERROR: G4VisCommandsViewerCopyViewFrom::SetNewValue: no current viewer." 
  544   const G4String& fromViewerName = newValue;
 
  548       G4cout << 
"ERROR: Viewer \"" << fromViewerName
 
  549          << 
"\" not found - \"/vis/viewer/list\" to see possibilities." 
  555   if (fromViewer == currentViewer) {
 
  558         "WARNING: G4VisCommandsViewerSet::SetNewValue:" 
  559         "\n  from-viewer and current viewer are identical." 
  580     G4cout << 
"Camera parameters of viewer \"" << currentViewer->
GetName()
 
  581        << 
"\"\n  set to those of viewer \"" << fromViewer->
GetName()
 
  591   fpCommand = 
new G4UIcommand (
"/vis/viewer/create", 
this);
 
  592   fpCommand -> SetGuidance
 
  593     (
"Creates a viewer for the specified scene handler.");
 
  594   fpCommand -> SetGuidance
 
  595     (
"Default scene handler is the current scene handler.  Invents a name" 
  596      "\nif not supplied.  (Note: the system adds information to the name" 
  597      "\nfor identification - only the characters up to the first blank are" 
  598      "\nused for removing, selecting, etc.)  This scene handler and viewer" 
  599      "\nbecome current.");
 
  601   parameter = 
new G4UIparameter (
"scene-handler", 
's', omitable = 
true);
 
  602   parameter -> SetCurrentAsDefault (
true);
 
  603   fpCommand -> SetParameter (parameter);
 
  604   parameter = 
new G4UIparameter (
"viewer-name", 
's', omitable = 
true);
 
  605   parameter -> SetCurrentAsDefault (
true);
 
  606   fpCommand -> SetParameter (parameter);
 
  607   parameter = 
new G4UIparameter (
"window-size-hint", 
's', omitable = 
true);
 
  609     (
"integer (pixels) for square window placed by window manager or" 
  610      " X-Windows-type geometry string, e.g. 600x600-100+100");
 
  612   fpCommand -> SetParameter (parameter);
 
  619 G4String G4VisCommandViewerCreate::NextName () {
 
  620   std::ostringstream oss;
 
  622   oss << 
"viewer-" << fId << 
" (";
 
  624     oss << sceneHandler -> GetGraphicsSystem () -> GetName ();
 
  627     oss << 
"no_scene_handlers";
 
  637   if (currentSceneHandler) {
 
  638     currentValue = currentSceneHandler -> GetName ();
 
  641     currentValue = 
"none";
 
  645   currentValue += NextName ();
 
  648   currentValue += 
" 600";  
 
  659   std::istringstream is (newValue);
 
  660   is >> sceneHandlerName;
 
  665   while (is.get(c) && c == 
' '){}
 
  667     while (is.get(c) && c != 
'"') {newName += 
c;}
 
  671     while (is.get(c) && c != 
' ') {newName += 
c;}
 
  677   is >> windowSizeHintString;
 
  681   G4int nHandlers = sceneHandlerList.size ();
 
  682   if (nHandlers <= 0) {
 
  685     "ERROR: G4VisCommandViewerCreate::SetNewValue: no scene handlers." 
  686     "\n  Create a scene handler with \"/vis/sceneHandler/create\"" 
  693   for (iHandler = 0; iHandler < nHandlers; iHandler++) {
 
  694     if (sceneHandlerList [iHandler] -> GetName () == sceneHandlerName) 
break;
 
  697   if (iHandler < 0 || iHandler >= nHandlers) {
 
  701       G4cout << 
"G4VisCommandViewerCreate::SetNewValue:" 
  702     " invalid scene handler specified." 
  711   if (sceneHandler != 
fpVisManager -> GetCurrentSceneHandler ()) {
 
  720   if (newName == nextName) fId++;
 
  723   for (
G4int ih = 0; ih < nHandlers; ih++) {
 
  725     const G4ViewerList& viewerList = sh -> GetViewerList ();
 
  726     for (
size_t iViewer = 0; iViewer < viewerList.size (); iViewer++) {
 
  727       if (viewerList [iViewer] -> GetShortName () == newShortName ) {
 
  729       G4cout << 
"ERROR: Viewer \"" << newShortName << 
"\" already exists." 
  741   fpVisManager -> CreateViewer (newName,windowSizeHintString);
 
  744   if (newViewer && newViewer -> GetName () == newName) {
 
  746       G4cout << 
"New viewer \"" << newName << 
"\" created." << 
G4endl;
 
  752     G4cout << 
"ERROR: New viewer doesn\'t match!!!  Curious!!" << 
G4endl;
 
  765     G4cout << 
"Issue /vis/viewer/refresh or flush to see effect." 
  775   fDollyIncrement  (0.),
 
  778   G4bool omitable, currentAsDefault;
 
  781     (
"/vis/viewer/dolly", 
this);
 
  782   fpCommandDolly -> SetGuidance
 
  783     (
"Incremental dolly.");
 
  784   fpCommandDolly -> SetGuidance
 
  785     (
"Moves the camera incrementally towards target point.");
 
  786   fpCommandDolly -> SetParameterName(
"increment",
 
  788                      currentAsDefault=
true);
 
  789   fpCommandDolly -> SetDefaultUnit(
"m");
 
  792     (
"/vis/viewer/dollyTo", 
this);
 
  793   fpCommandDollyTo -> SetGuidance
 
  794     (
"Dolly to specific coordinate.");
 
  795   fpCommandDollyTo -> SetGuidance
 
  796  (
"Places the camera towards target point relative to standard camera point.");
 
  797   fpCommandDollyTo -> SetParameterName(
"distance",
 
  799                        currentAsDefault=
true);
 
  800   fpCommandDollyTo -> SetDefaultUnit(
"m");
 
  804   delete fpCommandDolly;
 
  805   delete fpCommandDollyTo;
 
  810   if (command == fpCommandDolly) {
 
  813   else if (command == fpCommandDollyTo) {
 
  826   if (!currentViewer) {
 
  829     "ERROR: G4VisCommandsViewerDolly::SetNewValue: no current viewer." 
  837   if (command == fpCommandDolly) {
 
  841   else if (command == fpCommandDollyTo) {
 
  856   G4bool omitable, currentAsDefault;
 
  858   fpCommand -> SetGuidance
 
  859     (
"Compound command: \"/vis/viewer/refresh\" + \"/vis/viewer/update\".");
 
  860   fpCommand -> SetGuidance
 
  861     (
"Useful for refreshing and initiating post-processing for graphics" 
  862      "\nsystems which need post-processing.  By default, acts on current" 
  863      "\nviewer.  \"/vis/viewer/list\" to see possible viewers.  Viewer" 
  864      "\nbecomes current.");
 
  865   fpCommand -> SetParameterName (
"viewer-name",
 
  867                  currentAsDefault = 
true);
 
  876   G4VViewer* viewer = fpVisManager -> GetCurrentViewer ();
 
  877   return viewer ? viewer -> GetName () : 
G4String(
"none");
 
  888       G4cout << 
"ERROR: Viewer \"" << flushName << 
"\"" <<
 
  889     " not found - \"/vis/viewer/list\"\n  to see possibilities." 
  905     G4cout << 
"Viewer \"" << viewer -> GetName () << 
"\"" 
  914   fpCommand = 
new G4UIcommand (
"/vis/viewer/list", 
this);
 
  915   fpCommand -> SetGuidance (
"Lists viewers(s).");
 
  916   fpCommand -> SetGuidance
 
  917     (
"See \"/vis/verbose\" for definition of verbosity.");
 
  921   parameter -> SetDefaultValue (
"all");
 
  922   fpCommand -> SetParameter (parameter);
 
  925   parameter -> SetDefaultValue (
"warnings");
 
  926   fpCommand -> SetParameter (parameter);
 
  939   std::istringstream is (newValue);
 
  940   is >> name >> verbosityString;
 
  948     currentViewerShortName = currentViewer -> GetShortName ();
 
  951     currentViewerShortName = 
"none";
 
  956   G4int nHandlers = sceneHandlerList.size ();
 
  958   G4bool foundCurrent = 
false;
 
  959   for (
int iHandler = 0; iHandler < nHandlers; iHandler++) {
 
  961     const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
 
  962     G4cout << 
"Scene handler \"" << sceneHandler -> GetName ();
 
  963     const G4Scene* pScene = sceneHandler -> GetScene ();
 
  965       G4cout << 
"\", scene \"" << pScene -> GetName () << 
"\":";
 
  967     G4int nViewers = viewerList.size ();
 
  969       G4cout << 
"\n            No viewers for this scene handler." << 
G4endl;
 
  972       for (
int iViewer = 0; iViewer < nViewers; iViewer++) {
 
  973     const G4VViewer* thisViewer = viewerList [iViewer];
 
  974     G4String thisName = thisViewer -> GetName ();
 
  975     G4String thisShortName = thisViewer -> GetShortName ();
 
  977       if (thisShortName != shortName) 
continue;
 
  981     if (thisShortName == currentViewerShortName) {
 
  988     G4cout << 
" viewer \"" << thisName << 
"\"";
 
  990       G4cout << 
"\n  " << *thisViewer;
 
  998     G4cout << 
"No valid current viewer - please create or select one." 
 1004     if (name != 
"all") {
 
 1005       G4cout << 
" of name \"" << name << 
"\"";
 
 1014   fPanIncrementRight  (0.),
 
 1015   fPanIncrementUp  (0.),
 
 1022     (
"/vis/viewer/pan", 
this);
 
 1023   fpCommandPan -> SetGuidance
 
 1024     (
"Incremental pan.");
 
 1025   fpCommandPan -> SetGuidance
 
 1026     (
"Moves the camera incrementally right and up by these amounts (as seen" 
 1027      "\nfrom viewpoint direction).");
 
 1029   parameter = 
new G4UIparameter(
"right-increment", 
'd', omitable = 
true);
 
 1030   parameter -> SetCurrentAsDefault (
true);
 
 1031   fpCommandPan -> SetParameter (parameter);
 
 1032   parameter = 
new G4UIparameter(
"up-increment", 
'd', omitable = 
true);
 
 1033   parameter -> SetCurrentAsDefault (
true);
 
 1034   fpCommandPan -> SetParameter (parameter);
 
 1035   parameter = 
new G4UIparameter (
"unit", 
's', omitable = 
true);
 
 1036   parameter -> SetDefaultValue (
"m");
 
 1037   fpCommandPan -> SetParameter (parameter);
 
 1040     (
"/vis/viewer/panTo", 
this);
 
 1041   fpCommandPanTo -> SetGuidance
 
 1042     (
"Pan to specific coordinate.");
 
 1043   fpCommandPanTo -> SetGuidance
 
 1044     (
"Places the camera in this position right and up relative to standard" 
 1045      "\ntarget point (as seen from viewpoint direction).");
 
 1046   parameter = 
new G4UIparameter(
"right", 
'd', omitable = 
true);
 
 1047   parameter -> SetCurrentAsDefault (
true);
 
 1048   fpCommandPanTo -> SetParameter (parameter);
 
 1050   parameter -> SetCurrentAsDefault (
true);
 
 1051   fpCommandPanTo -> SetParameter (parameter);
 
 1052   parameter = 
new G4UIparameter (
"unit", 
's', omitable = 
true);
 
 1053   parameter -> SetDefaultValue (
"m");
 
 1054   fpCommandPanTo -> SetParameter (parameter);
 
 1058   delete fpCommandPan;
 
 1059   delete fpCommandPanTo;
 
 1064   if (command == fpCommandPan) {
 
 1065     currentValue = 
ConvertToString(fPanIncrementRight, fPanIncrementUp, 
"m");
 
 1067   else if (command == fpCommandPanTo) {
 
 1070   return currentValue;
 
 1080   if (!currentViewer) {
 
 1083     "ERROR: G4VisCommandsViewerPan::SetNewValue: no current viewer." 
 1091   if (command == fpCommandPan) {
 
 1095   else if (command == fpCommandPanTo) {
 
 1097     vp.
SetPan(fPanToRight, fPanToUp);
 
 1111   G4bool omitable, currentAsDefault;
 
 1113   fpCommand -> SetGuidance (
"Forces rebuild of graphical database.");
 
 1114   fpCommand -> SetGuidance 
 
 1115     (
"By default, acts on current viewer.  \"/vis/viewer/list\"" 
 1116      "\nto see possible viewers.  Viewer becomes current.");
 
 1117   fpCommand -> SetParameterName (
"viewer-name",
 
 1119                  currentAsDefault = 
true);
 
 1129     return viewer -> GetName ();
 
 1145       G4cout << 
"ERROR: Viewer \"" << rebuildName
 
 1146          << 
"\" not found - \"/vis/viewer/list\" to see possibilities." 
 1153   if (!sceneHandler) {
 
 1155       G4cout << 
"ERROR: Viewer \"" << viewer->
GetName() << 
"\"" <<
 
 1156     " has no scene handler - report serious bug." 
 1175   G4bool omitable, currentAsDefault;
 
 1177   fpCommand -> SetGuidance
 
 1178     (
"Refreshes viewer.");
 
 1179   fpCommand -> SetGuidance 
 
 1180     (
"By default, acts on current viewer.  \"/vis/viewer/list\"" 
 1181      "\nto see possible viewers.  Viewer becomes current.");
 
 1182   fpCommand -> SetParameterName (
"viewer-name",
 
 1184                  currentAsDefault = 
true);
 
 1193   return viewer ? viewer -> GetName () : 
G4String(
"none");
 
 1205       G4cout << 
"ERROR: Viewer \"" << refreshName << 
"\"" <<
 
 1206     " not found - \"/vis/viewer/list\"\n  to see possibilities." 
 1213   if (!sceneHandler) {
 
 1215       G4cout << 
"ERROR: Viewer \"" << refreshName << 
"\"" <<
 
 1216     " has no scene handler - report serious bug." 
 1225       G4cout << 
"NOTE: SceneHandler \"" << sceneHandler->
GetName()
 
 1226          << 
"\", to which viewer \"" << refreshName << 
"\"" <<
 
 1227     "\n  is attached, has no scene - \"/vis/scene/create\" and" 
 1228     " \"/vis/sceneHandler/attach\"" 
 1229     "\n  (or use compound command \"/vis/drawVolume\")." 
 1235     G4bool successful = scene -> AddWorldIfEmpty (warn);
 
 1239       "WARNING: Scene is empty.  Perhaps no geometry exists." 
 1240       "\n  Try /run/initialize." 
 1251       G4cout << 
"Refreshing viewer \"" << viewer -> GetName () << 
"\"..." 
 1254     viewer -> SetView ();
 
 1255     viewer -> ClearView ();
 
 1256     viewer -> DrawView ();
 
 1258       G4cout << 
"Viewer \"" << viewer -> GetName () << 
"\"" << 
" refreshed." 
 1259     "\n  (You might also need \"/vis/viewer/update\".)" << 
G4endl;
 
 1267   G4bool omitable, currentAsDefault;
 
 1269   fpCommand -> SetGuidance (
"Resets viewer.");
 
 1270   fpCommand -> SetGuidance 
 
 1271     (
"By default, acts on current viewer.  \"/vis/viewer/list\"" 
 1272      "\nto see possible viewers.  Viewer becomes current.");
 
 1273   fpCommand -> SetParameterName (
"viewer-name",
 
 1275                  currentAsDefault = 
true);
 
 1285     return viewer -> GetName ();
 
 1300       G4cout << 
"ERROR: Viewer \"" << resetName
 
 1301          << 
"\" not found - \"/vis/viewer/list\" to see possibilities." 
 1316   fpCommand -> SetGuidance
 
 1317   (
"Write commands that define the current view to file.");
 
 1318   fpCommand -> SetParameterName (
"file-name", omitable = 
true);
 
 1319   fpCommand -> SetDefaultValue (
"G4cout");
 
 1351   if (!currentViewer) {
 
 1354       "ERROR: G4VisCommandsViewerSave::SetNewValue: no current viewer." 
 1361   if (!currentScene) {
 
 1364       "ERROR: G4VisCommandsViewerSave::SetNewValue: no current scene." 
 1371   if (newValue != 
"G4cout") {
 
 1373     std::ifstream ifs(newValue);
 
 1377         "ERROR: G4VisCommandsViewerSave::SetNewValue: File \"" 
 1378         << newValue << 
"\" already exists." 
 1388         "ERROR: G4VisCommandsViewerSave::SetNewValue: Trouble opening file \"" 
 1389         << newValue << 
"\"." 
 1400   if (newValue == 
"G4cout") {
 
 1401     WriteCommands(
G4cout,vp,stp);
 
 1403     WriteCommands(ofs,vp,stp);
 
 1408     G4cout << 
"Viewer \"" << currentViewer -> GetName ()
 
 1409     << 
"\"" << 
" saved to ";
 
 1410     if (newValue == 
"G4cout") {
 
 1413       G4cout << 
"file \'" << newValue << 
"\".";
 
 1425   G4bool omitable, currentAsDefault;
 
 1428     (
"/vis/viewer/scale", 
this);
 
 1429   fpCommandScale -> SetGuidance (
"Incremental (non-uniform) scaling.");
 
 1430   fpCommandScale -> SetGuidance
 
 1431     (
"Multiplies components of current scaling by components of this factor." 
 1432      "\n Scales (x,y,z) by corresponding components of the resulting factor.");
 
 1433   fpCommandScale -> SetGuidance
 
 1435   fpCommandScale -> SetParameterName
 
 1436     (
"x-scale-multiplier",
"y-scale-multiplier",
"z-scale-multiplier",
 
 1437      omitable=
true, currentAsDefault=
true);
 
 1440     (
"/vis/viewer/scaleTo", 
this);
 
 1441   fpCommandScaleTo -> SetGuidance (
"Absolute (non-uniform) scaling.");
 
 1442   fpCommandScaleTo -> SetGuidance
 
 1443     (
"Scales (x,y,z) by corresponding components of this factor.");
 
 1444   fpCommandScaleTo -> SetParameterName
 
 1445     (
"x-scale-factor",
"y-scale-factor",
"z-scale-factor",
 
 1446      omitable=
true, currentAsDefault=
true);
 
 1450   delete fpCommandScale;
 
 1451   delete fpCommandScaleTo;
 
 1456   if (command == fpCommandScale) {
 
 1459   else if (command == fpCommandScaleTo) {
 
 1462   return currentValue;
 
 1472   if (!currentViewer) {
 
 1475     "ERROR: G4VisCommandsViewerScale::SetNewValue: no current viewer." 
 1483   if (command == fpCommandScale) {
 
 1487   else if (command == fpCommandScaleTo) {
 
 1504   fpCommand -> SetGuidance (
"Selects viewer.");
 
 1505   fpCommand -> SetGuidance
 
 1506     (
"Specify viewer by name.  \"/vis/viewer/list\" to see possible viewers.");
 
 1507   fpCommand -> SetParameterName (
"viewer-name", omitable = 
false);
 
 1527       G4cout << 
"ERROR: Viewer \"" << selectName << 
"\"";
 
 1528       G4cout << 
" not found - \"/vis/viewer/list\"" 
 1529     "\n  to see possibilities." 
 1537       G4cout << 
"WARNING: Viewer \"" << viewer -> GetName () << 
"\"" 
 1538          << 
" already selected." << 
G4endl;
 
 1551   G4bool omitable, currentAsDefault;
 
 1553   fpCommand -> SetGuidance
 
 1554     (
"Triggers graphical database post-processing for viewers" 
 1555      "\nusing that technique.");
 
 1556   fpCommand -> SetGuidance
 
 1557     (
"For such viewers the view only becomes visible with this command." 
 1558      "\nBy default, acts on current viewer.  \"/vis/viewer/list\"" 
 1559      "\nto see possible viewers.  Viewer becomes current.");
 
 1560   fpCommand -> SetParameterName (
"viewer-name",
 
 1562                  currentAsDefault = 
true);
 
 1572     return viewer -> GetName ();
 
 1589     "ERROR: G4VisCommandsViewerUpdate::SetNewValue: no current viewer." 
 1596   if (!sceneHandler) {
 
 1598       G4cout << 
"ERROR: Viewer \"" << updateName << 
"\"" <<
 
 1599     " has no scene handler - report serious bug." 
 1608       G4cout << 
"NOTE: SceneHandler \"" << sceneHandler->
GetName()
 
 1609          << 
"\", to which viewer \"" << updateName << 
"\"" <<
 
 1610     "\n  is attached, has no scene - \"/vis/scene/create\" and" 
 1611     " \"/vis/sceneHandler/attach\"" 
 1612     "\n  (or use compound command \"/vis/drawVolume\")." 
 1619     G4cout << 
"Viewer \"" << viewer -> GetName () << 
"\"";
 
 1622   viewer -> ShowView ();
 
 1624   sceneHandler -> SetMarkForClearingTransientStore(
true);
 
 1630   fZoomMultiplier (1.),
 
 1633   G4bool omitable, currentAsDefault;
 
 1636     (
"/vis/viewer/zoom", 
this);
 
 1637   fpCommandZoom -> SetGuidance (
"Incremental zoom.");
 
 1638   fpCommandZoom -> SetGuidance
 
 1639     (
"Multiplies current magnification by this factor.");
 
 1640   fpCommandZoom -> SetParameterName(
"multiplier",
 
 1642                      currentAsDefault=
true);
 
 1645     (
"/vis/viewer/zoomTo", 
this);
 
 1646   fpCommandZoomTo -> SetGuidance (
"Absolute zoom.");
 
 1647   fpCommandZoomTo -> SetGuidance
 
 1648     (
"Magnifies standard magnification by this factor.");
 
 1649   fpCommandZoomTo -> SetParameterName(
"factor",
 
 1651                        currentAsDefault=
true);
 
 1655   delete fpCommandZoom;
 
 1656   delete fpCommandZoomTo;
 
 1661   if (command == fpCommandZoom) {
 
 1664   else if (command == fpCommandZoomTo) {
 
 1667   return currentValue;
 
 1677   if (!currentViewer) {
 
 1680     "ERROR: G4VisCommandsViewerZoom::SetNewValue: no current viewer." 
 1688   if (command == fpCommandZoom) {
 
 1692   else if (command == fpCommandZoomTo) {