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
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 #ifndef G4Cons_HH
00068 #define G4Cons_HH
00069
00070 #include <CLHEP/Units/PhysicalConstants.h>
00071
00072 #include "G4CSGSolid.hh"
00073
00074 class G4Cons : public G4CSGSolid
00075 {
00076 public:
00077
00078 G4Cons(const G4String& pName,
00079 G4double pRmin1, G4double pRmax1,
00080 G4double pRmin2, G4double pRmax2,
00081 G4double pDz,
00082 G4double pSPhi, G4double pDPhi);
00083
00084
00085
00086 ~G4Cons() ;
00087
00088
00089
00090
00091
00092 inline G4double GetInnerRadiusMinusZ() const;
00093 inline G4double GetOuterRadiusMinusZ() const;
00094 inline G4double GetInnerRadiusPlusZ() const;
00095 inline G4double GetOuterRadiusPlusZ() const;
00096 inline G4double GetZHalfLength() const;
00097 inline G4double GetStartPhiAngle() const;
00098 inline G4double GetDeltaPhiAngle() const;
00099
00100
00101
00102 inline void SetInnerRadiusMinusZ (G4double Rmin1 );
00103 inline void SetOuterRadiusMinusZ (G4double Rmax1 );
00104 inline void SetInnerRadiusPlusZ (G4double Rmin2 );
00105 inline void SetOuterRadiusPlusZ (G4double Rmax2 );
00106 inline void SetZHalfLength (G4double newDz );
00107 inline void SetStartPhiAngle (G4double newSPhi, G4bool trig=true);
00108 inline void SetDeltaPhiAngle (G4double newDPhi);
00109
00110
00111
00112 inline G4double GetCubicVolume();
00113 inline G4double GetSurfaceArea();
00114
00115 void ComputeDimensions( G4VPVParameterisation* p,
00116 const G4int n,
00117 const G4VPhysicalVolume* pRep );
00118
00119 G4bool CalculateExtent( const EAxis pAxis,
00120 const G4VoxelLimits& pVoxelLimit,
00121 const G4AffineTransform& pTransform,
00122 G4double& pmin, G4double& pmax ) const;
00123
00124 EInside Inside( const G4ThreeVector& p ) const;
00125
00126 G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
00127
00128 G4double DistanceToIn (const G4ThreeVector& p,
00129 const G4ThreeVector& v) const;
00130 G4double DistanceToIn (const G4ThreeVector& p) const;
00131 G4double DistanceToOut(const G4ThreeVector& p,
00132 const G4ThreeVector& v,
00133 const G4bool calcNorm=G4bool(false),
00134 G4bool *validNorm=0,
00135 G4ThreeVector *n=0) const;
00136 G4double DistanceToOut(const G4ThreeVector& p) const;
00137
00138 G4GeometryType GetEntityType() const;
00139
00140 G4ThreeVector GetPointOnSurface() const;
00141
00142 G4VSolid* Clone() const;
00143
00144 std::ostream& StreamInfo(std::ostream& os) const;
00145
00146
00147
00148 void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
00149 G4Polyhedron* CreatePolyhedron() const;
00150 G4NURBS* CreateNURBS() const;
00151
00152 public:
00153
00154 G4Cons(__void__&);
00155
00156
00157
00158
00159
00160 G4Cons(const G4Cons& rhs);
00161 G4Cons& operator=(const G4Cons& rhs);
00162
00163
00164
00165
00166 inline G4double GetRmin1() const;
00167 inline G4double GetRmax1() const;
00168 inline G4double GetRmin2() const;
00169 inline G4double GetRmax2() const;
00170 inline G4double GetDz() const;
00171 inline G4double GetSPhi() const;
00172 inline G4double GetDPhi() const;
00173
00174 private:
00175
00176 G4ThreeVectorList*
00177 CreateRotatedVertices(const G4AffineTransform& pTransform) const;
00178
00179 inline void Initialize();
00180
00181
00182
00183 inline void CheckSPhiAngle(G4double sPhi);
00184 inline void CheckDPhiAngle(G4double dPhi);
00185 inline void CheckPhiAngles(G4double sPhi, G4double dPhi);
00186
00187
00188
00189 inline void InitializeTrigonometry();
00190
00191
00192
00193 G4ThreeVector ApproxSurfaceNormal(const G4ThreeVector& p) const;
00194
00195
00196
00197
00198 private:
00199
00200
00201
00202 enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPZ,kMZ};
00203
00204
00205
00206 enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNZ};
00207
00208 G4double kRadTolerance, kAngTolerance;
00209
00210
00211
00212 G4double fRmin1, fRmin2, fRmax1, fRmax2, fDz, fSPhi, fDPhi;
00213
00214
00215
00216 G4double sinCPhi, cosCPhi, cosHDPhiOT, cosHDPhiIT,
00217 sinSPhi, cosSPhi, sinEPhi, cosEPhi;
00218
00219
00220
00221 G4bool fPhiFullCone;
00222
00223
00224 };
00225
00226 #include "G4Cons.icc"
00227
00228 #endif