2799 G4cerr <<
"ERROR: No current scene. Please create one." <<
G4endl;
2805 G4int copyNo, requestedDepthOfDescent;
2806 G4double param1, param2, param3, param4, param5, param6;
2807 std::istringstream is (newValue);
2808 is >> name >> copyNo >> requestedDepthOfDescent
2809 >> clipVolumeType >> parameterUnit
2810 >> param1 >> param2 >> param3 >> param4 >> param5 >> param6;
2813 if (clipVolumeType[
size_t(0)] ==
'-') {
2814 clipVolumeType = clipVolumeType.substr(1);
2815 }
else if (clipVolumeType[
size_t(0)] ==
'*') {
2817 clipVolumeType = clipVolumeType.substr(1);
2820 param1 *= unit; param2 *= unit; param3 *= unit;
2821 param4 *= unit; param5 *= unit; param6 *= unit;
2826 size_t nWorlds = transportationManager->
GetNoWorlds();
2829 static G4bool warned =
false;
2830 if (!warned && name !=
"worlds") {
2832 "WARNING: Parallel worlds in operation. To visualise, specify"
2833 "\n \"worlds\" or the parallel world volume or sub-volume name"
2834 "\n and control visibility with /vis/geometry."
2836 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
2838 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
2839 G4cout <<
" World " << i <<
": " << (*iterWorld)->GetName()
2853 "ERROR: G4VisCommandSceneAddVolume::SetNewValue:"
2854 "\n No world. Maybe the geometry has not yet been defined."
2855 "\n Try \"/run/initialize\""
2861 std::vector<G4PhysicalVolumeModel*> models;
2862 std::vector<G4VPhysicalVolume*> foundVolumes;
2865 typedef std::vector<PVNodeID>
PVPath;
2866 PVPath foundFullPVPath;
2867 std::vector<G4int> foundDepths;
2868 std::vector<G4Transform3D> transformations;
2870 if (name ==
"world") {
2874 foundVolumes.push_back(world);
2875 foundDepths.push_back(0);
2878 }
else if (name ==
"worlds") {
2883 "WARNING: G4VisCommandSceneAddVolume::SetNewValue:"
2884 "\n Parallel worlds requested but none exist."
2885 "\n Just adding material world."
2889 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
2891 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
2894 foundVolumes.push_back(*iterWorld);
2895 foundDepths.push_back(0);
2901 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
2903 for (
size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
2906 searchModel.SetModelingParameters (&mp);
2908 searchModel.DescribeYourselfTo (searchScene);
2911 foundWorld = *iterWorld;
2912 foundVolumes.push_back(foundVolume);
2913 foundFullPVPath = searchScene.GetFoundFullPVPath();
2914 foundDepths.push_back(searchScene.GetFoundDepth());
2915 transformations.push_back(searchScene.GetFoundTransformation());
2920 if (foundVolumes.size()) {
2921 for (
size_t i = 0; i < foundVolumes.size(); ++i) {
2923 (foundVolumes[i], requestedDepthOfDescent, transformations[i]);
2924 foundFullPVPath.pop_back();
2926 models.push_back(foundPVModel);
2930 G4cerr <<
"ERROR: Volume \"" << name <<
"\"";
2932 G4cerr <<
", copy no. " << copyNo <<
",";
2940 if (clipVolumeType ==
"box") {
2941 const G4double dX = (param2 - param1) / 2.;
2942 const G4double dY = (param4 - param3) / 2.;
2943 const G4double dZ = (param6 - param5) / 2.;
2944 const G4double x0 = (param2 + param1) / 2.;
2945 const G4double y0 = (param4 + param3) / 2.;
2949 (
"_displaced_clipping_box",
2950 new G4Box(
"_clipping_box",dX,dY,dZ),
2952 for (
size_t i = 0; i < foundVolumes.size(); ++i) {
2953 models[i]->SetClippingSolid(clippingSolid);
2954 models[i]->SetClippingMode(clippingMode);
2958 const G4String& currentSceneName = pScene -> GetName ();
2960 for (
size_t i = 0; i < foundVolumes.size(); ++i) {
2961 G4bool successful = pScene -> AddRunDurationModel (models[i], warn);
2965 G4cout <<
"First occurrence of \""
2966 << foundVolumes[i] -> GetName ()
2969 G4cout <<
", copy no. " << copyNo <<
",";
2974 G4cout <<
"at depth " << foundDepths[i]
2975 <<
",\n with a requested depth of further descent of ";
2976 if (requestedDepthOfDescent < 0) {
2977 G4cout <<
"<0 (unlimited)";
2980 G4cout << requestedDepthOfDescent;
2982 G4cout <<
",\n has been added to scene \"" << currentSceneName <<
"\"."
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
void UpdateVisManagerScene(const G4String &sceneName="")
static void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID
std::vector< PVNodeID > PVPath
void SetBaseFullPVPath(const std::vector< G4PhysicalVolumeNodeID > &baseFullPVPath)
static G4TransportationManager * GetTransportationManager()
static G4double ValueOf(const char *unitName)
static Verbosity GetVerbosity()
size_t GetNoWorlds() const
G4Scene * GetCurrentScene() const
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager