Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:21:31

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4NavigationLevel
0027 //
0028 // Class description:
0029 //
0030 // Maintains one level of the geometrical hierarchy.
0031 // A utility class for use by G4NavigationHistory.
0032 
0033 // Author: John Apostolakis (CERN), 30.09.1997 - Initial version
0034 //         Services derived from requirements of touchables & G4NavigatorHistory
0035 // ----------------------------------------------------------------------
0036 #ifndef G4NAVIGATIONLEVEL_HH
0037 #define G4NAVIGATIONLEVEL_HH
0038 
0039 #include "G4Types.hh"
0040 
0041 #include "G4AffineTransform.hh"
0042 #include "G4VPhysicalVolume.hh"
0043 
0044 #include "G4NavigationLevelRep.hh"
0045 #include "G4Allocator.hh"
0046 
0047 #include "geomwdefs.hh"
0048 
0049 /**
0050  * @brief G4NavigationLevel is a utility class for use by G4NavigationHistory.
0051  * It maintains one level of the geometrical hierarchy.
0052  */
0053 
0054 class G4NavigationLevel
0055 {
0056   public:
0057 
0058     /**
0059      * Constructor for G4NavigationLevel.
0060      *  @param[in] newPtrPhysVol Pointer to the new physical volume.
0061      *  @param[in] newT The associated affine transformation.
0062      *  @param[in] newVolTp The volume type.
0063      *  @param[in] newRepNo The replica number.
0064      */
0065     G4NavigationLevel(G4VPhysicalVolume* newPtrPhysVol,
0066                       const G4AffineTransform& newT,
0067                       EVolume newVolTp,
0068                       G4int newRepNo = -1);
0069 
0070     /**
0071      * Alternative Constructor for G4NavigationLevel, as the previous
0072      * constructor, but instead of giving the new transformation, give 
0073      * the affine transformation to the level above and the current level's 
0074      * transformation relative to that.
0075      *  @param[in] newPtrPhysVol Pointer to the new physical volume.
0076      *  @param[in] levelAbove The affine transformation to the level above.
0077      *  @param[in] relativeCurrent The affine transformation at current level.
0078      *  @param[in] newVolTp The volume type.
0079      *  @param[in] newRepNo The replica number.
0080      */
0081     G4NavigationLevel(G4VPhysicalVolume* newPtrPhysVol,
0082                       const G4AffineTransform& levelAbove,
0083                       const G4AffineTransform& relativeCurrent,
0084                       EVolume newVolTp,
0085                       G4int newRepNo = -1);
0086 
0087     /**
0088      * Default Constructor & Destructor.
0089      */
0090     G4NavigationLevel();
0091     ~G4NavigationLevel();
0092 
0093     /**
0094      * Copy constructor and assignment operator.
0095      */
0096     G4NavigationLevel( const G4NavigationLevel& );
0097     G4NavigationLevel& operator=(const G4NavigationLevel& );
0098 
0099     /**
0100      * Returns a pointer to the physical volume at the current level.
0101      */
0102     inline G4VPhysicalVolume* GetPhysicalVolume() const;
0103 
0104     /**
0105      * Methods to return the associated affine transformation.
0106      */
0107     inline const G4AffineTransform* GetTransformPtr() const ;  // New
0108     inline const G4AffineTransform& GetTransform() const ;     // Old
0109     inline const G4AffineTransform* GetPtrTransform() const;
0110 
0111     /**
0112      * Returns the volume type.
0113      */
0114     inline EVolume GetVolumeType() const ;
0115 
0116     /**
0117      * Returns the replica number.
0118      */
0119     inline G4int GetReplicaNo() const ;
0120 
0121     /**
0122      * New/delete operator overrides for use by "G4Allocator".
0123      */
0124     inline void* operator new(size_t);
0125     inline void operator delete(void* aLevel);
0126 
0127     /**
0128      * New/delete operator overrides for use with STL.
0129      */
0130     inline void* operator new(size_t, void*);
0131     inline void operator delete(void* ptr, void*); // Not (directly) using
0132                                                    // allocator.
0133   private:
0134 
0135     G4NavigationLevelRep* fLevelRep;
0136 };
0137 
0138 #include "G4NavigationLevel.icc"
0139 
0140 #endif