Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Conic.cc
Go to the documentation of this file.
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$
28 //
29 // ----------------------------------------------------------------------
30 // GEANT 4 class source file
31 //
32 // G4conic.cc
33 //
34 // ----------------------------------------------------------------------
35 
36 #include "G4Conic.hh"
37 
38 G4Conic::G4Conic () : pShift(0)
39 {
40 }
41 
43 {
44 }
45 
47  : G4Curve(), position(right.position), pShift(right.pShift)
48 {
49  bBox = right.bBox;
50  start = right.start;
51  end = right.end;
52  pStart = right.pStart;
53  pEnd = right.pEnd;
54  pRange = right.pRange;
55  bounded = right.bounded;
56  sameSense = right.sameSense;
57 }
58 
60 {
61  if (&right == this) return *this;
62 
63  pShift = right.pShift;
64  position = right.position;
65  bBox = right.bBox;
66  start = right.start;
67  end = right.end;
68  pStart = right.pStart;
69  pEnd = right.pEnd;
70  pRange = right.pRange;
71  bounded = right.bounded;
72  sameSense = right.sameSense;
73 
74  return *this;
75 }
76 
77 /*
78 void
79 G4ConicalCurve::ProjectCurve(const G4Plane& Pl1, const G4Plane& Pl2)
80 {
81  // Curve start
82  Project(ProjStart, Start, Pl1, Pl2);
83  // Curve end
84  Project(ProjEnd, End, Pl1, Pl2);
85  // Placement
86  Position.ProjectPlacement(Pl1,Pl2);
87 }
88 
89 G4int
90 G4ConicalCurve::HitPartOfCurve(G4double Angle, G4double Solution,
91  const G4Point2d& ProjHit)
92 {
93  // Check if Solution1 is part of the curve i.e. in the "pie"
94  G4double TmpSol1 = Solution - ProjHit.X();
95  G4Point2d ArcHit1(TmpSol1, ProjHit.Y());
96  G4double Cross1 = CrossProduct( ProjStart, ArcHit1);
97  G4double Cross2 = CrossProduct( ArcHit1 , ProjEnd);
98  if( (Angle<=0 && Cross1<=0 && Cross2 <=0) ||
99  (Angle> 0 && !(Cross1>=0 && Cross2 >=0)) )
100  // Solution1 is on the curve
101  return 1;
102  return 0;
103 }
104 */