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: G4VPhysicalVolume.cc,v 1.14 2007/04/11 08:00:12 gcosmo Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $ |
---|
29 | // |
---|
30 | // |
---|
31 | // class G4VPhysicalVolume Implementation |
---|
32 | // |
---|
33 | // -------------------------------------------------------------------- |
---|
34 | |
---|
35 | #include "G4VPhysicalVolume.hh" |
---|
36 | |
---|
37 | #include "G4PhysicalVolumeStore.hh" |
---|
38 | #include "G4LogicalVolume.hh" |
---|
39 | |
---|
40 | // Constructor: init parameters and register in Store |
---|
41 | // |
---|
42 | G4VPhysicalVolume::G4VPhysicalVolume( G4RotationMatrix *pRot, |
---|
43 | const G4ThreeVector &tlate, |
---|
44 | const G4String& pName, |
---|
45 | G4LogicalVolume* pLogical, |
---|
46 | G4VPhysicalVolume* ) |
---|
47 | : frot(pRot), ftrans(tlate), flogical(pLogical), |
---|
48 | fname(pName), flmother(0) |
---|
49 | { |
---|
50 | G4PhysicalVolumeStore::Register(this); |
---|
51 | } |
---|
52 | |
---|
53 | // Fake default constructor - sets only member data and allocates memory |
---|
54 | // for usage restricted to object persistency. |
---|
55 | // |
---|
56 | G4VPhysicalVolume::G4VPhysicalVolume( __void__& ) |
---|
57 | : frot(0), flogical(0), fname(""), flmother(0) |
---|
58 | { |
---|
59 | // Register to store |
---|
60 | // |
---|
61 | G4PhysicalVolumeStore::Register(this); |
---|
62 | } |
---|
63 | |
---|
64 | // Destructor - remove from Store |
---|
65 | // |
---|
66 | G4VPhysicalVolume::~G4VPhysicalVolume() |
---|
67 | { |
---|
68 | G4PhysicalVolumeStore::DeRegister(this); |
---|
69 | } |
---|
70 | |
---|
71 | G4int G4VPhysicalVolume::GetMultiplicity() const |
---|
72 | { |
---|
73 | return 1; |
---|
74 | } |
---|
75 | |
---|
76 | G4RotationMatrix* G4VPhysicalVolume::GetObjectRotation() const |
---|
77 | { |
---|
78 | static G4RotationMatrix aRotM; |
---|
79 | static G4RotationMatrix IdentityRM; // Never changed (from "1") |
---|
80 | G4RotationMatrix* retval; |
---|
81 | |
---|
82 | // Insure against frot being a null pointer |
---|
83 | if(frot) |
---|
84 | { |
---|
85 | aRotM= frot->inverse(); |
---|
86 | retval= &aRotM; |
---|
87 | } |
---|
88 | else |
---|
89 | { |
---|
90 | retval= &IdentityRM; |
---|
91 | } |
---|
92 | return retval; |
---|
93 | } |
---|
94 | |
---|
95 | // Only implemented for placed and parameterised volumes. |
---|
96 | // Not required for replicas. |
---|
97 | // |
---|
98 | G4bool G4VPhysicalVolume::CheckOverlaps(G4int, G4double, G4bool) |
---|
99 | { |
---|
100 | return false; |
---|
101 | } |
---|