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;
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");
355 if (graphicsSystem) {
356 graphicsSystemName = graphicsSystem->GetName ();
359 graphicsSystemName =
"none";
361 return graphicsSystemName;
366 G4String systemName, windowSizeHint;
367 std::istringstream is(newValue);
368 is >> systemName >> windowSizeHint;
374 ed <<
"sub-command \"/vis/sceneHandler/create\" failed.";
381 ed <<
"sub-command \"/vis/viewer/create\" failed.";
389 ed <<
"Invoked command has failed - see above. Available graphics systems are:\n ";
403 fpCommand -> SetGuidance(
"Draws plots.");
404 parameter =
new G4UIparameter (
"type",
's', omitable =
false);
405 parameter -> SetParameterCandidates(
"h1 h2");
406 fpCommand -> SetParameter (parameter);
408 fpCommand -> SetParameter (parameter);
424 if (currentViewer->GetName().find(
"TOOLSSG") == std::string::npos) {
426 "WARNING: Current viewer not able to draw plots."
427 "\n Try \"/vis/open TSG\", then \"/vis/plot " << newValue <<
"\" again."
433 std::istringstream is (newValue);
439 ui->ApplyCommand(
"/vis/enable");
440 ui->ApplyCommand(
"/vis/viewer/resetCameraParameters");
441 ui->ApplyCommand(
"/vis/scene/create");
442 ui->ApplyCommand(
"/vis/scene/endOfEventAction accumulate 0");
443 static G4int plotterID = 0;
444 std::ostringstream ossPlotter;
445 ossPlotter <<
"plotter-" << plotterID++;
446 const G4String& plotterName = ossPlotter.str();
447 ui->ApplyCommand(
"/vis/plotter/create " + plotterName);
448 ui->ApplyCommand(
"/vis/scene/add/plotter " + plotterName);
449 ui->ApplyCommand(
"/vis/plotter/add/" + type +
' ' +
id +
' ' + plotterName);
450 ui->ApplyCommand(
"/vis/sceneHandler/attach");
455 "WARNING: drawing was enabled for plotting but is now restored to disabled mode."
466 (
"Draws logical volume with Boolean components, voxels and readout geometry.");
468 (
"Synonymous with \"/vis/drawLogicalVolume\".");
470 (
"Creates a scene consisting of this logical volume and asks the"
471 "\n current viewer to draw it to the specified depth of descent"
472 "\n showing boolean components (if any), voxels (if any),"
473 "\n readout geometry (if any), local axes and overlaps (if any),"
474 "\n under control of the appropriate flag.");
476 (
"Note: voxels are not constructed until start of run - /run/beamOn."
477 "\n (For voxels without a run, \"/run/beamOn 0\".)");
478 fpCommand->
SetGuidance(
"The scene becomes current.");
480 parameter =
new G4UIparameter(
"logical-volume-name",
's', omitable =
false);
482 parameter =
new G4UIparameter(
"depth-of-descent",
'i', omitable =
true);
485 parameter =
new G4UIparameter(
"booleans-flag",
'b', omitable =
true);
488 parameter =
new G4UIparameter(
"voxels-flag",
'b', omitable =
true);
491 parameter =
new G4UIparameter(
"readout-flag",
'b', omitable =
true);
494 parameter =
new G4UIparameter(
"axes-flag",
'b', omitable =
true);
496 parameter -> SetGuidance (
"Set \"false\" to suppress axes.");
498 parameter =
new G4UIparameter(
"check-overlap-flag",
'b', omitable =
true);
500 parameter -> SetGuidance (
"Set \"false\" to suppress overlap check.");
515 static G4bool warned =
false;
518 "NOTE: For systems which are not \"auto-refresh\" you will need to"
519 "\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
G4VViewer * GetCurrentViewer() const
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()
void SetVerboseLevel(G4int)
G4bool contains(const G4String &str, std::string_view ss)
Check if a string contains a given substring.