Geant4  10.02
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: G4VNestedParameterisation.hh 73434 2013-08-27 11:06:16Z gcosmo $
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 G4Ellipsoid;
73 class G4Torus;
74 class G4Para;
75 class G4Polycone;
76 class G4Polyhedra;
77 class G4Hype;
78 
81 {
82  public: // with description
83 
85  virtual ~G4VNestedParameterisation();
86 
87  // Methods required in derived classes
88  // -----------------------------------
89 
90  virtual G4Material* ComputeMaterial(G4VPhysicalVolume* currentVol,
91  const G4int repNo,
92  const G4VTouchable* parentTouch=0) = 0;
93  // Required method, as it is the reason for this class.
94  // Must cope with parentTouch=0 for navigator's SetupHierarchy.
95 
96  virtual G4int GetNumberOfMaterials() const=0;
97  virtual G4Material* GetMaterial(G4int idx) const=0;
98  // Needed to define materials for instances of Nested Parameterisation
99  // Current convention: each call should return the materials
100  // of all instances with the same mother/ancestor volume.
101 
102  virtual void ComputeTransformation(const G4int no,
103  G4VPhysicalVolume* currentPV) const = 0;
104 
105  // Methods optional in derived classes
106  // -----------------------------------
107 
108  virtual G4VSolid* ComputeSolid(const G4int no, G4VPhysicalVolume *thisVol);
109  // Additional standard parameterisation methods,
110  // which can be optionally defined, in case solid is used.
111 
112  virtual void ComputeDimensions(G4Box &,
113  const G4int,
114  const G4VPhysicalVolume *) const {}
115 
116  virtual void ComputeDimensions(G4Tubs &,
117  const G4int,
118  const G4VPhysicalVolume *) const {}
119 
120  virtual void ComputeDimensions(G4Trd &,
121  const G4int,
122  const G4VPhysicalVolume *) const {}
123 
124  virtual void ComputeDimensions(G4Trap &,
125  const G4int,
126  const G4VPhysicalVolume *) const {}
127 
128  virtual void ComputeDimensions(G4Cons &,
129  const G4int,
130  const G4VPhysicalVolume *) const {}
131 
132  virtual void ComputeDimensions(G4Sphere &,
133  const G4int,
134  const G4VPhysicalVolume *) const {}
135 
136  virtual void ComputeDimensions(G4Orb &,
137  const G4int,
138  const G4VPhysicalVolume *) const {}
139 
141  const G4int,
142  const G4VPhysicalVolume *) const {}
143 
144  virtual void ComputeDimensions(G4Torus &,
145  const G4int,
146  const G4VPhysicalVolume *) const {}
147 
148  virtual void ComputeDimensions(G4Para &,
149  const G4int,
150  const G4VPhysicalVolume *) const {}
151 
153  const G4int,
154  const G4VPhysicalVolume *) const {}
155 
157  const G4int,
158  const G4VPhysicalVolume *) const {}
159 
160  virtual void ComputeDimensions(G4Hype &,
161  const G4int,
162  const G4VPhysicalVolume *) const {}
163 
164 
165  G4Material* ComputeMaterial(const G4int repNo,
166  G4VPhysicalVolume *currentVol,
167  const G4VTouchable *parentTouch=0);
168  // Method implemented in this class in terms of the above
169  // ComputeMaterial() method.
170 
171  virtual G4bool IsNested() const;
173  // Methods to identify nested parameterisations. Required in order
174  // to enable material scan for nested parameterisations.
175 };
176 
177 #endif
virtual G4Material * ComputeMaterial(G4VPhysicalVolume *currentVol, const G4int repNo, const G4VTouchable *parentTouch=0)=0
virtual G4bool IsNested() const
virtual G4VVolumeMaterialScanner * GetMaterialScanner()
Definition: G4Para.hh:77
virtual void ComputeDimensions(G4Ellipsoid &, const G4int, const G4VPhysicalVolume *) const
Definition: G4Box.hh:64
Definition: G4Tubs.hh:85
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions(G4Sphere &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions(G4Orb &, const G4int, const G4VPhysicalVolume *) const
virtual G4int GetNumberOfMaterials() const =0
Definition: G4Trd.hh:72
virtual G4VSolid * ComputeSolid(const G4int no, G4VPhysicalVolume *thisVol)
virtual void ComputeDimensions(G4Para &, const G4int, const G4VPhysicalVolume *) const
int G4int
Definition: G4Types.hh:78
virtual void ComputeDimensions(G4Cons &, const G4int, const G4VPhysicalVolume *) const
virtual G4Material * GetMaterial(G4int idx) const =0
virtual void ComputeDimensions(G4Polyhedra &, const G4int, const G4VPhysicalVolume *) const
Definition: G4Hype.hh:67
bool G4bool
Definition: G4Types.hh:79
Definition: G4Cons.hh:83
virtual void ComputeDimensions(G4Hype &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeTransformation(const G4int no, G4VPhysicalVolume *currentPV) const =0
virtual void ComputeDimensions(G4Trap &, const G4int, const G4VPhysicalVolume *) const
Definition: G4Orb.hh:61
virtual void ComputeDimensions(G4Tubs &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions(G4Polycone &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions(G4Torus &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions(G4Trd &, const G4int, const G4VPhysicalVolume *) const