Import Geant4 11.1.0.beta source tree
This commit is contained in:
@@ -101,7 +101,8 @@ G4ViewParameters::G4ViewParameters ():
|
||||
fDisplayLightFrontRed(0.),
|
||||
fDisplayLightFrontGreen(1.),
|
||||
fDisplayLightFrontBlue(0.),
|
||||
fSpecialMeshRendering(false)
|
||||
fSpecialMeshRendering(false),
|
||||
fSpecialMeshRenderingOption(meshAsDots)
|
||||
{
|
||||
// Pick up default no of sides from G4Polyhedron.
|
||||
// Note that this parameter is variously called:
|
||||
@@ -459,6 +460,9 @@ G4String G4ViewParameters::DrawingStyleCommands() const
|
||||
oss << "false";
|
||||
}
|
||||
|
||||
oss << "\n/vis/viewer/set/specialMeshRenderingOption "
|
||||
<< fSpecialMeshRenderingOption;
|
||||
|
||||
oss << "\n/vis/viewer/set/specialMeshVolumes";
|
||||
for (const auto& volume : fSpecialMeshVolumes) {
|
||||
oss << ' ' << volume.GetName() << ' ' << volume.GetCopyNo();
|
||||
@@ -868,20 +872,32 @@ void G4ViewParameters::PrintDifferences (const G4ViewParameters& v) const {
|
||||
}
|
||||
|
||||
std::ostream& operator <<
|
||||
(std::ostream& os, const G4ViewParameters::DrawingStyle& style)
|
||||
(std::ostream& os, G4ViewParameters::DrawingStyle style)
|
||||
{
|
||||
switch (style) {
|
||||
case G4ViewParameters::wireframe:
|
||||
os << "wireframe"; break;
|
||||
case G4ViewParameters::hlr:
|
||||
os << "hlr - hidden lines removed"; break;
|
||||
case G4ViewParameters::hsr:
|
||||
os << "hsr - hidden surfaces removed"; break;
|
||||
case G4ViewParameters::hlhsr:
|
||||
os << "hlhsr - hidden line, hidden surface removed"; break;
|
||||
case G4ViewParameters::cloud:
|
||||
os << "cloud - draw volume as a cloud of dots"; break;
|
||||
default: os << "unrecognised"; break;
|
||||
case G4ViewParameters::wireframe:
|
||||
os << "wireframe"; break;
|
||||
case G4ViewParameters::hlr:
|
||||
os << "hlr - hidden lines removed"; break;
|
||||
case G4ViewParameters::hsr:
|
||||
os << "hsr - hidden surfaces removed"; break;
|
||||
case G4ViewParameters::hlhsr:
|
||||
os << "hlhsr - hidden line, hidden surface removed"; break;
|
||||
case G4ViewParameters::cloud:
|
||||
os << "cloud - draw volume as a cloud of dots"; break;
|
||||
default: os << "unrecognised"; break;
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream& operator <<
|
||||
(std::ostream& os, G4ViewParameters::SMROption option)
|
||||
{
|
||||
switch (option) {
|
||||
case G4ViewParameters::meshAsDots:
|
||||
os << "dots"; break;
|
||||
case G4ViewParameters::meshAsSurfaces:
|
||||
os << "surfaces"; break;
|
||||
}
|
||||
return os;
|
||||
}
|
||||
@@ -1063,19 +1079,19 @@ std::ostream& operator << (std::ostream& os, const G4ViewParameters& v) {
|
||||
<< ' ' << v.fDisplayLightFrontGreen << ' ' << v.fDisplayLightFrontBlue;
|
||||
}
|
||||
|
||||
os << "\n Special Mesh Rendering: ";
|
||||
os << "\n Special Mesh Rendering";
|
||||
if (v.fSpecialMeshRendering) {
|
||||
os << "on: ";
|
||||
os << " requested with option \"" << v.fSpecialMeshRenderingOption;
|
||||
os << "\" for ";
|
||||
if (v.fSpecialMeshVolumes.empty()) {
|
||||
os << "all meshes";
|
||||
os << "any mesh";
|
||||
} else {
|
||||
os << "selected meshes";
|
||||
for (const auto& vol: v.fSpecialMeshVolumes) {
|
||||
os << "\n " << vol.GetName() << ':' << vol.GetCopyNo();
|
||||
}
|
||||
}
|
||||
} else os << "off";
|
||||
|
||||
} else os << ": off";
|
||||
return os;
|
||||
}
|
||||
|
||||
@@ -1121,7 +1137,8 @@ G4bool G4ViewParameters::operator != (const G4ViewParameters& v) const {
|
||||
(fBackgroundColour != v.fBackgroundColour) ||
|
||||
(fPicking != v.fPicking) ||
|
||||
(fRotationStyle != v.fRotationStyle) ||
|
||||
(fSpecialMeshRendering != v.fSpecialMeshRendering)
|
||||
(fSpecialMeshRendering != v.fSpecialMeshRendering) ||
|
||||
(fSpecialMeshRenderingOption != v.fSpecialMeshRenderingOption)
|
||||
)
|
||||
return true;
|
||||
|
||||
@@ -1189,29 +1206,36 @@ G4bool G4ViewParameters::operator != (const G4ViewParameters& v) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void G4ViewParameters::SetXGeometryString (const G4String& geomStringArg)
|
||||
void G4ViewParameters::SetXGeometryString (const G4String& geomString)
|
||||
{
|
||||
G4int x = 0, y = 0;
|
||||
unsigned int w = 0, h = 0;
|
||||
G4String geomString = geomStringArg;
|
||||
// Parse windowSizeHintString for backwards compatibility...
|
||||
const G4String delimiters("xX+-");
|
||||
G4String::size_type i = geomString.find_first_of(delimiters);
|
||||
if (i == G4String::npos) { // Does not contain "xX+-". Assume single number
|
||||
if (i == G4String::npos) {
|
||||
// Does not contain "xX+-".
|
||||
// Is it a single number?
|
||||
std::istringstream iss(geomString);
|
||||
G4int size;
|
||||
iss >> size;
|
||||
if (!iss) {
|
||||
size = 600;
|
||||
G4cout << "Unrecognised windowSizeHint string: \""
|
||||
<< geomString
|
||||
<< "\". Asuuming " << size << G4endl;
|
||||
if (iss) {
|
||||
// It is a number
|
||||
fWindowSizeHintX = size;
|
||||
fWindowSizeHintY = size;
|
||||
}
|
||||
// Accept other or all defaults (in G4ViewParameters constructor)
|
||||
// Reconstruct a geometry string coherent with the above
|
||||
char signX, signY;
|
||||
if (fWindowLocationHintXNegative) signX = '-'; else signX ='+';
|
||||
if (fWindowLocationHintYNegative) signY = '-'; else signY ='+';
|
||||
std::ostringstream oss;
|
||||
oss << size << 'x' << size;
|
||||
geomString = oss.str();
|
||||
oss << fWindowSizeHintX << 'x' << fWindowSizeHintY
|
||||
<< signX << fWindowLocationHintX << signY << fWindowLocationHintY;
|
||||
fXGeometryString = oss.str();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Assume it's a parseable X geometry string
|
||||
G4int x = 0, y = 0;
|
||||
unsigned int w = 0, h = 0;
|
||||
fGeometryMask = ParseGeometry( geomString, &x, &y, &w, &h );
|
||||
|
||||
// Handle special case :
|
||||
|
||||
Reference in New Issue
Block a user