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 #ifndef G4EllipticalTube_hh
00051 #define G4EllipticalTube_hh
00052
00053 #include "G4VSolid.hh"
00054
00055 class G4EllipticalTube : public G4VSolid
00056 {
00057 public:
00058
00059 G4EllipticalTube( const G4String &name,
00060 G4double theDx,
00061 G4double theDy,
00062 G4double theDz );
00063
00064 virtual ~G4EllipticalTube();
00065
00066
00067
00068 G4bool CalculateExtent( const EAxis pAxis,
00069 const G4VoxelLimits& pVoxelLimit,
00070 const G4AffineTransform& pTransform,
00071 G4double& pmin, G4double& pmax ) const;
00072
00073 EInside Inside( const G4ThreeVector& p ) const;
00074
00075 G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
00076
00077 G4double DistanceToIn( const G4ThreeVector& p,
00078 const G4ThreeVector& v ) const;
00079 G4double DistanceToIn( const G4ThreeVector& p ) const;
00080 G4double DistanceToOut( const G4ThreeVector& p,
00081 const G4ThreeVector& v,
00082 const G4bool calcNorm=false,
00083 G4bool *validNorm=0,
00084 G4ThreeVector *n=0 ) const;
00085 G4double DistanceToOut( const G4ThreeVector& p ) const;
00086
00087 G4GeometryType GetEntityType() const;
00088
00089 G4VSolid* Clone() const;
00090
00091 std::ostream& StreamInfo(std::ostream& os) const;
00092
00093 G4double GetCubicVolume();
00094 G4double GetSurfaceArea();
00095
00096 G4ThreeVector GetPointOnSurface() const;
00097
00098
00099
00100 G4Polyhedron* CreatePolyhedron() const;
00101 G4Polyhedron* GetPolyhedron () const;
00102 void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
00103 G4VisExtent GetExtent() const;
00104
00105
00106
00107 inline G4double GetDx() const;
00108 inline G4double GetDy() const;
00109 inline G4double GetDz() const;
00110
00111 inline void SetDx( const G4double newDx );
00112 inline void SetDy( const G4double newDy );
00113 inline void SetDz( const G4double newDz );
00114
00115 public:
00116
00117 G4EllipticalTube(__void__&);
00118
00119
00120
00121
00122 G4EllipticalTube(const G4EllipticalTube& rhs);
00123 G4EllipticalTube& operator=(const G4EllipticalTube& rhs);
00124
00125
00126 protected:
00127
00128 G4double dx, dy, dz;
00129
00130
00131
00132 inline G4double CheckXY( const G4double x,
00133 const G4double y,
00134 const G4double toler ) const;
00135 inline G4double CheckXY( const G4double x, const G4double y ) const;
00136
00137 G4int IntersectXY( const G4ThreeVector &p,
00138 const G4ThreeVector &v, G4double s[2] ) const;
00139
00140 private:
00141
00142 G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
00143
00144
00145
00146 G4double fCubicVolume;
00147 G4double fSurfaceArea;
00148 mutable G4Polyhedron* fpPolyhedron;
00149
00150 };
00151
00152 #include "G4EllipticalTube.icc"
00153
00154 #endif