Geant4  10.01.p02
G4EllipticalCone.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: G4EllipticalCone.hh 83572 2014-09-01 15:23:27Z gcosmo $
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // G4EllipticalCone
34 //
35 // Class description:
36 //
37 // G4EllipticalCone is a full cone with elliptical base which can be cut in Z.
38 //
39 // Member Data:
40 //
41 // xSemiAxis semi-axis, x, without dimentions
42 // ySemiAxis semi-axis, y, without dimentions
43 // zheight height, z
44 // zTopCut upper cut plane level, z
45 //
46 // The height in Z corresponds to where the elliptical cone hits the
47 // Z-axis if it had no Z cut. Also the cone is centered at zero having a
48 // base at zTopCut and another at -zTopCut. The semi-major axes at the Z=0
49 // plane are given by xSemiAxis*zheight and ySemiAxis*zheight so that the
50 // curved surface of our cone satisfies the equation:
51 //
52 // ***************************************************************************
53 // * *
54 // * (x/xSemiAxis)^2 + (y/ySemiAxis)^2 = (zheight - z)^2 *
55 // * *
56 // ***************************************************************************
57 //
58 // In case you want to construct G4EllipticalCone from :
59 // 1. halflength in Z = zTopCut
60 // 2. Dx and Dy = halflength of ellipse axis at z = -zTopCut
61 // 3. dx and dy = halflength of ellipse axis at z = zTopCut
62 // ! Attention : dx/dy=Dx/Dy
63 //
64 // You need to find xSemiAxis,ySemiAxis and zheight:
65 //
66 // xSemiAxis = (Dx-dx)/(2*zTopCut)
67 // ySemiAxis = (Dy-dy)/(2*zTopCut)
68 // zheight = (Dx+dx)/(2*xSemiAxis)
69 //
70 // Author:
71 // Dionysios Anninos, 8.9.2005
72 //
73 // Revision:
74 // Lukas Lindroos, Tatiana Nikitina 20.08.2007
75 //
76 // --------------------------------------------------------------------
77 #ifndef G4EllipticalCone_HH
78 #define G4EllipticalCone_HH
79 
80 #include <CLHEP/Units/PhysicalConstants.h>
81 
82 #include "G4VSolid.hh"
83 #include "G4Polyhedron.hh"
84 
85 class G4EllipticalCone : public G4VSolid
86 {
87  public: // with description
88 
89  G4EllipticalCone(const G4String& pName,
90  G4double pxSemiAxis,
91  G4double pySemiAxis,
92  G4double zMax,
93  G4double pzTopCut);
94 
95  virtual ~G4EllipticalCone();
96 
97  // Access functions
98  //
99  inline G4double GetSemiAxisMax () const;
100  inline G4double GetSemiAxisX () const;
101  inline G4double GetSemiAxisY () const;
102  inline G4double GetZMax() const;
103  inline G4double GetZTopCut() const;
104  inline void SetSemiAxis (G4double x, G4double y, G4double z);
105  inline void SetZCut (G4double newzTopCut);
106 
107  inline G4double GetCubicVolume();
108  inline G4double GetSurfaceArea();
109 
110  // Solid standard methods
111  //
112  G4bool CalculateExtent(const EAxis pAxis,
113  const G4VoxelLimits& pVoxelLimit,
114  const G4AffineTransform& pTransform,
115  G4double& pmin, G4double& pmax) const;
116 
117  EInside Inside(const G4ThreeVector& p) const;
118 
119  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
120 
122  const G4ThreeVector& v) const;
123 
124  G4double DistanceToIn(const G4ThreeVector& p) const;
125 
127  const G4ThreeVector& v,
128  const G4bool calcNorm=G4bool(false),
129  G4bool *validNorm=0,
130  G4ThreeVector *n=0) const;
131 
132  G4double DistanceToOut(const G4ThreeVector& p) const;
133 
135 
136  G4VSolid* Clone() const;
137 
139 
140  std::ostream& StreamInfo(std::ostream& os) const;
141 
142  // Visualisation functions
143  //
144  G4Polyhedron* GetPolyhedron () const;
145  void DescribeYourselfTo(G4VGraphicsScene& scene) const;
146  G4VisExtent GetExtent() const;
148 
149  public: // without description
150 
151  G4EllipticalCone(__void__&);
152  // Fake default constructor for usage restricted to direct object
153  // persistency for clients requiring preallocation of memory for
154  // persistifiable objects.
155 
158  // Copy constructor and assignment operator.
159 
160  protected: // without description
161 
163  G4int& noPV) const;
164 
167 
168  private:
169 
172 
177 };
178 
179 #include "G4EllipticalCone.icc"
180 
181 #endif
G4VSolid * Clone() const
G4EllipticalCone & operator=(const G4EllipticalCone &rhs)
G4double GetSemiAxisX() const
CLHEP::Hep3Vector G4ThreeVector
G4double z
Definition: TRTMaterials.hh:39
G4ThreeVectorList * CreateRotatedVertices(const G4AffineTransform &pT, G4int &noPV) const
EInside Inside(const G4ThreeVector &p) const
G4double GetCubicVolume()
G4Polyhedron * CreatePolyhedron() const
int G4int
Definition: G4Types.hh:78
std::ostream & StreamInfo(std::ostream &os) const
G4ThreeVector GetPointOnSurface() const
G4double GetSemiAxisMax() const
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
G4Polyhedron * fpPolyhedron
bool G4bool
Definition: G4Types.hh:79
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4EllipticalCone(const G4String &pName, G4double pxSemiAxis, G4double pySemiAxis, G4double zMax, G4double pzTopCut)
G4double GetZMax() const
std::vector< G4ThreeVector > G4ThreeVectorList
Definition: G4VSolid.hh:79
const G4int n
void DescribeYourselfTo(G4VGraphicsScene &scene) const
G4double GetSemiAxisY() const
void SetSemiAxis(G4double x, G4double y, G4double z)
EInside
Definition: geomdefs.hh:58
EAxis
Definition: geomdefs.hh:54
void SetZCut(G4double newzTopCut)
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
G4double GetZTopCut() const
double G4double
Definition: G4Types.hh:76
G4double GetSurfaceArea()
G4Polyhedron * GetPolyhedron() const
G4GeometryType GetEntityType() const
G4VisExtent GetExtent() const
virtual ~G4EllipticalCone()
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=G4bool(false), G4bool *validNorm=0, G4ThreeVector *n=0) const