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: G4GeomTestOverlapList.cc,v 1.3 2006/06/29 18:36:39 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-02-cand-01 $ |
---|
29 | // |
---|
30 | // -------------------------------------------------------------------- |
---|
31 | // GEANT 4 class source file |
---|
32 | // |
---|
33 | // G4GeomTestOverlapList |
---|
34 | // |
---|
35 | // Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu) |
---|
36 | // -------------------------------------------------------------------- |
---|
37 | |
---|
38 | #include "G4GeomTestOverlapList.hh" |
---|
39 | |
---|
40 | #include "G4VPhysicalVolume.hh" |
---|
41 | #include "G4LogicalVolume.hh" |
---|
42 | |
---|
43 | // |
---|
44 | // Constructor |
---|
45 | // |
---|
46 | G4GeomTestOverlapList::G4GeomTestOverlapList( |
---|
47 | const G4VPhysicalVolume *theMother, |
---|
48 | G4int theDaughter1, |
---|
49 | G4int theDaughter2 ) |
---|
50 | : G4GeomTestErrorList(theMother), |
---|
51 | daughter1(theDaughter1), |
---|
52 | daughter2(theDaughter2) |
---|
53 | {} |
---|
54 | |
---|
55 | |
---|
56 | // |
---|
57 | // Default constructor |
---|
58 | // |
---|
59 | G4GeomTestOverlapList::G4GeomTestOverlapList() |
---|
60 | : G4GeomTestErrorList(0), |
---|
61 | daughter1(0), |
---|
62 | daughter2(0) |
---|
63 | {} |
---|
64 | |
---|
65 | |
---|
66 | // |
---|
67 | // Destructor |
---|
68 | // |
---|
69 | G4GeomTestOverlapList::~G4GeomTestOverlapList() |
---|
70 | {} |
---|
71 | |
---|
72 | |
---|
73 | // |
---|
74 | // Comparison operators |
---|
75 | // |
---|
76 | G4bool |
---|
77 | G4GeomTestOverlapList::operator==( const G4GeomTestOverlapList &other ) const |
---|
78 | { |
---|
79 | return daughter1==other.daughter1 && daughter2==other.daughter2; |
---|
80 | } |
---|
81 | |
---|
82 | G4bool |
---|
83 | G4GeomTestOverlapList::operator< ( const G4GeomTestOverlapList &other ) const |
---|
84 | { |
---|
85 | if (daughter1 > other.daughter1) return false; |
---|
86 | if (daughter1 < other.daughter1) return true; |
---|
87 | |
---|
88 | return (daughter2 < other.daughter2); |
---|
89 | } |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | // |
---|
94 | // Accessors |
---|
95 | // |
---|
96 | const G4VPhysicalVolume *G4GeomTestOverlapList::GetDaughter1() const |
---|
97 | { |
---|
98 | return GetMother()->GetLogicalVolume()->GetDaughter(daughter1); |
---|
99 | } |
---|
100 | |
---|
101 | const G4VPhysicalVolume *G4GeomTestOverlapList::GetDaughter2() const |
---|
102 | { |
---|
103 | return GetMother()->GetLogicalVolume()->GetDaughter(daughter2); |
---|
104 | } |
---|
105 | |
---|
106 | G4int G4GeomTestOverlapList::GetDaughter1Index() const |
---|
107 | { |
---|
108 | return daughter1; |
---|
109 | } |
---|
110 | |
---|
111 | G4int G4GeomTestOverlapList::GetDaughter2Index() const |
---|
112 | { |
---|
113 | return daughter2; |
---|
114 | } |
---|
115 | |
---|
116 | |
---|
117 | // |
---|
118 | // GetDaught1Points |
---|
119 | // |
---|
120 | // Return start and end points in the coordinate system of |
---|
121 | // the first daughter |
---|
122 | // |
---|
123 | void G4GeomTestOverlapList::GetDaught1Points( G4int i, |
---|
124 | G4ThreeVector &s1, |
---|
125 | G4ThreeVector &s2 ) const |
---|
126 | { |
---|
127 | GetOneDaughtPoints( GetDaughter1(), i, s1, s2 ); |
---|
128 | } |
---|
129 | |
---|
130 | |
---|
131 | // |
---|
132 | // GetDaught2Points |
---|
133 | // |
---|
134 | // Return start and end points in the coordinate system of |
---|
135 | // the second daughter |
---|
136 | // |
---|
137 | void G4GeomTestOverlapList::GetDaught2Points( G4int i, |
---|
138 | G4ThreeVector &s1, |
---|
139 | G4ThreeVector &s2 ) const |
---|
140 | { |
---|
141 | GetOneDaughtPoints( GetDaughter2(), i, s1, s2 ); |
---|
142 | } |
---|