G4VNestedParameterisation.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // class G4VNestedParameterisation
00030 //
00031 // Class description:
00032 //
00033 // Base class for parameterisations that use information from the parent
00034 // volume to compute the material of a copy/instance of this volume. 
00035 // This is in addition to using the current replication number.
00036 // 
00037 // Notes:
00038 //  - Such a volume can be nested inside a placement volume or a parameterised  
00039 //    volume.
00040 //  - The user can modify the solid type, size or transformation using only
00041 //    the replication number of this parameterised volume.
00042 //    He/she is NOT allowed to change these attributes using information of
00043 //    parent volumes - otherwise incorrect results will occur.
00044 //  Also note that the usual restrictions apply: 
00045 //   - the mother volume, in which these copies are placed, must always be
00046 //     of the same dimensions
00047 
00048 // History:
00049 // 24.02.05 - J.Apostolakis - First created version.
00050 // --------------------------------------------------------------------
00051 #ifndef G4VNESTEDPARAMETERISATION_HH
00052 #define G4VNESTEDPARAMETERISATION_HH
00053 
00054 #include "G4Types.hh"
00055 #include "G4VPVParameterisation.hh" 
00056 #include "G4VVolumeMaterialScanner.hh"
00057 
00058 class G4VPhysicalVolume;
00059 class G4VTouchable; 
00060 class G4VSolid;
00061 class G4Material;
00062 
00063 // CSG Entities which may be parameterised/replicated
00064 //
00065 class G4Box;
00066 class G4Tubs;
00067 class G4Trd;
00068 class G4Trap;
00069 class G4Cons;
00070 class G4Sphere;
00071 class G4Orb;
00072 class G4Torus;
00073 class G4Para;
00074 class G4Polycone;
00075 class G4Polyhedra;
00076 class G4Hype;
00077 
00078 class G4VNestedParameterisation: public G4VPVParameterisation, 
00079                                  public G4VVolumeMaterialScanner
00080 {
00081   public:  // with description
00082 
00083     G4VNestedParameterisation(); 
00084     virtual ~G4VNestedParameterisation(); 
00085 
00086     // Methods required in derived classes
00087     // -----------------------------------
00088 
00089     virtual G4Material* ComputeMaterial(G4VPhysicalVolume* currentVol,
00090                                         const G4int repNo, 
00091                                         const G4VTouchable* parentTouch=0) = 0;
00092       // Required method, as it is the reason for this class.
00093       // Must cope with parentTouch=0 for navigator's SetupHierarchy.
00094 
00095     virtual G4int       GetNumberOfMaterials() const=0;
00096     virtual G4Material* GetMaterial(G4int idx) const=0;
00097       // Needed to define materials for instances of Nested Parameterisation 
00098       // Current convention: each call should return the materials 
00099       // of all instances with the same mother/ancestor volume.
00100 
00101     virtual void ComputeTransformation(const G4int no,
00102                                        G4VPhysicalVolume* currentPV) const = 0;
00103 
00104     // Methods optional in derived classes
00105     // -----------------------------------
00106 
00107     virtual G4VSolid* ComputeSolid(const G4int no, G4VPhysicalVolume *thisVol);
00108       // Additional standard parameterisation methods, 
00109       // which can be optionally defined, in case solid is used.
00110 
00111     virtual void ComputeDimensions(G4Box &,
00112                                    const G4int,
00113                                    const G4VPhysicalVolume *) const {}
00114 
00115     virtual void ComputeDimensions(G4Tubs &,
00116                                    const G4int,
00117                                    const G4VPhysicalVolume *) const {}
00118 
00119     virtual void ComputeDimensions(G4Trd &,
00120                                    const G4int,
00121                                    const G4VPhysicalVolume *) const {}
00122 
00123     virtual void ComputeDimensions(G4Trap &,
00124                                    const G4int,
00125                                    const G4VPhysicalVolume *) const {}
00126 
00127     virtual void ComputeDimensions(G4Cons &,
00128                                    const G4int,
00129                                    const G4VPhysicalVolume *) const {}
00130 
00131     virtual void ComputeDimensions(G4Sphere &,
00132                                    const G4int,
00133                                    const G4VPhysicalVolume *) const {}
00134 
00135     virtual void ComputeDimensions(G4Orb &,
00136                                    const G4int,
00137                                    const G4VPhysicalVolume *) const {}
00138 
00139     virtual void ComputeDimensions(G4Torus &,
00140                                    const G4int,
00141                                    const G4VPhysicalVolume *) const {}
00142 
00143     virtual void ComputeDimensions(G4Para &,
00144                                    const G4int,
00145                                    const G4VPhysicalVolume *) const {}
00146 
00147     virtual void ComputeDimensions(G4Polycone &,
00148                                    const G4int,
00149                                    const G4VPhysicalVolume *) const {}
00150 
00151     virtual void ComputeDimensions(G4Polyhedra &,
00152                                    const G4int,
00153                                    const G4VPhysicalVolume *) const {}
00154 
00155     virtual void ComputeDimensions(G4Hype &,
00156                                    const G4int,
00157                                    const G4VPhysicalVolume *) const {}
00158  
00159 
00160     G4Material* ComputeMaterial(const G4int repNo, 
00161                                       G4VPhysicalVolume *currentVol,
00162                                 const G4VTouchable *parentTouch=0);
00163       // Method implemented in this class in terms of the above
00164       // ComputeMaterial() method.
00165 
00166     virtual G4bool IsNested() const;
00167     virtual G4VVolumeMaterialScanner* GetMaterialScanner(); 
00168       // Methods to identify nested parameterisations. Required in order
00169       // to enable material scan for nested parameterisations.
00170 };
00171 
00172 #endif

Generated on Mon May 27 17:50:18 2013 for Geant4 by  doxygen 1.4.7