Import Geant4 10.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 12:08:39 +02:00
parent 286caacf06
commit c9b32a6c0a
5770 changed files with 1050949 additions and 367105 deletions
@@ -2021,9 +2021,9 @@ HepPolyhedron BooleanProcessor::execute(int op,
ifaces1 = faces.size(); takePolyhedron(a,0,0,0);
ifaces2 = faces.size(); takePolyhedron(b,0,0,0);
if (processor_error) { // corrapted polyhedron
if (processor_error) { // corrupted polyhedron
G4cerr
<< "BooleanProcessor: corrapted input polyhedron"
<< "BooleanProcessor: corrupted input polyhedron"
<< G4endl;
err = processor_error; //G.Barrand
return HepPolyhedron();
+209 -209
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AttCheck.cc 69802 2013-05-15 14:52:57Z gcosmo $
// $Id: G4AttCheck.cc 78955 2014-02-05 09:45:46Z gcosmo $
#include "G4AttCheck.hh"
@@ -87,14 +87,14 @@ G4AttCheck::G4AttCheck
G4UnitsTable& units = G4UnitDefinition::GetUnitsTable();
for (size_t i = 0; i < units.size(); ++i) {
if (fUnitCategories->find(units[i]->GetName()) !=
fUnitCategories->end()) {
//G4cout << units[i]->GetName() << G4endl;
G4UnitsContainer& container = units[i]->GetUnitsList();
for (size_t j = 0; j < container.size(); ++j) {
//G4cout << container[j]->GetName() << ' '
// << container[j]->GetSymbol() << G4endl;
fUnits->insert(container[j]->GetSymbol());
}
fUnitCategories->end()) {
//G4cout << units[i]->GetName() << G4endl;
G4UnitsContainer& container = units[i]->GetUnitsList();
for (size_t j = 0; j < container.size(); ++j) {
//G4cout << container[j]->GetName() << ' '
// << container[j]->GetSymbol() << G4endl;
fUnits->insert(container[j]->GetSymbol());
}
}
}
@@ -136,14 +136,14 @@ G4bool G4AttCheck::Check(const G4String& leader) const
error = true;
if (print) {
G4cerr <<
"\n*******************************************************";
"\n*******************************************************";
if (leader != "") {
G4cerr << '\n' << leader;
G4cerr << '\n' << leader;
}
G4cerr <<
"\nG4AttCheck: ERROR " << iError << ": Null definitions pointer"
"\n*******************************************************"
<< G4endl;
"\nG4AttCheck: ERROR " << iError << ": Null definitions pointer"
"\n*******************************************************"
<< G4endl;
}
return error;
}
@@ -157,89 +157,89 @@ G4bool G4AttCheck::Check(const G4String& leader) const
++iError;
error = true;
if (print) {
G4cerr <<
"\n*******************************************************";
if (leader != "") {
G4cerr << '\n' << leader;
}
G4cerr <<
"\nG4AttCheck: ERROR " << iError << ": No G4AttDef for G4AttValue \""
<< valueName << "\": " << value <<
"\n*******************************************************"
<< G4endl;
G4cerr <<
"\n*******************************************************";
if (leader != "") {
G4cerr << '\n' << leader;
}
G4cerr <<
"\nG4AttCheck: ERROR " << iError << ": No G4AttDef for G4AttValue \""
<< valueName << "\": " << value <<
"\n*******************************************************"
<< G4endl;
}
} else {
const G4String& category = iDef->second.GetCategory();
const G4String& extra = iDef->second.GetExtra();
const G4String& valueType = iDef->second.GetValueType();
if (fCategories->find(category) == fCategories->end()) {
++iError;
error = true;
if (print) {
G4cerr <<
"\n*******************************************************";
if (leader != "") {
G4cerr << '\n' << leader;
}
G4cerr <<
"\nG4AttCheck: ERROR " << iError << ": Illegal Category Field \""
<< category << "\" for G4AttValue \""
<< valueName << "\": " << value <<
"\n Possible Categories:";
set<G4String>::iterator i;
for (i = fCategories->begin(); i != fCategories->end(); ++i) {
G4cerr << ' ' << *i;
}
G4cerr <<
"\n*******************************************************"
<< G4endl;
}
++iError;
error = true;
if (print) {
G4cerr <<
"\n*******************************************************";
if (leader != "") {
G4cerr << '\n' << leader;
}
G4cerr <<
"\nG4AttCheck: ERROR " << iError << ": Illegal Category Field \""
<< category << "\" for G4AttValue \""
<< valueName << "\": " << value <<
"\n Possible Categories:";
set<G4String>::iterator i;
for (i = fCategories->begin(); i != fCategories->end(); ++i) {
G4cerr << ' ' << *i;
}
G4cerr <<
"\n*******************************************************"
<< G4endl;
}
}
if(category == "Physics" && fUnits->find(extra) == fUnits->end()) {
++iError;
error = true;
if (print) {
G4cerr <<
"\n*******************************************************";
if (leader != "") {
G4cerr << '\n' << leader;
}
G4cerr <<
"\nG4AttCheck: ERROR " << iError << ": Illegal Extra field \""
<< extra << "\" for G4AttValue \""
<< valueName << "\": " << value <<
"\n Possible Extra fields if Category==\"Physics\":\n ";
set<G4String>::iterator i;
for (i = fUnits->begin(); i != fUnits->end(); ++i) {
G4cerr << ' ' << *i;
}
G4cerr <<
"\n*******************************************************"
<< G4endl;
}
++iError;
error = true;
if (print) {
G4cerr <<
"\n*******************************************************";
if (leader != "") {
G4cerr << '\n' << leader;
}
G4cerr <<
"\nG4AttCheck: ERROR " << iError << ": Illegal Extra field \""
<< extra << "\" for G4AttValue \""
<< valueName << "\": " << value <<
"\n Possible Extra fields if Category==\"Physics\":\n ";
set<G4String>::iterator i;
for (i = fUnits->begin(); i != fUnits->end(); ++i) {
G4cerr << ' ' << *i;
}
G4cerr <<
"\n*******************************************************"
<< G4endl;
}
}
if (fValueTypes->find(valueType) == fValueTypes->end()) {
++iError;
error = true;
if (print) {
G4cerr <<
"\n*******************************************************";
if (leader != "") {
G4cerr << '\n' << leader;
}
G4cerr <<
"\nG4AttCheck: ERROR " << iError << ": Illegal Value Type field \""
<< valueType << "\" for G4AttValue \""
<< valueName << "\": " << value <<
"\n Possible Value Types:";
set<G4String>::iterator i;
for (i = fValueTypes->begin(); i != fValueTypes->end(); ++i) {
G4cerr << ' ' << *i;
}
G4cerr <<
"\n*******************************************************"
<< G4endl;
}
++iError;
error = true;
if (print) {
G4cerr <<
"\n*******************************************************";
if (leader != "") {
G4cerr << '\n' << leader;
}
G4cerr <<
"\nG4AttCheck: ERROR " << iError << ": Illegal Value Type field \""
<< valueType << "\" for G4AttValue \""
<< valueName << "\": " << value <<
"\n Possible Value Types:";
set<G4String>::iterator i;
for (i = fValueTypes->begin(); i != fValueTypes->end(); ++i) {
G4cerr << ' ' << *i;
}
G4cerr <<
"\n*******************************************************"
<< G4endl;
}
}
}
}
@@ -272,55 +272,55 @@ std::ostream& operator<< (std::ostream& os, const G4AttCheck& ac)
if (iDef == ac.fpDefinitions->end()) {
error = true;
os << "G4AttCheck: ERROR: No G4AttDef for G4AttValue \""
<< valueName << "\": " << value << endl;
<< valueName << "\": " << value << endl;
} else {
const G4String& category = iDef->second.GetCategory();
const G4String& extra = iDef->second.GetExtra();
const G4String& valueType = iDef->second.GetValueType();
if (ac.fCategories->find(category) == ac.fCategories->end()) {
error = true;
os <<
"G4AttCheck: ERROR: Illegal Category Field \"" << category
<< "\" for G4AttValue \"" << valueName << "\": " << value <<
"\n Possible Categories:";
set<G4String>::iterator i;
for (i = ac.fCategories->begin(); i != ac.fCategories->end(); ++i) {
os << ' ' << *i;
}
os << endl;
error = true;
os <<
"G4AttCheck: ERROR: Illegal Category Field \"" << category
<< "\" for G4AttValue \"" << valueName << "\": " << value <<
"\n Possible Categories:";
set<G4String>::iterator i;
for (i = ac.fCategories->begin(); i != ac.fCategories->end(); ++i) {
os << ' ' << *i;
}
os << endl;
}
if(category == "Physics" && ac.fUnits->find(extra) == ac.fUnits->end()) {
error = true;
os <<
"G4AttCheck: ERROR: Illegal Extra field \""<< extra
<< "\" for G4AttValue \"" << valueName << "\": " << value <<
"\n Possible Extra fields if Category==\"Physics\":\n ";
set<G4String>::iterator i;
for (i = ac.fUnits->begin(); i != ac.fUnits->end(); ++i) {
os << ' ' << *i;
}
os << endl;
error = true;
os <<
"G4AttCheck: ERROR: Illegal Extra field \""<< extra
<< "\" for G4AttValue \"" << valueName << "\": " << value <<
"\n Possible Extra fields if Category==\"Physics\":\n ";
set<G4String>::iterator i;
for (i = ac.fUnits->begin(); i != ac.fUnits->end(); ++i) {
os << ' ' << *i;
}
os << endl;
}
if (ac.fValueTypes->find(valueType) == ac.fValueTypes->end()) {
error = true;
os <<
"G4AttCheck: ERROR: Illegal Value Type field \"" << valueType
<< "\" for G4AttValue \"" << valueName << "\": " << value <<
"\n Possible Value Types:";
set<G4String>::iterator i;
for (i = ac.fValueTypes->begin(); i != ac.fValueTypes->end(); ++i) {
os << ' ' << *i;
}
os << endl;
error = true;
os <<
"G4AttCheck: ERROR: Illegal Value Type field \"" << valueType
<< "\" for G4AttValue \"" << valueName << "\": " << value <<
"\n Possible Value Types:";
set<G4String>::iterator i;
for (i = ac.fValueTypes->begin(); i != ac.fValueTypes->end(); ++i) {
os << ' ' << *i;
}
os << endl;
}
}
if (!error) {
os << iDef->second.GetDesc()
<< " (" << valueName
<< "): " << value;
<< " (" << valueName
<< "): " << value;
if (iDef->second.GetCategory() == "Physics" &&
!iDef->second.GetExtra().empty()) {
os << " (" << iDef->second.GetExtra() << ")";
!iDef->second.GetExtra().empty()) {
os << " (" << iDef->second.GetExtra() << ")";
}
os << endl;
}
@@ -368,94 +368,94 @@ G4bool G4AttCheck::Standard
const G4String& extra = iDef->second.GetExtra();
const G4String& valueType = iDef->second.GetValueType();
if (fCategories->find(category) == fCategories->end() ||
(category == "Physics" && fUnits->find(extra) == fUnits->end()) ||
fValueTypes->find(valueType) == fValueTypes->end()) {
error = true;
(category == "Physics" && fUnits->find(extra) == fUnits->end()) ||
fValueTypes->find(valueType) == fValueTypes->end()) {
error = true;
} else {
if (category != "Physics") { // Simply copy...
standardValues->push_back(*iValue);
(*standardDefinitions)[valueName] =
fpDefinitions->find(valueName)->second;
} else { // "Physics"...
if (extra.empty()) { // Dimensionless...
if (valueType == "G4ThreeVector") { // Split vector into 3...
G4ThreeVector internalValue =
G4UIcommand::ConvertTo3Vector(value);
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-X",
G4UIcommand::ConvertToString(internalValue.x()),"",
fpDefinitions->find(valueName)->second.GetDesc()+"-X");
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-Y",
G4UIcommand::ConvertToString(internalValue.y()),"",
fpDefinitions->find(valueName)->second.GetDesc()+"-Y");
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-Z",
G4UIcommand::ConvertToString(internalValue.z()),"",
fpDefinitions->find(valueName)->second.GetDesc()+"-Z");
} else { // Simply copy...
standardValues->push_back(*iValue);
(*standardDefinitions)[valueName] =
fpDefinitions->find(valueName)->second;
}
} else { // Dimensioned...
G4String valueAndUnit;
G4String unit;
if (extra == "G4BestUnit") {
valueAndUnit = value;
valueAndUnit = valueAndUnit.strip();
unit = valueAndUnit.substr(valueAndUnit.rfind(' ')+1);
} else {
valueAndUnit = value + ' ' + extra;
valueAndUnit = valueAndUnit.strip();
unit = extra;
}
G4String unitCategory = G4UnitDefinition::GetCategory(unit);
if (fUnitCategories->find(unitCategory) != fUnitCategories->end()) {
G4String standardUnit = (*fStandardUnits)[unitCategory];
G4double valueOfStandardUnit =
G4UnitDefinition::GetValueOf(standardUnit);
// G4String exstr = iDef->second.GetExtra();
if (valueType == "G4ThreeVector") { // Split vector into 3...
G4ThreeVector internalValue =
G4UIcommand::ConvertToDimensioned3Vector(valueAndUnit);
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-X",
G4UIcommand::ConvertToString
(internalValue.x()/valueOfStandardUnit),
standardUnit,
fpDefinitions->find(valueName)->second.GetDesc()+"-X");
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-Y",
G4UIcommand::ConvertToString
(internalValue.y()/valueOfStandardUnit),
standardUnit,
fpDefinitions->find(valueName)->second.GetDesc()+"-Y");
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-Z",
G4UIcommand::ConvertToString
(internalValue.z()/valueOfStandardUnit),
standardUnit,
fpDefinitions->find(valueName)->second.GetDesc()+"-Z");
} else {
G4double internalValue =
G4UIcommand::ConvertToDimensionedDouble(valueAndUnit);
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName,
G4UIcommand::ConvertToString
(internalValue/valueOfStandardUnit),
standardUnit);
}
}
}
}
if (category != "Physics") { // Simply copy...
standardValues->push_back(*iValue);
(*standardDefinitions)[valueName] =
fpDefinitions->find(valueName)->second;
} else { // "Physics"...
if (extra.empty()) { // Dimensionless...
if (valueType == "G4ThreeVector") { // Split vector into 3...
G4ThreeVector internalValue =
G4UIcommand::ConvertTo3Vector(value);
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-X",
G4UIcommand::ConvertToString(internalValue.x()),"",
fpDefinitions->find(valueName)->second.GetDesc()+"-X");
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-Y",
G4UIcommand::ConvertToString(internalValue.y()),"",
fpDefinitions->find(valueName)->second.GetDesc()+"-Y");
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-Z",
G4UIcommand::ConvertToString(internalValue.z()),"",
fpDefinitions->find(valueName)->second.GetDesc()+"-Z");
} else { // Simply copy...
standardValues->push_back(*iValue);
(*standardDefinitions)[valueName] =
fpDefinitions->find(valueName)->second;
}
} else { // Dimensioned...
G4String valueAndUnit;
G4String unit;
if (extra == "G4BestUnit") {
valueAndUnit = value;
valueAndUnit = valueAndUnit.strip();
unit = valueAndUnit.substr(valueAndUnit.rfind(' ')+1);
} else {
valueAndUnit = value + ' ' + extra;
valueAndUnit = valueAndUnit.strip();
unit = extra;
}
G4String unitCategory = G4UnitDefinition::GetCategory(unit);
if (fUnitCategories->find(unitCategory) != fUnitCategories->end()) {
G4String standardUnit = (*fStandardUnits)[unitCategory];
G4double valueOfStandardUnit =
G4UnitDefinition::GetValueOf(standardUnit);
// G4String exstr = iDef->second.GetExtra();
if (valueType == "G4ThreeVector") { // Split vector into 3...
G4ThreeVector internalValue =
G4UIcommand::ConvertToDimensioned3Vector(valueAndUnit);
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-X",
G4UIcommand::ConvertToString
(internalValue.x()/valueOfStandardUnit),
standardUnit,
fpDefinitions->find(valueName)->second.GetDesc()+"-X");
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-Y",
G4UIcommand::ConvertToString
(internalValue.y()/valueOfStandardUnit),
standardUnit,
fpDefinitions->find(valueName)->second.GetDesc()+"-Y");
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName+"-Z",
G4UIcommand::ConvertToString
(internalValue.z()/valueOfStandardUnit),
standardUnit,
fpDefinitions->find(valueName)->second.GetDesc()+"-Z");
} else {
G4double internalValue =
G4UIcommand::ConvertToDimensionedDouble(valueAndUnit);
AddValuesAndDefs
(standardValues,standardDefinitions,
valueName,valueName,
G4UIcommand::ConvertToString
(internalValue/valueOfStandardUnit),
standardUnit);
}
}
}
}
}
}
}
+27 -15
View File
@@ -24,35 +24,47 @@
// ********************************************************************
//
//
// $Id: G4AttDef.cc 66376 2012-12-18 09:42:59Z gcosmo $
// $Id: G4AttDef.cc 78955 2014-02-05 09:45:46Z gcosmo $
#include "G4AttDef.hh"
#include "G4AttDefStore.hh"
using namespace std;
// Deprecated - see header.
std::ostream& operator<<
(std::ostream& os, const std::map<G4String,G4AttDef>* definitions)
(std::ostream& os, const std::map<G4String,G4AttDef>* definitions)
{
using namespace std;
if (!definitions) {
os << "Deprecated output function. Use const reference equivalent." << endl;
if (definitions) {
os << *definitions;
} else {
os << "G4AttCheck: ERROR: zero definitions pointer." << endl;
return os;
}
return os;
}
std::ostream& operator<<
(std::ostream& os, const std::map<G4String,G4AttDef>& definitions)
{
G4String storeKey;
if (G4AttDefStore::GetStoreKey(definitions, storeKey)) {
if (G4AttDefStore::GetStoreKey(&definitions, storeKey)) {
os << storeKey << ":";
}
std::map<G4String,G4AttDef>::const_iterator i;
for (i = definitions->begin(); i != definitions->end(); ++i) {
if (i->second.GetCategory() == "Physics") {
os << "\n " << i->second.GetDesc()
<< " (" << i->first << "): ";
if (!i->second.GetExtra().empty()) {
if (i->second.GetExtra() != "G4BestUnit") os << "unit: ";
os << i->second.GetExtra() << " (";
for (i = definitions.begin(); i != definitions.end(); ++i) {
const G4String& name = i->first;
const G4AttDef& attDef = i->second;
if (attDef.GetCategory() == "Physics") {
os << "\n " << attDef.GetDesc()
<< " (" << name << "): ";
if (!attDef.GetExtra().empty()) {
if (attDef.GetExtra() != "G4BestUnit") os << "unit: ";
os << attDef.GetExtra() << " (";
}
os << i->second.GetValueType();
if (!i->second.GetExtra().empty()) os << ")";
os << attDef.GetValueType();
if (!attDef.GetExtra().empty()) os << ")";
}
}
os << endl;
+6 -6
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AttDefStore.cc 69802 2013-05-15 14:52:57Z gcosmo $
// $Id: G4AttDefStore.cc 78955 2014-02-05 09:45:46Z gcosmo $
#include "G4AttDefStore.hh"
@@ -36,7 +36,7 @@ G4ThreadLocal
std::map<G4String,std::map<G4String,G4AttDef>*> *m_defsmaps = 0;
std::map<G4String,G4AttDef>*
GetInstance(G4String storeKey, G4bool& isNew)
GetInstance(const G4String& storeKey, G4bool& isNew)
{
if (!m_defsmaps)
m_defsmaps = new std::map<G4String,std::map<G4String,G4AttDef>*>;
@@ -71,10 +71,10 @@ G4bool GetStoreKey
for (i = m_defsmaps->begin(); i != m_defsmaps->end(); ++i)
{
if (i->second == definitions)
{
key = i->first;
return true;
}
{
key = i->first;
return true;
}
}
return false;
+2 -2
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Colour.cc 69802 2013-05-15 14:52:57Z gcosmo $
// $Id: G4Colour.cc 78955 2014-02-05 09:45:46Z gcosmo $
//
//
// John Allison 20th October 1996
@@ -54,7 +54,7 @@ G4Colour::operator G4ThreeVector() {
std::ostream& operator << (std::ostream& os, const G4Colour& c) {
os << '(' << c.red << ',' << c.green << ',' << c.blue
<< ',' << c.alpha << ')';
<< ',' << c.alpha << ')';
const std::map<G4String, G4Colour>& colourMap = G4Colour::GetMap();
// Reverse iterator to pick up English spelling of grey!! :)
std::map<G4String, G4Colour>::const_reverse_iterator ri;
+27 -27
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Polyhedron.cc 66376 2012-12-18 09:42:59Z gcosmo $
// $Id: G4Polyhedron.cc 78955 2014-02-05 09:45:46Z gcosmo $
#include "G4Polyhedron.hh"
@@ -47,74 +47,74 @@ G4PolyhedronBox::G4PolyhedronBox (G4double dx, G4double dy, G4double dz):
G4PolyhedronBox::~G4PolyhedronBox () {}
G4PolyhedronCone::G4PolyhedronCone (G4double Rmn1, G4double Rmx1,
G4double Rmn2, G4double Rmx2, G4double Dz):
G4double Rmn2, G4double Rmx2, G4double Dz):
G4Polyhedron (HepPolyhedronCone (Rmn1, Rmx1, Rmn2, Rmx2, Dz)) {}
G4PolyhedronCone::~G4PolyhedronCone () {}
G4PolyhedronCons::G4PolyhedronCons (G4double Rmn1, G4double Rmx1,
G4double Rmn2, G4double Rmx2, G4double Dz,
G4double Phi1, G4double Dphi):
G4double Rmn2, G4double Rmx2, G4double Dz,
G4double Phi1, G4double Dphi):
G4Polyhedron (HepPolyhedronCons (Rmn1, Rmx1, Rmn2, Rmx2, Dz, Phi1, Dphi)) {}
G4PolyhedronCons::~G4PolyhedronCons () {}
G4PolyhedronPara::G4PolyhedronPara (G4double Dx, G4double Dy, G4double Dz,
G4double Alpha, G4double Theta,
G4double Phi):
G4double Alpha, G4double Theta,
G4double Phi):
G4Polyhedron (HepPolyhedronPara (Dx, Dy, Dz, Alpha, Theta, Phi)) {}
G4PolyhedronPara::~G4PolyhedronPara () {}
G4PolyhedronPcon::G4PolyhedronPcon (G4double phi, G4double dphi, G4int nz,
const G4double *z,
const G4double *rmin,
const G4double *rmax):
const G4double *z,
const G4double *rmin,
const G4double *rmax):
G4Polyhedron (HepPolyhedronPcon (phi, dphi, nz, z, rmin, rmax)) {}
G4PolyhedronPcon::~G4PolyhedronPcon () {}
G4PolyhedronPgon::G4PolyhedronPgon (G4double phi, G4double dphi, G4int npdv,
G4int nz,
const G4double *z,
const G4double *rmin,
const G4double *rmax):
G4int nz,
const G4double *z,
const G4double *rmin,
const G4double *rmax):
G4Polyhedron (HepPolyhedronPgon (phi, dphi, npdv, nz, z, rmin, rmax)) {}
G4PolyhedronPgon::~G4PolyhedronPgon () {}
G4PolyhedronSphere::G4PolyhedronSphere (G4double rmin, G4double rmax,
G4double phi, G4double dphi,
G4double the, G4double dthe):
G4double phi, G4double dphi,
G4double the, G4double dthe):
G4Polyhedron (HepPolyhedronSphere (rmin, rmax, phi, dphi, the, dthe)) {}
G4PolyhedronSphere::~G4PolyhedronSphere () {}
G4PolyhedronTorus::G4PolyhedronTorus (G4double rmin, G4double rmax,
G4double rtor,
G4double phi, G4double dphi):
G4double rtor,
G4double phi, G4double dphi):
G4Polyhedron (HepPolyhedronTorus (rmin, rmax, rtor, phi, dphi)) {}
G4PolyhedronTorus::~G4PolyhedronTorus () {}
G4PolyhedronTrap::G4PolyhedronTrap (G4double Dz, G4double Theta, G4double Phi,
G4double Dy1,
G4double Dx1, G4double Dx2, G4double Alp1,
G4double Dy2,
G4double Dx3, G4double Dx4, G4double Alp2):
G4double Dy1,
G4double Dx1, G4double Dx2, G4double Alp1,
G4double Dy2,
G4double Dx3, G4double Dx4, G4double Alp2):
G4Polyhedron (HepPolyhedronTrap (Dz, Theta, Phi, Dy1, Dx1, Dx2, Alp1,
Dy2, Dx3, Dx4, Alp2)) {}
Dy2, Dx3, Dx4, Alp2)) {}
G4PolyhedronTrap::~G4PolyhedronTrap () {}
G4PolyhedronTrd1::G4PolyhedronTrd1 (G4double Dx1, G4double Dx2,
G4double Dy, G4double Dz):
G4double Dy, G4double Dz):
G4Polyhedron (HepPolyhedronTrd1 (Dx1, Dx2, Dy, Dz)) {}
G4PolyhedronTrd1::~G4PolyhedronTrd1 () {}
G4PolyhedronTrd2::G4PolyhedronTrd2 (G4double Dx1, G4double Dx2,
G4double Dy1, G4double Dy2, G4double Dz):
G4double Dy1, G4double Dy2, G4double Dz):
G4Polyhedron (HepPolyhedronTrd2 (Dx1, Dx2, Dy1, Dy2, Dz)) {}
G4PolyhedronTrd2::~G4PolyhedronTrd2 () {}
@@ -125,7 +125,7 @@ G4PolyhedronTube::G4PolyhedronTube (G4double Rmin, G4double Rmax, G4double Dz):
G4PolyhedronTube::~G4PolyhedronTube () {}
G4PolyhedronTubs::G4PolyhedronTubs (G4double Rmin, G4double Rmax, G4double Dz,
G4double Phi1, G4double Dphi):
G4double Phi1, G4double Dphi):
G4Polyhedron (HepPolyhedronTubs (Rmin, Rmax, Dz, Phi1, Dphi)) {}
G4PolyhedronTubs::~G4PolyhedronTubs () {}
@@ -145,7 +145,7 @@ G4PolyhedronHype::~G4PolyhedronHype () {}
G4PolyhedronEllipsoid::G4PolyhedronEllipsoid (G4double ax, G4double by,
G4double cz,
G4double zCut1, G4double zCut2):
G4double zCut1, G4double zCut2):
G4Polyhedron (HepPolyhedronEllipsoid (ax, by, cz, zCut1, zCut2)) {}
G4PolyhedronEllipsoid::~G4PolyhedronEllipsoid () {}
@@ -153,7 +153,7 @@ G4PolyhedronEllipsoid::~G4PolyhedronEllipsoid () {}
G4PolyhedronEllipticalCone::G4PolyhedronEllipticalCone (G4double ax,
G4double ay,
G4double h,
G4double zCut1):
G4double zCut1):
G4Polyhedron (HepPolyhedronEllipticalCone (ax, ay, h, zCut1)) {}
G4PolyhedronEllipticalCone::~G4PolyhedronEllipticalCone () {}
@@ -27,13 +27,13 @@
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4PolyhedronArbitrary.cc
// MODULE: G4PolyhedronArbitrary.cc
//
// Date: 15/06/2005
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: UK Ministry of Defence : RAO CRP TD Electronic Systems
// Contract: C/MAT/N03517
// Date: 15/06/2005
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: UK Ministry of Defence : RAO CRP TD Electronic Systems
// Contract: C/MAT/N03517
//
// This software is the intellectual property of QinetiQ Ltd, subject
// DEFCON 705 IPR conditions.
@@ -72,7 +72,7 @@ G4PolyhedronArbitrary::~G4PolyhedronArbitrary ()
{;}
///////////////////////////////////////////////////////////////////////////////
//
void G4PolyhedronArbitrary::AddVertex (const G4ThreeVector v)
void G4PolyhedronArbitrary::AddVertex (const G4ThreeVector& v)
{
if (nVertexCount == nvert + 1)
{
+6 -4
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Scale.cc 66376 2012-12-18 09:42:59Z gcosmo $
// $Id: G4Scale.cc 83392 2014-08-21 14:36:35Z gcosmo $
//
//
// John Allison 21st July 2001
@@ -32,11 +32,13 @@
#include "G4Scale.hh"
G4Scale::G4Scale (G4double length, const G4String& annotation,
G4Scale::Direction direction,
G4bool autoPlacing,
G4double xmid, G4double ymid, G4double zmid):
G4Scale::Direction direction,
G4bool autoPlacing,
G4double xmid, G4double ymid, G4double zmid,
G4double annotationSize):
fLength(length),
fAnnotation(annotation),
fAnnotationSize(annotationSize),
fDirection(direction),
fAutoPlacing(autoPlacing),
fXmid(xmid), fYmid(ymid), fZmid(zmid) {}
+6 -5
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VisAttributes.cc 66376 2012-12-18 09:42:59Z gcosmo $
// $Id: G4VisAttributes.cc 85261 2014-10-27 08:54:57Z gcosmo $
//
//
// John Allison 23rd October 1996
@@ -104,7 +104,7 @@ fAttDefs (0)
{}
G4VisAttributes::G4VisAttributes (G4bool visibility,
const G4Colour& colour):
const G4Colour& colour):
fVisible (visibility),
fDaughtersInvisible (false),
fColour (colour),
@@ -156,7 +156,7 @@ const std::vector<G4AttValue>* G4VisAttributes::CreateAttValues () const {
}
void G4VisAttributes::SetForceLineSegmentsPerCircle (G4int nSegments) {
const G4int nSegmentsMin = 12;
const G4int nSegmentsMin = fMinLineSegmentsPerCircle;
if (nSegments > 0 && nSegments < nSegmentsMin) {
nSegments = nSegmentsMin;
G4cout <<
@@ -185,14 +185,15 @@ std::ostream& operator << (std::ostream& os, const G4VisAttributes& a) {
default: os << "unrecognised"; break;
}
os << ", line width: " << a.fLineWidth;
os << ", min line segments per circle: " << a.GetMinLineSegmentsPerCircle();
os << "\n drawing style: ";
if (a.fForceDrawingStyle) {
os << "forced to: ";
switch (a.fForcedStyle) {
case G4VisAttributes::wireframe:
os << "wireframe"; break;
os << "wireframe"; break;
case G4VisAttributes::solid:
os << "solid"; break;
os << "solid"; break;
default: os << "unrecognised"; break;
}
}
+12 -12
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VisExtent.cc 66376 2012-12-18 09:42:59Z gcosmo $
// $Id: G4VisExtent.cc 78955 2014-02-05 09:45:46Z gcosmo $
//
//
// A.Walkden 28/11/95
@@ -38,8 +38,8 @@
const G4VisExtent G4VisExtent::NullExtent; // Default extent is null.
G4VisExtent::G4VisExtent (G4double xmin, G4double xmax,
G4double ymin, G4double ymax,
G4double zmin, G4double zmax):
G4double ymin, G4double ymax,
G4double zmin, G4double zmax):
fXmin(xmin), fXmax(xmax), fYmin(ymin), fYmax(ymax), fZmin(zmin), fZmax(zmax),
fRadiusCached(false), fCentreCached(false), fRadius(0.)
{}
@@ -63,8 +63,8 @@ G4VisExtent::~G4VisExtent () {}
const G4Point3D& G4VisExtent::GetExtentCentre () const {
if (!fCentreCached) {
fCentre = G4Point3D (((fXmin + fXmax) / 2.),
((fYmin + fYmax) / 2.),
((fZmin + fZmax) / 2.));
((fYmin + fYmax) / 2.),
((fZmin + fZmax) / 2.));
fCentreCached = true;
}
return fCentre;
@@ -73,8 +73,8 @@ const G4Point3D& G4VisExtent::GetExtentCentre () const {
G4double G4VisExtent::GetExtentRadius () const {
if (!fRadiusCached) {
fRadius = std::sqrt (((fXmax - fXmin) * (fXmax - fXmin)) +
((fYmax - fYmin) * (fYmax - fYmin)) +
((fZmax - fZmin) * (fZmax - fZmin))) / 2.;
((fYmax - fYmin) * (fYmax - fYmin)) +
((fZmax - fZmin) * (fZmax - fZmin))) / 2.;
fRadiusCached = true;
}
return fRadius;
@@ -90,9 +90,9 @@ std::ostream& operator << (std::ostream& os, const G4VisExtent& e) {
G4bool G4VisExtent::operator != (const G4VisExtent& e) const {
return ((fXmin != e.fXmin) ||
(fXmax != e.fXmax) ||
(fYmin != e.fYmin) ||
(fYmax != e.fYmax) ||
(fZmin != e.fZmin) ||
(fZmax != e.fZmax));
(fXmax != e.fXmax) ||
(fYmin != e.fYmin) ||
(fYmax != e.fYmax) ||
(fZmin != e.fZmin) ||
(fZmax != e.fZmax));
}
+14 -2
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: HepPolyhedron.cc 69802 2013-05-15 14:52:57Z gcosmo $
// $Id: HepPolyhedron.cc 83392 2014-08-21 14:36:35Z gcosmo $
//
//
//
@@ -721,6 +721,12 @@ void HepPolyhedron::SetReferences()
cur = headList[k1];
if (cur == 0) {
headList[k1] = freeList;
if (!freeList) {
std::cerr
<< "Polyhedron::SetReferences: bad link "
<< std::endl;
break;
}
freeList = freeList->next;
cur = headList[k1];
cur->next = 0;
@@ -756,6 +762,12 @@ void HepPolyhedron::SetReferences()
cur = prev->next;
if (cur == 0) {
prev->next = freeList;
if (!freeList) {
std::cerr
<< "Polyhedron::SetReferences: bad link "
<< std::endl;
break;
}
freeList = freeList->next;
cur = prev->next;
cur->next = 0;
@@ -2122,7 +2134,7 @@ HepPolyhedronEllipsoid::HepPolyhedronEllipsoid(G4double ax, G4double by,
if (!zz || !rr)
{
G4Exception("HepPolyhedronEllipsoid::HepPolyhedronEllipsoid",
"greps1002", FatalException, "Out of memory");
"greps1002", FatalException, "Out of memory");
}
G4double a = dthe/(np1-cutflag-1);