Geant4  10.02.p01
G4Ellipsoid.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: G4Ellipsoid.hh 83572 2014-09-01 15:23:27Z gcosmo $
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // G4Ellipsoid
34 //
35 // Class description:
36 //
37 // A G4Ellipsoid is an ellipsoidal solid, optionally cut at a given z.
38 //
39 // Member Data:
40 //
41 // xSemiAxis semi-axis, x
42 // ySemiAxis semi-axis, y
43 // zSemiAxis semi-axis, z
44 // zBottomCut lower cut plane level, z (solid lies above this plane)
45 // zTopCut upper cut plane level, z (solid lies below this plane)
46 
47 // History:
48 // -------
49 // 10.11.1999 G.Horton-Smith (Caltech, USA) - First implementation
50 // 10.02.2005 G.Guerrieri (INFN Genova, Italy) - Revision
51 // --------------------------------------------------------------------
52 #ifndef G4Ellipsoid_HH
53 #define G4Ellipsoid_HH
54 
55 #include <CLHEP/Units/PhysicalConstants.h>
56 
57 #include "G4VSolid.hh"
58 #include "G4Polyhedron.hh"
59 
60 class G4Ellipsoid : public G4VSolid
61 {
62  public: // with description
63 
64  G4Ellipsoid(const G4String& pName,
65  G4double pxSemiAxis,
66  G4double pySemiAxis,
67  G4double pzSemiAxis,
68  G4double pzBottomCut=0,
69  G4double pzTopCut=0);
70 
71  virtual ~G4Ellipsoid();
72 
73  // Access functions
74 
75  inline G4double GetSemiAxisMax (G4int i) const;
76  inline G4double GetZBottomCut() const;
77  inline G4double GetZTopCut() const;
78  inline void SetSemiAxis (G4double x, G4double y, G4double z);
79  inline void SetZCuts (G4double newzBottomCut, G4double newzTopCut);
80  inline G4double GetCubicVolume();
81  inline G4double GetSurfaceArea();
82 
83  // Solid standard methods
84 
86  const G4int n,
87  const G4VPhysicalVolume* pRep);
88 
89  G4bool CalculateExtent(const EAxis pAxis,
90  const G4VoxelLimits& pVoxelLimit,
91  const G4AffineTransform& pTransform,
92  G4double& pmin, G4double& pmax) const;
93  EInside Inside(const G4ThreeVector& p) const;
94  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
96  const G4ThreeVector& v) const;
97  G4double DistanceToIn(const G4ThreeVector& p) const;
99  const G4ThreeVector& v,
100  const G4bool calcNorm=G4bool(false),
101  G4bool *validNorm=0,
102  G4ThreeVector *n=0) const;
103  G4double DistanceToOut(const G4ThreeVector& p) const;
104 
106 
107  G4VSolid* Clone() const;
108 
109  std::ostream& StreamInfo(std::ostream& os) const;
110 
112 
113  // Visualisation functions
114 
115  G4Polyhedron* GetPolyhedron () const;
116  void DescribeYourselfTo(G4VGraphicsScene& scene) const;
117  G4VisExtent GetExtent() const;
119 
120  public: // without description
121 
122  G4Ellipsoid(__void__&);
123  // Fake default constructor for usage restricted to direct object
124  // persistency for clients requiring preallocation of memory for
125  // persistifiable objects.
126 
127  G4Ellipsoid(const G4Ellipsoid& rhs);
128  G4Ellipsoid& operator=(const G4Ellipsoid& rhs);
129  // Copy constructor and assignment operator.
130 
131  protected: // without description
132 
134  G4int& noPV) const;
135 
138 
139  private:
140 
143 
148 };
149 
150 #include "G4Ellipsoid.icc"
151 
152 #endif
G4Polyhedron * GetPolyhedron() const
G4double zSemiAxis
Definition: G4Ellipsoid.hh:146
G4double zTopCut
Definition: G4Ellipsoid.hh:146
G4double halfRadTolerance
Definition: G4Ellipsoid.hh:142
G4double fSurfaceArea
Definition: G4Ellipsoid.hh:145
G4GeometryType GetEntityType() const
Definition: G4Ellipsoid.cc:962
G4bool fRebuildPolyhedron
Definition: G4Ellipsoid.hh:136
G4double xSemiAxis
Definition: G4Ellipsoid.hh:146
CLHEP::Hep3Vector G4ThreeVector
G4double z
Definition: TRTMaterials.hh:39
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=G4bool(false), G4bool *validNorm=0, G4ThreeVector *n=0) const
Definition: G4Ellipsoid.cc:657
G4double GetZTopCut() const
EInside Inside(const G4ThreeVector &p) const
Definition: G4Ellipsoid.cc:445
G4double GetZBottomCut() const
G4double GetSurfaceArea()
virtual ~G4Ellipsoid()
Definition: G4Ellipsoid.cc:131
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
Definition: G4Ellipsoid.cc:199
int G4int
Definition: G4Types.hh:78
G4double GetSemiAxisMax(G4int i) const
G4double ySemiAxis
Definition: G4Ellipsoid.hh:146
G4double kRadTolerance
Definition: G4Ellipsoid.hh:141
void SetZCuts(G4double newzBottomCut, G4double newzTopCut)
void DescribeYourselfTo(G4VGraphicsScene &scene) const
G4Ellipsoid(const G4String &pName, G4double pxSemiAxis, G4double pySemiAxis, G4double pzSemiAxis, G4double pzBottomCut=0, G4double pzTopCut=0)
Definition: G4Ellipsoid.cc:69
G4double semiAxisMax
Definition: G4Ellipsoid.hh:146
G4VisExtent GetExtent() const
G4Polyhedron * fpPolyhedron
Definition: G4Ellipsoid.hh:137
G4ThreeVectorList * CreateRotatedVertices(const G4AffineTransform &pT, G4int &noPV) const
Definition: G4Ellipsoid.cc:846
bool G4bool
Definition: G4Types.hh:79
G4double GetCubicVolume()
G4Ellipsoid & operator=(const G4Ellipsoid &rhs)
Definition: G4Ellipsoid.cc:157
G4Polyhedron * CreatePolyhedron() const
G4VSolid * Clone() const
Definition: G4Ellipsoid.cc:971
std::vector< G4ThreeVector > G4ThreeVectorList
Definition: G4VSolid.hh:79
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Ellipsoid.cc:521
G4double zBottomCut
Definition: G4Ellipsoid.hh:146
G4double fCubicVolume
Definition: G4Ellipsoid.hh:144
const G4int n
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
Definition: G4Ellipsoid.cc:487
G4double halfCarTolerance
Definition: G4Ellipsoid.hh:142
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Ellipsoid.cc:980
EInside
Definition: geomdefs.hh:58
EAxis
Definition: geomdefs.hh:54
const G4double x[NPOINTSGL]
void SetSemiAxis(G4double x, G4double y, G4double z)
G4ThreeVector GetPointOnSurface() const
double G4double
Definition: G4Types.hh:76
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Ellipsoid.cc:187