Geant4  10.00.p01
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 72937 2013-08-14 13:20:38Z 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 
84 class G4EllipticalCone : public G4VSolid
85 {
86  public: // with description
87 
88  G4EllipticalCone(const G4String& pName,
89  G4double pxSemiAxis,
90  G4double pySemiAxis,
91  G4double zMax,
92  G4double pzTopCut);
93 
94  virtual ~G4EllipticalCone();
95 
96  // Access functions
97  //
98  inline G4double GetSemiAxisMax () const;
99  inline G4double GetSemiAxisX () const;
100  inline G4double GetSemiAxisY () const;
101  inline G4double GetZMax() const;
102  inline G4double GetZTopCut() const;
103  inline void SetSemiAxis (G4double x, G4double y, G4double z);
104  inline void SetZCut (G4double newzTopCut);
105 
106  inline G4double GetCubicVolume();
107  inline G4double GetSurfaceArea();
108 
109  // Solid standard methods
110  //
111  G4bool CalculateExtent(const EAxis pAxis,
112  const G4VoxelLimits& pVoxelLimit,
113  const G4AffineTransform& pTransform,
114  G4double& pmin, G4double& pmax) const;
115 
116  EInside Inside(const G4ThreeVector& p) const;
117 
118  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
119 
121  const G4ThreeVector& v) const;
122 
123  G4double DistanceToIn(const G4ThreeVector& p) const;
124 
126  const G4ThreeVector& v,
127  const G4bool calcNorm=G4bool(false),
128  G4bool *validNorm=0,
129  G4ThreeVector *n=0) const;
130 
131  G4double DistanceToOut(const G4ThreeVector& p) const;
132 
134 
135  G4VSolid* Clone() const;
136 
138 
139  std::ostream& StreamInfo(std::ostream& os) const;
140 
141  // Visualisation functions
142  //
143  G4Polyhedron* GetPolyhedron () const;
144  void DescribeYourselfTo(G4VGraphicsScene& scene) const;
145  G4VisExtent GetExtent() const;
147 
148  public: // without description
149 
150  G4EllipticalCone(__void__&);
151  // Fake default constructor for usage restricted to direct object
152  // persistency for clients requiring preallocation of memory for
153  // persistifiable objects.
154 
157  // Copy constructor and assignment operator.
158 
159  protected: // without description
160 
162  G4int& noPV) const;
163 
165 
166  private:
167 
170 
175 };
176 
177 #include "G4EllipticalCone.icc"
178 
179 #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