48 (
"Produces a representation of the geometry hierarchy. Further"
49 "\nguidance is given on running the command. Or look at the guidance"
50 "\nfor \"/vis/ASCIITree/verbose\".");
51 fpCommand->
SetGuidance(
"The pre-existing scene and view are preserved.");
53 parameter =
new G4UIparameter(
"physical-volume-name",
's', omitable =
true);
54 parameter -> SetDefaultValue(
"world");
55 fpCommand -> SetParameter (parameter);
56 parameter =
new G4UIparameter(
"system",
's', omitable =
true);
57 parameter -> SetDefaultValue(
"ATree");
58 fpCommand -> SetParameter (parameter);
68 std::istringstream is(newValue);
69 is >> pvname >> system;
81 if (!G4StrUtil::contains(system,
"Tree")) {
95 if (keepUIVerbose >= 2 ||
101 if (errorCode == 0) {
132 fpCommand =
new G4UIcommand(
"/vis/drawView",
this);
134 (
"Draw view from this angle, etc.");
136 parameter =
new G4UIparameter(
"theta-degrees",
'd', omitable =
true);
137 parameter -> SetDefaultValue(0.);
138 fpCommand -> SetParameter (parameter);
139 parameter =
new G4UIparameter(
"phi-degrees",
'd', omitable =
true);
140 parameter -> SetDefaultValue(0.);
141 fpCommand -> SetParameter (parameter);
142 parameter =
new G4UIparameter(
"pan-right",
'd', omitable =
true);
143 parameter -> SetDefaultValue(0.);
144 fpCommand -> SetParameter (parameter);
145 parameter =
new G4UIparameter(
"pan-up",
'd', omitable =
true);
146 parameter -> SetDefaultValue(0.);
147 fpCommand -> SetParameter (parameter);
148 parameter =
new G4UIparameter(
"pan-unit",
's', omitable =
true);
149 parameter -> SetDefaultValue(
"cm");
150 fpCommand -> SetParameter (parameter);
151 parameter =
new G4UIparameter(
"zoom-factor",
'd', omitable =
true);
152 parameter -> SetDefaultValue(1.);
153 fpCommand -> SetParameter (parameter);
154 parameter =
new G4UIparameter(
"dolly",
'd', omitable =
true);
155 parameter -> SetDefaultValue(0.);
156 fpCommand -> SetParameter (parameter);
157 parameter =
new G4UIparameter(
"dolly-unit",
's', omitable =
true);
158 parameter -> SetDefaultValue(
"cm");
159 fpCommand -> SetParameter (parameter);
171 if (!currentViewer) {
174 "WARNING: G4VisCommandsDrawView::SetNewValue: no current viewer."
188 std::istringstream is(newValue);
189 is >> thetaDeg >> phiDeg >> panRight >> panUp >> panUnit
190 >> zoomFactor >> dolly >> dollyUnit;
198 G4String(
"/vis/viewer/set/viewpointThetaPhi " + thetaDeg +
" " + phiDeg +
" deg"));
200 G4String(
"/vis/viewer/panTo " + panRight +
" " + panUp +
" " + panUnit));
202 G4String(
"/vis/viewer/zoomTo " + zoomFactor));
207 G4String(
"/vis/viewer/dollyTo " + dolly +
" " + dollyUnit));
213 fpCommand =
new G4UIcommand(
"/vis/drawLogicalVolume",
this);
215 (
"Draws logical volume with additional components.");
217 (
"Synonymous with \"/vis/specify\".");
219 (
"Creates a scene consisting of this logical volume and asks the"
220 "\n current viewer to draw it. The scene becomes current.");
239 if (keepAutoRefresh) UImanager->
ApplyCommand(
"/vis/viewer/set/autoRefresh false");
245 UImanager->
ApplyCommand(
"/vis/viewer/set/style wireframe");
247 if (!keepMarkerNotHidden) UImanager->
ApplyCommand(
"/vis/viewer/set/hiddenMarker false");
248 if (keepAutoRefresh) UImanager->
ApplyCommand(
"/vis/viewer/set/autoRefresh true");
252 <<
"Drawing style changed to wireframe. To restore previous style:";
254 switch (keepDrawingStyle) {
256 style =
"wireframe"; edge =
"false";
break;
258 style =
"wireframe"; edge =
"true";
break;
260 style =
"surface"; edge =
"false";
break;
262 style =
"surface"; edge =
"true";
break;
264 style =
"cloud"; edge =
"";
break;
266 G4warn <<
"\n /vis/viewer/set/style " + style;
267 if (!edge.empty())
G4warn <<
"\n /vis/viewer/set/hiddenEdge " + edge;
272 <<
"Markers changed to \"not hidden\". To restore previous condition:"
273 <<
"\n /vis/viewer/set/hiddenmarker true"
277 static G4bool warned =
false;
280 "NOTE: For systems which are not \"auto-refresh\" you will need to"
281 "\n issue \"/vis/viewer/refresh\" or \"/vis/viewer/flush\"."
290 fpCommand =
new G4UIcommand(
"/vis/drawVolume",
this);
292 (
"Creates a scene containing this physical volume and asks the"
293 "\ncurrent viewer to draw it. The scene becomes current.");
312 static G4bool warned =
false;
315 "NOTE: For systems which are not \"auto-refresh\" you will need to"
316 "\n issue \"/vis/viewer/refresh\" or \"/vis/viewer/flush\"."
328 (
"Creates a scene handler and viewer ready for drawing.");
330 (
"The scene handler and viewer names are auto-generated.");
336 parameter =
new G4UIparameter(
"graphics-system-name",
's', omitable =
true);
339 parameter =
new G4UIparameter(
"window-size-hint",
's', omitable =
true);
341 (
"integer (pixels) for square window placed by window manager or"
342 " X-Windows-type geometry string, e.g. 600x600-100+100");
353 G4String graphicsSystemName, windowSizeHint;
355 if (graphicsSystem) {
357 graphicsSystemName = graphicsSystem->GetName();
360 windowSizeHint = viewer->GetViewParameters().GetXGeometryString();
370 return graphicsSystemName +
' ' + windowSizeHint;
375 G4String systemName, windowSizeHint;
376 std::istringstream is(newValue);
377 is >> systemName >> windowSizeHint;
382 G4warn <<
"sub-command \"/vis/sceneHandler/create\" failed." <<
G4endl;
388 G4warn <<
"sub-command \"/vis/viewer/create\" failed." <<
G4endl;
397 ed <<
"Invoked command has failed - see above.";
411 fpCommand -> SetGuidance(
"Draws plots.");
412 parameter =
new G4UIparameter (
"type",
's', omitable =
false);
413 parameter -> SetParameterCandidates(
"h1 h2");
414 fpCommand -> SetParameter (parameter);
416 fpCommand -> SetParameter (parameter);
432 if (currentViewer->GetName().find(
"TOOLSSG") == std::string::npos) {
434 "WARNING: Current viewer not able to draw plots."
435 "\n Try \"/vis/open TSG\", then \"/vis/plot " << newValue <<
"\" again."
441 std::istringstream is (newValue);
447 ui->ApplyCommand(
"/vis/enable");
448 ui->ApplyCommand(
"/vis/viewer/resetCameraParameters");
449 ui->ApplyCommand(
"/vis/scene/create");
450 ui->ApplyCommand(
"/vis/scene/endOfEventAction accumulate 0");
451 static G4int plotterID = 0;
452 std::ostringstream ossPlotter;
453 ossPlotter <<
"plotter-" << plotterID++;
454 const G4String& plotterName = ossPlotter.str();
455 ui->ApplyCommand(
"/vis/plotter/create " + plotterName);
456 ui->ApplyCommand(
"/vis/scene/add/plotter " + plotterName);
457 ui->ApplyCommand(
"/vis/plotter/add/" + type +
' ' +
id +
' ' + plotterName);
458 ui->ApplyCommand(
"/vis/sceneHandler/attach");
463 "WARNING: drawing was enabled for plotting but is now restored to disabled mode."
474 (
"Draws logical volume with Boolean components, voxels and readout geometry.");
476 (
"Synonymous with \"/vis/drawLogicalVolume\".");
478 (
"Creates a scene consisting of this logical volume and asks the"
479 "\n current viewer to draw it to the specified depth of descent"
480 "\n showing boolean components (if any), voxels (if any),"
481 "\n readout geometry (if any), local axes and overlaps (if any),"
482 "\n under control of the appropriate flag.");
484 (
"Note: voxels are not constructed until start of run - /run/beamOn."
485 "\n (For voxels without a run, \"/run/beamOn 0\".)");
486 fpCommand->
SetGuidance(
"The scene becomes current.");
488 parameter =
new G4UIparameter(
"logical-volume-name",
's', omitable =
false);
490 parameter =
new G4UIparameter(
"depth-of-descent",
'i', omitable =
true);
493 parameter =
new G4UIparameter(
"booleans-flag",
'b', omitable =
true);
496 parameter =
new G4UIparameter(
"voxels-flag",
'b', omitable =
true);
499 parameter =
new G4UIparameter(
"readout-flag",
'b', omitable =
true);
502 parameter =
new G4UIparameter(
"axes-flag",
'b', omitable =
true);
504 parameter -> SetGuidance (
"Set \"false\" to suppress axes.");
506 parameter =
new G4UIparameter(
"check-overlap-flag",
'b', omitable =
true);
508 parameter -> SetGuidance (
"Set \"false\" to suppress overlap check.");
523 static G4bool warned =
false;
526 "NOTE: For systems which are not \"auto-refresh\" you will need to"
527 "\n issue \"/vis/viewer/refresh\" or \"/vis/viewer/flush\"."
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
G4UIcommand * FindPath(const char *commandPath) const
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
void CommandFailed(G4int errCode, G4ExceptionDescription &ed)
G4UIcommandTree * GetTree() const
G4int ApplyCommand(const char *aCommand)
G4int GetVerboseLevel() const
static G4UImanager * GetUIpointer()
void SetVerboseLevel(G4int val)
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *theGuidance)
void SetCurrentAsDefault(G4bool val)
const G4String & GetName() const
const G4ViewParameters & GetViewParameters() const
void SetViewParameters(const G4ViewParameters &vp)
static G4VisManager * fpVisManager
void CopyParametersFrom(const G4UIcommand *fromCmd, G4UIcommand *toCmd)
void CopyGuidanceFrom(const G4UIcommand *fromCmd, G4UIcommand *toCmd, G4int startLine=0)
static G4VVisManager * GetConcreteInstance()
void SetAutoRefresh(G4bool)
G4bool IsMarkerNotHidden() const
G4bool IsAutoRefresh() const
DrawingStyle GetDrawingStyle() const
G4VisCommandDrawLogicalVolume()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandDrawLogicalVolume()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandDrawTree()
virtual ~G4VisCommandDrawView()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandDrawVolume()
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *)
virtual ~G4VisCommandOpen()
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandPlot()
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSpecify()
void SetCurrentGraphicsSystem(G4VGraphicsSystem *)
G4Scene * GetCurrentScene() const
void PrintAvailableGraphicsSystems(Verbosity, std::ostream &=G4cout) const
void SetCurrentSceneHandler(G4VSceneHandler *)
void SetCurrentScene(G4Scene *)
void SetCurrentViewer(G4VViewer *)
G4VGraphicsSystem * GetCurrentGraphicsSystem() const
const G4String & GetDefaultGraphicsSystemName() const
G4VViewer * GetCurrentViewer() const
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()
const G4String & GetDefaultXGeometryString() const
void SetVerboseLevel(G4int)