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
00053
00054
00055
00056
00057 #ifndef G4HYPE_HH
00058 #define G4HYPE_HH
00059
00060 #include "G4VSolid.hh"
00061 #include "G4ThreeVector.hh"
00062
00063 class G4SolidExtentList;
00064 class G4ClippablePolygon;
00065
00066 class G4Hype : public G4VSolid
00067 {
00068 public:
00069
00070 G4Hype(const G4String& pName,
00071 G4double newInnerRadius,
00072 G4double newOuterRadius,
00073 G4double newInnerStereo,
00074 G4double newOuterStereo,
00075 G4double newHalfLenZ);
00076
00077 virtual ~G4Hype();
00078
00079 void ComputeDimensions(G4VPVParameterisation* p,
00080 const G4int n,
00081 const G4VPhysicalVolume* pRep);
00082
00083 G4bool CalculateExtent(const EAxis pAxis,
00084 const G4VoxelLimits& pVoxelLimit,
00085 const G4AffineTransform& pTransform,
00086 G4double& pmin, G4double& pmax) const;
00087
00088 inline G4double GetInnerRadius () const;
00089 inline G4double GetOuterRadius () const;
00090 inline G4double GetZHalfLength () const;
00091 inline G4double GetInnerStereo () const;
00092 inline G4double GetOuterStereo () const;
00093
00094 inline void SetInnerRadius (G4double newIRad);
00095 inline void SetOuterRadius (G4double newORad);
00096 inline void SetZHalfLength (G4double newHLZ);
00097 inline void SetInnerStereo (G4double newISte);
00098 inline void SetOuterStereo (G4double newOSte);
00099
00100 EInside Inside(const G4ThreeVector& p) const;
00101
00102 G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const;
00103
00104 G4double DistanceToIn(const G4ThreeVector& p, const G4ThreeVector& v) const;
00105 G4double DistanceToIn(const G4ThreeVector& p) const;
00106 G4double DistanceToOut(const G4ThreeVector& p, const G4ThreeVector& v,
00107 const G4bool calcNorm=G4bool(false),
00108 G4bool *validNorm=0, G4ThreeVector *n=0) const;
00109 G4double DistanceToOut(const G4ThreeVector& p) const;
00110
00111 G4GeometryType GetEntityType() const;
00112
00113 G4VSolid* Clone() const;
00114
00115 std::ostream& StreamInfo(std::ostream& os) const;
00116
00117 G4double GetCubicVolume();
00118 G4double GetSurfaceArea();
00119
00120 G4ThreeVector GetPointOnSurface() const;
00121
00122 void DescribeYourselfTo (G4VGraphicsScene& scene) const;
00123 G4VisExtent GetExtent () const;
00124 G4Polyhedron* CreatePolyhedron () const;
00125 G4NURBS* CreateNURBS () const;
00126 G4Polyhedron* GetPolyhedron () const;
00127
00128 public:
00129
00130 G4Hype(__void__&);
00131
00132
00133
00134
00135 G4Hype(const G4Hype& rhs);
00136 G4Hype& operator=(const G4Hype& rhs);
00137
00138
00139 protected:
00140
00141 inline G4bool InnerSurfaceExists() const;
00142
00143
00144 static G4double ApproxDistOutside( G4double pr, G4double pz,
00145 G4double r0, G4double tanPhi );
00146 static G4double ApproxDistInside( G4double pr, G4double pz,
00147 G4double r0, G4double tan2Phi );
00148
00149
00150 inline G4double HypeInnerRadius2(G4double zVal) const;
00151 inline G4double HypeOuterRadius2(G4double zVal) const;
00152
00153
00154 static G4int IntersectHype( const G4ThreeVector &p, const G4ThreeVector &v,
00155 G4double r2, G4double tan2Phi, G4double s[2] );
00156
00157
00158 static void AddPolyToExtent( const G4ThreeVector &v0,
00159 const G4ThreeVector &v1,
00160 const G4ThreeVector &w1,
00161 const G4ThreeVector &w0,
00162 const G4VoxelLimits &voxelLimit,
00163 const EAxis axis,
00164 G4SolidExtentList &extentList );
00165
00166 protected:
00167
00168 G4double innerRadius;
00169 G4double outerRadius;
00170 G4double halfLenZ;
00171 G4double innerStereo;
00172 G4double outerStereo;
00173
00174
00175
00176 G4double tanInnerStereo;
00177 G4double tanOuterStereo;
00178 G4double tanInnerStereo2;
00179 G4double tanOuterStereo2;
00180 G4double innerRadius2;
00181 G4double outerRadius2;
00182 G4double endInnerRadius2;
00183 G4double endOuterRadius2;
00184 G4double endInnerRadius;
00185 G4double endOuterRadius;
00186
00187
00188
00189 enum ESide {outerFace,innerFace,leftCap, rightCap};
00190
00191 private:
00192
00193 G4double asinh(G4double arg);
00194
00195 private:
00196
00197 G4double fCubicVolume;
00198 G4double fSurfaceArea;
00199
00200 mutable G4Polyhedron* fpPolyhedron;
00201
00202 };
00203
00204 #include "G4Hype.icc"
00205
00206 #endif