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 G4TRD_HH
00058 #define G4TRD_HH
00059
00060 #include "G4CSGSolid.hh"
00061
00062 class G4Trd : public G4CSGSolid
00063 {
00064 public:
00065
00066 G4Trd( const G4String& pName,
00067 G4double pdx1, G4double pdx2,
00068 G4double pdy1, G4double pdy2,
00069 G4double pdz );
00070
00071
00072
00073 ~G4Trd();
00074
00075
00076
00077
00078
00079 inline G4double GetXHalfLength1() const;
00080 inline G4double GetXHalfLength2() const;
00081 inline G4double GetYHalfLength1() const;
00082 inline G4double GetYHalfLength2() const;
00083 inline G4double GetZHalfLength() const;
00084
00085
00086
00087 inline void SetXHalfLength1(G4double val);
00088 inline void SetXHalfLength2(G4double val);
00089 inline void SetYHalfLength1(G4double val);
00090 inline void SetYHalfLength2(G4double val);
00091 inline void SetZHalfLength(G4double val);
00092
00093
00094
00095 inline G4double GetCubicVolume();
00096 inline G4double GetSurfaceArea();
00097
00098 void ComputeDimensions( G4VPVParameterisation* p,
00099 const G4int n,
00100 const G4VPhysicalVolume* pRep );
00101
00102 G4bool CalculateExtent( const EAxis pAxis,
00103 const G4VoxelLimits& pVoxelLimit,
00104 const G4AffineTransform& pTransform,
00105 G4double& pMin, G4double& pMax ) const;
00106
00107 EInside Inside( const G4ThreeVector& p ) const;
00108
00109 G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
00110
00111 G4double DistanceToIn( const G4ThreeVector& p,
00112 const G4ThreeVector& v ) const;
00113
00114 G4double DistanceToIn( const G4ThreeVector& p ) const;
00115
00116 G4double DistanceToOut( const G4ThreeVector& p,
00117 const G4ThreeVector& v,
00118 const G4bool calcNorm=false,
00119 G4bool *validNorm=0,
00120 G4ThreeVector *n=0 ) const;
00121
00122 G4double DistanceToOut( const G4ThreeVector& p ) const;
00123
00124 void CheckAndSetAllParameters ( G4double pdx1, G4double pdx2,
00125 G4double pdy1, G4double pdy2,
00126 G4double pdz );
00127
00128 void SetAllParameters ( G4double pdx1, G4double pdx2,
00129 G4double pdy1, G4double pdy2,
00130 G4double pdz );
00131
00132 G4GeometryType GetEntityType() const;
00133
00134 G4ThreeVector GetPointOnSurface() const;
00135
00136 G4VSolid* Clone() const;
00137
00138 std::ostream& StreamInfo( std::ostream& os ) const;
00139
00140
00141
00142 void DescribeYourselfTo (G4VGraphicsScene& scene) const;
00143 G4Polyhedron* CreatePolyhedron () const;
00144 G4NURBS* CreateNURBS () const;
00145
00146 public:
00147
00148 enum ESide {kUndefined, kPX,kMX,kPY,kMY,kPZ,kMZ};
00149
00150
00151 G4Trd(__void__&);
00152
00153
00154
00155
00156 G4Trd(const G4Trd& rhs);
00157 G4Trd& operator=(const G4Trd& rhs);
00158
00159
00160 G4ThreeVectorList*
00161 CreateRotatedVertices( const G4AffineTransform& pTransform ) const;
00162
00163
00164
00165
00166 G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
00167
00168
00169
00170 private:
00171
00172 G4double fDx1,fDx2,fDy1,fDy2,fDz;
00173 };
00174
00175 #include "G4Trd.icc"
00176
00177 #endif