Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UPolyhedra.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// G4UPolyhedra
27//
28// Class description:
29//
30// Wrapper class for G4Polyhedra to make use of VecGeom Polyhedron.
31
32// 31.10.13 G.Cosmo, CERN
33// --------------------------------------------------------------------
34#ifndef G4UPOLYHEDRA_HH
35#define G4UPOLYHEDRA_HH
36
37#include "G4UAdapter.hh"
38
39#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
40
41#include <VecGeom/volumes/UnplacedPolyhedron.h>
42
43#include "G4TwoVector.hh"
44#include "G4PolyhedraSide.hh"
46#include "G4Polyhedron.hh"
47
50
51class G4UPolyhedra : public G4UAdapter<vecgeom::UnplacedPolyhedron>
52{
53 using Shape_t = vecgeom::UnplacedPolyhedron;
54 using Base_t = G4UAdapter<vecgeom::UnplacedPolyhedron>;
55
56 public:
57
58 G4UPolyhedra( const G4String& name,
59 G4double phiStart, // initial phi starting angle
60 G4double phiTotal, // total phi angle
61 G4int numSide, // number sides
62 G4int numZPlanes, // number of z planes
63 const G4double zPlane[], // position of z planes
64 const G4double rInner[], // tangent distance to inner surface
65 const G4double rOuter[] ); // tangent distance to outer surface
66
67 G4UPolyhedra( const G4String& name,
68 G4double phiStart, // initial phi starting angle
69 G4double phiTotal, // total phi angle
70 G4int numSide, // number sides
71 G4int numRZ, // number corners in r,z space
72 const G4double r[], // r coordinate of these corners
73 const G4double z[] ); // z coordinate of these corners
74
75 ~G4UPolyhedra() override;
76
77 void ComputeDimensions( G4VPVParameterisation* p,
78 const G4int n,
79 const G4VPhysicalVolume* pRep) override;
80
81 G4VSolid* Clone() const override;
82
83 G4int GetNumSide() const;
84 G4double GetStartPhi() const;
85 G4double GetEndPhi() const;
86 G4double GetSinStartPhi() const;
87 G4double GetCosStartPhi() const;
88 G4double GetSinEndPhi() const;
89 G4double GetCosEndPhi() const;
90 G4bool IsOpen() const;
91 G4bool IsGeneric() const;
92 G4int GetNumRZCorner() const;
93 G4PolyhedraSideRZ GetCorner( const G4int index ) const;
94 G4PolyhedraHistorical* GetOriginalParameters() const;
95 void SetOriginalParameters(G4PolyhedraHistorical* pars);
96
97 G4bool Reset();
98
99 inline G4GeometryType GetEntityType() const override;
100
101 G4UPolyhedra(__void__&);
102 // Fake default constructor for usage restricted to direct object
103 // persistency for clients requiring preallocation of memory for
104 // persistifiable objects.
105
106 G4UPolyhedra( const G4UPolyhedra& source );
107 G4UPolyhedra& operator=( const G4UPolyhedra& source );
108 // Copy constructor and assignment operator.
109
110 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
111
112 G4bool CalculateExtent(const EAxis pAxis,
113 const G4VoxelLimits& pVoxelLimit,
114 const G4AffineTransform& pTransform,
115 G4double& pMin, G4double& pMax) const override;
116
117 G4Polyhedron* CreatePolyhedron() const override;
118
119 protected:
120
121 void SetOriginalParameters();
122
123 G4bool fGenericPgon; // true if created through the 2nd generic constructor
124 G4PolyhedraHistorical fOriginalParameters; // original input parameters
125
126 private:
127
128 G4double wrStart;
129 G4double wrDelta;
130 G4int wrNumSide;
131 std::vector<G4TwoVector> rzcorners;
132};
133
134// --------------------------------------------------------------------
135// Inline methods
136// --------------------------------------------------------------------
137
138inline G4GeometryType G4UPolyhedra::GetEntityType() const
139{
140 return "G4Polyhedra";
141}
142
143#endif // G4GEOM_USE_USOLIDS
144
145#endif
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
EAxis
Definition geomdefs.hh:54