137{
140
142
145
146 size_t nWorlds = transportationManager->
GetNoWorlds();
147
149 if (!world) {
152 "ERROR: G4VisCommandsTouchable::SetNewValue:"
153 "\n No world. Maybe the geometry has not yet been defined."
154 "\n Try \"/run/initialize\""
156 }
157 return;
158 }
159
161 if (!currentViewer) {
164 "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities."
166 }
167 return;
168 }
169
171 if (!currentScene) {
174 "ERROR: No current scene - \"/vis/scene/list\" to see possibilities."
176 }
177 return;
178 }
179
180 if (command == fpCommandCentreOn || command == fpCommandCentreAndZoomInOn) {
181
185
191 nullptr,
192 true,
194
195 G4Scene tempScene(
"Centre Scene");
196 G4bool successful = tempScene.AddRunDurationModel(&tempPVModel,warn);
197 if (successful) {
201 << ",\n has been added to temporary scene \"" << tempScene.GetName() << "\"."
203 }
204 }
205 const G4VisExtent& newExtent = tempScene.GetExtent();
209 if (command == fpCommandCentreAndZoomInOn) {
210
214 }
215
218
222 <<
"Viewer \"" << currentViewer->
GetName()
223 << "\" centred ";
224 if (fpCommandCentreAndZoomInOn) {
225 G4cout <<
"and zoomed in";
226 }
229 }
231 } else {
233 }
234 return;
235
236 } else if (command == fpCommandDraw) {
237
241
247 nullptr,
248 true,
250
254 newVerbose = 2;
261
262 if (successful) {
265 <<
"\", copy no. " << properties.
fCopyNo <<
" drawn"
267 }
268 } else {
270 }
271 } else {
273 }
274 return;
275
276 } else if (command == fpCommandDump) {
277
281
287 nullptr,
288 true,
290 const std::map<G4String,G4AttDef>* attDefs = tempPVModel.GetAttDefs();
291 std::vector<G4AttValue>* attValues = tempPVModel.CreateCurrentAttValues();
293 delete attValues;
296 G4cout <<
"\nLocal polyhedron coordinates:\n" << *polyhedron;
297 G4Transform3D* transform = tempPVModel.GetCurrentTransform();
298 polyhedron->Transform(*transform);
299 G4cout <<
"\nGlobal polyhedron coordinates:\n" << *polyhedron;
300 } else {
302 }
303 return;
304
305 } else if (command == fpCommandExtentForField) {
306
316 G4cout <<
"Extent for field set to " << extent
317 << "\nVolume for field has been cleared."
319 }
322 }
323 } else {
325 }
326 return;
327
328 } else if (command == fpCommandFindPath) {
329
332 std::istringstream iss(newValue);
333 iss >> pvName >> copyNo;
334 std::vector<G4PhysicalVolumesSearchScene::Findings> findingsVector;
335 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
337 for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
340 searchModel.SetModelingParameters (&mp);
342 searchModel.DescribeYourselfTo (searchScene);
343 for (const auto& findings: searchScene.GetFindings()) {
344 findingsVector.push_back(findings);
345 }
346 }
347 for (const auto& findings: findingsVector) {
349 << findings.fFoundBasePVPath
350 << ' ' << findings.fpFoundPV->GetName()
351 << ' ' << findings.fFoundPVCopyNo
352 << " (mother logical volume: "
353 << findings.fpFoundPV->GetMotherLogical()->GetName()
354 << ')'
356 }
357 if (findingsVector.size()) {
359 << "Use this to set a particular touchable with \"/vis/set/touchable <path>\""
360 << "\nor to see overlaps: \"/vis/drawLogicalVolume <mother-logical-volume-name>\""
362 } else {
364 if (copyNo >= 0)
G4cout <<
':' << copyNo;
366 }
367
368 } else if (command == fpCommandShowExtent) {
369
378 } else {
380 }
381 return;
382
383 } else if (command == fpCommandVolumeForField) {
384
401 }
404 }
405 } else {
407 }
408 return;
409
410 } else {
411
414 "ERROR: G4VisCommandsTouchable::SetNewValue: unrecognised command."
416 }
417 return;
418 }
419}
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4VSolid * GetSolid() const
G4bool AddRunDurationModel(G4VModel *, G4bool warn=false)
const G4VisExtent & GetExtent() const
const G4Point3D & GetStandardTargetPoint() const
static G4TransportationManager * GetTransportationManager()
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
size_t GetNoWorlds() const
static G4bool GetNewBoolValue(const char *paramString)
G4int ApplyCommand(const char *aCommand)
G4int GetVerboseLevel() const
static G4UImanager * GetUIpointer()
void SetVerboseLevel(G4int val)
virtual void SetCopyNo(G4int CopyNo)=0
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
virtual G4VisExtent GetExtent() const
virtual G4Polyhedron * GetPolyhedron() const
const G4String & GetName() const
const G4ViewParameters & GetViewParameters() const
void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
static std::vector< G4PhysicalVolumesSearchScene::Findings > fCurrrentPVFindingsForField
static G4VisManager * fpVisManager
static G4VisExtent fCurrentExtentForField
void DrawExtent(const G4VisExtent &)
void InterpolateToNewView(G4VViewer *currentViewer, const G4ViewParameters &oldVP, const G4ViewParameters &newVP, const G4int nInterpolationPoints=50, const G4int waitTimePerPointmilliseconds=20, const G4String exportString="")
void SetViewParameters(G4VViewer *viewer, const G4ViewParameters &viewParams)
static G4PhysicalVolumeModel::TouchableProperties fCurrentTouchableProperties
void SetCurrentTargetPoint(const G4Point3D ¤tTargetPoint)
void SetZoomFactor(G4double zoomFactor)
G4double GetExtentRadius() const
G4VisExtent & Transform(const G4Transform3D &)
const G4Point3D & GetExtentCentre() const
G4Scene * GetCurrentScene() const
static Verbosity GetVerbosity()
G4PhysicalVolumeModel::TouchableProperties FindTouchableProperties(G4ModelingParameters::PVNameCopyNoPath path)
G4ModelingParameters::PVNameCopyNoPath fTouchablePath
G4VPhysicalVolume * fpTouchablePV
std::vector< G4PhysicalVolumeNodeID > fTouchableBaseFullPVPath
G4Transform3D fTouchableGlobalTransform