[831] | 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.icc,v 1.14 2006/06/29 18:57:29 gunter Exp $ |
---|
[1058] | 28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $ |
---|
[831] | 29 | // |
---|
| 30 | // 1 October 1997 J.Apostolakis Initial version. |
---|
| 31 | // |
---|
| 32 | // ---------------------------------------------------------------------- |
---|
| 33 | |
---|
| 34 | #if defined G4GEOM_ALLOC_EXPORT |
---|
| 35 | extern G4DLLEXPORT G4Allocator<G4NavigationLevelRep> aNavigLevelRepAllocator; |
---|
| 36 | #else |
---|
| 37 | extern G4DLLIMPORT G4Allocator<G4NavigationLevelRep> aNavigLevelRepAllocator; |
---|
| 38 | #endif |
---|
| 39 | |
---|
| 40 | // Accessors |
---|
| 41 | // -------------- |
---|
| 42 | |
---|
| 43 | inline |
---|
| 44 | G4VPhysicalVolume* |
---|
| 45 | G4NavigationLevelRep::GetPhysicalVolume() |
---|
| 46 | { |
---|
| 47 | return sPhysicalVolumePtr; |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | inline |
---|
| 51 | const G4AffineTransform& |
---|
| 52 | G4NavigationLevelRep::GetTransform() const |
---|
| 53 | { |
---|
| 54 | return sTransform; |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | inline |
---|
| 58 | const G4AffineTransform* |
---|
| 59 | G4NavigationLevelRep::GetTransformPtr() const |
---|
| 60 | { |
---|
| 61 | return &sTransform; |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | inline |
---|
| 65 | EVolume G4NavigationLevelRep::GetVolumeType() const |
---|
| 66 | { |
---|
| 67 | return sVolumeType; |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | inline |
---|
| 71 | G4int G4NavigationLevelRep::GetReplicaNo() const |
---|
| 72 | { |
---|
| 73 | return sReplicaNo; |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | inline |
---|
| 77 | void G4NavigationLevelRep::AddAReference() |
---|
| 78 | { |
---|
| 79 | fCountRef++; |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | inline |
---|
| 83 | G4bool G4NavigationLevelRep::RemoveAReference() |
---|
| 84 | { |
---|
| 85 | return( --fCountRef <= 0 ); |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | // There is no provision that this class is subclassed. |
---|
| 89 | // If it is subclassed & new data members are added then the |
---|
| 90 | // following "new" & "delete" will fail and give errors. |
---|
| 91 | // |
---|
| 92 | inline |
---|
| 93 | void* G4NavigationLevelRep::operator new(size_t) |
---|
| 94 | { |
---|
| 95 | return (void *) aNavigLevelRepAllocator.MallocSingle(); |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | inline |
---|
| 99 | void G4NavigationLevelRep::operator delete(void *aLevelRep) |
---|
| 100 | { |
---|
| 101 | aNavigLevelRepAllocator.FreeSingle((G4NavigationLevelRep *) aLevelRep); |
---|
| 102 | } |
---|