| 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,v 1.2 2006/06/29 18:58:06 gunter Exp $
|
|---|
| 28 | // GEANT4 tag $Name: geant4-09-04-beta-01 $
|
|---|
| 29 | //
|
|---|
| 30 | // 1 October 1997 J.Apostolakis Initial version.
|
|---|
| 31 | //
|
|---|
| 32 | // ----------------------------------------------------------------------
|
|---|
| 33 |
|
|---|
| 34 | #include "G4NavigationLevelRep.hh"
|
|---|
| 35 |
|
|---|
| 36 | G4Allocator<G4NavigationLevelRep> aNavigLevelRepAllocator;
|
|---|
| 37 |
|
|---|
| 38 | // Constructors
|
|---|
| 39 | //--------------
|
|---|
| 40 |
|
|---|
| 41 | G4NavigationLevelRep::G4NavigationLevelRep( G4VPhysicalVolume* pPhysVol,
|
|---|
| 42 | const G4AffineTransform& afTransform,
|
|---|
| 43 | EVolume volTp,
|
|---|
| 44 | G4int repNo )
|
|---|
| 45 | : sTransform(afTransform),
|
|---|
| 46 | sPhysicalVolumePtr(pPhysVol),
|
|---|
| 47 | sReplicaNo(repNo),
|
|---|
| 48 | sVolumeType(volTp),
|
|---|
| 49 | fCountRef(1)
|
|---|
| 50 | {
|
|---|
| 51 | }
|
|---|
| 52 |
|
|---|
| 53 | G4NavigationLevelRep::G4NavigationLevelRep()
|
|---|
| 54 | : sTransform(),
|
|---|
| 55 | sPhysicalVolumePtr(0),
|
|---|
| 56 | sReplicaNo(-1),
|
|---|
| 57 | sVolumeType(kReplica),
|
|---|
| 58 | fCountRef(1)
|
|---|
| 59 | {
|
|---|
| 60 | }
|
|---|
| 61 |
|
|---|
| 62 | G4NavigationLevelRep::G4NavigationLevelRep( G4VPhysicalVolume* pPhysVol,
|
|---|
| 63 | const G4AffineTransform& levelAbove,
|
|---|
| 64 | const G4AffineTransform& relativeCurrent,
|
|---|
| 65 | EVolume volTp,
|
|---|
| 66 | G4int repNo )
|
|---|
| 67 | : sPhysicalVolumePtr(pPhysVol),
|
|---|
| 68 | sReplicaNo(repNo),
|
|---|
| 69 | sVolumeType(volTp),
|
|---|
| 70 | fCountRef(1)
|
|---|
| 71 | {
|
|---|
| 72 | sTransform.InverseProduct( levelAbove, relativeCurrent );
|
|---|
| 73 | }
|
|---|
| 74 |
|
|---|
| 75 | G4NavigationLevelRep::G4NavigationLevelRep( G4NavigationLevelRep& right )
|
|---|
| 76 | : sTransform(right.sTransform),
|
|---|
| 77 | sPhysicalVolumePtr(right.sPhysicalVolumePtr),
|
|---|
| 78 | sReplicaNo(right.sReplicaNo),
|
|---|
| 79 | sVolumeType(right.sVolumeType),
|
|---|
| 80 | fCountRef(1)
|
|---|
| 81 | {
|
|---|
| 82 | }
|
|---|
| 83 |
|
|---|
| 84 | // Destructor
|
|---|
| 85 | //--------------
|
|---|
| 86 |
|
|---|
| 87 | G4NavigationLevelRep::~G4NavigationLevelRep()
|
|---|
| 88 | {
|
|---|
| 89 | #ifdef DEBUG_NAVIG_LEVEL
|
|---|
| 90 | if(fCountRef>0)
|
|---|
| 91 | {
|
|---|
| 92 | G4cerr << "ERROR! - A G4NavigationLevelRep is being deleted that has"
|
|---|
| 93 | << G4endl << " positive reference count (fCountRef > 0) !"
|
|---|
| 94 | << G4endl;
|
|---|
| 95 | G4Exception("G4NavigationLevelRep::~G4NavigationLevelRep()",
|
|---|
| 96 | "MemoryCorruption", FatalException,
|
|---|
| 97 | "Deletion of data-level object with positive reference count.");
|
|---|
| 98 | }
|
|---|
| 99 | #endif
|
|---|
| 100 | }
|
|---|
| 101 |
|
|---|
| 102 | // Operators
|
|---|
| 103 | // --------------
|
|---|
| 104 |
|
|---|
| 105 | G4NavigationLevelRep&
|
|---|
| 106 | G4NavigationLevelRep::operator=( const G4NavigationLevelRep &right )
|
|---|
| 107 | {
|
|---|
| 108 | if ( &right != this )
|
|---|
| 109 | {
|
|---|
| 110 | sTransform = right.sTransform;
|
|---|
| 111 | sPhysicalVolumePtr = right.sPhysicalVolumePtr;
|
|---|
| 112 | sVolumeType = right.sVolumeType;
|
|---|
| 113 | sReplicaNo = right.sReplicaNo;
|
|---|
| 114 | fCountRef = right.fCountRef;
|
|---|
| 115 | }
|
|---|
| 116 | return *this;
|
|---|
| 117 | }
|
|---|