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