00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4EllipticalCone.hh 67011 2013-01-29 16:17:41Z gcosmo $ 00028 // 00029 // 00030 // -------------------------------------------------------------------- 00031 // GEANT 4 class header file 00032 // 00033 // G4EllipticalCone 00034 // 00035 // Class description: 00036 // 00037 // G4EllipticalCone is a full cone with elliptical base which can be cut in Z. 00038 // 00039 // Member Data: 00040 // 00041 // xSemiAxis semi-axis, x, without dimentions 00042 // ySemiAxis semi-axis, y, without dimentions 00043 // zheight height, z 00044 // zTopCut upper cut plane level, z 00045 // 00046 // The height in Z corresponds to where the elliptical cone hits the 00047 // Z-axis if it had no Z cut. Also the cone is centered at zero having a 00048 // base at zTopCut and another at -zTopCut. The semi-major axes at the Z=0 00049 // plane are given by xSemiAxis*zheight and ySemiAxis*zheight so that the 00050 // curved surface of our cone satisfies the equation: 00051 // 00052 // *************************************************************************** 00053 // * * 00054 // * (x/xSemiAxis)^2 + (y/ySemiAxis)^2 = (zheight - z)^2 * 00055 // * * 00056 // *************************************************************************** 00057 // 00058 // In case you want to construct G4EllipticalCone from : 00059 // 1. halflength in Z = zTopCut 00060 // 2. Dx and Dy = halflength of ellipse axis at z = -zTopCut 00061 // 3. dx and dy = halflength of ellipse axis at z = zTopCut 00062 // ! Attention : dx/dy=Dx/Dy 00063 // 00064 // You need to find xSemiAxis,ySemiAxis and zheight: 00065 // 00066 // xSemiAxis = (Dx-dx)/(2*zTopCut) 00067 // ySemiAxis = (Dy-dy)/(2*zTopCut) 00068 // zheight = (Dx+dx)/(2*xSemiAxis) 00069 // 00070 // Author: 00071 // Dionysios Anninos, 8.9.2005 00072 // 00073 // Revision: 00074 // Lukas Lindroos, Tatiana Nikitina 20.08.2007 00075 // 00076 // -------------------------------------------------------------------- 00077 #ifndef G4EllipticalCone_HH 00078 #define G4EllipticalCone_HH 00079 00080 #include <CLHEP/Units/PhysicalConstants.h> 00081 00082 #include "G4VSolid.hh" 00083 00084 class G4EllipticalCone : public G4VSolid 00085 { 00086 public: // with description 00087 00088 G4EllipticalCone(const G4String& pName, 00089 G4double pxSemiAxis, 00090 G4double pySemiAxis, 00091 G4double zMax, 00092 G4double pzTopCut); 00093 00094 virtual ~G4EllipticalCone(); 00095 00096 // Access functions 00097 // 00098 inline G4double GetSemiAxisMax () const; 00099 inline G4double GetSemiAxisX () const; 00100 inline G4double GetSemiAxisY () const; 00101 inline G4double GetZMax() const; 00102 inline G4double GetZTopCut() const; 00103 inline void SetSemiAxis (G4double x, G4double y, G4double z); 00104 inline void SetZCut (G4double newzTopCut); 00105 00106 inline G4double GetCubicVolume(); 00107 inline G4double GetSurfaceArea(); 00108 00109 // Solid standard methods 00110 // 00111 G4bool CalculateExtent(const EAxis pAxis, 00112 const G4VoxelLimits& pVoxelLimit, 00113 const G4AffineTransform& pTransform, 00114 G4double& pmin, G4double& pmax) const; 00115 00116 EInside Inside(const G4ThreeVector& p) const; 00117 00118 G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const; 00119 00120 G4double DistanceToIn(const G4ThreeVector& p, 00121 const G4ThreeVector& v) const; 00122 00123 G4double DistanceToIn(const G4ThreeVector& p) const; 00124 00125 G4double DistanceToOut(const G4ThreeVector& p, 00126 const G4ThreeVector& v, 00127 const G4bool calcNorm=G4bool(false), 00128 G4bool *validNorm=0, 00129 G4ThreeVector *n=0) const; 00130 00131 G4double DistanceToOut(const G4ThreeVector& p) const; 00132 00133 G4GeometryType GetEntityType() const; 00134 00135 G4VSolid* Clone() const; 00136 00137 G4ThreeVector GetPointOnSurface() const; 00138 00139 std::ostream& StreamInfo(std::ostream& os) const; 00140 00141 // Visualisation functions 00142 // 00143 G4Polyhedron* GetPolyhedron () const; 00144 void DescribeYourselfTo(G4VGraphicsScene& scene) const; 00145 G4VisExtent GetExtent() const; 00146 G4Polyhedron* CreatePolyhedron() const; 00147 G4NURBS* CreateNURBS() const; 00148 00149 public: // without description 00150 00151 G4EllipticalCone(__void__&); 00152 // Fake default constructor for usage restricted to direct object 00153 // persistency for clients requiring preallocation of memory for 00154 // persistifiable objects. 00155 00156 G4EllipticalCone(const G4EllipticalCone& rhs); 00157 G4EllipticalCone& operator=(const G4EllipticalCone& rhs); 00158 // Copy constructor and assignment operator. 00159 00160 protected: // without description 00161 00162 G4ThreeVectorList* CreateRotatedVertices(const G4AffineTransform& pT, 00163 G4int& noPV) const; 00164 00165 mutable G4Polyhedron* fpPolyhedron; 00166 00167 private: 00168 00169 G4double kRadTolerance; 00170 00171 G4double fCubicVolume; 00172 G4double fSurfaceArea; 00173 G4double xSemiAxis, ySemiAxis, zheight, 00174 semiAxisMax, zTopCut; 00175 }; 00176 00177 #include "G4EllipticalCone.icc" 00178 00179 #endif