Geant4  10.02.p02
G4Paraboloid.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: G4Paraboloid.hh 92392 2015-08-31 14:07:02Z gcosmo $
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // G4Paraboloid
34 //
35 // Class description:
36 //
37 // A G4Paraboloid represents a solid with parabolic profile with possible
38 // cuts along the Z axis.
39 //
40 // Member Data:
41 //
42 // dz z half lenght
43 // r1 radius at -dz
44 // r2 radius at dz
45 // r2 > r1
46 //
47 // Equation for the solid:
48 // rho^2 <= k1 * z + k2;
49 // -dz <= z <= dz
50 // r1^2 = k1 * (-dz) + k2
51 // r2^2 = k1 * ( dz) + k2
52 
53 // History:
54 // -------
55 // 10.07.2007 L.Lindroos (CERN) - First implementation
56 //
57 // --------------------------------------------------------------------
58 #ifndef G4Paraboloid_HH
59 #define G4Paraboloid_HH
60 
61 #if defined(G4GEOM_USE_USOLIDS)
62 #define G4GEOM_USE_UPARABOLOID 1
63 #endif
64 
65 #if (defined(G4GEOM_USE_UPARABOLOID) && defined(G4GEOM_USE_SYS_USOLIDS))
66  #define G4UParaboloid G4Paraboloid
67  #include "G4UParaboloid.hh"
68 #else
69 
70 #include <CLHEP/Units/PhysicalConstants.h>
71 
72 #include "G4VSolid.hh"
73 #include "G4Polyhedron.hh"
74 
75 class G4Paraboloid : public G4VSolid
76 {
77  public: // with description
78 
79  G4Paraboloid(const G4String& pName,
80  G4double pDz,
81  G4double pR1,
82  G4double pR2);
83 
84  virtual ~G4Paraboloid();
85 
86  // Access functions
87 
88  inline G4double GetZHalfLength() const;
89  inline G4double GetRadiusMinusZ() const;
90  inline G4double GetRadiusPlusZ() const;
91 
92  inline G4double GetCubicVolume();
93  inline G4double GetSurfaceArea();
94  inline G4double CalculateSurfaceArea() const;
95 
96  // Modifiers functions
97 
98  inline void SetZHalfLength(G4double dz);
99  inline void SetRadiusMinusZ(G4double R1);
100  inline void SetRadiusPlusZ(G4double R2);
101 
102  // Solid standard methods
103 
104  //void ComputeDimensions( G4VPVParamerisation p,
105  // const G4Int n,
106  // const G4VPhysicalVolume* pRep );
107  G4bool CalculateExtent(const EAxis pAxis,
108  const G4VoxelLimits& pVoxelLimit,
109  const G4AffineTransform& pTransform,
110  G4double& pmin, G4double& pmax) const;
111  EInside Inside(const G4ThreeVector& p) const;
112  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
114  const G4ThreeVector& v) const;
115  G4double DistanceToIn(const G4ThreeVector& p) const;
117  const G4ThreeVector& v,
118  const G4bool calcNorm=G4bool(false),
119  G4bool *validNorm=0,
120  G4ThreeVector *n=0) const;
121  G4double DistanceToOut(const G4ThreeVector& p) const;
122 
124 
125  G4VSolid* Clone() const;
126 
127  std::ostream& StreamInfo(std::ostream& os) const;
128 
130 
131  // Visualisation functions
132 
133  void DescribeYourselfTo(G4VGraphicsScene& scene) const;
135  G4Polyhedron* GetPolyhedron () const;
136 
137  public: // without description
138 
139  G4Paraboloid(__void__&);
140  // Fake default constructor for usage restricted to direct object
141  // persistency for clients requiring preallocation of memory for
142  // persistifiable objects.
143 
144  G4Paraboloid(const G4Paraboloid& rhs);
145  G4Paraboloid& operator=(const G4Paraboloid& rhs);
146  // Copy constructor and assignment operator.
147 
148  protected: // without description
149 
152 
153  private:
154 
156  CreateRotatedVertices(const G4AffineTransform& pTransform,
157  G4int& noPolygonVertices) const;
158  // Making this mutable to allow GetPointOnSurface to have access to
159  // area function.
162 
165  // Defined to make some calculations easier to follow
166 };
167 
168 #include "G4Paraboloid.icc"
169 
170 #endif // defined(G4GEOM_USE_UPARABOLOID) && defined(G4GEOM_USE_SYS_USOLIDS)
171 
172 #endif // G4Paraboloid_HH
CLHEP::Hep3Vector G4ThreeVector
G4Polyhedron * fpPolyhedron
G4Paraboloid & operator=(const G4Paraboloid &rhs)
G4double GetSurfaceArea()
G4double GetCubicVolume()
G4GeometryType GetEntityType() const
G4double GetRadiusMinusZ() const
int G4int
Definition: G4Types.hh:78
G4double fCubicVolume
G4double CalculateSurfaceArea() const
G4double fSurfaceArea
void SetRadiusPlusZ(G4double R2)
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
void DescribeYourselfTo(G4VGraphicsScene &scene) const
void SetRadiusMinusZ(G4double R1)
G4double GetZHalfLength() const
bool G4bool
Definition: G4Types.hh:79
std::vector< G4ThreeVector > G4ThreeVectorList
Definition: G4VSolid.hh:79
const G4int n
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=G4bool(false), G4bool *validNorm=0, G4ThreeVector *n=0) const
G4VSolid * Clone() const
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
EInside Inside(const G4ThreeVector &p) const
std::ostream & StreamInfo(std::ostream &os) const
G4double GetRadiusPlusZ() const
EInside
Definition: geomdefs.hh:58
EAxis
Definition: geomdefs.hh:54
virtual ~G4Paraboloid()
void SetZHalfLength(G4double dz)
G4ThreeVector GetPointOnSurface() const
G4ThreeVectorList * CreateRotatedVertices(const G4AffineTransform &pTransform, G4int &noPolygonVertices) const
double G4double
Definition: G4Types.hh:76
G4Polyhedron * GetPolyhedron() const
G4Paraboloid(const G4String &pName, G4double pDz, G4double pR1, G4double pR2)
Definition: G4Paraboloid.cc:65
G4Polyhedron * CreatePolyhedron() const
G4bool fRebuildPolyhedron