Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // >> 27 // $Id: G4VisCommandsGeometrySet.cc,v 1.7 2007/01/05 16:24:19 allison Exp $ >> 28 // GEANT4 tag $Name: geant4-08-03-patch-02 $ 27 29 28 // /vis/geometry commands - John Allison 31st 30 // /vis/geometry commands - John Allison 31st January 2006 29 31 30 #include "G4VisCommandsGeometrySet.hh" 32 #include "G4VisCommandsGeometrySet.hh" 31 33 32 #include "G4UIcommand.hh" 34 #include "G4UIcommand.hh" 33 #include "G4VisManager.hh" 35 #include "G4VisManager.hh" 34 #include "G4LogicalVolumeStore.hh" 36 #include "G4LogicalVolumeStore.hh" 35 #include "G4UImanager.hh" 37 #include "G4UImanager.hh" 36 38 37 #include <sstream> 39 #include <sstream> 38 << 40 #include <cctype> 39 #define G4warn G4cout << 40 41 41 void G4VVisCommandGeometrySet::Set 42 void G4VVisCommandGeometrySet::Set 42 (const G4String& requestedName, << 43 (G4String requestedName, 43 const G4VVisCommandGeometrySetFunction& setFu 44 const G4VVisCommandGeometrySetFunction& setFunction, 44 G4int requestedDepth) 45 G4int requestedDepth) 45 { 46 { 46 G4VisManager::Verbosity verbosity = fpVisMan 47 G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity(); 47 G4LogicalVolumeStore* pLVStore = G4LogicalVo 48 G4LogicalVolumeStore* pLVStore = G4LogicalVolumeStore::GetInstance(); 48 G4bool found = false; 49 G4bool found = false; 49 for (std::size_t iLV = 0; iLV < pLVStore->si << 50 for (size_t iLV = 0; iLV < pLVStore->size(); iLV++ ) { 50 G4LogicalVolume* pLV = (*pLVStore)[iLV]; 51 G4LogicalVolume* pLV = (*pLVStore)[iLV]; 51 const G4String& logVolName = pLV->GetName( 52 const G4String& logVolName = pLV->GetName(); 52 if (logVolName == requestedName) found = t 53 if (logVolName == requestedName) found = true; 53 if (requestedName == "all" || logVolName = 54 if (requestedName == "all" || logVolName == requestedName) { 54 SetLVVisAtts(pLV, setFunction, 0, reques 55 SetLVVisAtts(pLV, setFunction, 0, requestedDepth); 55 } 56 } 56 } 57 } 57 if (requestedName != "all" && !found) { 58 if (requestedName != "all" && !found) { 58 if (verbosity >= G4VisManager::errors) { 59 if (verbosity >= G4VisManager::errors) { 59 G4warn << "ERROR: Logical volume \"" << << 60 G4cout << "ERROR: Logical volume \"" << requestedName 60 << "\" not found in logical volume stor 61 << "\" not found in logical volume store." << G4endl; 61 } 62 } 62 return; 63 return; 63 } 64 } 64 // Recalculate extent of any physical volume << 65 for (const auto& scene : fpVisManager->GetSc << 66 const auto& runDurationModelList = scene-> << 67 for (const auto& sceneModel : runDurationM << 68 auto model = sceneModel.fpModel; << 69 auto pvModel = dynamic_cast<G4PhysicalVo << 70 if (pvModel) pvModel->CalculateExtent(); << 71 } << 72 // And re-calculate the scene's extent << 73 scene->CalculateExtent(); << 74 } << 75 if (fpVisManager->GetCurrentViewer()) { 65 if (fpVisManager->GetCurrentViewer()) { 76 G4UImanager::GetUIpointer()->ApplyCommand( << 66 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/rebuild"); 77 } 67 } 78 } 68 } 79 69 80 void G4VVisCommandGeometrySet::SetLVVisAtts 70 void G4VVisCommandGeometrySet::SetLVVisAtts 81 (G4LogicalVolume* pLV, 71 (G4LogicalVolume* pLV, 82 const G4VVisCommandGeometrySetFunction& setFu 72 const G4VVisCommandGeometrySetFunction& setFunction, 83 G4int depth, G4int requestedDepth) 73 G4int depth, G4int requestedDepth) 84 { 74 { 85 G4VisManager::Verbosity verbosity = fpVisMan 75 G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity(); 86 const G4VisAttributes* oldVisAtts = pLV->Get 76 const G4VisAttributes* oldVisAtts = pLV->GetVisAttributes(); 87 fVisAttsMap.insert(std::make_pair(pLV,oldVis 77 fVisAttsMap.insert(std::make_pair(pLV,oldVisAtts)); // Store old vis atts. 88 G4VisAttributes* newVisAtts = new G4VisAttri 78 G4VisAttributes* newVisAtts = new G4VisAttributes; // Memory leak! 89 if (oldVisAtts) { 79 if (oldVisAtts) { 90 *newVisAtts = *oldVisAtts; 80 *newVisAtts = *oldVisAtts; 91 } 81 } 92 setFunction(newVisAtts); // Sets whatever a 82 setFunction(newVisAtts); // Sets whatever attribute determined by 93 // function object. 83 // function object. 94 pLV->SetVisAttributes(newVisAtts); 84 pLV->SetVisAttributes(newVisAtts); 95 if (verbosity >= G4VisManager::confirmations 85 if (verbosity >= G4VisManager::confirmations) { 96 G4cout << "\nLogical Volume \"" << pLV->Ge 86 G4cout << "\nLogical Volume \"" << pLV->GetName() 97 << "\": setting vis attributes:"; << 87 << "\": setting vis attributes:\nwas: " << *oldVisAtts 98 if (oldVisAtts) { << 88 << "\nnow: " << *newVisAtts 99 G4cout << "\nwas: " << *oldVisAtts; << 100 } else { << 101 G4cout << "\n(no old attributes)"; << 102 } << 103 G4cout << "\nnow: " << *newVisAtts << 104 << G4endl; 89 << G4endl; 105 } 90 } 106 if (requestedDepth < 0 || depth < requestedD << 91 if (requestedDepth < 0 || depth++ < requestedDepth) { 107 G4int nDaughters = (G4int)pLV->GetNoDaught << 92 G4int nDaughters = pLV->GetNoDaughters(); 108 for (G4int i = 0; i < nDaughters; ++i) { 93 for (G4int i = 0; i < nDaughters; ++i) { 109 SetLVVisAtts(pLV->GetDaughter(i)->GetLog 94 SetLVVisAtts(pLV->GetDaughter(i)->GetLogicalVolume(), 110 setFunction, ++depth, requestedDepth); << 95 setFunction, depth, requestedDepth); 111 } 96 } 112 } 97 } 113 } 98 } 114 99 115 ////////////// /vis/geometry/set/colour ////// 100 ////////////// /vis/geometry/set/colour /////////////////////////////////////// 116 101 117 G4VisCommandGeometrySetColour::G4VisCommandGeo 102 G4VisCommandGeometrySetColour::G4VisCommandGeometrySetColour() 118 { 103 { 119 G4bool omitable; 104 G4bool omitable; 120 fpCommand = new G4UIcommand("/vis/geometry/s 105 fpCommand = new G4UIcommand("/vis/geometry/set/colour", this); 121 fpCommand->SetGuidance("Sets colour of logic 106 fpCommand->SetGuidance("Sets colour of logical volume(s)."); 122 fpCommand->SetGuidance("\"all\" sets all log 107 fpCommand->SetGuidance("\"all\" sets all logical volumes."); 123 fpCommand->SetGuidance 108 fpCommand->SetGuidance 124 ("Optionally propagates down hierarchy to 109 ("Optionally propagates down hierarchy to given depth."); 125 G4UIparameter* parameter; 110 G4UIparameter* parameter; 126 parameter = new G4UIparameter ("logical-volu 111 parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true); 127 parameter->SetDefaultValue("all"); 112 parameter->SetDefaultValue("all"); 128 fpCommand->SetParameter(parameter); 113 fpCommand->SetParameter(parameter); 129 parameter = new G4UIparameter("depth", 'd', 114 parameter = new G4UIparameter("depth", 'd', omitable = true); 130 parameter->SetDefaultValue(0); 115 parameter->SetDefaultValue(0); 131 parameter->SetGuidance 116 parameter->SetGuidance 132 ("Depth of propagation (-1 means unlimited 117 ("Depth of propagation (-1 means unlimited depth)."); 133 fpCommand->SetParameter(parameter); 118 fpCommand->SetParameter(parameter); 134 parameter = new G4UIparameter("red", 's', om 119 parameter = new G4UIparameter("red", 's', omitable = true); 135 parameter->SetDefaultValue("1."); 120 parameter->SetDefaultValue("1."); 136 parameter->SetGuidance 121 parameter->SetGuidance 137 ("Red component or a string, e.g., \"blue\ 122 ("Red component or a string, e.g., \"blue\", in which case succeeding colour components are ignored."); 138 fpCommand->SetParameter(parameter); 123 fpCommand->SetParameter(parameter); 139 parameter = new G4UIparameter("green", 'd', 124 parameter = new G4UIparameter("green", 'd', omitable = true); 140 parameter->SetDefaultValue(1.); 125 parameter->SetDefaultValue(1.); 141 fpCommand->SetParameter(parameter); 126 fpCommand->SetParameter(parameter); 142 parameter = new G4UIparameter("blue", 'd', o 127 parameter = new G4UIparameter("blue", 'd', omitable = true); 143 parameter->SetDefaultValue(1.); 128 parameter->SetDefaultValue(1.); 144 fpCommand->SetParameter(parameter); 129 fpCommand->SetParameter(parameter); 145 parameter = new G4UIparameter("opacity", 'd' 130 parameter = new G4UIparameter("opacity", 'd', omitable = true); 146 parameter->SetDefaultValue(1.); 131 parameter->SetDefaultValue(1.); 147 fpCommand->SetParameter(parameter); 132 fpCommand->SetParameter(parameter); 148 } 133 } 149 134 150 G4VisCommandGeometrySetColour::~G4VisCommandGe 135 G4VisCommandGeometrySetColour::~G4VisCommandGeometrySetColour() 151 { 136 { 152 delete fpCommand; 137 delete fpCommand; 153 } 138 } 154 139 155 G4String G4VisCommandGeometrySetColour::GetCur 140 G4String G4VisCommandGeometrySetColour::GetCurrentValue(G4UIcommand*) 156 { 141 { 157 return ""; 142 return ""; 158 } 143 } 159 144 160 void G4VisCommandGeometrySetColour::SetNewValu 145 void G4VisCommandGeometrySetColour::SetNewValue 161 (G4UIcommand*, G4String newValue) 146 (G4UIcommand*, G4String newValue) 162 { 147 { 163 G4String name, redOrString; 148 G4String name, redOrString; 164 G4int requestedDepth; 149 G4int requestedDepth; 165 G4double green, blue, opacity; 150 G4double green, blue, opacity; 166 std::istringstream iss(newValue); 151 std::istringstream iss(newValue); 167 iss >> name >> requestedDepth >> redOrString 152 iss >> name >> requestedDepth >> redOrString >> green >> blue >> opacity; 168 G4Colour colour(1,1,1,1); // Default white 153 G4Colour colour(1,1,1,1); // Default white and opaque. 169 ConvertToColour(colour, redOrString, green, << 154 const size_t iPos0 = 0; >> 155 if (std::isalpha(redOrString[iPos0])) { >> 156 G4Colour::GetColour(redOrString, colour); // Remains if not found. >> 157 } else { >> 158 colour = G4Colour(G4UIcommand::ConvertToDouble(redOrString), green, blue); >> 159 } >> 160 colour = G4Colour >> 161 (colour.GetRed(), colour.GetGreen(), colour.GetBlue(), opacity); >> 162 170 G4VisCommandGeometrySetColourFunction setCol 163 G4VisCommandGeometrySetColourFunction setColour(colour); 171 Set(name, setColour, requestedDepth); 164 Set(name, setColour, requestedDepth); 172 } 165 } 173 166 174 ////////////// /vis/geometry/set/daughtersInvi 167 ////////////// /vis/geometry/set/daughtersInvisible ////////////////////// 175 168 176 G4VisCommandGeometrySetDaughtersInvisible::G4V 169 G4VisCommandGeometrySetDaughtersInvisible::G4VisCommandGeometrySetDaughtersInvisible() 177 { 170 { 178 G4bool omitable; 171 G4bool omitable; 179 fpCommand = new G4UIcommand("/vis/geometry/s 172 fpCommand = new G4UIcommand("/vis/geometry/set/daughtersInvisible", this); 180 fpCommand->SetGuidance("Makes daughters of l 173 fpCommand->SetGuidance("Makes daughters of logical volume(s) invisible."); 181 fpCommand->SetGuidance("\"all\" sets all log 174 fpCommand->SetGuidance("\"all\" sets all logical volumes."); 182 fpCommand->SetGuidance 175 fpCommand->SetGuidance 183 ("Optionally propagates down hierarchy to 176 ("Optionally propagates down hierarchy to given depth."); 184 G4UIparameter* parameter; 177 G4UIparameter* parameter; 185 parameter = new G4UIparameter ("logical-volu 178 parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true); 186 parameter->SetDefaultValue("all"); 179 parameter->SetDefaultValue("all"); 187 fpCommand->SetParameter(parameter); 180 fpCommand->SetParameter(parameter); 188 parameter = new G4UIparameter("depth", 'd', 181 parameter = new G4UIparameter("depth", 'd', omitable = true); 189 parameter->SetDefaultValue(0); 182 parameter->SetDefaultValue(0); 190 parameter->SetGuidance 183 parameter->SetGuidance 191 ("Depth of propagation (-1 means unlimited 184 ("Depth of propagation (-1 means unlimited depth)."); 192 fpCommand->SetParameter(parameter); 185 fpCommand->SetParameter(parameter); 193 parameter = new G4UIparameter("daughtersInvi 186 parameter = new G4UIparameter("daughtersInvisible", 'b', omitable = true); 194 parameter->SetDefaultValue(true); << 187 parameter->SetDefaultValue(false); 195 fpCommand->SetParameter(parameter); 188 fpCommand->SetParameter(parameter); 196 } 189 } 197 190 198 G4VisCommandGeometrySetDaughtersInvisible::~G4 191 G4VisCommandGeometrySetDaughtersInvisible::~G4VisCommandGeometrySetDaughtersInvisible() 199 { 192 { 200 delete fpCommand; 193 delete fpCommand; 201 } 194 } 202 195 203 G4String 196 G4String 204 G4VisCommandGeometrySetDaughtersInvisible::Get 197 G4VisCommandGeometrySetDaughtersInvisible::GetCurrentValue(G4UIcommand*) 205 { 198 { 206 return ""; 199 return ""; 207 } 200 } 208 201 209 void G4VisCommandGeometrySetDaughtersInvisible 202 void G4VisCommandGeometrySetDaughtersInvisible::SetNewValue 210 (G4UIcommand*, G4String newValue) 203 (G4UIcommand*, G4String newValue) 211 { 204 { 212 G4String name; 205 G4String name; 213 G4int requestedDepth; 206 G4int requestedDepth; 214 G4String daughtersInvisibleString; 207 G4String daughtersInvisibleString; 215 std::istringstream iss(newValue); 208 std::istringstream iss(newValue); 216 iss >> name >> requestedDepth >> daughtersIn 209 iss >> name >> requestedDepth >> daughtersInvisibleString; 217 G4bool daughtersInvisible = 210 G4bool daughtersInvisible = 218 G4UIcommand::ConvertToBool(daughtersInvisi 211 G4UIcommand::ConvertToBool(daughtersInvisibleString); 219 212 220 if (requestedDepth !=0) { 213 if (requestedDepth !=0) { 221 requestedDepth = 0; 214 requestedDepth = 0; 222 if (fpVisManager->GetVerbosity() >= G4VisM 215 if (fpVisManager->GetVerbosity() >= G4VisManager::warnings) { 223 G4warn << "Recursive application suppres << 216 G4cout << "Recursive application suppressed for this attribute." 224 << G4endl; 217 << G4endl; 225 } 218 } 226 } 219 } 227 220 228 G4VisCommandGeometrySetDaughtersInvisibleFun 221 G4VisCommandGeometrySetDaughtersInvisibleFunction 229 setDaughtersInvisible(daughtersInvisible); 222 setDaughtersInvisible(daughtersInvisible); 230 Set(name, setDaughtersInvisible, requestedDe 223 Set(name, setDaughtersInvisible, requestedDepth); 231 224 232 G4VViewer* pViewer = fpVisManager->GetCurren 225 G4VViewer* pViewer = fpVisManager->GetCurrentViewer(); 233 if (pViewer) { 226 if (pViewer) { 234 const G4ViewParameters& viewParams = pView 227 const G4ViewParameters& viewParams = pViewer->GetViewParameters(); 235 if (fpVisManager->GetVerbosity() >= G4VisM 228 if (fpVisManager->GetVerbosity() >= G4VisManager::warnings) { 236 if (!viewParams.IsCulling()) { 229 if (!viewParams.IsCulling()) { 237 G4warn << << 230 G4cout << 238 "Culling must be on - \"/vis/viewer/set/cu 231 "Culling must be on - \"/vis/viewer/set/culling global true\" - to see effect." 239 << G4endl; 232 << G4endl; 240 } 233 } 241 } 234 } 242 } 235 } 243 } 236 } 244 237 245 ////////////// /vis/geometry/set/forceAuxEdgeV 238 ////////////// /vis/geometry/set/forceAuxEdgeVisible ///////////////////////// 246 239 247 G4VisCommandGeometrySetForceAuxEdgeVisible::G4 240 G4VisCommandGeometrySetForceAuxEdgeVisible::G4VisCommandGeometrySetForceAuxEdgeVisible() 248 { 241 { 249 G4bool omitable; 242 G4bool omitable; 250 fpCommand = new G4UIcommand("/vis/geometry/s 243 fpCommand = new G4UIcommand("/vis/geometry/set/forceAuxEdgeVisible", this); 251 fpCommand->SetGuidance 244 fpCommand->SetGuidance 252 ("Forces auxiliary (soft) edges of logical 245 ("Forces auxiliary (soft) edges of logical volume(s) to be visible," 253 "\nregardless of the view parameters."); 246 "\nregardless of the view parameters."); 254 fpCommand->SetGuidance("\"all\" sets all log 247 fpCommand->SetGuidance("\"all\" sets all logical volumes."); 255 fpCommand->SetGuidance 248 fpCommand->SetGuidance 256 ("Optionally propagates down hierarchy to 249 ("Optionally propagates down hierarchy to given depth."); 257 G4UIparameter* parameter; 250 G4UIparameter* parameter; 258 parameter = new G4UIparameter ("logical-volu 251 parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true); 259 parameter->SetDefaultValue("all"); 252 parameter->SetDefaultValue("all"); 260 fpCommand->SetParameter(parameter); 253 fpCommand->SetParameter(parameter); 261 parameter = new G4UIparameter("depth", 'd', 254 parameter = new G4UIparameter("depth", 'd', omitable = true); 262 parameter->SetDefaultValue(0); 255 parameter->SetDefaultValue(0); 263 parameter->SetGuidance 256 parameter->SetGuidance 264 ("Depth of propagation (-1 means unlimited 257 ("Depth of propagation (-1 means unlimited depth)."); 265 fpCommand->SetParameter(parameter); 258 fpCommand->SetParameter(parameter); 266 parameter = new G4UIparameter("forceAuxEdgeV 259 parameter = new G4UIparameter("forceAuxEdgeVisible", 'b', omitable = true); 267 parameter->SetDefaultValue(true); << 260 parameter->SetDefaultValue(false); 268 fpCommand->SetParameter(parameter); 261 fpCommand->SetParameter(parameter); 269 } 262 } 270 263 271 G4VisCommandGeometrySetForceAuxEdgeVisible::~G 264 G4VisCommandGeometrySetForceAuxEdgeVisible::~G4VisCommandGeometrySetForceAuxEdgeVisible() 272 { 265 { 273 delete fpCommand; 266 delete fpCommand; 274 } 267 } 275 268 276 G4String 269 G4String 277 G4VisCommandGeometrySetForceAuxEdgeVisible::Ge 270 G4VisCommandGeometrySetForceAuxEdgeVisible::GetCurrentValue(G4UIcommand*) 278 { 271 { 279 return ""; 272 return ""; 280 } 273 } 281 274 282 void G4VisCommandGeometrySetForceAuxEdgeVisibl 275 void G4VisCommandGeometrySetForceAuxEdgeVisible::SetNewValue 283 (G4UIcommand*, G4String newValue) 276 (G4UIcommand*, G4String newValue) 284 { 277 { 285 G4String name; 278 G4String name; 286 G4int requestedDepth; 279 G4int requestedDepth; 287 G4String forceAuxEdgeVisibleString; 280 G4String forceAuxEdgeVisibleString; 288 std::istringstream iss(newValue); 281 std::istringstream iss(newValue); 289 iss >> name >> requestedDepth >> forceAuxEdg 282 iss >> name >> requestedDepth >> forceAuxEdgeVisibleString; 290 G4bool forceAuxEdgeVisible = 283 G4bool forceAuxEdgeVisible = 291 G4UIcommand::ConvertToBool(forceAuxEdgeVis 284 G4UIcommand::ConvertToBool(forceAuxEdgeVisibleString);; 292 285 293 G4VisCommandGeometrySetForceAuxEdgeVisibleFu 286 G4VisCommandGeometrySetForceAuxEdgeVisibleFunction 294 setForceAuxEdgeVisible(forceAuxEdgeVisible 287 setForceAuxEdgeVisible(forceAuxEdgeVisible); 295 Set(name, setForceAuxEdgeVisible, requestedD 288 Set(name, setForceAuxEdgeVisible, requestedDepth); 296 } 289 } 297 290 298 ////////////// /vis/geometry/set/forceCloud // << 299 << 300 G4VisCommandGeometrySetForceCloud::G4VisComman << 301 { << 302 G4bool omitable; << 303 fpCommand = new G4UIcommand("/vis/geometry/s << 304 fpCommand->SetGuidance << 305 ("Forces logical volume(s) always to be draw << 306 "\nregardless of the view parameters."); << 307 fpCommand->SetGuidance("\"all\" sets all log << 308 fpCommand->SetGuidance << 309 ("Optionally propagates down hierarchy to << 310 G4UIparameter* parameter; << 311 parameter = new G4UIparameter ("logical-volu << 312 parameter->SetDefaultValue("all"); << 313 fpCommand->SetParameter(parameter); << 314 parameter = new G4UIparameter("depth", 'd', << 315 parameter->SetDefaultValue(0); << 316 parameter->SetGuidance << 317 ("Depth of propagation (-1 means unlimited << 318 fpCommand->SetParameter(parameter); << 319 parameter = new G4UIparameter("forceCloud", << 320 parameter->SetDefaultValue(true); << 321 fpCommand->SetParameter(parameter); << 322 parameter = new G4UIparameter("nPoints", 'd' << 323 parameter->SetGuidance << 324 ("<= 0 means under control of viewer."); << 325 parameter->SetDefaultValue(0); << 326 fpCommand->SetParameter(parameter); << 327 } << 328 << 329 G4VisCommandGeometrySetForceCloud::~G4VisComma << 330 { << 331 delete fpCommand; << 332 } << 333 << 334 G4String << 335 G4VisCommandGeometrySetForceCloud::GetCurrentV << 336 { << 337 return ""; << 338 } << 339 << 340 void G4VisCommandGeometrySetForceCloud::SetNew << 341 (G4UIcommand*, G4String newValue) << 342 { << 343 G4String name, forceCloudString; << 344 G4int requestedDepth, nPoints; << 345 std::istringstream iss(newValue); << 346 iss >> name >> requestedDepth >> forceCloudS << 347 G4bool forceCloud = G4UIcommand::ConvertToBo << 348 << 349 G4VisCommandGeometrySetForceCloudFunction se << 350 Set(name, setForceCloud, requestedDepth); << 351 } << 352 << 353 ////////////// /vis/geometry/set/forceLineSegm 291 ////////////// /vis/geometry/set/forceLineSegmentsPerCircle ///////////////////////// 354 292 355 G4VisCommandGeometrySetForceLineSegmentsPerCir 293 G4VisCommandGeometrySetForceLineSegmentsPerCircle::G4VisCommandGeometrySetForceLineSegmentsPerCircle() 356 { 294 { 357 G4bool omitable; 295 G4bool omitable; 358 fpCommand = new G4UIcommand("/vis/geometry/s 296 fpCommand = new G4UIcommand("/vis/geometry/set/forceLineSegmentsPerCircle", this); 359 fpCommand->SetGuidance 297 fpCommand->SetGuidance 360 ("Forces number of line segments per circl 298 ("Forces number of line segments per circle, the precision with which a" 361 "\ncurved line or surface is represented 299 "\ncurved line or surface is represented by a polygon or polyhedron," 362 "\nregardless of the view parameters."); 300 "\nregardless of the view parameters."); 363 fpCommand->SetGuidance("\"all\" sets all log 301 fpCommand->SetGuidance("\"all\" sets all logical volumes."); 364 fpCommand->SetGuidance 302 fpCommand->SetGuidance 365 ("Optionally propagates down hierarchy to 303 ("Optionally propagates down hierarchy to given depth."); 366 G4UIparameter* parameter; 304 G4UIparameter* parameter; 367 parameter = new G4UIparameter ("logical-volu 305 parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true); 368 parameter->SetDefaultValue("all"); 306 parameter->SetDefaultValue("all"); 369 fpCommand->SetParameter(parameter); 307 fpCommand->SetParameter(parameter); 370 parameter = new G4UIparameter("depth", 'd', 308 parameter = new G4UIparameter("depth", 'd', omitable = true); 371 parameter->SetDefaultValue(0); 309 parameter->SetDefaultValue(0); 372 parameter->SetGuidance 310 parameter->SetGuidance 373 ("Depth of propagation (-1 means unlimited 311 ("Depth of propagation (-1 means unlimited depth)."); 374 fpCommand->SetParameter(parameter); 312 fpCommand->SetParameter(parameter); 375 parameter = new G4UIparameter("lineSegmentsP 313 parameter = new G4UIparameter("lineSegmentsPerCircle", 'd', omitable = true); 376 parameter->SetGuidance 314 parameter->SetGuidance 377 ("<= 0 means not forced, i.e., under contr << 315 ("< 0 means not forced, i.e., under control of viewer."); 378 parameter->SetDefaultValue(0); << 316 parameter->SetDefaultValue(-1); 379 fpCommand->SetParameter(parameter); 317 fpCommand->SetParameter(parameter); 380 } 318 } 381 319 382 G4VisCommandGeometrySetForceLineSegmentsPerCir 320 G4VisCommandGeometrySetForceLineSegmentsPerCircle::~G4VisCommandGeometrySetForceLineSegmentsPerCircle() 383 { 321 { 384 delete fpCommand; 322 delete fpCommand; 385 } 323 } 386 324 387 G4String 325 G4String 388 G4VisCommandGeometrySetForceLineSegmentsPerCir 326 G4VisCommandGeometrySetForceLineSegmentsPerCircle::GetCurrentValue(G4UIcommand*) 389 { 327 { 390 return ""; 328 return ""; 391 } 329 } 392 330 393 void G4VisCommandGeometrySetForceLineSegmentsP 331 void G4VisCommandGeometrySetForceLineSegmentsPerCircle::SetNewValue 394 (G4UIcommand*, G4String newValue) 332 (G4UIcommand*, G4String newValue) 395 { 333 { 396 G4String name; 334 G4String name; 397 G4int requestedDepth; 335 G4int requestedDepth; 398 G4int lineSegmentsPerCircle; 336 G4int lineSegmentsPerCircle; 399 std::istringstream iss(newValue); 337 std::istringstream iss(newValue); 400 iss >> name >> requestedDepth >> lineSegment 338 iss >> name >> requestedDepth >> lineSegmentsPerCircle; 401 339 402 G4VisCommandGeometrySetForceLineSegmentsPerC << 340 G4VisCommandGeometrySetForceLineSegmentsPerCircleFunction setForceLineSegmentsPerCircle(lineSegmentsPerCircle); 403 setForceLineSegmentsPerCircle(lineSegmentsPe << 404 Set(name, setForceLineSegmentsPerCircle, req 341 Set(name, setForceLineSegmentsPerCircle, requestedDepth); 405 } 342 } 406 343 407 ////////////// /vis/geometry/set/forceSolid // 344 ////////////// /vis/geometry/set/forceSolid ///////////////////////// 408 345 409 G4VisCommandGeometrySetForceSolid::G4VisComman 346 G4VisCommandGeometrySetForceSolid::G4VisCommandGeometrySetForceSolid() 410 { 347 { 411 G4bool omitable; 348 G4bool omitable; 412 fpCommand = new G4UIcommand("/vis/geometry/s 349 fpCommand = new G4UIcommand("/vis/geometry/set/forceSolid", this); 413 fpCommand->SetGuidance 350 fpCommand->SetGuidance 414 ("Forces logical volume(s) always to be dra 351 ("Forces logical volume(s) always to be drawn solid (surface drawing)," 415 "\nregardless of the view parameters."); 352 "\nregardless of the view parameters."); 416 fpCommand->SetGuidance("\"all\" sets all log 353 fpCommand->SetGuidance("\"all\" sets all logical volumes."); 417 fpCommand->SetGuidance 354 fpCommand->SetGuidance 418 ("Optionally propagates down hierarchy to 355 ("Optionally propagates down hierarchy to given depth."); 419 G4UIparameter* parameter; 356 G4UIparameter* parameter; 420 parameter = new G4UIparameter ("logical-volu 357 parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true); 421 parameter->SetDefaultValue("all"); 358 parameter->SetDefaultValue("all"); 422 fpCommand->SetParameter(parameter); 359 fpCommand->SetParameter(parameter); 423 parameter = new G4UIparameter("depth", 'd', 360 parameter = new G4UIparameter("depth", 'd', omitable = true); 424 parameter->SetDefaultValue(0); 361 parameter->SetDefaultValue(0); 425 parameter->SetGuidance 362 parameter->SetGuidance 426 ("Depth of propagation (-1 means unlimited 363 ("Depth of propagation (-1 means unlimited depth)."); 427 fpCommand->SetParameter(parameter); 364 fpCommand->SetParameter(parameter); 428 parameter = new G4UIparameter("force", 'b', << 365 parameter = new G4UIparameter("forceSolid", 'b', omitable = true); 429 parameter->SetDefaultValue(true); << 366 parameter->SetDefaultValue(false); 430 fpCommand->SetParameter(parameter); 367 fpCommand->SetParameter(parameter); 431 } 368 } 432 369 433 G4VisCommandGeometrySetForceSolid::~G4VisComma 370 G4VisCommandGeometrySetForceSolid::~G4VisCommandGeometrySetForceSolid() 434 { 371 { 435 delete fpCommand; 372 delete fpCommand; 436 } 373 } 437 374 438 G4String 375 G4String 439 G4VisCommandGeometrySetForceSolid::GetCurrentV 376 G4VisCommandGeometrySetForceSolid::GetCurrentValue(G4UIcommand*) 440 { 377 { 441 return ""; 378 return ""; 442 } 379 } 443 380 444 void G4VisCommandGeometrySetForceSolid::SetNew 381 void G4VisCommandGeometrySetForceSolid::SetNewValue 445 (G4UIcommand*, G4String newValue) 382 (G4UIcommand*, G4String newValue) 446 { 383 { 447 G4String name; 384 G4String name; 448 G4int requestedDepth; 385 G4int requestedDepth; 449 G4String forceString; << 386 G4String forceSolidString; 450 std::istringstream iss(newValue); 387 std::istringstream iss(newValue); 451 iss >> name >> requestedDepth >> forceString << 388 iss >> name >> requestedDepth >> forceSolidString; 452 G4bool force = G4UIcommand::ConvertToBool(fo << 389 G4bool forceSolid = G4UIcommand::ConvertToBool(forceSolidString); 453 390 454 G4VisCommandGeometrySetForceSolidFunction se << 391 G4VisCommandGeometrySetForceSolidFunction setForceSolid(forceSolid); 455 Set(name, setForceSolid, requestedDepth); 392 Set(name, setForceSolid, requestedDepth); 456 } 393 } 457 394 458 ////////////// /vis/geometry/set/forceWirefram 395 ////////////// /vis/geometry/set/forceWireframe ///////////////////////// 459 396 460 G4VisCommandGeometrySetForceWireframe::G4VisCo 397 G4VisCommandGeometrySetForceWireframe::G4VisCommandGeometrySetForceWireframe() 461 { 398 { 462 G4bool omitable; 399 G4bool omitable; 463 fpCommand = new G4UIcommand("/vis/geometry/s 400 fpCommand = new G4UIcommand("/vis/geometry/set/forceWireframe", this); 464 fpCommand->SetGuidance 401 fpCommand->SetGuidance 465 ("Forces logical volume(s) always to be dra 402 ("Forces logical volume(s) always to be drawn as wireframe," 466 "\nregardless of the view parameters."); 403 "\nregardless of the view parameters."); 467 fpCommand->SetGuidance("\"all\" sets all log 404 fpCommand->SetGuidance("\"all\" sets all logical volumes."); 468 fpCommand->SetGuidance 405 fpCommand->SetGuidance 469 ("Optionally propagates down hierarchy to 406 ("Optionally propagates down hierarchy to given depth."); 470 G4UIparameter* parameter; 407 G4UIparameter* parameter; 471 parameter = new G4UIparameter ("logical-volu 408 parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true); 472 parameter->SetDefaultValue("all"); 409 parameter->SetDefaultValue("all"); 473 fpCommand->SetParameter(parameter); 410 fpCommand->SetParameter(parameter); 474 parameter = new G4UIparameter("depth", 'd', 411 parameter = new G4UIparameter("depth", 'd', omitable = true); 475 parameter->SetDefaultValue(0); 412 parameter->SetDefaultValue(0); 476 parameter->SetGuidance 413 parameter->SetGuidance 477 ("Depth of propagation (-1 means unlimited 414 ("Depth of propagation (-1 means unlimited depth)."); 478 fpCommand->SetParameter(parameter); 415 fpCommand->SetParameter(parameter); 479 parameter = new G4UIparameter("forceWirefram 416 parameter = new G4UIparameter("forceWireframe", 'b', omitable = true); 480 parameter->SetDefaultValue(true); << 417 parameter->SetDefaultValue(false); 481 fpCommand->SetParameter(parameter); 418 fpCommand->SetParameter(parameter); 482 } 419 } 483 420 484 G4VisCommandGeometrySetForceWireframe::~G4VisC 421 G4VisCommandGeometrySetForceWireframe::~G4VisCommandGeometrySetForceWireframe() 485 { 422 { 486 delete fpCommand; 423 delete fpCommand; 487 } 424 } 488 425 489 G4String 426 G4String 490 G4VisCommandGeometrySetForceWireframe::GetCurr 427 G4VisCommandGeometrySetForceWireframe::GetCurrentValue(G4UIcommand*) 491 { 428 { 492 return ""; 429 return ""; 493 } 430 } 494 431 495 void G4VisCommandGeometrySetForceWireframe::Se 432 void G4VisCommandGeometrySetForceWireframe::SetNewValue 496 (G4UIcommand*, G4String newValue) 433 (G4UIcommand*, G4String newValue) 497 { 434 { 498 G4String name; 435 G4String name; 499 G4int requestedDepth; 436 G4int requestedDepth; 500 G4String forceWireframeString; 437 G4String forceWireframeString; 501 std::istringstream iss(newValue); 438 std::istringstream iss(newValue); 502 iss >> name >> requestedDepth >> forceWirefr 439 iss >> name >> requestedDepth >> forceWireframeString; 503 G4bool forceWireframe = G4UIcommand::Convert 440 G4bool forceWireframe = G4UIcommand::ConvertToBool(forceWireframeString); 504 441 505 G4VisCommandGeometrySetForceWireframeFunctio 442 G4VisCommandGeometrySetForceWireframeFunction 506 setForceWireframe(forceWireframe); 443 setForceWireframe(forceWireframe); 507 Set(name, setForceWireframe, requestedDepth) 444 Set(name, setForceWireframe, requestedDepth); 508 } 445 } 509 446 510 ////////////// /vis/geometry/set/lineStyle /// 447 ////////////// /vis/geometry/set/lineStyle ///////////////////////////////// 511 448 512 G4VisCommandGeometrySetLineStyle::G4VisCommand 449 G4VisCommandGeometrySetLineStyle::G4VisCommandGeometrySetLineStyle() 513 { 450 { 514 G4bool omitable; 451 G4bool omitable; 515 fpCommand = new G4UIcommand("/vis/geometry/s 452 fpCommand = new G4UIcommand("/vis/geometry/set/lineStyle", this); 516 fpCommand->SetGuidance("Sets line style of l 453 fpCommand->SetGuidance("Sets line style of logical volume(s) drawing."); 517 fpCommand->SetGuidance("\"all\" sets all log 454 fpCommand->SetGuidance("\"all\" sets all logical volumes."); 518 fpCommand->SetGuidance 455 fpCommand->SetGuidance 519 ("Optionally propagates down hierarchy to 456 ("Optionally propagates down hierarchy to given depth."); 520 G4UIparameter* parameter; 457 G4UIparameter* parameter; 521 parameter = new G4UIparameter ("logical-volu 458 parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true); 522 parameter->SetDefaultValue("all"); 459 parameter->SetDefaultValue("all"); 523 fpCommand->SetParameter(parameter); 460 fpCommand->SetParameter(parameter); 524 parameter = new G4UIparameter("depth", 'd', 461 parameter = new G4UIparameter("depth", 'd', omitable = true); 525 parameter->SetDefaultValue(0); 462 parameter->SetDefaultValue(0); 526 parameter->SetGuidance 463 parameter->SetGuidance 527 ("Depth of propagation (-1 means unlimited 464 ("Depth of propagation (-1 means unlimited depth)."); 528 fpCommand->SetParameter(parameter); 465 fpCommand->SetParameter(parameter); 529 parameter = new G4UIparameter("lineStyle", ' 466 parameter = new G4UIparameter("lineStyle", 's', omitable = true); 530 parameter->SetParameterCandidates("unbroken 467 parameter->SetParameterCandidates("unbroken dashed dotted"); 531 parameter->SetDefaultValue("unbroken"); 468 parameter->SetDefaultValue("unbroken"); 532 fpCommand->SetParameter(parameter); 469 fpCommand->SetParameter(parameter); 533 } 470 } 534 471 535 G4VisCommandGeometrySetLineStyle::~G4VisComman 472 G4VisCommandGeometrySetLineStyle::~G4VisCommandGeometrySetLineStyle() 536 { 473 { 537 delete fpCommand; 474 delete fpCommand; 538 } 475 } 539 476 540 G4String 477 G4String 541 G4VisCommandGeometrySetLineStyle::GetCurrentVa 478 G4VisCommandGeometrySetLineStyle::GetCurrentValue(G4UIcommand*) 542 { 479 { 543 return ""; 480 return ""; 544 } 481 } 545 482 546 void G4VisCommandGeometrySetLineStyle::SetNewV 483 void G4VisCommandGeometrySetLineStyle::SetNewValue 547 (G4UIcommand*, G4String newValue) 484 (G4UIcommand*, G4String newValue) 548 { 485 { 549 G4String name, lineStyleString; 486 G4String name, lineStyleString; 550 G4int requestedDepth; 487 G4int requestedDepth; 551 std::istringstream iss(newValue); 488 std::istringstream iss(newValue); 552 iss >> name >> requestedDepth >> lineStyleSt 489 iss >> name >> requestedDepth >> lineStyleString; 553 G4VisAttributes::LineStyle lineStyle = G4Vis 490 G4VisAttributes::LineStyle lineStyle = G4VisAttributes::unbroken; 554 if (lineStyleString == "unbroken") lineStyle 491 if (lineStyleString == "unbroken") lineStyle = G4VisAttributes::unbroken; 555 if (lineStyleString == "dashed") lineStyle = 492 if (lineStyleString == "dashed") lineStyle = G4VisAttributes::dashed; 556 if (lineStyleString == "dotted") lineStyle = 493 if (lineStyleString == "dotted") lineStyle = G4VisAttributes::dotted; 557 494 558 G4VisCommandGeometrySetLineStyleFunction set 495 G4VisCommandGeometrySetLineStyleFunction setLineStyle(lineStyle); 559 Set(name, setLineStyle, requestedDepth); 496 Set(name, setLineStyle, requestedDepth); 560 } 497 } 561 498 562 ////////////// /vis/geometry/set/lineWidth /// 499 ////////////// /vis/geometry/set/lineWidth ///////////////////////////////// 563 500 564 G4VisCommandGeometrySetLineWidth::G4VisCommand 501 G4VisCommandGeometrySetLineWidth::G4VisCommandGeometrySetLineWidth() 565 { 502 { 566 G4bool omitable; 503 G4bool omitable; 567 fpCommand = new G4UIcommand("/vis/geometry/s 504 fpCommand = new G4UIcommand("/vis/geometry/set/lineWidth", this); 568 fpCommand->SetGuidance("Sets line width of l 505 fpCommand->SetGuidance("Sets line width of logical volume(s) drawing."); 569 fpCommand->SetGuidance("\"all\" sets all log 506 fpCommand->SetGuidance("\"all\" sets all logical volumes."); 570 fpCommand->SetGuidance 507 fpCommand->SetGuidance 571 ("Optionally propagates down hierarchy to 508 ("Optionally propagates down hierarchy to given depth."); 572 G4UIparameter* parameter; 509 G4UIparameter* parameter; 573 parameter = new G4UIparameter ("logical-volu 510 parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true); 574 parameter->SetDefaultValue("all"); 511 parameter->SetDefaultValue("all"); 575 fpCommand->SetParameter(parameter); 512 fpCommand->SetParameter(parameter); 576 parameter = new G4UIparameter("depth", 'd', 513 parameter = new G4UIparameter("depth", 'd', omitable = true); 577 parameter->SetDefaultValue(0); 514 parameter->SetDefaultValue(0); 578 parameter->SetGuidance 515 parameter->SetGuidance 579 ("Depth of propagation (-1 means unlimited 516 ("Depth of propagation (-1 means unlimited depth)."); 580 fpCommand->SetParameter(parameter); 517 fpCommand->SetParameter(parameter); 581 parameter = new G4UIparameter("lineWidth", ' 518 parameter = new G4UIparameter("lineWidth", 'd', omitable = true); 582 parameter->SetDefaultValue(1.); 519 parameter->SetDefaultValue(1.); 583 fpCommand->SetParameter(parameter); 520 fpCommand->SetParameter(parameter); 584 } 521 } 585 522 586 G4VisCommandGeometrySetLineWidth::~G4VisComman 523 G4VisCommandGeometrySetLineWidth::~G4VisCommandGeometrySetLineWidth() 587 { 524 { 588 delete fpCommand; 525 delete fpCommand; 589 } 526 } 590 527 591 G4String 528 G4String 592 G4VisCommandGeometrySetLineWidth::GetCurrentVa 529 G4VisCommandGeometrySetLineWidth::GetCurrentValue(G4UIcommand*) 593 { 530 { 594 return ""; 531 return ""; 595 } 532 } 596 533 597 void G4VisCommandGeometrySetLineWidth::SetNewV 534 void G4VisCommandGeometrySetLineWidth::SetNewValue 598 (G4UIcommand*, G4String newValue) 535 (G4UIcommand*, G4String newValue) 599 { 536 { 600 G4String name; 537 G4String name; 601 G4int requestedDepth; 538 G4int requestedDepth; 602 G4double lineWidth; 539 G4double lineWidth; 603 std::istringstream iss(newValue); 540 std::istringstream iss(newValue); 604 iss >> name >> requestedDepth >> lineWidth; 541 iss >> name >> requestedDepth >> lineWidth; 605 542 606 G4VisCommandGeometrySetLineWidthFunction set 543 G4VisCommandGeometrySetLineWidthFunction setLineWidth(lineWidth); 607 Set(name, setLineWidth, requestedDepth); 544 Set(name, setLineWidth, requestedDepth); 608 } 545 } 609 546 610 ////////////// /vis/geometry/set/visibility // 547 ////////////// /vis/geometry/set/visibility /////////////////////////////////////// 611 548 612 G4VisCommandGeometrySetVisibility::G4VisComman 549 G4VisCommandGeometrySetVisibility::G4VisCommandGeometrySetVisibility() 613 { 550 { 614 G4bool omitable; 551 G4bool omitable; 615 fpCommand = new G4UIcommand("/vis/geometry/s 552 fpCommand = new G4UIcommand("/vis/geometry/set/visibility", this); 616 fpCommand->SetGuidance("Sets visibility of l 553 fpCommand->SetGuidance("Sets visibility of logical volume(s)."); 617 fpCommand->SetGuidance("\"all\" sets all log 554 fpCommand->SetGuidance("\"all\" sets all logical volumes."); 618 fpCommand->SetGuidance 555 fpCommand->SetGuidance 619 ("Optionally propagates down hierarchy to 556 ("Optionally propagates down hierarchy to given depth."); 620 G4UIparameter* parameter; 557 G4UIparameter* parameter; 621 parameter = new G4UIparameter ("logical-volu 558 parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true); 622 parameter->SetDefaultValue("all"); 559 parameter->SetDefaultValue("all"); 623 fpCommand->SetParameter(parameter); 560 fpCommand->SetParameter(parameter); 624 parameter = new G4UIparameter("depth", 'd', 561 parameter = new G4UIparameter("depth", 'd', omitable = true); 625 parameter->SetDefaultValue(0); 562 parameter->SetDefaultValue(0); 626 parameter->SetGuidance 563 parameter->SetGuidance 627 ("Depth of propagation (-1 means unlimited 564 ("Depth of propagation (-1 means unlimited depth)."); 628 fpCommand->SetParameter(parameter); 565 fpCommand->SetParameter(parameter); 629 parameter = new G4UIparameter("visibility", 566 parameter = new G4UIparameter("visibility", 'b', omitable = true); 630 parameter->SetDefaultValue(true); 567 parameter->SetDefaultValue(true); 631 fpCommand->SetParameter(parameter); 568 fpCommand->SetParameter(parameter); 632 } 569 } 633 570 634 G4VisCommandGeometrySetVisibility::~G4VisComma 571 G4VisCommandGeometrySetVisibility::~G4VisCommandGeometrySetVisibility() 635 { 572 { 636 delete fpCommand; 573 delete fpCommand; 637 } 574 } 638 575 639 G4String G4VisCommandGeometrySetVisibility::Ge 576 G4String G4VisCommandGeometrySetVisibility::GetCurrentValue(G4UIcommand*) 640 { 577 { 641 return ""; 578 return ""; 642 } 579 } 643 580 644 void G4VisCommandGeometrySetVisibility::SetNew 581 void G4VisCommandGeometrySetVisibility::SetNewValue 645 (G4UIcommand*, G4String newValue) 582 (G4UIcommand*, G4String newValue) 646 { 583 { 647 G4String name; 584 G4String name; 648 G4int requestedDepth; 585 G4int requestedDepth; 649 G4String visibilityString; 586 G4String visibilityString; 650 std::istringstream iss(newValue); 587 std::istringstream iss(newValue); 651 iss >> name >> requestedDepth >> visibilityS 588 iss >> name >> requestedDepth >> visibilityString; 652 G4bool visibility = G4UIcommand::ConvertToBo 589 G4bool visibility = G4UIcommand::ConvertToBool(visibilityString); 653 590 654 G4VisCommandGeometrySetVisibilityFunction se 591 G4VisCommandGeometrySetVisibilityFunction setVisibility(visibility); 655 Set(name, setVisibility, requestedDepth); 592 Set(name, setVisibility, requestedDepth); 656 593 657 G4VViewer* pViewer = fpVisManager->GetCurren 594 G4VViewer* pViewer = fpVisManager->GetCurrentViewer(); 658 if (pViewer) { 595 if (pViewer) { 659 const G4ViewParameters& viewParams = pView 596 const G4ViewParameters& viewParams = pViewer->GetViewParameters(); 660 if (fpVisManager->GetVerbosity() >= G4VisM 597 if (fpVisManager->GetVerbosity() >= G4VisManager::warnings) { 661 if (!viewParams.IsCulling() || 598 if (!viewParams.IsCulling() || 662 !viewParams.IsCullingInvisible()) { 599 !viewParams.IsCullingInvisible()) { 663 G4warn << << 600 G4cout << 664 "Culling must be on - \"/vis/viewer/set/cu << 665 "\n \"/vis/viewer/set/culling invisible t << 666 << G4endl; << 667 } << 668 } << 669 } << 670 } << 671 << 672 void G4VisCommandGeometrySetVisibility::SetNew << 673 (G4LogicalVolume* pLV, G4int requestedDepth,G4 << 674 { << 675 if (!pLV) return; << 676 G4VisCommandGeometrySetVisibilityFunction se << 677 SetLVVisAtts(pLV, setVisibility, 0, requeste << 678 << 679 G4VViewer* pViewer = fpVisManager->GetCurren << 680 if (pViewer) { << 681 G4UImanager::GetUIpointer()->ApplyCommand( << 682 const G4ViewParameters& viewParams = pView << 683 if (fpVisManager->GetVerbosity() >= G4VisM << 684 if (!viewParams.IsCulling() || << 685 !viewParams.IsCullingInvisible()) { << 686 G4warn << << 687 "Culling must be on - \"/vis/viewer/set/cu 601 "Culling must be on - \"/vis/viewer/set/culling global true\" and" 688 "\n \"/vis/viewer/set/culling invisible t 602 "\n \"/vis/viewer/set/culling invisible true\" - to see effect." 689 << G4endl; 603 << G4endl; 690 } 604 } 691 } 605 } 692 } 606 } 693 } 607 } 694 608