00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifndef G4Ellipsoid_HH
00053 #define G4Ellipsoid_HH
00054
00055 #include <CLHEP/Units/PhysicalConstants.h>
00056
00057 #include "G4VSolid.hh"
00058
00059 class G4Ellipsoid : public G4VSolid
00060 {
00061 public:
00062
00063 G4Ellipsoid(const G4String& pName,
00064 G4double pxSemiAxis,
00065 G4double pySemiAxis,
00066 G4double pzSemiAxis,
00067 G4double pzBottomCut=0,
00068 G4double pzTopCut=0);
00069
00070 virtual ~G4Ellipsoid();
00071
00072
00073
00074 inline G4double GetSemiAxisMax (G4int i) const;
00075 inline G4double GetZBottomCut() const;
00076 inline G4double GetZTopCut() const;
00077 inline void SetSemiAxis (G4double x, G4double y, G4double z);
00078 inline void SetZCuts (G4double newzBottomCut, G4double newzTopCut);
00079 inline G4double GetCubicVolume();
00080 inline G4double GetSurfaceArea();
00081
00082
00083
00084 G4bool CalculateExtent(const EAxis pAxis,
00085 const G4VoxelLimits& pVoxelLimit,
00086 const G4AffineTransform& pTransform,
00087 G4double& pmin, G4double& pmax) const;
00088 EInside Inside(const G4ThreeVector& p) const;
00089 G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
00090 G4double DistanceToIn(const G4ThreeVector& p,
00091 const G4ThreeVector& v) const;
00092 G4double DistanceToIn(const G4ThreeVector& p) const;
00093 G4double DistanceToOut(const G4ThreeVector& p,
00094 const G4ThreeVector& v,
00095 const G4bool calcNorm=G4bool(false),
00096 G4bool *validNorm=0,
00097 G4ThreeVector *n=0) const;
00098 G4double DistanceToOut(const G4ThreeVector& p) const;
00099
00100 G4GeometryType GetEntityType() const;
00101
00102 G4VSolid* Clone() const;
00103
00104 std::ostream& StreamInfo(std::ostream& os) const;
00105
00106 G4ThreeVector GetPointOnSurface() const;
00107
00108
00109
00110 G4Polyhedron* GetPolyhedron () const;
00111 void DescribeYourselfTo(G4VGraphicsScene& scene) const;
00112 G4VisExtent GetExtent() const;
00113 G4Polyhedron* CreatePolyhedron() const;
00114 G4NURBS* CreateNURBS() const;
00115
00116 public:
00117
00118 G4Ellipsoid(__void__&);
00119
00120
00121
00122
00123 G4Ellipsoid(const G4Ellipsoid& rhs);
00124 G4Ellipsoid& operator=(const G4Ellipsoid& rhs);
00125
00126
00127 protected:
00128
00129 G4ThreeVectorList* CreateRotatedVertices(const G4AffineTransform& pT,
00130 G4int& noPV) const;
00131
00132 mutable G4Polyhedron* fpPolyhedron;
00133
00134 private:
00135
00136 G4double kRadTolerance;
00137
00138 G4double fCubicVolume;
00139 G4double fSurfaceArea;
00140 G4double xSemiAxis, ySemiAxis, zSemiAxis,
00141 semiAxisMax, zBottomCut, zTopCut;
00142 };
00143
00144 #include "G4Ellipsoid.icc"
00145
00146 #endif