Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VNestedParameterisation.hh
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$
28 //
29 // class G4VNestedParameterisation
30 //
31 // Class description:
32 //
33 // Base class for parameterisations that use information from the parent
34 // volume to compute the material of a copy/instance of this volume.
35 // This is in addition to using the current replication number.
36 //
37 // Notes:
38 // - Such a volume can be nested inside a placement volume or a parameterised
39 // volume.
40 // - The user can modify the solid type, size or transformation using only
41 // the replication number of this parameterised volume.
42 // He/she is NOT allowed to change these attributes using information of
43 // parent volumes - otherwise incorrect results will occur.
44 // Also note that the usual restrictions apply:
45 // - the mother volume, in which these copies are placed, must always be
46 // of the same dimensions
47 
48 // History:
49 // 24.02.05 - J.Apostolakis - First created version.
50 // --------------------------------------------------------------------
51 #ifndef G4VNESTEDPARAMETERISATION_HH
52 #define G4VNESTEDPARAMETERISATION_HH
53 
54 #include "G4Types.hh"
55 #include "G4VPVParameterisation.hh"
57 
58 class G4VPhysicalVolume;
59 class G4VTouchable;
60 class G4VSolid;
61 class G4Material;
62 
63 // CSG Entities which may be parameterised/replicated
64 //
65 class G4Box;
66 class G4Tubs;
67 class G4Trd;
68 class G4Trap;
69 class G4Cons;
70 class G4Sphere;
71 class G4Orb;
72 class G4Torus;
73 class G4Para;
74 class G4Polycone;
75 class G4Polyhedra;
76 class G4Hype;
77 
80 {
81  public: // with description
82 
84  virtual ~G4VNestedParameterisation();
85 
86  // Methods required in derived classes
87  // -----------------------------------
88 
89  virtual G4Material* ComputeMaterial(G4VPhysicalVolume* currentVol,
90  const G4int repNo,
91  const G4VTouchable* parentTouch=0) = 0;
92  // Required method, as it is the reason for this class.
93  // Must cope with parentTouch=0 for navigator's SetupHierarchy.
94 
95  virtual G4int GetNumberOfMaterials() const=0;
96  virtual G4Material* GetMaterial(G4int idx) const=0;
97  // Needed to define materials for instances of Nested Parameterisation
98  // Current convention: each call should return the materials
99  // of all instances with the same mother/ancestor volume.
100 
101  virtual void ComputeTransformation(const G4int no,
102  G4VPhysicalVolume* currentPV) const = 0;
103 
104  // Methods optional in derived classes
105  // -----------------------------------
106 
107  virtual G4VSolid* ComputeSolid(const G4int no, G4VPhysicalVolume *thisVol);
108  // Additional standard parameterisation methods,
109  // which can be optionally defined, in case solid is used.
110 
111  virtual void ComputeDimensions(G4Box &,
112  const G4int,
113  const G4VPhysicalVolume *) const {}
114 
115  virtual void ComputeDimensions(G4Tubs &,
116  const G4int,
117  const G4VPhysicalVolume *) const {}
118 
119  virtual void ComputeDimensions(G4Trd &,
120  const G4int,
121  const G4VPhysicalVolume *) const {}
122 
123  virtual void ComputeDimensions(G4Trap &,
124  const G4int,
125  const G4VPhysicalVolume *) const {}
126 
127  virtual void ComputeDimensions(G4Cons &,
128  const G4int,
129  const G4VPhysicalVolume *) const {}
130 
131  virtual void ComputeDimensions(G4Sphere &,
132  const G4int,
133  const G4VPhysicalVolume *) const {}
134 
135  virtual void ComputeDimensions(G4Orb &,
136  const G4int,
137  const G4VPhysicalVolume *) const {}
138 
139  virtual void ComputeDimensions(G4Torus &,
140  const G4int,
141  const G4VPhysicalVolume *) const {}
142 
143  virtual void ComputeDimensions(G4Para &,
144  const G4int,
145  const G4VPhysicalVolume *) const {}
146 
148  const G4int,
149  const G4VPhysicalVolume *) const {}
150 
152  const G4int,
153  const G4VPhysicalVolume *) const {}
154 
155  virtual void ComputeDimensions(G4Hype &,
156  const G4int,
157  const G4VPhysicalVolume *) const {}
158 
159 
160  G4Material* ComputeMaterial(const G4int repNo,
161  G4VPhysicalVolume *currentVol,
162  const G4VTouchable *parentTouch=0);
163  // Method implemented in this class in terms of the above
164  // ComputeMaterial() method.
165 
166  virtual G4bool IsNested() const;
168  // Methods to identify nested parameterisations. Required in order
169  // to enable material scan for nested parameterisations.
170 };
171 
172 #endif