420{
422
423 if (newValue.empty()) {
429 }
430 return;
431 }
432
434
435
436 G4String::size_type iBegin, iEnd;
437 iBegin = newValue.find_first_not_of(' ');
438 while (iBegin != G4String::npos) {
439 iEnd = newValue.find_first_of(' ',iBegin);
440 if (iEnd == G4String::npos) {
441 iEnd = newValue.length();
442 }
444 iBegin = newValue.find_first_not_of(' ',iEnd);
445 if (iBegin == G4String::npos) {
448 "WARNING: G4VisCommandSetTouchable::SetNewValue"
449 "\n A pair not found. (There should be an even number of parameters.)"
450 "\n Command ignored."
452 return;
453 }
454 }
455 iEnd = newValue.find_first_of(' ',iBegin);
456 if (iEnd == G4String::npos) {
457 iEnd = newValue.length();
458 }
460 std::istringstream iss(newValue.substr(iBegin,iEnd-iBegin));
461 if (!(iss >> copyNo)) {
464 "WARNING: G4VisCommandSetTouchable::SetNewValue"
465 "\n Error reading copy number - it was not numeric?"
466 "\n Command ignored."
468 return;
469 }
470 }
471 currentTouchablePath.push_back
473 iBegin = newValue.find_first_not_of(' ',iEnd);
474 }
475
476
477 G4bool successful =
false;
480 size_t nWorlds = transportationManager->
GetNoWorlds();
481 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
483 for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
486 pvModel.SetModelingParameters (&mp);
488 pvModel.DescribeYourselfTo (scene);
489 if (scene.GetFoundTouchableProperties().fpTouchablePV) {
490 successful = true;
492 break;
493 }
494 }
495
496 if (successful) {
501 return;
502 }
503 } else {
506 "WARNING: G4VisCommandSetTouchable::SetNewValue"
507 "\n Touchable not found."
509 return;
510 }
511 }
512}
G4GLOB_DLL std::ostream G4cout
std::vector< PVNameCopyNo > PVNameCopyNoPath
static G4TransportationManager * GetTransportationManager()
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
std::size_t GetNoWorlds() const
static G4VisManager * fpVisManager
static G4PhysicalVolumeModel::TouchableProperties fCurrentTouchableProperties
static Verbosity GetVerbosity()
const char * name(G4int ptype)
G4ModelingParameters::PVNameCopyNoPath fTouchablePath