[831] | 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,v 1.4 2008/01/22 17:42:09 tnikitin Exp $ |
---|
[1337] | 28 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
[831] | 29 | // |
---|
| 30 | // |
---|
| 31 | // -------------------------------------------------------------------- |
---|
| 32 | // GEANT 4 class header file |
---|
| 33 | // |
---|
| 34 | // G4Paraboloid |
---|
| 35 | // |
---|
| 36 | // Class description: |
---|
| 37 | // |
---|
| 38 | // A G4Paraboloid represents a solid with parabolic profile with possible |
---|
| 39 | // cuts along the Z axis. |
---|
| 40 | // |
---|
| 41 | // Member Data: |
---|
| 42 | // |
---|
| 43 | // dz z half lenght |
---|
| 44 | // r1 radius at -dz |
---|
| 45 | // r2 radius at dz |
---|
| 46 | // r2 > r1 |
---|
| 47 | // |
---|
| 48 | // Equation for the solid: |
---|
| 49 | // rho^2 <= k1 * z + k2; |
---|
| 50 | // -dz <= z <= dz |
---|
| 51 | // r1^2 = k1 * (-dz) + k2 |
---|
| 52 | // r2^2 = k1 * ( dz) + k2 |
---|
| 53 | |
---|
| 54 | // History: |
---|
| 55 | // ------- |
---|
| 56 | // 10.07.2007 L.Lindroos (CERN) - First implementation |
---|
| 57 | // -------------------------------------------------------------------- |
---|
| 58 | #ifndef G4Paraboloid_HH |
---|
| 59 | #define G4Paraboloid_HH |
---|
| 60 | |
---|
| 61 | #include "G4VSolid.hh" |
---|
| 62 | |
---|
| 63 | class G4Paraboloid : public G4VSolid |
---|
| 64 | { |
---|
| 65 | public: // with description |
---|
| 66 | |
---|
| 67 | G4Paraboloid(const G4String& pName, |
---|
| 68 | G4double pDz, |
---|
| 69 | G4double pR1, |
---|
| 70 | G4double pR2); |
---|
| 71 | |
---|
| 72 | virtual ~G4Paraboloid(); |
---|
| 73 | |
---|
| 74 | // Access functions |
---|
| 75 | |
---|
| 76 | inline G4double GetZHalfLength() const; |
---|
| 77 | inline G4double GetRadiusMinusZ() const; |
---|
| 78 | inline G4double GetRadiusPlusZ() const; |
---|
| 79 | |
---|
| 80 | inline G4double GetCubicVolume(); |
---|
| 81 | inline G4double GetSurfaceArea(); |
---|
| 82 | inline G4double CalculateSurfaceArea() const; |
---|
| 83 | |
---|
| 84 | // Modifiers functions |
---|
| 85 | |
---|
| 86 | inline void SetZHalfLength(G4double dz); |
---|
| 87 | inline void SetRadiusMinusZ(G4double R1); |
---|
| 88 | inline void SetRadiusPlusZ(G4double R2); |
---|
| 89 | |
---|
| 90 | // Solid standard methods |
---|
| 91 | |
---|
| 92 | //void ComputeDimensions( G4VPVParamerisation p, |
---|
| 93 | // const G4Int n, |
---|
| 94 | // const G4VPhysicalVolume* pRep ); |
---|
| 95 | G4bool CalculateExtent(const EAxis pAxis, |
---|
| 96 | const G4VoxelLimits& pVoxelLimit, |
---|
| 97 | const G4AffineTransform& pTransform, |
---|
| 98 | G4double& pmin, G4double& pmax) const; |
---|
| 99 | EInside Inside(const G4ThreeVector& p) const; |
---|
| 100 | G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const; |
---|
| 101 | G4double DistanceToIn(const G4ThreeVector& p, |
---|
| 102 | const G4ThreeVector& v) const; |
---|
| 103 | G4double DistanceToIn(const G4ThreeVector& p) const; |
---|
| 104 | G4double DistanceToOut(const G4ThreeVector& p, |
---|
| 105 | const G4ThreeVector& v, |
---|
| 106 | const G4bool calcNorm=G4bool(false), |
---|
| 107 | G4bool *validNorm=0, |
---|
| 108 | G4ThreeVector *n=0) const; |
---|
| 109 | G4double DistanceToOut(const G4ThreeVector& p) const; |
---|
| 110 | |
---|
| 111 | G4GeometryType GetEntityType() const; |
---|
| 112 | |
---|
| 113 | std::ostream& StreamInfo(std::ostream& os) const; |
---|
| 114 | |
---|
| 115 | G4ThreeVector GetPointOnSurface() const; |
---|
| 116 | |
---|
| 117 | // Visualisation functions |
---|
| 118 | |
---|
| 119 | void DescribeYourselfTo(G4VGraphicsScene& scene) const; |
---|
| 120 | G4Polyhedron* CreatePolyhedron() const; |
---|
| 121 | G4Polyhedron* GetPolyhedron () const; |
---|
| 122 | G4NURBS* CreateNURBS() const; |
---|
| 123 | |
---|
| 124 | public: // without description |
---|
| 125 | |
---|
| 126 | G4Paraboloid(__void__&); |
---|
| 127 | // Fake default constructor for usage restricted to direct object |
---|
| 128 | // persistency for clients requiring preallocation of memory for |
---|
| 129 | // persistifiable objects. |
---|
| 130 | |
---|
| 131 | protected: // without description |
---|
| 132 | |
---|
| 133 | mutable G4Polyhedron* fpPolyhedron; |
---|
| 134 | |
---|
| 135 | private: |
---|
| 136 | |
---|
| 137 | G4ThreeVectorList* |
---|
| 138 | CreateRotatedVertices(const G4AffineTransform& pTransform, |
---|
| 139 | G4int& noPolygonVertices) const; |
---|
| 140 | // Making this mutable to allow GetPointOnSurface to have access to |
---|
| 141 | // area function. |
---|
| 142 | mutable G4double fSurfaceArea; |
---|
| 143 | G4double fCubicVolume; |
---|
| 144 | |
---|
| 145 | G4double dz, r1, r2; |
---|
| 146 | G4double k1, k2; |
---|
| 147 | // Defined to make some calculations easier to follow |
---|
| 148 | }; |
---|
| 149 | |
---|
| 150 | #include "G4Paraboloid.icc" |
---|
| 151 | |
---|
| 152 | #endif |
---|