Import Geant4 5.1.0 source tree
This commit is contained in:
@@ -780,7 +780,7 @@ void BooleanProcessor::caseII(ExtEdge & edge1, ExtEdge & edge2)
|
||||
insertEdge(edge2);
|
||||
}
|
||||
|
||||
void BooleanProcessor::caseIE(ExtEdge & edge1, ExtEdge & edge2)
|
||||
void BooleanProcessor::caseIE(ExtEdge &, ExtEdge &)
|
||||
/***********************************************************************
|
||||
* *
|
||||
* Name: BooleanProcessor::caseIE Date: 19.01.00 *
|
||||
@@ -796,7 +796,7 @@ void BooleanProcessor::caseIE(ExtEdge & edge1, ExtEdge & edge2)
|
||||
<< HepStd::endl;
|
||||
}
|
||||
|
||||
void BooleanProcessor::caseEE(ExtEdge & edge1, ExtEdge & edge2)
|
||||
void BooleanProcessor::caseEE(ExtEdge &, ExtEdge &)
|
||||
/***********************************************************************
|
||||
* *
|
||||
* Name: BooleanProcessor::caseEE Date: 19.01.00 *
|
||||
@@ -890,7 +890,7 @@ void BooleanProcessor::invertNewEdges(int iface)
|
||||
}
|
||||
}
|
||||
|
||||
void BooleanProcessor::checkDoubleEdges(int iface)
|
||||
void BooleanProcessor::checkDoubleEdges(int)
|
||||
/***********************************************************************
|
||||
* *
|
||||
* Name: BooleanProcessor::checkDoubleEdges Date: 04.02.00 *
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4AttDefStore.cc,v 1.2 2002/10/28 11:13:08 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-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-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Colour.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 20th October 1996
|
||||
|
||||
+508
-520
File diff suppressed because it is too large
Load Diff
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBSbox.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBSbox.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -32,64 +32,53 @@
|
||||
|
||||
#include "G4NURBSbox.hh"
|
||||
|
||||
G4NURBSbox::G4NURBSbox(G4double DX, G4double DY, G4double DZ)
|
||||
:
|
||||
G4NURBS (
|
||||
2, 2, // linear along U and V
|
||||
4, 5 // line with two 90 degrees folds along U
|
||||
// rectangle along V (3 folds)
|
||||
)
|
||||
// let's it Generate regular knots vector
|
||||
// (note we are calling the second constructor)
|
||||
{
|
||||
t_indCtrlPt i = 0;
|
||||
G4NURBSbox::G4NURBSbox(G4double DX, G4double DY, G4double DZ)
|
||||
: G4NURBS ( 2, 2, // linear along U and V
|
||||
4, 5 ) // line with two 90 degrees folds along U
|
||||
// rectangle along V (3 folds)
|
||||
{
|
||||
// let's it Generate regular knots vector
|
||||
// (note we are calling the second constructor)
|
||||
|
||||
t_indCtrlPt i = 0;
|
||||
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++],-DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX,-DY,-DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY, DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
G4Visible & G4NURBSbox::operator = (const G4Visible &right) {
|
||||
G4Visible & G4NURBSbox::operator = (const G4Visible &right)
|
||||
{
|
||||
return G4Visible::operator = (right);
|
||||
}
|
||||
|
||||
G4VVisPrim & G4NURBSbox::operator = (const G4VVisPrim &right) {
|
||||
G4VVisPrim & G4NURBSbox::operator = (const G4VVisPrim &right)
|
||||
{
|
||||
return G4VVisPrim::operator = (right);
|
||||
}
|
||||
|
||||
const char* G4NURBSbox::Whoami() const
|
||||
{
|
||||
return "Box (as a folded piece)";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const char* G4NURBSbox::Whoami() const
|
||||
{
|
||||
return "Box (as a folded piece)";
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBScylinder.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBScylinder.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -32,104 +32,91 @@
|
||||
|
||||
#include "G4NURBScylinder.hh"
|
||||
|
||||
// for sqrt
|
||||
//#include <math.h>
|
||||
// math.h included in template.hh included in globals.hh included in
|
||||
// G4NURBS.hh included in G4NURBScylinder.hh
|
||||
|
||||
// the cylinder constructor use the first G4NURBS constructor
|
||||
// look in G4NURBStube if you want to see how to use the second one.
|
||||
|
||||
G4NURBScylinder::G4NURBScylinder(G4double R, G4double DZ)
|
||||
:
|
||||
G4NURBS (
|
||||
2, 3, // linear along U, quadratic along V
|
||||
4, 9, // half rectangle along U, circle along V
|
||||
(new t_CtrlPt [ 4 * 9 ]), // the array for CtrlPts
|
||||
NULL, // the knot vector along U will be generated
|
||||
(new t_Knot [ 3 + 9 ]) // knot vector for the circle
|
||||
)
|
||||
{
|
||||
// define the V knot vector
|
||||
m[V].pKnots[ 0] = 0;
|
||||
m[V].pKnots[ 1] = 0;
|
||||
m[V].pKnots[ 2] = 0;
|
||||
m[V].pKnots[ 3] = 0.25;
|
||||
m[V].pKnots[ 4] = 0.25;
|
||||
m[V].pKnots[ 5] = 0.5;
|
||||
m[V].pKnots[ 6] = 0.5;
|
||||
m[V].pKnots[ 7] = 0.75;
|
||||
m[V].pKnots[ 8] = 0.75;
|
||||
m[V].pKnots[ 9] = 1;
|
||||
m[V].pKnots[10] = 1;
|
||||
m[V].pKnots[11] = 1;
|
||||
G4NURBScylinder::G4NURBScylinder(G4double R, G4double DZ)
|
||||
: G4NURBS ( 2, 3, // linear along U, quadratic along V
|
||||
4, 9, // half rectangle along U, circle along V
|
||||
(new t_CtrlPt [ 4 * 9 ]), // the array for CtrlPts
|
||||
0, // the knot vector along U will be generated
|
||||
(new t_Knot [ 3 + 9 ]) ) // knot vector for the circle
|
||||
{
|
||||
// define the V knot vector
|
||||
m[V].pKnots[ 0] = 0;
|
||||
m[V].pKnots[ 1] = 0;
|
||||
m[V].pKnots[ 2] = 0;
|
||||
m[V].pKnots[ 3] = 0.25;
|
||||
m[V].pKnots[ 4] = 0.25;
|
||||
m[V].pKnots[ 5] = 0.5;
|
||||
m[V].pKnots[ 6] = 0.5;
|
||||
m[V].pKnots[ 7] = 0.75;
|
||||
m[V].pKnots[ 8] = 0.75;
|
||||
m[V].pKnots[ 9] = 1;
|
||||
m[V].pKnots[10] = 1;
|
||||
m[V].pKnots[11] = 1;
|
||||
|
||||
// define control points
|
||||
// define control points
|
||||
|
||||
const G4double sr2o2 = sqrt(2.)/2. ;
|
||||
const G4double sr2o2 = sqrt(2.)/2. ;
|
||||
|
||||
CP(mpCtrlPts[ 0] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 1] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 2] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 3] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 0] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 1] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 2] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 3] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[ 4] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 5] , R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 6] , R, R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 7] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 4] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 5] , R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 6] , R, R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 7] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[ 8] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 9] , 0, R, DZ, 1 );
|
||||
CP(mpCtrlPts[10] , 0, R, -DZ, 1 );
|
||||
CP(mpCtrlPts[11] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 8] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 9] , 0, R, DZ, 1 );
|
||||
CP(mpCtrlPts[10] , 0, R, -DZ, 1 );
|
||||
CP(mpCtrlPts[11] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[12] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[13] , -R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[14] , -R, R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[15] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[12] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[13] , -R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[14] , -R, R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[15] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[16] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[17] , -R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[18] , -R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[19] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[16] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[17] , -R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[18] , -R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[19] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[20] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[21] , -R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[22] , -R,-R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[23] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[20] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[21] , -R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[22] , -R,-R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[23] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[24] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[25] , 0, -R, DZ, 1 );
|
||||
CP(mpCtrlPts[26] , 0, -R,-DZ, 1 );
|
||||
CP(mpCtrlPts[27] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[24] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[25] , 0, -R, DZ, 1 );
|
||||
CP(mpCtrlPts[26] , 0, -R,-DZ, 1 );
|
||||
CP(mpCtrlPts[27] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[28] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[29] , R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[30] , R,-R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[31] , 0, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[28] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[29] , R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[30] , R,-R,-DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[31] , 0, 0, -DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[32] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[33] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[34] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[35] , 0, 0, -DZ, 1 );
|
||||
|
||||
}
|
||||
CP(mpCtrlPts[32] , 0, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[33] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[34] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[35] , 0, 0, -DZ, 1 );
|
||||
}
|
||||
|
||||
G4Visible & G4NURBScylinder::operator = (const G4Visible &right) {
|
||||
G4Visible & G4NURBScylinder::operator = (const G4Visible &right)
|
||||
{
|
||||
return G4Visible::operator = (right);
|
||||
}
|
||||
|
||||
G4VVisPrim & G4NURBScylinder::operator = (const G4VVisPrim &right) {
|
||||
G4VVisPrim & G4NURBScylinder::operator = (const G4VVisPrim &right)
|
||||
{
|
||||
return G4VVisPrim::operator = (right);
|
||||
}
|
||||
|
||||
const char* G4NURBScylinder::Whoami() const
|
||||
{
|
||||
return "Cylinder";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const char* G4NURBScylinder::Whoami() const
|
||||
{
|
||||
return "Cylinder";
|
||||
}
|
||||
|
||||
@@ -21,71 +21,56 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBShexahedron.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBShexahedron.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
// hexahedron implementation
|
||||
// OC 17 9 96
|
||||
|
||||
#include "G4NURBShexahedron.hh"
|
||||
|
||||
G4NURBShexahedron::G4NURBShexahedron(const G4ThreeVector c [8])
|
||||
:
|
||||
G4NURBS (
|
||||
2, 2, // linear along U and V
|
||||
5, 4 // Square x polyline
|
||||
)
|
||||
// let's it Generate regular knots vector
|
||||
{
|
||||
// we need to define control points, indeed
|
||||
G4NURBShexahedron::G4NURBShexahedron(const G4ThreeVector c [8])
|
||||
: G4NURBS( 2, 2, // linear along U and V
|
||||
5, 4 ) // Square x polyline
|
||||
{
|
||||
// let's it Generate regular knots vector
|
||||
|
||||
CP(mpCtrlPts[To1d(0,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,0)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,0)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
|
||||
CP(mpCtrlPts[To1d(0,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,0)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,0)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,0)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(0,1)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,1)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,1)] , c[2].x(), c[2].y(), c[2].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,1)] , c[3].x(), c[3].y(), c[3].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,1)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
|
||||
CP(mpCtrlPts[To1d(0,2)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,2)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,2)] , c[6].x(), c[6].y(), c[6].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,2)] , c[7].x(), c[7].y(), c[7].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,2)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
|
||||
CP(mpCtrlPts[To1d(0,1)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,1)] , c[1].x(), c[1].y(), c[1].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,1)] , c[2].x(), c[2].y(), c[2].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,1)] , c[3].x(), c[3].y(), c[3].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,1)] , c[0].x(), c[0].y(), c[0].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(0,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,3)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,3)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
}
|
||||
|
||||
|
||||
CP(mpCtrlPts[To1d(0,2)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,2)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,2)] , c[6].x(), c[6].y(), c[6].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,2)] , c[7].x(), c[7].y(), c[7].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,2)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
|
||||
|
||||
CP(mpCtrlPts[To1d(0,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(1,3)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(2,3)] , c[5].x(), c[5].y(), c[5].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(3,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
CP(mpCtrlPts[To1d(4,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
G4Visible & G4NURBShexahedron::operator = (const G4Visible &right) {
|
||||
G4Visible & G4NURBShexahedron::operator = (const G4Visible &right)
|
||||
{
|
||||
return G4Visible::operator = (right);
|
||||
}
|
||||
|
||||
G4VVisPrim & G4NURBShexahedron::operator = (const G4VVisPrim &right) {
|
||||
G4VVisPrim & G4NURBShexahedron::operator = (const G4VVisPrim &right)
|
||||
{
|
||||
return G4VVisPrim::operator = (right);
|
||||
}
|
||||
|
||||
const char* G4NURBShexahedron::Whoami() const
|
||||
{
|
||||
return "Hexahedron";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const char* G4NURBShexahedron::Whoami() const
|
||||
{
|
||||
return "Hexahedron";
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBStube.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBStube.cc,v 1.5 2003/04/03 15:31:07 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -32,94 +32,82 @@
|
||||
|
||||
#include "G4NURBStube.hh"
|
||||
|
||||
// for sqrt
|
||||
//#include <math.h>
|
||||
// cf cylinder
|
||||
G4NURBStube::G4NURBStube(G4double r, G4double R, G4double DZ)
|
||||
: G4NURBS( 2, 3, // linear along U, quadratic along V
|
||||
5, 9, // rectangle along U, circle along V
|
||||
Regular, // the knot vector along U will be generated
|
||||
RegularRep ) // knot vector for the circle also
|
||||
{
|
||||
// define control points
|
||||
|
||||
G4NURBStube::G4NURBStube(G4double r, G4double R, G4double DZ)
|
||||
:
|
||||
G4NURBS (
|
||||
2, 3, // linear along U, quadratic along V
|
||||
5, 9, // rectangle along U, circle along V
|
||||
Regular, // the knot vector along U will be generated
|
||||
RegularRep // knot vector for the circle also
|
||||
)
|
||||
{
|
||||
// define control points
|
||||
const G4double sr2o2 = sqrt(2.)/2.;
|
||||
|
||||
const G4double sr2o2 = sqrt(2.)/2.;
|
||||
CP(mpCtrlPts[ 0] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 1] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 2] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 3] , r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 4] , r, 0, DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[ 0] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 1] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 2] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 3] , r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[ 4] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[ 5] , r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 6] , R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 7] , R, R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 8] , r, r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 9] , r, r, DZ, 1 , sr2o2);
|
||||
|
||||
CP(mpCtrlPts[ 5] , r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 6] , R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 7] , R, R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 8] , r, r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[ 9] , r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[10] , 0, r, DZ, 1 );
|
||||
CP(mpCtrlPts[11] , 0, R, DZ, 1 );
|
||||
CP(mpCtrlPts[12] , 0, R, -DZ, 1 );
|
||||
CP(mpCtrlPts[13] , 0, r, -DZ, 1 );
|
||||
CP(mpCtrlPts[14] , 0, r, DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[10] , 0, r, DZ, 1 );
|
||||
CP(mpCtrlPts[11] , 0, R, DZ, 1 );
|
||||
CP(mpCtrlPts[12] , 0, R, -DZ, 1 );
|
||||
CP(mpCtrlPts[13] , 0, r, -DZ, 1 );
|
||||
CP(mpCtrlPts[14] , 0, r, DZ, 1 );
|
||||
CP(mpCtrlPts[15] , -r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[16] , -R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[17] , -R, R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[18] , -r, r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[19] , -r, r, DZ, 1 , sr2o2);
|
||||
|
||||
CP(mpCtrlPts[15] , -r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[16] , -R, R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[17] , -R, R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[18] , -r, r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[19] , -r, r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[20] , -r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[21] , -R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[22] , -R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[23] , -r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[24] , -r, 0, DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[20] , -r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[21] , -R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[22] , -R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[23] , -r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[24] , -r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[25] , -r,-r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[26] , -R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[27] , -R,-R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[28] , -r,-r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[29] , -r,-R, DZ, 1 , sr2o2);
|
||||
|
||||
CP(mpCtrlPts[25] , -r,-r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[26] , -R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[27] , -R,-R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[28] , -r,-r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[29] , -r,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[30] , 0,-r, DZ, 1 );
|
||||
CP(mpCtrlPts[31] , 0,-R, DZ, 1 );
|
||||
CP(mpCtrlPts[32] , 0,-R, -DZ, 1 );
|
||||
CP(mpCtrlPts[33] , 0,-r, -DZ, 1 );
|
||||
CP(mpCtrlPts[34] , 0,-r, DZ, 1 );
|
||||
|
||||
CP(mpCtrlPts[30] , 0,-r, DZ, 1 );
|
||||
CP(mpCtrlPts[31] , 0,-R, DZ, 1 );
|
||||
CP(mpCtrlPts[32] , 0,-R, -DZ, 1 );
|
||||
CP(mpCtrlPts[33] , 0,-r, -DZ, 1 );
|
||||
CP(mpCtrlPts[34] , 0,-r, DZ, 1 );
|
||||
CP(mpCtrlPts[35] , r,-r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[36] , R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[37] , R,-R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[38] , r,-r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[39] , r,-r, DZ, 1 , sr2o2);
|
||||
|
||||
CP(mpCtrlPts[35] , r,-r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[36] , R,-R, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[37] , R,-R, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[38] , r,-r, -DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[39] , r,-r, DZ, 1 , sr2o2);
|
||||
CP(mpCtrlPts[40] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[41] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[42] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[43] , r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[44] , r, 0, DZ, 1 );
|
||||
}
|
||||
|
||||
CP(mpCtrlPts[40] , r, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[41] , R, 0, DZ, 1 );
|
||||
CP(mpCtrlPts[42] , R, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[43] , r, 0, -DZ, 1 );
|
||||
CP(mpCtrlPts[44] , r, 0, DZ, 1 );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
G4Visible & G4NURBStube::operator = (const G4Visible &right) {
|
||||
G4Visible & G4NURBStube::operator = (const G4Visible &right)
|
||||
{
|
||||
return G4Visible::operator = (right);
|
||||
}
|
||||
|
||||
G4VVisPrim & G4NURBStube::operator = (const G4VVisPrim &right) {
|
||||
G4VVisPrim & G4NURBStube::operator = (const G4VVisPrim &right)
|
||||
{
|
||||
return G4VVisPrim::operator = (right);
|
||||
}
|
||||
|
||||
const char* G4NURBStube::Whoami() const
|
||||
{
|
||||
return "Tube";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const char* G4NURBStube::Whoami() const
|
||||
{
|
||||
return "Tube";
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NURBStubesector.cc,v 1.5 2001/07/11 10:01:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4NURBStubesector.cc,v 1.6 2003/04/03 15:31:07 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
@@ -31,207 +31,193 @@
|
||||
// OC 290896
|
||||
|
||||
#include "G4NURBStubesector.hh"
|
||||
|
||||
// for sqrt
|
||||
//#include <math.h>
|
||||
// cf cylinder
|
||||
|
||||
// for G4std::ostrstream
|
||||
#include "g4std/strstream"
|
||||
|
||||
G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
|
||||
G4double DZ, G4double PHI1, G4double PHI2)
|
||||
: G4NURBS( 2, 3, // linear along U, quadratic along V
|
||||
5, DecideNbrCtrlPts(PHI1, PHI2),
|
||||
// rectangle along U, required stuff along V
|
||||
// we must use a static function which
|
||||
// take the two angles because the
|
||||
// mother constructor is initialised
|
||||
// before everything
|
||||
Regular, // the knot vector along U will be generated
|
||||
RegularRep ) // circular like knot vector also
|
||||
{
|
||||
// check angles
|
||||
G4double deltaPHI = PHI2-PHI1;
|
||||
while (deltaPHI <= 0) { PHI2 += 2*M_PI; deltaPHI += 2*M_PI; };
|
||||
|
||||
G4NURBStubesector::G4NURBStubesector(G4double r, G4double R, G4double DZ, G4double PHI1, G4double PHI2)
|
||||
:
|
||||
G4NURBS (
|
||||
2, 3, // linear along U, quadratic along V
|
||||
5, DecideNbrCtrlPts(PHI1, PHI2),
|
||||
// rectangle along U, required stuff along V
|
||||
// we must use a static function which
|
||||
// take the two angles because the
|
||||
// mother constructor is initialised
|
||||
// before everything
|
||||
Regular, // the knot vector along U will be generated
|
||||
RegularRep // circular like knot vector also
|
||||
)
|
||||
{
|
||||
G4int f = (int)floor(deltaPHI / (M_PI_2)); //number of pi/2 arcs
|
||||
|
||||
// check angles
|
||||
G4double deltaPHI = PHI2-PHI1;
|
||||
while (deltaPHI <= 0) { PHI2 += 2*M_PI; deltaPHI += 2*M_PI; };
|
||||
const G4double mr = (r+R)/2;
|
||||
|
||||
G4int f = (int)floor(deltaPHI / (M_PI_2)); //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);
|
||||
|
||||
|
||||
// define control points
|
||||
CP(mpCtrlPts[ 0] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 1] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 2] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 3] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 4] , cp1*mr, sp1*mr, 0, 1 );
|
||||
|
||||
CP(mpCtrlPts[ 5] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 6] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 7] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 8] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 9] , cp1*mr, sp1*mr, 0, 1 );
|
||||
|
||||
CP(mpCtrlPts[10] , cp1*r, sp1*r, DZ, 1 );
|
||||
CP(mpCtrlPts[11] , cp1*R, sp1*R, DZ, 1 );
|
||||
CP(mpCtrlPts[12] , cp1*R, sp1*R, -DZ, 1 );
|
||||
CP(mpCtrlPts[13] , cp1*r, sp1*r, -DZ, 1 );
|
||||
CP(mpCtrlPts[14] , cp1*r, sp1*r, DZ, 1 );
|
||||
|
||||
t_indCtrlPt i = 15;
|
||||
G4double srcAngle = PHI1;
|
||||
G4double deltaAngleo2;
|
||||
|
||||
G4double destAngle = M_PI_2 + 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);
|
||||
|
||||
// to calculate the intermediate CP :
|
||||
// rotate by srcAngle the (1, tdao2) point
|
||||
const t_Coord x = csa - ssa*tdao2;
|
||||
const t_Coord y = ssa + csa*tdao2;
|
||||
|
||||
// weight of the CP
|
||||
const G4Float weight = (cos(deltaAngleo2));
|
||||
|
||||
// initialization. postfix ++ because i initialized to 15
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, -DZ, 1, weight);
|
||||
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);
|
||||
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);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
|
||||
// prepare next arc
|
||||
srcAngle = destAngle;
|
||||
destAngle += M_PI_2;
|
||||
};
|
||||
const G4double cp1 = cos(PHI1);
|
||||
const G4double sp1 = sin(PHI1);
|
||||
const G4double cp2 = cos(PHI2);
|
||||
const G4double sp2 = sin(PHI2);
|
||||
|
||||
|
||||
|
||||
// f == 0, final Arc
|
||||
// could be handled in the loops
|
||||
// define control points
|
||||
CP(mpCtrlPts[ 0] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 1] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 2] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 3] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 4] , cp1*mr, sp1*mr, 0, 1 );
|
||||
|
||||
destAngle = PHI2;
|
||||
deltaAngleo2 = (destAngle - srcAngle) / 2;
|
||||
const G4double csa = cos(srcAngle);
|
||||
const G4double ssa = sin(srcAngle);
|
||||
const G4double tdao2 = tan(deltaAngleo2);
|
||||
CP(mpCtrlPts[ 5] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 6] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 7] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 8] , cp1*mr, sp1*mr, 0, 1 );
|
||||
CP(mpCtrlPts[ 9] , cp1*mr, sp1*mr, 0, 1 );
|
||||
|
||||
// to calculate the intermediate CP :
|
||||
// rotate by srcAngle the (1, tdao2) point
|
||||
const t_Coord x = csa - ssa*tdao2;
|
||||
const t_Coord y = ssa + csa*tdao2;
|
||||
CP(mpCtrlPts[10] , cp1*r, sp1*r, DZ, 1 );
|
||||
CP(mpCtrlPts[11] , cp1*R, sp1*R, DZ, 1 );
|
||||
CP(mpCtrlPts[12] , cp1*R, sp1*R, -DZ, 1 );
|
||||
CP(mpCtrlPts[13] , cp1*r, sp1*r, -DZ, 1 );
|
||||
CP(mpCtrlPts[14] , cp1*r, sp1*r, DZ, 1 );
|
||||
|
||||
// weight of the CP
|
||||
const G4Float weight = (cos(deltaAngleo2));
|
||||
t_indCtrlPt i = 15;
|
||||
G4double srcAngle = PHI1;
|
||||
G4double deltaAngleo2;
|
||||
|
||||
// initialization.
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
G4double destAngle = M_PI_2 + PHI1;
|
||||
|
||||
// end CP
|
||||
const G4double cda = cos(destAngle);
|
||||
const G4double sda = 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);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
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);
|
||||
|
||||
/**/ if (i != (mtotnbrCtrlPts - 10) )
|
||||
{ G4cerr
|
||||
<< "\nERROR: G4NURBStubesector::G4NURBStubesector: wrong index,"
|
||||
<< i << " instead of " << (mtotnbrCtrlPts - 10)
|
||||
<< "\n\tIt sounds very strange. The tubesector won't be correct. Have a nice debuging!"
|
||||
<< G4endl;
|
||||
};
|
||||
// to calculate the intermediate CP :
|
||||
// rotate by srcAngle the (1, tdao2) point
|
||||
const t_Coord x = csa - ssa*tdao2;
|
||||
const t_Coord y = ssa + csa*tdao2;
|
||||
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
|
||||
// weight of the CP
|
||||
const G4Float weight = (cos(deltaAngleo2));
|
||||
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
// initialization. postfix ++ because i initialized to 15
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
|
||||
// possible to put a DZ DZ -DZ -DZ DZ column to scratch to a line instead of a point
|
||||
// end CP (which is the first CP of the next arc)
|
||||
const G4double cda = cos(destAngle);
|
||||
const G4double sda = 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);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
|
||||
// creating the nurbs identity
|
||||
mpwhoami = new char [200];
|
||||
G4std::ostrstream tmpstr(mpwhoami, 200);
|
||||
tmpstr << "Tubs" << " \tPHI1=" << PHI1 << " ; PHI2=" << PHI2 << '\0';
|
||||
// could be more sophisticated, reallocating
|
||||
// mpwhoami to the exact length
|
||||
|
||||
}
|
||||
// prepare next arc
|
||||
srcAngle = destAngle;
|
||||
destAngle += M_PI_2;
|
||||
}
|
||||
|
||||
// f == 0, final Arc
|
||||
// could be handled in the loops
|
||||
|
||||
G4Visible & G4NURBStubesector::operator = (const G4Visible &right) {
|
||||
destAngle = PHI2;
|
||||
deltaAngleo2 = (destAngle - srcAngle) / 2;
|
||||
const G4double csa = cos(srcAngle);
|
||||
const G4double ssa = sin(srcAngle);
|
||||
const G4double tdao2 = tan(deltaAngleo2);
|
||||
|
||||
// to calculate the intermediate CP :
|
||||
// rotate by srcAngle the (1, tdao2) point
|
||||
const t_Coord x = csa - ssa*tdao2;
|
||||
const t_Coord y = ssa + csa*tdao2;
|
||||
|
||||
// weight of the CP
|
||||
const G4Float weight = (cos(deltaAngleo2));
|
||||
|
||||
// initialization.
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*R, y*R, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, -DZ, 1, weight);
|
||||
CP(mpCtrlPts[i++], x*r, y*r, DZ, 1, weight);
|
||||
|
||||
// end CP
|
||||
const G4double cda = cos(destAngle);
|
||||
const G4double sda = 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);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, -DZ, 1);
|
||||
CP(mpCtrlPts[i++], cda*r, sda*r, DZ, 1);
|
||||
|
||||
if (i != (mtotnbrCtrlPts - 10) )
|
||||
{
|
||||
G4cerr << "\nERROR: G4NURBStubesector::G4NURBStubesector: wrong index,"
|
||||
<< i << " instead of " << (mtotnbrCtrlPts - 10)
|
||||
<< "\n\tThe tubesector won't be correct."
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
CP(mpCtrlPts[i++] , cp2*mr, sp2*mr, 0, 1);
|
||||
|
||||
// possible to put a DZ DZ -DZ -DZ DZ column to scratch
|
||||
// to a line instead of a point
|
||||
|
||||
// creating the nurbs identity
|
||||
mpwhoami = new char [200];
|
||||
G4std::ostrstream tmpstr(mpwhoami, 200);
|
||||
tmpstr << "Tubs" << " \tPHI1=" << PHI1 << " ; PHI2=" << PHI2 << '\0';
|
||||
// could be more sophisticated, reallocating
|
||||
// mpwhoami to the exact length
|
||||
}
|
||||
|
||||
G4Visible & G4NURBStubesector::operator = (const G4Visible &right)
|
||||
{
|
||||
return G4Visible::operator = (right);
|
||||
}
|
||||
|
||||
G4VVisPrim & G4NURBStubesector::operator = (const G4VVisPrim &right) {
|
||||
G4VVisPrim & G4NURBStubesector::operator = (const G4VVisPrim &right)
|
||||
{
|
||||
return G4VVisPrim::operator = (right);
|
||||
}
|
||||
|
||||
const char* G4NURBStubesector::Whoami() const
|
||||
{
|
||||
return mpwhoami;
|
||||
}
|
||||
const char* G4NURBStubesector::Whoami() const
|
||||
{
|
||||
return mpwhoami;
|
||||
}
|
||||
|
||||
G4NURBStubesector::~G4NURBStubesector()
|
||||
{
|
||||
if (mpwhoami) { delete [] mpwhoami; mpwhoami = NULL; };
|
||||
}
|
||||
G4NURBStubesector::~G4NURBStubesector()
|
||||
{
|
||||
if (mpwhoami) { delete [] mpwhoami; mpwhoami = 0; }
|
||||
}
|
||||
|
||||
G4NURBStubesector::t_inddCtrlPt
|
||||
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);
|
||||
|
||||
G4NURBStubesector::t_inddCtrlPt 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);
|
||||
// G4cerr << " k " << k << G4endl;
|
||||
// G4cerr << " fk " << floor(k) << G4endl;
|
||||
// G4cerr << " ifk " << ((int)(floor(k))) << G4endl;
|
||||
// G4cerr << " n " << (2*((int)(floor(k))) + 7) << G4endl;
|
||||
|
||||
// G4cerr << " k " << k << G4endl;
|
||||
// G4cerr << " fk " << floor(k) << G4endl;
|
||||
// G4cerr << " ifk " << ((int)(floor(k))) << G4endl;
|
||||
// G4cerr << " n " << (2*((int)(floor(k))) + 7) << G4endl;
|
||||
|
||||
return ( 2*((int)(floor(k))) + 7 );
|
||||
}
|
||||
return ( 2*((int)(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-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
|
||||
#include "G4PlacedPolyhedron.hh"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Point3DList.cc,v 1.5 2001/07/11 10:01:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Polyhedron.cc,v 1.11 2001/07/11 10:01:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4Polyhedron.cc,v 1.12 2003/04/03 15:31:07 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
|
||||
#include "G4Polyhedron.hh"
|
||||
|
||||
@@ -30,7 +30,9 @@ G4Polyhedron::G4Polyhedron () {}
|
||||
|
||||
G4Polyhedron::~G4Polyhedron () {}
|
||||
|
||||
G4Polyhedron::G4Polyhedron (const G4Polyhedron& from) {
|
||||
G4Polyhedron::G4Polyhedron (const G4Polyhedron& from)
|
||||
: HepPolyhedron(from), G4VVisPrim(from)
|
||||
{
|
||||
*this = from;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Polyline.cc,v 1.7 2001/08/14 18:24:58 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Polymarker.cc,v 1.7 2001/07/11 10:01:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison November 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Scale.cc,v 1.6 2002/11/27 12:24:01 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-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-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Text.cc,v 1.6 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VMarker.cc,v 1.7 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VVisPrim.cc,v 1.7 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison August 1995
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisAttributes.cc,v 1.8 2002/11/20 14:18:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 23rd October 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisExtent.cc,v 1.6 2001/07/24 21:39:50 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// A.Walkden 28/11/95
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Visible.cc,v 1.4 2001/07/11 10:01:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 30th October 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: HepPolyhedron.cc,v 1.12 2002/11/20 14:18:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user