File indexing completed on 2025-01-18 09:58:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #ifndef G4GDMLPARAMETERISATION_HH
0035 #define G4GDMLPARAMETERISATION_HH 1
0036
0037 #include "G4VPVParameterisation.hh"
0038 #include "G4VPhysicalVolume.hh"
0039 #include "G4ThreeVector.hh"
0040 #include "G4Box.hh"
0041 #include "G4Trd.hh"
0042 #include "G4Trap.hh"
0043 #include "G4Cons.hh"
0044 #include "G4Sphere.hh"
0045 #include "G4Orb.hh"
0046 #include "G4Ellipsoid.hh"
0047 #include "G4Polycone.hh"
0048 #include "G4Polyhedra.hh"
0049 #include "G4Torus.hh"
0050 #include "G4Para.hh"
0051 #include "G4Hype.hh"
0052 #include "G4Tubs.hh"
0053 #include "G4Polycone.hh"
0054 #include "G4Polyhedra.hh"
0055 #include "G4RotationMatrix.hh"
0056 #include "G4ThreeVector.hh"
0057
0058 #include <vector>
0059
0060 class G4GDMLParameterisation : public G4VPVParameterisation
0061 {
0062 public:
0063
0064 struct PARAMETER
0065 {
0066 G4RotationMatrix* pRot = nullptr;
0067 G4ThreeVector position;
0068 G4double dimension[16];
0069
0070 PARAMETER()
0071 {
0072 memset(dimension, 0, sizeof(dimension));
0073 }
0074 };
0075
0076 G4int GetSize() const;
0077 void AddParameter(const PARAMETER&);
0078
0079 private:
0080
0081 void ComputeTransformation(const G4int, G4VPhysicalVolume*) const;
0082 void ComputeDimensions(G4Box&, const G4int,
0083 const G4VPhysicalVolume*) const;
0084 void ComputeDimensions(G4Trd&, const G4int,
0085 const G4VPhysicalVolume*) const;
0086 void ComputeDimensions(G4Trap&, const G4int,
0087 const G4VPhysicalVolume*) const;
0088 void ComputeDimensions(G4Cons&, const G4int,
0089 const G4VPhysicalVolume*) const;
0090 void ComputeDimensions(G4Sphere&, const G4int,
0091 const G4VPhysicalVolume*) const;
0092 void ComputeDimensions(G4Orb&, const G4int,
0093 const G4VPhysicalVolume*) const;
0094 void ComputeDimensions(G4Ellipsoid&, const G4int,
0095 const G4VPhysicalVolume*) const;
0096 void ComputeDimensions(G4Torus&, const G4int,
0097 const G4VPhysicalVolume*) const;
0098 void ComputeDimensions(G4Para&, const G4int,
0099 const G4VPhysicalVolume*) const;
0100 void ComputeDimensions(G4Hype&, const G4int,
0101 const G4VPhysicalVolume*) const;
0102 void ComputeDimensions(G4Tubs&, const G4int,
0103 const G4VPhysicalVolume*) const;
0104 void ComputeDimensions(G4Polycone&, const G4int,
0105 const G4VPhysicalVolume*) const;
0106 void ComputeDimensions(G4Polyhedra&, const G4int,
0107 const G4VPhysicalVolume*) const;
0108
0109 private:
0110
0111 std::vector<PARAMETER> parameterList;
0112 };
0113
0114 #endif