42 fRefreshAtEndOfEvent(true),
43 fRefreshAtEndOfRun(true),
44 fMaxNumberOfKeptEvents(100)
50 std::vector<Model>::const_iterator i;
51 for (i = fRunDurationModelList.begin ();
52 i != fRunDurationModelList.end (); ++i) {
53 if (pModel -> GetGlobalDescription () ==
56 if (i != fRunDurationModelList.end ()) {
58 G4cout <<
"G4Scene::AddRunDurationModel: model \""
59 << pModel -> GetGlobalDescription ()
60 <<
"\"\n is already in the run-duration list of scene \""
67 fRunDurationModelList.push_back (
Model(pModel));
76 for (
size_t i = 0; i < fRunDurationModelList.size(); i++) {
77 if (fRunDurationModelList[i].fActive) {
79 if (model -> Validate()) {
82 if (thisRadius > 0.) {
84 thisCentre.transform (model -> GetTransformation ());
90 <<
"\".\n Not included in extent calculation.";
92 (
"G4Scene::CalculateExtent",
98 for (
size_t i = 0; i < fEndOfEventModelList.size(); i++) {
99 if (fEndOfEventModelList[i].fActive) {
101 if (model -> Validate()) {
104 if (thisRadius > 0.) {
106 thisCentre.transform (model -> GetTransformation ());
112 <<
"\".\n Not included in extent calculation.";
114 (
"G4Scene::CalculateExtent",
120 for (
size_t i = 0; i < fEndOfRunModelList.size(); i++) {
121 if (fEndOfRunModelList[i].fActive) {
123 if (model -> Validate()) {
126 if (thisRadius > 0.) {
128 thisCentre.transform (model -> GetTransformation ());
134 <<
"\".\n Not included in extent calculation.";
136 (
"G4Scene::CalculateExtent",
146 (
"G4Scene::CalculateExtent",
148 "Scene has no extent. Please activate or add something."
149 "\nThe camera needs to have something to point at!"
150 "\nAdd a volume. (You may need \"/run/initialize\".)"
151 "\nOr use \"/vis/scene/add/extent\"."
152 "\n\"/vis/scene/list\" to see list of models.");
162 -> GetNavigatorForTracking () -> GetWorldVolume ();
165 pWorld -> GetLogicalVolume () -> GetVisAttributes ();
166 if (!pVisAttribs || pVisAttribs -> IsVisible ()) {
169 "Your \"world\" has no vis attributes or is marked as visible."
170 "\n For a better view of the contents, mark the world as"
172 "\n myWorldLogicalVol ->"
173 " SetVisAttributes (G4VisAttributes::GetInvisible());"
182 "G4Scene::AddWorldIfEmpty: The scene was empty of run-duration models."
183 "\n \"world\" has been added.";
193 G4int i, nModels = fEndOfEventModelList.size ();
194 for (i = 0; i < nModels; i++) {
195 if (pModel -> GetGlobalDescription () ==
196 fEndOfEventModelList[i].fpModel -> GetGlobalDescription ())
break;
200 G4cout <<
"G4Scene::AddEndOfEventModel: a model \""
201 << pModel -> GetGlobalDescription ()
202 <<
"\"\n is already in the end-of-event list of scene \""
208 fEndOfEventModelList.push_back (
Model(pModel));
213 G4int i, nModels = fEndOfRunModelList.size ();
214 for (i = 0; i < nModels; i++) {
215 if (pModel -> GetGlobalDescription () ==
216 fEndOfRunModelList[i].fpModel -> GetGlobalDescription ())
break;
220 G4cout <<
"G4Scene::AddEndOfRunModel: a model \""
221 << pModel -> GetGlobalDescription ()
222 <<
"\"\n is already in the end-of-run list of scene \""
228 fEndOfRunModelList.push_back (pModel);
238 os <<
"\n Run-duration model list:";
239 for (i = 0; i < scene.fRunDurationModelList.size (); i++) {
240 if (scene.fRunDurationModelList[i].fActive) os <<
"\n Active: ";
241 else os <<
"\n Inactive: ";
242 os << *(scene.fRunDurationModelList[i].fpModel);
245 os <<
"\n End-of-event model list:";
246 for (i = 0; i < scene.fEndOfEventModelList.size (); i++) {
247 if (scene.fEndOfEventModelList[i].fActive) os <<
"\n Active: ";
248 else os <<
"\n Inactive: ";
249 os << *(scene.fEndOfEventModelList[i].fpModel);
252 os <<
"\n End-of-run model list:";
253 for (i = 0; i < scene.fEndOfRunModelList.size (); i++) {
254 if (scene.fEndOfRunModelList[i].fActive) os <<
"\n Active: ";
255 else os <<
"\n Inactive: ";
256 os << *(scene.fEndOfRunModelList[i].fpModel);
259 os <<
"\n Extent or bounding box: " << scene.fExtent;
261 os <<
"\n Standard target point: " << scene.fStandardTargetPoint;
263 os <<
"\n End of event action set to \"";
264 if (scene.fRefreshAtEndOfEvent) os <<
"refresh\"";
266 os <<
"accumulate (maximum number of kept events: ";
267 if (scene.fMaxNumberOfKeptEvents >= 0) os << scene.fMaxNumberOfKeptEvents;
268 else os <<
"unlimited";
272 os <<
"\n End of run action set to \"";
273 if (scene.fRefreshAtEndOfRun) os <<
"refresh";
274 else os <<
"accumulate";
282 (fRunDurationModelList.size () !=
283 scene.fRunDurationModelList.size ()) ||
284 (fEndOfEventModelList.size () !=
285 scene.fEndOfEventModelList.size ()) ||
286 (fEndOfRunModelList.size () !=
287 scene.fEndOfRunModelList.size ()) ||
288 (fExtent != scene.fExtent) ||
289 !(fStandardTargetPoint == scene.fStandardTargetPoint) ||
290 fRefreshAtEndOfEvent != scene.fRefreshAtEndOfEvent ||
291 fRefreshAtEndOfRun != scene.fRefreshAtEndOfRun ||
292 fMaxNumberOfKeptEvents != scene.fMaxNumberOfKeptEvents
G4Scene(const G4String &name="scene-with-unspecified-name")
std::ostringstream G4ExceptionDescription
G4bool operator!=(const G4Scene &) const
const G4Point3D & GetExtentCentre() const
G4double GetExtentRadius() const
G4GLOB_DLL std::ostream G4cout
const G4VisExtent & GetExtent() const
const G4String & GetGlobalDescription() const
G4bool AddRunDurationModel(G4VModel *, G4bool warn=false)
G4VisExtent GetBoundingSphereExtent()
G4bool AddEndOfRunModel(G4VModel *, G4bool warn=false)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4TransportationManager * GetTransportationManager()
G4bool AddWorldIfEmpty(G4bool warn=false)
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
void AccrueBoundingSphere(const G4Point3D ¢re, G4double radius)
G4bool AddEndOfEventModel(G4VModel *, G4bool warn=false)
const XML_Char XML_Content * model