Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4GeomTestOverlapList.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 // G4GeomTestOverlapList
33 //
34 // Author: D.C.Williams, UCSC (davidw@scipp.ucsc.edu)
35 // --------------------------------------------------------------------
36 
37 #include "G4GeomTestOverlapList.hh"
38 
39 #include "G4VPhysicalVolume.hh"
40 #include "G4LogicalVolume.hh"
41 
42 //
43 // Constructor
44 //
46  const G4VPhysicalVolume *theMother,
47  G4int theDaughter1,
48  G4int theDaughter2 )
49  : G4GeomTestErrorList(theMother),
50  daughter1(theDaughter1),
51  daughter2(theDaughter2)
52 {}
53 
54 
55 //
56 // Default constructor
57 //
60  daughter1(0),
61  daughter2(0)
62 {}
63 
64 
65 //
66 // Destructor
67 //
69 {}
70 
71 
72 //
73 // Comparison operators
74 //
75 G4bool
77 {
78  return daughter1==other.daughter1 && daughter2==other.daughter2;
79 }
80 
81 G4bool
83 {
84  if (daughter1 > other.daughter1) return false;
85  if (daughter1 < other.daughter1) return true;
86 
87  return (daughter2 < other.daughter2);
88 }
89 
90 
91 
92 //
93 // Accessors
94 //
96 {
97  return GetMother()->GetLogicalVolume()->GetDaughter(daughter1);
98 }
99 
101 {
102  return GetMother()->GetLogicalVolume()->GetDaughter(daughter2);
103 }
104 
106 {
107  return daughter1;
108 }
109 
111 {
112  return daughter2;
113 }
114 
115 
116 //
117 // GetDaught1Points
118 //
119 // Return start and end points in the coordinate system of
120 // the first daughter
121 //
123  G4ThreeVector &s1,
124  G4ThreeVector &s2 ) const
125 {
126  GetOneDaughtPoints( GetDaughter1(), i, s1, s2 );
127 }
128 
129 
130 //
131 // GetDaught2Points
132 //
133 // Return start and end points in the coordinate system of
134 // the second daughter
135 //
137  G4ThreeVector &s1,
138  G4ThreeVector &s2 ) const
139 {
140  GetOneDaughtPoints( GetDaughter2(), i, s1, s2 );
141 }