Import Geant4 7.0.0 source tree
This commit is contained in:
@@ -791,9 +791,9 @@ void BooleanProcessor::caseIE(ExtEdge &, ExtEdge &)
|
||||
***********************************************************************/
|
||||
{
|
||||
processor_error = 1;
|
||||
HepStd::cout
|
||||
std::cout
|
||||
<< "BooleanProcessor::caseIE : unimplemented case"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
void BooleanProcessor::caseEE(ExtEdge &, ExtEdge &)
|
||||
@@ -807,9 +807,9 @@ void BooleanProcessor::caseEE(ExtEdge &, ExtEdge &)
|
||||
***********************************************************************/
|
||||
{
|
||||
processor_error = 1;
|
||||
HepStd::cout
|
||||
std::cout
|
||||
<< "BooleanProcessor::caseEE : unimplemented case"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
void BooleanProcessor::testFaceVsFace(int iface1, int iface2)
|
||||
@@ -959,10 +959,10 @@ void BooleanProcessor::assembleFace(int what, int iface)
|
||||
if (edges[icur].i2 == ifirst) { break; } else { continue; }
|
||||
}else{
|
||||
processor_error = 1;
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor::assembleFace(" << iface << ") : "
|
||||
<< "could not find next edge of the contour"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
faces[iface].inew = DEFECTIVE_FACE;
|
||||
return;
|
||||
}
|
||||
@@ -1199,7 +1199,7 @@ BooleanProcessor::findABC(double x1, double y1, double x2, double y2,
|
||||
double w;
|
||||
a = y1 - y2;
|
||||
b = x2 - x1;
|
||||
w = abs(a)+abs(b);
|
||||
w = std::abs(a)+std::abs(b);
|
||||
a /= w;
|
||||
b /= w;
|
||||
c = -(a*x2 + b*y2);
|
||||
@@ -1455,7 +1455,7 @@ void BooleanProcessor::triangulateContour(int ix, int iy, int ihead)
|
||||
***********************************************************************/
|
||||
{
|
||||
|
||||
//HepStd::cout << "Next Countour" << HepStd::endl;
|
||||
//std::cout << "Next Countour" << std::endl;
|
||||
//int draw_flag = 0;
|
||||
//if (draw_flag) draw_contour(5, 3, ihead);
|
||||
|
||||
@@ -1496,10 +1496,10 @@ void BooleanProcessor::triangulateContour(int ix, int iy, int ihead)
|
||||
}
|
||||
}else if (istart == iedge1) {
|
||||
processor_error = 1;
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor::triangulateContour : "
|
||||
<< "could not generate a triangle (infinite loop)"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1558,10 +1558,10 @@ void BooleanProcessor::modifyReference(int iface, int i1, int i2, int iref)
|
||||
iedge = edges[iedge].inext;
|
||||
}
|
||||
processor_error = 1;
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor::modifyReference : could not find the edge, "
|
||||
<< "iface=" << iface << ", i1,i2=" << i1 << "," << i2 << ", iref=" << iref
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
void BooleanProcessor::triangulateFace(int iface)
|
||||
@@ -1580,8 +1580,8 @@ void BooleanProcessor::triangulateFace(int iface)
|
||||
|
||||
HepNormal3D normal = faces[iface].plane.normal();
|
||||
int ix, iy, iz = 0;
|
||||
if (abs(normal[1]) > abs(normal[iz])) iz = 1;
|
||||
if (abs(normal[2]) > abs(normal[iz])) iz = 2;
|
||||
if (std::abs(normal[1]) > std::abs(normal[iz])) iz = 1;
|
||||
if (std::abs(normal[2]) > std::abs(normal[iz])) iz = 2;
|
||||
if (normal[iz] > 0) {
|
||||
ix = (iz+1)%3; iy = (ix+1)%3;
|
||||
}else{
|
||||
@@ -1613,9 +1613,9 @@ void BooleanProcessor::triangulateFace(int iface)
|
||||
internal_contours.push_back(icontour);
|
||||
}else{
|
||||
processor_error = 1;
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor::triangulateFace : too small contour"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
icontour = edges[iedge].inext;
|
||||
edges[iedge].inext = 0;
|
||||
@@ -1623,9 +1623,9 @@ void BooleanProcessor::triangulateFace(int iface)
|
||||
}
|
||||
}else{
|
||||
processor_error = 1;
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor::triangulateFace : broken contour"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
icontour = 0;
|
||||
break;
|
||||
}
|
||||
@@ -1642,10 +1642,10 @@ void BooleanProcessor::triangulateFace(int iface)
|
||||
}
|
||||
if (kext == external_contours.size()) {
|
||||
processor_error = 1;
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor::triangulateFace : "
|
||||
<< "could not merge internal contour " << kint
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1664,10 +1664,10 @@ void BooleanProcessor::triangulateFace(int iface)
|
||||
while (iedge > 0) {
|
||||
if (edges[iedge].iface1 != ifa) {
|
||||
processor_error = 1;
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor::triangulateFace : wrong reference to itself, "
|
||||
<< "iface=" << ifa << ", iface1=" << edges[iedge].iface1
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}else if (edges[iedge].iface2 > 0) {
|
||||
modifyReference(edges[iedge].iface2,
|
||||
edges[iedge].i1, edges[iedge].i2, ifa);
|
||||
@@ -1733,9 +1733,9 @@ HepPolyhedron BooleanProcessor::createPolyhedron()
|
||||
iedge = faces[i].iold;
|
||||
while (iedge > 0) {
|
||||
if (k > 3) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor::createPolyhedron : too many edges"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
break;
|
||||
}
|
||||
v[k] = nodes[edges[iedge].i1].s;
|
||||
@@ -1745,10 +1745,10 @@ HepPolyhedron BooleanProcessor::createPolyhedron()
|
||||
k++;
|
||||
}
|
||||
if (k < 3) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor::createPolyhedron : "
|
||||
<< "face has only " << k << " edges"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
polyhedron.pF[faces[i].inew] =
|
||||
G4Facet(v[0],f[0], v[1],f[1], v[2],f[2], v[3],f[3]);
|
||||
@@ -1794,9 +1794,9 @@ HepPolyhedron BooleanProcessor::execute(int op,
|
||||
ifaces2 = faces.size(); takePolyhedron(b,0,0,0);
|
||||
|
||||
if (processor_error) { // corrapted polyhedron
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor: corrapted input polyhedron"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return HepPolyhedron();
|
||||
}
|
||||
if (ifaces1 == ifaces2) { // a is empty
|
||||
@@ -1804,14 +1804,14 @@ HepPolyhedron BooleanProcessor::execute(int op,
|
||||
case OP_UNION:
|
||||
return b;
|
||||
case OP_INTERSECTION:
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor: intersection with empty polyhedron"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return HepPolyhedron();
|
||||
case OP_SUBTRACTION:
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor: subtraction from empty polyhedron"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return HepPolyhedron();
|
||||
}
|
||||
}
|
||||
@@ -1820,9 +1820,9 @@ HepPolyhedron BooleanProcessor::execute(int op,
|
||||
case OP_UNION:
|
||||
return a;
|
||||
case OP_INTERSECTION:
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor: intersection with empty polyhedron"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return HepPolyhedron();
|
||||
case OP_SUBTRACTION:
|
||||
return a;
|
||||
@@ -1872,7 +1872,7 @@ HepPolyhedron BooleanProcessor::execute(int op,
|
||||
}
|
||||
|
||||
#define PROCESSOR_ERROR \
|
||||
HepStd::cerr << "BooleanProcessor: boolean operation failed" << HepStd::endl;\
|
||||
std::cerr << "BooleanProcessor: boolean operation failed" << std::endl;\
|
||||
return a;
|
||||
|
||||
// F I N D N E W E D G E S
|
||||
@@ -1904,9 +1904,9 @@ return a;
|
||||
assemblePolyhedra();
|
||||
if (unknown_faces.front() != 0) {
|
||||
processor_error = 1;
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "BooleanProcessor::execute : unknown faces !!!"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2127,7 +2127,7 @@ BooleanProcessor::print_face(int iface) {
|
||||
void
|
||||
BooleanProcessor::print_edge(int iedge) {
|
||||
cout << "==== Edge N " << iedge << endl;
|
||||
int i = abs(iedge);
|
||||
int i = std::abs(iedge);
|
||||
int i1 = edges[i].i1;
|
||||
int i2 = edges[i].i2;
|
||||
cout << "node[" << i1 << "] = "
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AttDefStore.cc,v 1.5 2004/03/31 06:50:19 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
|
||||
#include "G4AttDefStore.hh"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Circle.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Colour.cc,v 1.6 2003/09/18 11:03:12 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 20th October 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBS.cc,v 1.7 2003/06/16 16:55:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBSbox.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBScylinder.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4NURBScylinder.cc,v 1.6 2004/12/07 08:42:25 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -58,7 +58,7 @@ G4NURBScylinder::G4NURBScylinder(G4double R, G4double DZ)
|
||||
|
||||
// define control points
|
||||
|
||||
const G4double sr2o2 = sqrt(2.)/2. ;
|
||||
const G4double sr2o2 = std::sqrt(2.)/2. ;
|
||||
|
||||
CP(mpCtrlPts[ 0] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 1] , R, 0, DZ, 1 );
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBShexahedron.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
// hexahedron implementation
|
||||
// OC 17 9 96
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBStube.cc,v 1.5 2003/04/03 15:31:07 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4NURBStube.cc,v 1.6 2004/12/07 08:42:25 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -40,7 +40,7 @@ G4NURBStube::G4NURBStube(G4double r, G4double R, G4double DZ)
|
||||
{
|
||||
// define control points
|
||||
|
||||
const G4double sr2o2 = sqrt(2.)/2.;
|
||||
const G4double sr2o2 = std::sqrt(2.)/2.;
|
||||
|
||||
CP(mpCtrlPts[ 0] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 1] , R, 0, DZ, 1 );
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBStubesector.cc,v 1.7 2003/06/16 16:55:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4NURBStubesector.cc,v 1.9 2004/12/10 17:48:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-05 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -47,16 +47,16 @@ G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
|
||||
{
|
||||
// check angles
|
||||
G4double deltaPHI = PHI2-PHI1;
|
||||
while (deltaPHI <= 0) { PHI2 += 2*M_PI; deltaPHI += 2*M_PI; };
|
||||
while (deltaPHI <= 0) { PHI2 += twopi; deltaPHI += twopi; };
|
||||
|
||||
G4int f = (int)floor(deltaPHI / (M_PI_2)); //number of pi/2 arcs
|
||||
G4int f = (int)floor(deltaPHI / (halfpi)); //number of pi/2 arcs
|
||||
|
||||
const G4double mr = (r+R)/2;
|
||||
|
||||
const G4double cp1 = cos(PHI1);
|
||||
const G4double sp1 = sin(PHI1);
|
||||
const G4double cp2 = cos(PHI2);
|
||||
const G4double sp2 = sin(PHI2);
|
||||
const G4double cp1 = std::cos(PHI1);
|
||||
const G4double sp1 = std::sin(PHI1);
|
||||
const G4double cp2 = std::cos(PHI2);
|
||||
const G4double sp2 = std::sin(PHI2);
|
||||
|
||||
|
||||
// define control points
|
||||
@@ -82,16 +82,16 @@ G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
|
||||
G4double srcAngle = PHI1;
|
||||
G4double deltaAngleo2;
|
||||
|
||||
G4double destAngle = M_PI_2 + PHI1;
|
||||
G4double destAngle = halfpi + PHI1;
|
||||
|
||||
for(; f > 0; f--)
|
||||
{
|
||||
// the first arc CP is already Done
|
||||
|
||||
deltaAngleo2 = (destAngle - srcAngle) / 2;
|
||||
const G4double csa = cos(srcAngle);
|
||||
const G4double ssa = sin(srcAngle);
|
||||
const G4double tdao2 = tan(deltaAngleo2);
|
||||
const G4double csa = std::cos(srcAngle);
|
||||
const G4double ssa = std::sin(srcAngle);
|
||||
const G4double tdao2 = std::tan(deltaAngleo2);
|
||||
|
||||
// to calculate the intermediate CP :
|
||||
// rotate by srcAngle the (1, tdao2) point
|
||||
@@ -99,7 +99,7 @@ G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
|
||||
const t_Coord y = ssa + csa*tdao2;
|
||||
|
||||
// weight of the CP
|
||||
const G4Float weight = (cos(deltaAngleo2));
|
||||
const G4Float weight = (std::cos(deltaAngleo2));
|
||||
|
||||
// initialization. postfix ++ because i initialized to 15
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
@@ -109,8 +109,8 @@ G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
|
||||
// end CP (which is the first CP of the next arc)
|
||||
const G4double cda = cos(destAngle);
|
||||
const G4double sda = sin(destAngle);
|
||||
const G4double cda = std::cos(destAngle);
|
||||
const G4double sda = std::sin(destAngle);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, -DZ, 1);
|
||||
@@ -119,7 +119,7 @@ G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
|
||||
|
||||
// prepare next arc
|
||||
srcAngle = destAngle;
|
||||
destAngle += M_PI_2;
|
||||
destAngle += halfpi;
|
||||
}
|
||||
|
||||
// f == 0, final Arc
|
||||
@@ -127,9 +127,9 @@ G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
|
||||
|
||||
destAngle = PHI2;
|
||||
deltaAngleo2 = (destAngle - srcAngle) / 2;
|
||||
const G4double csa = cos(srcAngle);
|
||||
const G4double ssa = sin(srcAngle);
|
||||
const G4double tdao2 = tan(deltaAngleo2);
|
||||
const G4double csa = std::cos(srcAngle);
|
||||
const G4double ssa = std::sin(srcAngle);
|
||||
const G4double tdao2 = std::tan(deltaAngleo2);
|
||||
|
||||
// to calculate the intermediate CP :
|
||||
// rotate by srcAngle the (1, tdao2) point
|
||||
@@ -137,7 +137,7 @@ G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
|
||||
const t_Coord y = ssa + csa*tdao2;
|
||||
|
||||
// weight of the CP
|
||||
const G4Float weight = (cos(deltaAngleo2));
|
||||
const G4Float weight = (std::cos(deltaAngleo2));
|
||||
|
||||
// initialization.
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
@@ -147,8 +147,8 @@ G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
|
||||
// end CP
|
||||
const G4double cda = cos(destAngle);
|
||||
const G4double sda = sin(destAngle);
|
||||
const G4double cda = std::cos(destAngle);
|
||||
const G4double sda = std::sin(destAngle);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*R, sda*R, -DZ, 1);
|
||||
@@ -211,13 +211,13 @@ G4NURBStubesector::DecideNbrCtrlPts(G4double PHI1, G4double PHI2)
|
||||
{
|
||||
// check angles
|
||||
G4double deltaPHI = PHI2-PHI1;
|
||||
while (deltaPHI <= 0) { PHI2 += 2*M_PI; deltaPHI += 2*M_PI; }
|
||||
G4double k = deltaPHI / (M_PI_2);
|
||||
while (deltaPHI <= 0) { PHI2 += twopi; deltaPHI += twopi; }
|
||||
G4double k = deltaPHI / (halfpi);
|
||||
|
||||
// G4cerr << " k " << k << G4endl;
|
||||
// G4cerr << " fk " << floor(k) << G4endl;
|
||||
// G4cerr << " ifk " << ((int)(floor(k))) << G4endl;
|
||||
// G4cerr << " n " << (2*((int)(floor(k))) + 7) << G4endl;
|
||||
// G4cerr << " fk " << std::floor(k) << G4endl;
|
||||
// G4cerr << " ifk " << ((int)(std::floor(k))) << G4endl;
|
||||
// G4cerr << " n " << (2*((int)(std::floor(k))) + 7) << G4endl;
|
||||
|
||||
return ( 2*((int)(floor(k))) + 7 );
|
||||
return ( 2*((int)(std::floor(k))) + 7 );
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PlacedPolyhedron.cc,v 1.3 2001/07/11 10:01:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
|
||||
#include "G4PlacedPolyhedron.hh"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Point3DList.cc,v 1.6 2003/06/16 16:55:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Polyhedron.cc,v 1.12 2003/04/03 15:31:07 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
|
||||
#include "G4Polyhedron.hh"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Polyline.cc,v 1.8 2003/06/16 16:55:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Polymarker.cc,v 1.8 2003/06/16 16:55:24 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4Polymarker.cc,v 1.9 2004/11/11 16:41:27 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison November 1996
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "G4Polymarker.hh"
|
||||
|
||||
G4Polymarker::G4Polymarker ():
|
||||
fMarkerType (line)
|
||||
fMarkerType (G4Polymarker::dots)
|
||||
{}
|
||||
|
||||
G4Polymarker::~G4Polymarker () {}
|
||||
@@ -57,8 +57,6 @@ G4Polymarker & G4Polymarker::operator = (const G4Polymarker &right) {
|
||||
std::ostream& operator << (std::ostream& os, const G4Polymarker& marker) {
|
||||
os << "G4Polymarker: type: ";
|
||||
switch (marker.fMarkerType) {
|
||||
case G4Polymarker::line:
|
||||
os << "line"; break;
|
||||
case G4Polymarker::dots:
|
||||
os << "dots"; break;
|
||||
case G4Polymarker::circles:
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Scale.cc,v 1.6 2002/11/27 12:24:01 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 21st July 2001
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Square.cc,v 1.3 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Text.cc,v 1.6 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VMarker.cc,v 1.8 2003/06/16 16:55:25 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VVisPrim.cc,v 1.8 2003/06/16 16:55:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison August 1995
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisAttributes.cc,v 1.9 2003/06/16 16:55:27 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4VisAttributes.cc,v 1.10 2004/07/28 15:44:32 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 23rd October 1996
|
||||
@@ -30,36 +30,39 @@
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
G4VisAttributes::G4VisAttributes ():
|
||||
fVisible (true),
|
||||
fDaughtersInvisible (false),
|
||||
fColour (G4Colour ()),
|
||||
fLineStyle (unbroken),
|
||||
fLineWidth (1.),
|
||||
fForceDrawingStyle (false),
|
||||
fAttValues (0),
|
||||
fAttDefs (0)
|
||||
fVisible (true),
|
||||
fDaughtersInvisible (false),
|
||||
fColour (G4Colour ()),
|
||||
fLineStyle (unbroken),
|
||||
fLineWidth (1.),
|
||||
fForceDrawingStyle (false),
|
||||
fForceAuxEdgeVisible (false),
|
||||
fAttValues (0),
|
||||
fAttDefs (0)
|
||||
{}
|
||||
|
||||
G4VisAttributes::G4VisAttributes (G4bool visibility):
|
||||
fVisible (visibility),
|
||||
fDaughtersInvisible (false),
|
||||
fColour (G4Colour ()),
|
||||
fLineStyle (unbroken),
|
||||
fLineWidth (1.),
|
||||
fForceDrawingStyle (false),
|
||||
fAttValues (0),
|
||||
fAttDefs (0)
|
||||
fVisible (visibility),
|
||||
fDaughtersInvisible (false),
|
||||
fColour (G4Colour ()),
|
||||
fLineStyle (unbroken),
|
||||
fLineWidth (1.),
|
||||
fForceDrawingStyle (false),
|
||||
fForceAuxEdgeVisible (false),
|
||||
fAttValues (0),
|
||||
fAttDefs (0)
|
||||
{}
|
||||
|
||||
G4VisAttributes::G4VisAttributes (const G4Colour& colour):
|
||||
fVisible (true),
|
||||
fDaughtersInvisible (false),
|
||||
fColour (colour),
|
||||
fLineStyle (unbroken),
|
||||
fLineWidth (1.),
|
||||
fForceDrawingStyle (false),
|
||||
fAttValues (0),
|
||||
fAttDefs (0)
|
||||
fVisible (true),
|
||||
fDaughtersInvisible (false),
|
||||
fColour (colour),
|
||||
fLineStyle (unbroken),
|
||||
fLineWidth (1.),
|
||||
fForceDrawingStyle (false),
|
||||
fForceAuxEdgeVisible (false),
|
||||
fAttValues (0),
|
||||
fAttDefs (0)
|
||||
{}
|
||||
|
||||
G4VisAttributes::G4VisAttributes (G4bool visibility,
|
||||
@@ -112,6 +115,11 @@ std::ostream& operator << (std::ostream& os, const G4VisAttributes& a) {
|
||||
else {
|
||||
os << "unforced";
|
||||
}
|
||||
os << "\n auxiliary edge visibility";
|
||||
if (!a.fForceAuxEdgeVisible) {
|
||||
os << " not";
|
||||
}
|
||||
os << " forced";
|
||||
os << "\n vector<G4AttValue> pointer is ";
|
||||
if (a.fAttValues) {
|
||||
os << "non-";
|
||||
@@ -136,6 +144,7 @@ G4bool G4VisAttributes::operator != (const G4VisAttributes& a) const {
|
||||
(fLineStyle != a.fLineStyle) ||
|
||||
(fLineWidth != a.fLineWidth) ||
|
||||
(fForceDrawingStyle != a.fForceDrawingStyle) ||
|
||||
(fForceAuxEdgeVisible!= a.fForceAuxEdgeVisible)||
|
||||
(fAttValues != a.fAttValues) ||
|
||||
(fAttDefs != a.fAttDefs)
|
||||
)
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisExtent.cc,v 1.7 2003/06/16 16:55:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4VisExtent.cc,v 1.8 2004/12/07 08:42:25 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
//
|
||||
// A.Walkden 28/11/95
|
||||
@@ -41,7 +41,7 @@ G4VisExtent::G4VisExtent (G4double xmin, G4double xmax,
|
||||
|
||||
G4VisExtent::G4VisExtent (const G4Point3D& centre, G4double radius) {
|
||||
// Use exscribed radius ... see comments in header file.
|
||||
G4double halfSide (radius / sqrt (3.));
|
||||
G4double halfSide (radius / std::sqrt (3.));
|
||||
fXmin = centre.x () - halfSide;
|
||||
fXmax = centre.x () + halfSide;
|
||||
fYmin = centre.y () - halfSide;
|
||||
@@ -59,7 +59,7 @@ G4Point3D G4VisExtent::GetExtentCentre () const {
|
||||
}
|
||||
|
||||
G4double G4VisExtent::GetExtentRadius () const {
|
||||
return sqrt (((fXmax - fXmin) * (fXmax - fXmin)) +
|
||||
return std::sqrt (((fXmax - fXmin) * (fXmax - fXmin)) +
|
||||
((fYmax - fYmin) * (fYmax - fYmin)) +
|
||||
((fZmax - fZmin) * (fZmax - fZmin))) / 2.;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Visible.cc,v 1.5 2003/06/16 16:55:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 30th October 1996
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: HepPolyhedron.cc,v 1.12 2002/11/20 14:18:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: HepPolyhedron.cc,v 1.16 2004/12/10 23:28:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-05 $
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -54,8 +54,9 @@
|
||||
//
|
||||
|
||||
#include "HepPolyhedron.h"
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
#include <CLHEP/config/TemplateFunctions.h>
|
||||
#include <CLHEP/Units/PhysicalConstants.h>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
/***********************************************************************
|
||||
* *
|
||||
@@ -65,24 +66,24 @@
|
||||
* Function: Print contents of G4 polyhedron *
|
||||
* *
|
||||
***********************************************************************/
|
||||
HepStd::ostream & operator<<(HepStd::ostream & ostr, const G4Facet & facet) {
|
||||
std::ostream & operator<<(std::ostream & ostr, const G4Facet & facet) {
|
||||
for (int k=0; k<4; k++) {
|
||||
ostr << " " << facet.edge[k].v << "/" << facet.edge[k].f;
|
||||
}
|
||||
return ostr;
|
||||
}
|
||||
|
||||
HepStd::ostream & operator<<(HepStd::ostream & ostr, const HepPolyhedron & ph) {
|
||||
ostr << HepStd::endl;
|
||||
ostr << "Nverteces=" << ph.nvert << ", Nfacets=" << ph.nface << HepStd::endl;
|
||||
std::ostream & operator<<(std::ostream & ostr, const HepPolyhedron & ph) {
|
||||
ostr << std::endl;
|
||||
ostr << "Nverteces=" << ph.nvert << ", Nfacets=" << ph.nface << std::endl;
|
||||
int i;
|
||||
for (i=1; i<=ph.nvert; i++) {
|
||||
ostr << "xyz(" << i << ")="
|
||||
<< ph.pV[i].x() << ' ' << ph.pV[i].y() << ' ' << ph.pV[i].z()
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
for (i=1; i<=ph.nface; i++) {
|
||||
ostr << "face(" << i << ")=" << ph.pF[i] << HepStd::endl;
|
||||
ostr << "face(" << i << ")=" << ph.pF[i] << std::endl;
|
||||
}
|
||||
return ostr;
|
||||
}
|
||||
@@ -132,13 +133,13 @@ HepPolyhedron::FindNeighbour(int iFace, int iNode, int iOrder) const
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<4; i++) {
|
||||
if (iNode == abs(pF[iFace].edge[i].v)) break;
|
||||
if (iNode == std::abs(pF[iFace].edge[i].v)) break;
|
||||
}
|
||||
if (i == 4) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedron::FindNeighbour: face " << iFace
|
||||
<< " has no node " << iNode
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return 0;
|
||||
}
|
||||
if (iOrder < 0) {
|
||||
@@ -201,10 +202,10 @@ void HepPolyhedron::SetNumberOfRotationSteps(int n)
|
||||
{
|
||||
const int nMin = 3;
|
||||
if (n < nMin) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedron::SetNumberOfRotationSteps: attempt to set the\n"
|
||||
<< "number of steps per circle < " << nMin << "; forced to " << nMin
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
fNumberOfRotationSteps = nMin;
|
||||
}else{
|
||||
fNumberOfRotationSteps = n;
|
||||
@@ -354,7 +355,7 @@ void HepPolyhedron::SetSideFacets(int ii[4], int vv[4],
|
||||
{
|
||||
int k1, k2, k3, k4;
|
||||
|
||||
if (abs((double)(dphi-M_PI)) < perMillion) { // half a circle
|
||||
if (std::abs((double)(dphi-pi)) < perMillion) { // half a circle
|
||||
for (int i=0; i<4; i++) {
|
||||
k1 = ii[i];
|
||||
k2 = (i == 3) ? ii[0] : ii[i+1];
|
||||
@@ -429,11 +430,11 @@ void HepPolyhedron::RotateAroundZ(int nstep, double phi, double dphi,
|
||||
* *
|
||||
***********************************************************************/
|
||||
{
|
||||
static double wholeCircle = 2*M_PI;
|
||||
static double wholeCircle = twopi;
|
||||
|
||||
// S E T R O T A T I O N P A R A M E T E R S
|
||||
|
||||
bool ifWholeCircle = (abs(dphi-wholeCircle) < perMillion) ? true : false;
|
||||
bool ifWholeCircle = (std::abs(dphi-wholeCircle) < perMillion) ? true : false;
|
||||
double delPhi = ifWholeCircle ? wholeCircle : dphi;
|
||||
int nSphi = (nstep > 0) ?
|
||||
nstep : int(delPhi*GetNumberOfRotationSteps()/wholeCircle+.5);
|
||||
@@ -443,8 +444,8 @@ void HepPolyhedron::RotateAroundZ(int nstep, double phi, double dphi,
|
||||
|
||||
// C O U N T V E R T E C E S
|
||||
|
||||
int absNp1 = abs(np1);
|
||||
int absNp2 = abs(np2);
|
||||
int absNp1 = std::abs(np1);
|
||||
int absNp2 = std::abs(np2);
|
||||
int i1beg = 0;
|
||||
int i1end = absNp1-1;
|
||||
int i2beg = absNp1;
|
||||
@@ -452,7 +453,7 @@ void HepPolyhedron::RotateAroundZ(int nstep, double phi, double dphi,
|
||||
int i, j, k;
|
||||
|
||||
for(i=i1beg; i<=i2end; i++) {
|
||||
if (abs(r[i]) < perMillion) r[i] = 0.;
|
||||
if (std::abs(r[i]) < perMillion) r[i] = 0.;
|
||||
}
|
||||
|
||||
j = 0; // external nodes
|
||||
@@ -541,8 +542,8 @@ void HepPolyhedron::RotateAroundZ(int nstep, double phi, double dphi,
|
||||
double cosPhi, sinPhi;
|
||||
|
||||
for(j=0; j<nVphi; j++) {
|
||||
cosPhi = cos(phi+j*delPhi/nSphi);
|
||||
sinPhi = sin(phi+j*delPhi/nSphi);
|
||||
cosPhi = std::cos(phi+j*delPhi/nSphi);
|
||||
sinPhi = std::sin(phi+j*delPhi/nSphi);
|
||||
for(i=i1beg; i<=i2end; i++) {
|
||||
if (r[i] != 0.) pV[kk[i]+j] = HepPoint3D(r[i]*cosPhi,r[i]*sinPhi,z[i]);
|
||||
}
|
||||
@@ -638,11 +639,11 @@ void HepPolyhedron::RotateAroundZ(int nstep, double phi, double dphi,
|
||||
delete [] kk;
|
||||
|
||||
if (k-1 != nface) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "Polyhedron::RotateAroundZ: number of generated faces ("
|
||||
<< k-1 << ") is not equal to the number of allocated faces ("
|
||||
<< nface << ")"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -691,8 +692,8 @@ void HepPolyhedron::SetReferences()
|
||||
for (iedge=0; iedge<nedge; iedge++) {
|
||||
i1 = iedge;
|
||||
i2 = (iedge < nedge-1) ? iedge+1 : 0;
|
||||
i1 = abs(pF[iface].edge[i1].v);
|
||||
i2 = abs(pF[iface].edge[i2].v);
|
||||
i1 = std::abs(pF[iface].edge[i1].v);
|
||||
i2 = std::abs(pF[iface].edge[i2].v);
|
||||
k1 = (i1 < i2) ? i1 : i2; // k1 = ::min(i1,i2);
|
||||
k2 = (i1 > i2) ? i1 : i2; // k2 = ::max(i1,i2);
|
||||
|
||||
@@ -718,13 +719,13 @@ void HepPolyhedron::SetReferences()
|
||||
i1 = (pF[iface].edge[iedge].v < 0) ? -1 : 1;
|
||||
i2 = (pF[cur->iface].edge[cur->iedge].v < 0) ? -1 : 1;
|
||||
if (i1 != i2) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "Polyhedron::SetReferences: different edge visibility "
|
||||
<< iface << "/" << iedge << "/"
|
||||
<< pF[iface].edge[iedge].v << " and "
|
||||
<< cur->iface << "/" << cur->iedge << "/"
|
||||
<< pF[cur->iface].edge[cur->iedge].v
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -753,13 +754,13 @@ void HepPolyhedron::SetReferences()
|
||||
i1 = (pF[iface].edge[iedge].v < 0) ? -1 : 1;
|
||||
i2 = (pF[cur->iface].edge[cur->iedge].v < 0) ? -1 : 1;
|
||||
if (i1 != i2) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "Polyhedron::SetReferences: different edge visibility "
|
||||
<< iface << "/" << iedge << "/"
|
||||
<< pF[iface].edge[iedge].v << " and "
|
||||
<< cur->iface << "/" << cur->iedge << "/"
|
||||
<< pF[cur->iface].edge[cur->iedge].v
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -771,9 +772,9 @@ void HepPolyhedron::SetReferences()
|
||||
|
||||
for (i=0; i<nvert; i++) {
|
||||
if (headList[i] != 0) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "Polyhedron::SetReferences: List " << i << " is not empty"
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -849,7 +850,7 @@ bool HepPolyhedron::GetNextVertexIndex(int &index, int &edgeFlag) const
|
||||
int vIndex = pF[iFace].edge[iQVertex].v;
|
||||
|
||||
edgeFlag = (vIndex > 0) ? 1 : 0;
|
||||
index = abs(vIndex);
|
||||
index = std::abs(vIndex);
|
||||
|
||||
if (iQVertex >= 3 || pF[iFace].edge[iQVertex+1].v == 0) {
|
||||
iQVertex = 0;
|
||||
@@ -872,9 +873,9 @@ HepPoint3D HepPolyhedron::GetVertex(int index) const
|
||||
***********************************************************************/
|
||||
{
|
||||
if (index <= 0 || index > nvert) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedron::GetVertex: irrelevant index " << index
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return HepPoint3D();
|
||||
}
|
||||
return pV[index];
|
||||
@@ -953,22 +954,22 @@ bool HepPolyhedron::GetNextEdgeIndeces(int &i1, int &i2, int &edgeFlag,
|
||||
k2 = pF[nface].edge[0].v;
|
||||
k1 = pF[nface].edge[3].v;
|
||||
if (k1 == 0) k1 = pF[nface].edge[2].v;
|
||||
if (abs(k1) > abs(k2)) iOrder = -1;
|
||||
if (std::abs(k1) > std::abs(k2)) iOrder = -1;
|
||||
}
|
||||
|
||||
do {
|
||||
k1 = pF[iFace].edge[iQVertex].v;
|
||||
kflag = k1;
|
||||
k1 = abs(k1);
|
||||
k1 = std::abs(k1);
|
||||
kface1 = iFace;
|
||||
kface2 = pF[iFace].edge[iQVertex].f;
|
||||
if (iQVertex >= 3 || pF[iFace].edge[iQVertex+1].v == 0) {
|
||||
iQVertex = 0;
|
||||
k2 = abs(pF[iFace].edge[iQVertex].v);
|
||||
k2 = std::abs(pF[iFace].edge[iQVertex].v);
|
||||
iFace++;
|
||||
}else{
|
||||
iQVertex++;
|
||||
k2 = abs(pF[iFace].edge[iQVertex].v);
|
||||
k2 = std::abs(pF[iFace].edge[iQVertex].v);
|
||||
}
|
||||
} while (iOrder*k1 > iOrder*k2);
|
||||
|
||||
@@ -1053,9 +1054,9 @@ void HepPolyhedron::GetFacet(int iFace, int &n, int *iNodes,
|
||||
***********************************************************************/
|
||||
{
|
||||
if (iFace < 1 || iFace > nface) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedron::GetFacet: irrelevant index " << iFace
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
n = 0;
|
||||
}else{
|
||||
int i, k;
|
||||
@@ -1138,16 +1139,16 @@ HepNormal3D HepPolyhedron::GetNormal(int iFace) const
|
||||
***********************************************************************/
|
||||
{
|
||||
if (iFace < 1 || iFace > nface) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedron::GetNormal: irrelevant index " << iFace
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return HepNormal3D();
|
||||
}
|
||||
|
||||
int i0 = abs(pF[iFace].edge[0].v);
|
||||
int i1 = abs(pF[iFace].edge[1].v);
|
||||
int i2 = abs(pF[iFace].edge[2].v);
|
||||
int i3 = abs(pF[iFace].edge[3].v);
|
||||
int i0 = std::abs(pF[iFace].edge[0].v);
|
||||
int i1 = std::abs(pF[iFace].edge[1].v);
|
||||
int i2 = std::abs(pF[iFace].edge[2].v);
|
||||
int i3 = std::abs(pF[iFace].edge[3].v);
|
||||
if (i3 == 0) i3 = i0;
|
||||
return (pV[i2] - pV[i0]).cross(pV[i3] - pV[i1]);
|
||||
}
|
||||
@@ -1163,16 +1164,16 @@ HepNormal3D HepPolyhedron::GetUnitNormal(int iFace) const
|
||||
***********************************************************************/
|
||||
{
|
||||
if (iFace < 1 || iFace > nface) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedron::GetUnitNormal: irrelevant index " << iFace
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return HepNormal3D();
|
||||
}
|
||||
|
||||
int i0 = abs(pF[iFace].edge[0].v);
|
||||
int i1 = abs(pF[iFace].edge[1].v);
|
||||
int i2 = abs(pF[iFace].edge[2].v);
|
||||
int i3 = abs(pF[iFace].edge[3].v);
|
||||
int i0 = std::abs(pF[iFace].edge[0].v);
|
||||
int i1 = std::abs(pF[iFace].edge[1].v);
|
||||
int i2 = std::abs(pF[iFace].edge[2].v);
|
||||
int i3 = std::abs(pF[iFace].edge[3].v);
|
||||
if (i3 == 0) i3 = i0;
|
||||
return ((pV[i2] - pV[i0]).cross(pV[i3] - pV[i1])).unit();
|
||||
}
|
||||
@@ -1226,10 +1227,10 @@ double HepPolyhedron::GetSurfaceArea() const
|
||||
{
|
||||
double s = 0.;
|
||||
for (int iFace=1; iFace<=nface; iFace++) {
|
||||
int i0 = abs(pF[iFace].edge[0].v);
|
||||
int i1 = abs(pF[iFace].edge[1].v);
|
||||
int i2 = abs(pF[iFace].edge[2].v);
|
||||
int i3 = abs(pF[iFace].edge[3].v);
|
||||
int i0 = std::abs(pF[iFace].edge[0].v);
|
||||
int i1 = std::abs(pF[iFace].edge[1].v);
|
||||
int i2 = std::abs(pF[iFace].edge[2].v);
|
||||
int i3 = std::abs(pF[iFace].edge[3].v);
|
||||
if (i3 == 0) i3 = i0;
|
||||
s += ((pV[i2] - pV[i0]).cross(pV[i3] - pV[i1])).mag();
|
||||
}
|
||||
@@ -1248,10 +1249,10 @@ double HepPolyhedron::GetVolume() const
|
||||
{
|
||||
double v = 0.;
|
||||
for (int iFace=1; iFace<=nface; iFace++) {
|
||||
int i0 = abs(pF[iFace].edge[0].v);
|
||||
int i1 = abs(pF[iFace].edge[1].v);
|
||||
int i2 = abs(pF[iFace].edge[2].v);
|
||||
int i3 = abs(pF[iFace].edge[3].v);
|
||||
int i0 = std::abs(pF[iFace].edge[0].v);
|
||||
int i1 = std::abs(pF[iFace].edge[1].v);
|
||||
int i2 = std::abs(pF[iFace].edge[2].v);
|
||||
int i3 = std::abs(pF[iFace].edge[3].v);
|
||||
HepPoint3D g;
|
||||
if (i3 == 0) {
|
||||
i3 = i0;
|
||||
@@ -1443,10 +1444,10 @@ HepPolyhedronTrap::HepPolyhedronTrap(double Dz,
|
||||
* *
|
||||
***********************************************************************/
|
||||
{
|
||||
double DzTthetaCphi = Dz*tan(Theta)*cos(Phi);
|
||||
double DzTthetaSphi = Dz*tan(Theta)*sin(Phi);
|
||||
double Dy1Talp1 = Dy1*tan(Alp1);
|
||||
double Dy2Talp2 = Dy2*tan(Alp2);
|
||||
double DzTthetaCphi = Dz*std::tan(Theta)*std::cos(Phi);
|
||||
double DzTthetaSphi = Dz*std::tan(Theta)*std::sin(Phi);
|
||||
double Dy1Talp1 = Dy1*std::tan(Alp1);
|
||||
double Dy2Talp2 = Dy2*std::tan(Alp2);
|
||||
|
||||
AllocateMemory(8,6);
|
||||
|
||||
@@ -1493,7 +1494,7 @@ HepPolyhedronCons::HepPolyhedronCons(double Rmn1,
|
||||
* *
|
||||
***********************************************************************/
|
||||
{
|
||||
static double wholeCircle=2*M_PI;
|
||||
static double wholeCircle=twopi;
|
||||
|
||||
// C H E C K I N P U T P A R A M E T E R S
|
||||
|
||||
@@ -1513,19 +1514,19 @@ HepPolyhedronCons::HepPolyhedronCons(double Rmn1,
|
||||
phi1 = Phi1; phi2 = phi1 + Dphi;
|
||||
}
|
||||
dphi = phi2 - phi1;
|
||||
if (abs(dphi-wholeCircle) < perMillion) dphi = wholeCircle;
|
||||
if (std::abs(dphi-wholeCircle) < perMillion) dphi = wholeCircle;
|
||||
if (dphi > wholeCircle) k += 4;
|
||||
|
||||
if (k != 0) {
|
||||
HepStd::cerr << "HepPolyhedronCone(s)/Tube(s): error in input parameters";
|
||||
if ((k & 1) != 0) HepStd::cerr << " (radiuses)";
|
||||
if ((k & 2) != 0) HepStd::cerr << " (half-length)";
|
||||
if ((k & 4) != 0) HepStd::cerr << " (angles)";
|
||||
HepStd::cerr << HepStd::endl;
|
||||
HepStd::cerr << " Rmn1=" << Rmn1 << " Rmx1=" << Rmx1;
|
||||
HepStd::cerr << " Rmn2=" << Rmn2 << " Rmx2=" << Rmx2;
|
||||
HepStd::cerr << " Dz=" << Dz << " Phi1=" << Phi1 << " Dphi=" << Dphi
|
||||
<< HepStd::endl;
|
||||
std::cerr << "HepPolyhedronCone(s)/Tube(s): error in input parameters";
|
||||
if ((k & 1) != 0) std::cerr << " (radiuses)";
|
||||
if ((k & 2) != 0) std::cerr << " (half-length)";
|
||||
if ((k & 4) != 0) std::cerr << " (angles)";
|
||||
std::cerr << std::endl;
|
||||
std::cerr << " Rmn1=" << Rmn1 << " Rmx1=" << Rmx1;
|
||||
std::cerr << " Rmn2=" << Rmn2 << " Rmx2=" << Rmx2;
|
||||
std::cerr << " Dz=" << Dz << " Phi1=" << Phi1 << " Dphi=" << Dphi
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1595,34 +1596,34 @@ HepPolyhedronPgon::HepPolyhedronPgon(double phi,
|
||||
{
|
||||
// C H E C K I N P U T P A R A M E T E R S
|
||||
|
||||
if (dphi <= 0. || dphi > 2*M_PI) {
|
||||
HepStd::cerr
|
||||
if (dphi <= 0. || dphi > twopi) {
|
||||
std::cerr
|
||||
<< "HepPolyhedronPgon/Pcon: wrong delta phi = " << dphi
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (nz < 2) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedronPgon/Pcon: number of z-planes less than two = " << nz
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (npdv < 0) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedronPgon/Pcon: error in number of phi-steps =" << npdv
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
int i;
|
||||
for (i=0; i<nz; i++) {
|
||||
if (rmin[i] < 0. || rmax[i] < 0. || rmin[i] > rmax[i]) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedronPgon: error in radiuses rmin[" << i << "]="
|
||||
<< rmin[i] << " rmax[" << i << "]=" << rmax[i]
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1689,47 +1690,47 @@ HepPolyhedronSphere::HepPolyhedronSphere(double rmin, double rmax,
|
||||
{
|
||||
// C H E C K I N P U T P A R A M E T E R S
|
||||
|
||||
if (dphi <= 0. || dphi > 2*M_PI) {
|
||||
HepStd::cerr
|
||||
if (dphi <= 0. || dphi > twopi) {
|
||||
std::cerr
|
||||
<< "HepPolyhedronSphere: wrong delta phi = " << dphi
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (the < 0. || the > M_PI) {
|
||||
HepStd::cerr
|
||||
if (the < 0. || the > pi) {
|
||||
std::cerr
|
||||
<< "HepPolyhedronSphere: wrong theta = " << the
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (dthe <= 0. || dthe > M_PI) {
|
||||
HepStd::cerr
|
||||
if (dthe <= 0. || dthe > pi) {
|
||||
std::cerr
|
||||
<< "HepPolyhedronSphere: wrong delta theta = " << dthe
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (the+dthe > M_PI) {
|
||||
HepStd::cerr
|
||||
if (the+dthe > pi) {
|
||||
std::cerr
|
||||
<< "HepPolyhedronSphere: wrong theta + delta theta = "
|
||||
<< the << " " << dthe
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (rmin < 0. || rmin >= rmax) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedronSphere: error in radiuses"
|
||||
<< " rmin=" << rmin << " rmax=" << rmax
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// P R E P A R E T W O P O L Y L I N E S
|
||||
|
||||
int ns = (GetNumberOfRotationSteps() + 1) / 2;
|
||||
int np1 = int(dthe*ns/M_PI+.5) + 1;
|
||||
int np1 = int(dthe*ns/pi+.5) + 1;
|
||||
if (np1 <= 1) np1 = 2;
|
||||
int np2 = rmin < perMillion ? 1 : np1;
|
||||
|
||||
@@ -1740,8 +1741,8 @@ HepPolyhedronSphere::HepPolyhedronSphere(double rmin, double rmax,
|
||||
double a = dthe/(np1-1);
|
||||
double cosa, sina;
|
||||
for (int i=0; i<np1; i++) {
|
||||
cosa = cos(the+i*a);
|
||||
sina = sin(the+i*a);
|
||||
cosa = std::cos(the+i*a);
|
||||
sina = std::sin(the+i*a);
|
||||
zz[i] = rmax*cosa;
|
||||
rr[i] = rmax*sina;
|
||||
if (np2 > 1) {
|
||||
@@ -1787,18 +1788,18 @@ HepPolyhedronTorus::HepPolyhedronTorus(double rmin,
|
||||
{
|
||||
// C H E C K I N P U T P A R A M E T E R S
|
||||
|
||||
if (dphi <= 0. || dphi > 2*M_PI) {
|
||||
HepStd::cerr
|
||||
if (dphi <= 0. || dphi > twopi) {
|
||||
std::cerr
|
||||
<< "HepPolyhedronTorus: wrong delta phi = " << dphi
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (rmin < 0. || rmin >= rmax || rmax >= rtor) {
|
||||
HepStd::cerr
|
||||
std::cerr
|
||||
<< "HepPolyhedronTorus: error in radiuses"
|
||||
<< " rmin=" << rmin << " rmax=" << rmax << " rtorus=" << rtor
|
||||
<< HepStd::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1811,11 +1812,11 @@ HepPolyhedronTorus::HepPolyhedronTorus(double rmin,
|
||||
zz = new double[np1+np2];
|
||||
rr = new double[np1+np2];
|
||||
|
||||
double a = 2*M_PI/np1;
|
||||
double a = twopi/np1;
|
||||
double cosa, sina;
|
||||
for (int i=0; i<np1; i++) {
|
||||
cosa = cos(i*a);
|
||||
sina = sin(i*a);
|
||||
cosa = std::cos(i*a);
|
||||
sina = std::sin(i*a);
|
||||
zz[i] = rmax*cosa;
|
||||
rr[i] = rtor+rmax*sina;
|
||||
if (np2 > 1) {
|
||||
|
||||
Reference in New Issue
Block a user