Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4NavigationLevelRep.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: G4NavigationLevelRep.cc 67974 2013-03-13 10:17:37Z gcosmo $
28 //
29 // 1 October 1997 J.Apostolakis Initial version.
30 //
31 // ----------------------------------------------------------------------
32 
33 #include "G4NavigationLevelRep.hh"
34 
36 
37 // Constructors
38 //--------------
39 
41  const G4AffineTransform& afTransform,
42  EVolume volTp,
43  G4int repNo )
44  : sTransform(afTransform),
45  sPhysicalVolumePtr(pPhysVol),
46  sReplicaNo(repNo),
47  sVolumeType(volTp),
48  fCountRef(1)
49 {
50 }
51 
53  : sTransform(),
54  sPhysicalVolumePtr(0),
55  sReplicaNo(-1),
56  sVolumeType(kReplica),
57  fCountRef(1)
58 {
59 }
60 
62  const G4AffineTransform& levelAbove,
63  const G4AffineTransform& relativeCurrent,
64  EVolume volTp,
65  G4int repNo )
66  : sPhysicalVolumePtr(pPhysVol),
67  sReplicaNo(repNo),
68  sVolumeType(volTp),
69  fCountRef(1)
70 {
71  sTransform.InverseProduct( levelAbove, relativeCurrent );
72 }
73 
75  : sTransform(right.sTransform),
76  sPhysicalVolumePtr(right.sPhysicalVolumePtr),
77  sReplicaNo(right.sReplicaNo),
78  sVolumeType(right.sVolumeType),
79  fCountRef(1)
80 {
81 }
82 
83 // Destructor
84 //--------------
85 
87 {
88 #ifdef DEBUG_NAVIG_LEVEL
89  if(fCountRef>0)
90  {
91  G4Exception("G4NavigationLevelRep::~G4NavigationLevelRep()",
92  "GeomVol0003", FatalException,
93  "Deletion of data-level object with positive reference count.");
94  }
95 #endif
96 }
97 
98 // Operators
99 // --------------
100 
103 {
104  if ( &right != this )
105  {
106  sTransform = right.sTransform;
107  sPhysicalVolumePtr = right.sPhysicalVolumePtr;
108  sVolumeType = right.sVolumeType;
109  sReplicaNo = right.sReplicaNo;
110  fCountRef = right.fCountRef;
111  }
112  return *this;
113 }
#define G4ThreadLocal
Definition: tls.hh:52
int G4int
Definition: G4Types.hh:78
G4AffineTransform & InverseProduct(const G4AffineTransform &tf1, const G4AffineTransform &tf2)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4ThreadLocal G4Allocator< G4NavigationLevelRep > * aNavigLevelRepAllocator
EVolume
Definition: geomdefs.hh:68
G4NavigationLevelRep & operator=(const G4NavigationLevelRep &right)