[831] | 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: G4Conic.cc,v 1.8 2006/06/29 18:41:56 gunter Exp $ |
---|
[1228] | 28 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
[831] | 29 | // |
---|
| 30 | // ---------------------------------------------------------------------- |
---|
| 31 | // GEANT 4 class source file |
---|
| 32 | // |
---|
| 33 | // G4conic.cc |
---|
| 34 | // |
---|
| 35 | // ---------------------------------------------------------------------- |
---|
| 36 | |
---|
| 37 | #include "G4Conic.hh" |
---|
| 38 | |
---|
| 39 | G4Conic::G4Conic () : pShift(0) |
---|
| 40 | { |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | G4Conic::~G4Conic() |
---|
| 44 | { |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | G4Conic::G4Conic(const G4Conic& right) |
---|
| 48 | : G4Curve(), position(right.position), pShift(right.pShift) |
---|
| 49 | { |
---|
| 50 | bBox = right.bBox; |
---|
| 51 | start = right.start; |
---|
| 52 | end = right.end; |
---|
| 53 | pStart = right.pStart; |
---|
| 54 | pEnd = right.pEnd; |
---|
| 55 | pRange = right.pRange; |
---|
| 56 | bounded = right.bounded; |
---|
| 57 | sameSense = right.sameSense; |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | G4Conic& G4Conic::operator=(const G4Conic& right) |
---|
| 61 | { |
---|
| 62 | if (&right == this) return *this; |
---|
| 63 | |
---|
| 64 | pShift = right.pShift; |
---|
| 65 | position = right.position; |
---|
| 66 | bBox = right.bBox; |
---|
| 67 | start = right.start; |
---|
| 68 | end = right.end; |
---|
| 69 | pStart = right.pStart; |
---|
| 70 | pEnd = right.pEnd; |
---|
| 71 | pRange = right.pRange; |
---|
| 72 | bounded = right.bounded; |
---|
| 73 | sameSense = right.sameSense; |
---|
| 74 | |
---|
| 75 | return *this; |
---|
| 76 | } |
---|
| 77 | |
---|
| 78 | /* |
---|
| 79 | void |
---|
| 80 | G4ConicalCurve::ProjectCurve(const G4Plane& Pl1, const G4Plane& Pl2) |
---|
| 81 | { |
---|
| 82 | // Curve start |
---|
| 83 | Project(ProjStart, Start, Pl1, Pl2); |
---|
| 84 | // Curve end |
---|
| 85 | Project(ProjEnd, End, Pl1, Pl2); |
---|
| 86 | // Placement |
---|
| 87 | Position.ProjectPlacement(Pl1,Pl2); |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | G4int |
---|
| 91 | G4ConicalCurve::HitPartOfCurve(G4double Angle, G4double Solution, |
---|
| 92 | const G4Point2d& ProjHit) |
---|
| 93 | { |
---|
| 94 | // Check if Solution1 is part of the curve i.e. in the "pie" |
---|
| 95 | G4double TmpSol1 = Solution - ProjHit.X(); |
---|
| 96 | G4Point2d ArcHit1(TmpSol1, ProjHit.Y()); |
---|
| 97 | G4double Cross1 = CrossProduct( ProjStart, ArcHit1); |
---|
| 98 | G4double Cross2 = CrossProduct( ArcHit1 , ProjEnd); |
---|
| 99 | if( (Angle<=0 && Cross1<=0 && Cross2 <=0) || |
---|
| 100 | (Angle> 0 && !(Cross1>=0 && Cross2 >=0)) ) |
---|
| 101 | // Solution1 is on the curve |
---|
| 102 | return 1; |
---|
| 103 | return 0; |
---|
| 104 | } |
---|
| 105 | */ |
---|