1320 G4cerr <<
"ERROR: No current scene. Please create one." <<
G4endl;
1327 <<
"ERROR: Scene has no extent. Add volumes or use \"/vis/scene/add/extent\"." 1338 "ERROR: G4VisCommandSceneAddLogo::SetNewValue: no viewer." 1339 "\n Auto direction needs a viewer." 1346 G4String userHeightUnit, direction, auto_manual, positionUnit;
1347 std::istringstream is (newValue);
1348 is >> userHeight >> userHeightUnit >> direction
1349 >> red >> green >> blue
1351 >> xmid >> ymid >> zmid >> positionUnit;
1355 if (userHeightUnit ==
"auto") {
1362 xmid *= unit; ymid *= unit; zmid *= unit;
1365 if (direction ==
"auto") {
1369 if (vp.
x() > vp.
y() && vp.
x() > vp.
z()) logoDirection =
X;
1370 else if (vp.
x() < vp.
y() && vp.
x() < vp.
z()) logoDirection =
minusX;
1371 else if (vp.
y() > vp.
x() && vp.
y() > vp.
z()) logoDirection =
Y;
1372 else if (vp.
y() < vp.
x() && vp.
y() < vp.
z()) logoDirection =
minusY;
1373 else if (vp.
z() > vp.
x() && vp.
z() > vp.
y()) logoDirection =
Z;
1374 else if (vp.
z() < vp.
x() && vp.
z() < vp.
y()) logoDirection =
minusZ;
1376 else if (direction(0) ==
'x') logoDirection =
X;
1377 else if (direction(0) ==
'y') logoDirection =
Y;
1378 else if (direction(0) ==
'z') logoDirection =
Z;
1379 else if (direction(0) ==
'-') {
1380 if (direction(1) ==
'x') logoDirection =
minusX;
1381 else if (direction(1) ==
'y') logoDirection =
minusY;
1382 else if (direction(1) ==
'z') logoDirection =
minusZ;
1385 G4cerr <<
"ERROR: Unrecogniseed direction: \"" 1386 << direction <<
"\"." <<
G4endl;
1391 G4bool autoPlacing =
false;
if (auto_manual ==
"auto") autoPlacing =
true;
1408 "WARNING: Existing scene does not yet have any extent." 1409 "\n Maybe you have not yet added any geometrical object." 1415 const G4double halfHeight(height / 2.);
1417 const G4double freeHeightFraction (1. + 2. * comfort);
1421 switch (logoDirection) {
1424 if (freeHeightFraction * (xmax - xmin) < height) room =
false;
1428 if (freeHeightFraction * (ymax - ymin) < height) room =
false;
1432 if (freeHeightFraction * (zmax - zmin) < height) room =
false;
1439 "WARNING: Not enough room in existing scene. Maybe logo is too large." 1446 "WARNING: The logo you have asked for is bigger than the existing" 1447 "\n scene. Maybe you have added it too soon. It is recommended that" 1448 "\n you add the logo last so that it can be correctly auto-positioned" 1449 "\n so as not to be obscured by any existing object and so that the" 1450 "\n view parameters can be correctly recalculated." 1455 G4double sxmid(xmid), symid(ymid), szmid(zmid);
1459 const G4double xComfort = comfort * (xmax - xmin);
1460 const G4double yComfort = comfort * (ymax - ymin);
1461 const G4double zComfort = comfort * (zmax - zmin);
1462 switch (logoDirection) {
1464 sxmid = xmax + halfHeight + xComfort;
1465 symid = ymin - yComfort;
1466 szmid = zmin - zComfort;
1469 sxmid = xmin - halfHeight - xComfort;
1470 symid = ymin - yComfort;
1471 szmid = zmax + zComfort;
1474 sxmid = xmin - xComfort;
1475 symid = ymax + halfHeight + yComfort;
1476 szmid = zmin - zComfort;
1479 sxmid = xmax + xComfort;
1480 symid = ymin - halfHeight - yComfort;
1481 szmid = zmin - zComfort;
1484 sxmid = xmax + xComfort;
1485 symid = ymin - yComfort;
1486 szmid = zmax + halfHeight + zComfort;
1489 sxmid = xmin - xComfort;
1490 symid = ymin - yComfort;
1491 szmid = zmin - halfHeight - zComfort;
1497 switch (logoDirection) {
1520 visAtts.SetForceSolid(
true);
1522 G4Logo* logo =
new G4Logo(height,visAtts);
1537 const G4String& currentSceneName = pScene -> GetName ();
1538 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1541 G4cout <<
"G4 Logo of height " << userHeight <<
' ' << userHeightUnit
1542 <<
", " << direction <<
"-direction, added to scene \"" 1543 << currentSceneName <<
"\"";
1545 G4cout <<
"\n with extent " << extent
void SetGlobalTag(const G4String &)
G4VViewer * GetCurrentViewer() const
static const double halfpi
G4Scene * GetCurrentScene() const
void UpdateVisManagerScene(const G4String &sceneName="")
G4double GetExtentRadius() const
void SetExtent(const G4VisExtent &)
void SetTransformation(const G4Transform3D &)
static void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
const G4Vector3D & GetViewpointDirection() const
G4GLOB_DLL std::ostream G4cout
const G4VisExtent & GetExtent() const
void SetType(const G4String &)
static G4double ValueOf(const char *unitName)
static Verbosity GetVerbosity()
const G4ViewParameters & GetViewParameters() const
void SetGlobalDescription(const G4String &)
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager