1135 G4cerr <<
"ERROR: No current scene. Please create one." <<
G4endl;
1141 G4int requestedDepthOfDescent;
1142 G4String booleansString, voxelsString, readoutString, axesString;
1143 std::istringstream is (newValue);
1144 is >> name >> requestedDepthOfDescent
1145 >> booleansString >> voxelsString >> readoutString >> axesString;
1152 int nLV = pLVStore -> size ();
1155 for (iLV = 0; iLV < nLV; iLV++ ) {
1156 pLV = (*pLVStore) [iLV];
1157 if (pLV -> GetName () == name)
break;
1161 G4cerr <<
"ERROR: Logical volume " << name
1162 <<
" not found in logical volume store." <<
G4endl;
1167 const std::vector<G4Scene::Model>& rdModelList =
1168 pScene -> GetRunDurationModelList();
1169 std::vector<G4Scene::Model>::const_iterator i;
1170 for (i = rdModelList.begin(); i != rdModelList.end(); ++i) {
1171 if (i->fpModel->GetGlobalDescription().find(
"Volume") != std::string::npos)
break;
1173 if (i != rdModelList.end()) {
1175 G4cout <<
"There is already a volume, \"" 1176 << i->fpModel->GetGlobalDescription()
1177 <<
"\",\n in the run-duration model list of scene \"" 1178 << pScene -> GetName()
1179 <<
"\".\n Your logical volume must be the only volume in the scene." 1180 <<
"\n Create a new scene and try again:" 1181 <<
"\n /vis/specify " << name
1183 <<
"\n /vis/scene/create" 1184 <<
"\n /vis/scene/add/logicalVolume " << name
1185 <<
"\n /vis/sceneHandler/attach" 1186 <<
"\n (and also, if necessary, /vis/viewer/flush)" 1193 (pLV, requestedDepthOfDescent, booleans, voxels, readout);
1194 const G4String& currentSceneName = pScene -> GetName ();
1195 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1199 G4bool axesSuccessful =
false;
1202 const G4double axisLengthMax = radius / 2.;
1203 const G4double intLog10Length = std::floor(std::log10(axisLengthMax));
1204 G4double axisLength = std::pow(10,intLog10Length);
1205 if (5.*axisLength < axisLengthMax) axisLength *= 5.;
1206 else if (2.*axisLength < axisLengthMax) axisLength *= 2.;
1207 const G4double axisWidth = axisLength / 20.;
1209 axesSuccessful = pScene -> AddRunDurationModel (axesModel, warn);
1220 G4cout <<
"Logical volume \"" << pLV -> GetName ()
1221 <<
" with requested depth of descent " 1222 << requestedDepthOfDescent
1224 if (!booleans)
G4cout <<
"out";
1225 G4cout <<
" boolean components, with";
1226 if (!voxels)
G4cout <<
"out";
1227 G4cout <<
" voxels and with";
1228 if (!readout)
G4cout <<
"out";
1229 G4cout <<
" readout geometry," 1230 <<
"\n has been added to scene \"" << currentSceneName <<
"\".";
1232 if (axesSuccessful) {
1234 "\n Axes have also been added at the origin of local cooordinates.";
1237 "\n Axes have not been added for some reason possibly stated above.";
const G4VisExtent & GetExtent() const
G4Scene * GetCurrentScene() const
void UpdateVisManagerScene(const G4String &sceneName="")
G4double GetExtentRadius() const
static void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
G4GLOB_DLL std::ostream G4cout
static G4bool ConvertToBool(const char *st)
static G4LogicalVolumeStore * GetInstance()
static Verbosity GetVerbosity()
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager