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 | ////////////////////////////////////////////////////////////////////////// |
---|
27 | // $Id: G4BREPSolidConeTest.cc,v 1.11 2006/06/29 18:43:09 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-04-ref-00 $ |
---|
29 | ////////////////////////////////////////////////////////////////////////// |
---|
30 | // |
---|
31 | // |
---|
32 | // BREP solid test, create by L. Broglia, 20/10/98 |
---|
33 | // modification of old G4Gerep test |
---|
34 | // |
---|
35 | |
---|
36 | #include "G4Timer.hh" |
---|
37 | #include <cmath> |
---|
38 | #include <fstream> |
---|
39 | #include "G4ios.hh" |
---|
40 | #include "G4BREPSolid.hh" |
---|
41 | #include "G4BREPSolidCone.hh" |
---|
42 | |
---|
43 | |
---|
44 | int main() |
---|
45 | { |
---|
46 | |
---|
47 | G4ThreeVector tStart(19000,0,10.1); |
---|
48 | G4ThreeVector tDir(-1,0,0); |
---|
49 | G4ThreeVector tStart2(0,0,10); |
---|
50 | G4ThreeVector pt(0,0,50); |
---|
51 | G4ThreeVector pt2(100000,0,50); |
---|
52 | double Dist; |
---|
53 | |
---|
54 | |
---|
55 | G4cout << "\n ============ Cone test ================"; |
---|
56 | |
---|
57 | G4BREPSolidCone *MyConBox = new G4BREPSolidCone ("MyConBox" , |
---|
58 | G4ThreeVector(0,0,0), |
---|
59 | G4ThreeVector(0,0,1), |
---|
60 | G4ThreeVector(1,0,0), |
---|
61 | 1000.0 , |
---|
62 | 0.0 , |
---|
63 | 101.0 ); |
---|
64 | |
---|
65 | G4cout << "\n\nCone created ! "; |
---|
66 | G4cout << "\nDir = -1,0,0"; |
---|
67 | G4cout << "\nStart 19000,1,0"; |
---|
68 | Dist = MyConBox->DistanceToIn(tStart, tDir); |
---|
69 | G4cout << "\nDist to in : " << Dist; |
---|
70 | MyConBox->Reset(); |
---|
71 | |
---|
72 | Dist = MyConBox->DistanceToOut(tStart2, tDir); |
---|
73 | G4cout << "\nStart 0,0,0"; |
---|
74 | G4cout << "\nDist to out: " << Dist ; |
---|
75 | |
---|
76 | Dist = MyConBox->DistanceToOut(pt); |
---|
77 | G4cout << "\nPoint 0,0,50"; |
---|
78 | G4cout << "\nDist to out: " << Dist ; |
---|
79 | |
---|
80 | Dist = MyConBox->DistanceToIn(pt2); |
---|
81 | G4cout << "\nPoint 100000,0,50"; |
---|
82 | G4cout << "\nDist to in: " << Dist << G4endl; |
---|
83 | |
---|
84 | |
---|
85 | return EXIT_SUCCESS; |
---|
86 | } |
---|
87 | |
---|