1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // $Id: G4BREPIOtest.cc,v 1.6 2006/06/29 18:43:05 gunter Exp $ |
---|
27 | // GEANT4 tag $Name: geant4-09-04-ref-00 $ |
---|
28 | // |
---|
29 | // ---------------------------------------------------------------------- |
---|
30 | // GEANT 4 source file |
---|
31 | // ---------------------------------------------------------------------- |
---|
32 | #include "G4BREPSolid.hh" |
---|
33 | #include "G4BREPSolidBox.hh" |
---|
34 | #include "G4BREPSolidCone.hh" |
---|
35 | #include "G4BREPSolidCylinder.hh" |
---|
36 | #include "G4BREPSolidOpenPCone.hh" |
---|
37 | #include "G4BREPSolidPCone.hh" |
---|
38 | #include "G4BREPSolidPolyhedra.hh" |
---|
39 | #include "G4BREPSolidSphere.hh" |
---|
40 | #include "G4BREPSolidTorus.hh" |
---|
41 | |
---|
42 | #include <iostream> |
---|
43 | |
---|
44 | |
---|
45 | int main() |
---|
46 | { |
---|
47 | G4cout << "Testing generic BREP solid:" << G4endl; |
---|
48 | G4BREPSolid gbs("Generic BREP"); |
---|
49 | G4cout << gbs << G4endl; |
---|
50 | |
---|
51 | G4cout << "Testing BREP Box solid:" << G4endl; |
---|
52 | G4BREPSolidBox bb("BREP Box", |
---|
53 | G4Point3D( 1, 1, 1), G4Point3D( 1,-1, 1), G4Point3D(-1,-1, 1), G4Point3D(-1, 1, 1), |
---|
54 | G4Point3D( 1, 1,-1), G4Point3D( 1,-1,-1), G4Point3D(-1,-1,-1), G4Point3D(-1, 1,-1) |
---|
55 | ); |
---|
56 | G4cout << bb << G4endl; |
---|
57 | |
---|
58 | G4cout << "Testing BREP Cone solid:" << G4endl; |
---|
59 | G4BREPSolidCone bc("BREP Cone", |
---|
60 | G4ThreeVector( 0, 0, 0 ), G4ThreeVector( 0, 0, 1 ), G4ThreeVector( 1, 0, 0 ), |
---|
61 | 10*mm, 5*mm, 10*mm |
---|
62 | ); |
---|
63 | G4cout << bc << G4endl; |
---|
64 | |
---|
65 | G4cout << "Testing BREP Cylinder solid:" << G4endl; |
---|
66 | G4BREPSolidCylinder bcyl("BREP Cylinder", |
---|
67 | G4ThreeVector( 0, 0, 0 ), G4ThreeVector( 0, 0, 1 ), G4ThreeVector( 1, 0, 0 ), |
---|
68 | 10*mm, 5*mm |
---|
69 | ); |
---|
70 | G4cout << bcyl << G4endl; |
---|
71 | |
---|
72 | G4cout << "Testing BREP Open PolyCone solid:" << G4endl; |
---|
73 | |
---|
74 | G4double zVals[4] = { -12000*mm, -11500*mm, -11500*mm, -11000*mm }; |
---|
75 | G4double rMins[4] = { 100*mm, 0*mm, 0*mm, 100*mm }; |
---|
76 | G4double rMaxs[4] = { 100*mm, 2000*mm, 1000*mm, 100*mm }; |
---|
77 | |
---|
78 | G4BREPSolidOpenPCone bopc( "BREPS OpenPCone", |
---|
79 | 0.0*rad, twopi*rad, |
---|
80 | 4, zVals[0], zVals, |
---|
81 | rMins, rMaxs |
---|
82 | ); |
---|
83 | |
---|
84 | G4cout << bopc << G4endl; |
---|
85 | |
---|
86 | G4cout << "Testing BREP PolyCone solid:" << G4endl; |
---|
87 | |
---|
88 | G4BREPSolidPCone bpc( "BREP PolyCone", |
---|
89 | 0.0*rad, twopi*rad, |
---|
90 | 4, zVals[0], zVals, |
---|
91 | rMins, rMaxs |
---|
92 | ); |
---|
93 | |
---|
94 | G4cout << bpc << G4endl; |
---|
95 | |
---|
96 | G4cout << "Testing BREP Polyhedra solid:" << G4endl; |
---|
97 | |
---|
98 | #define VECSIZE 3 |
---|
99 | G4int Sides = 4; |
---|
100 | G4double RMINVec[VECSIZE] = { 0, 0, 0 }; |
---|
101 | G4double RMAXVec[VECSIZE] = { 700, 0, 700 }; |
---|
102 | G4double Z_Values[VECSIZE] = { 3500, 4000, 4500 }; |
---|
103 | |
---|
104 | G4BREPSolidPolyhedra bph( "BREP Polyhedra", |
---|
105 | pi/2, 2*pi, Sides, VECSIZE, 3500, |
---|
106 | Z_Values, RMINVec, RMAXVec |
---|
107 | ); |
---|
108 | |
---|
109 | G4cout << bph << G4endl; |
---|
110 | |
---|
111 | G4cout << "Testing BREP Sphere solid:" << G4endl; |
---|
112 | G4BREPSolidSphere bsph("BREP Sphere", |
---|
113 | G4ThreeVector( 0, 0, 0 ), G4ThreeVector( 1, 0, 0 ), G4ThreeVector( 0, 0, 1 ), 10*mm |
---|
114 | ); |
---|
115 | G4cout << bsph << G4endl; |
---|
116 | |
---|
117 | G4cout << "Testing BREP Torus solid:" << G4endl; |
---|
118 | G4BREPSolidTorus btor("BREP Torus", |
---|
119 | G4ThreeVector( 0, 0, 0 ), G4ThreeVector( 1, 0, 0 ), G4ThreeVector( 0, 0, 1 ), 5*mm, 10*mm |
---|
120 | ); |
---|
121 | G4cout << btor << G4endl; |
---|
122 | |
---|
123 | return 0; |
---|
124 | } |
---|