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 #ifndef G4VCSGfaceted_hh
00046 #define G4VCSGfaceted_hh
00047
00048 #include "G4VSolid.hh"
00049
00050 class G4VCSGface;
00051 class G4VisExtent;
00052
00053 class G4VCSGfaceted : public G4VSolid
00054 {
00055 public:
00056
00057 G4VCSGfaceted( const G4String& name );
00058 virtual ~G4VCSGfaceted();
00059
00060 G4VCSGfaceted( const G4VCSGfaceted &source );
00061 const G4VCSGfaceted &operator=( const G4VCSGfaceted &source );
00062
00063 virtual G4bool CalculateExtent( const EAxis pAxis,
00064 const G4VoxelLimits& pVoxelLimit,
00065 const G4AffineTransform& pTransform,
00066 G4double& pmin,G4double& pmax ) const;
00067
00068 virtual EInside Inside( const G4ThreeVector& p ) const;
00069
00070 virtual G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
00071
00072 virtual G4double DistanceToIn( const G4ThreeVector& p,
00073 const G4ThreeVector& v ) const;
00074 virtual G4double DistanceToIn( const G4ThreeVector& p ) const;
00075 virtual G4double DistanceToOut( const G4ThreeVector& p,
00076 const G4ThreeVector& v,
00077 const G4bool calcNorm=false,
00078 G4bool *validNorm=0,
00079 G4ThreeVector *n=0 ) const;
00080 virtual G4double DistanceToOut( const G4ThreeVector& p ) const;
00081
00082 virtual G4GeometryType GetEntityType() const;
00083
00084 virtual std::ostream& StreamInfo(std::ostream& os) const;
00085
00086 virtual G4Polyhedron* CreatePolyhedron() const = 0;
00087
00088 virtual void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
00089
00090 virtual G4VisExtent GetExtent() const;
00091
00092 virtual G4Polyhedron* GetPolyhedron () const;
00093
00094 G4int GetCubVolStatistics() const;
00095 G4double GetCubVolEpsilon() const;
00096 void SetCubVolStatistics(G4int st);
00097 void SetCubVolEpsilon(G4double ep);
00098 G4int GetAreaStatistics() const;
00099 G4double GetAreaAccuracy() const;
00100 void SetAreaStatistics(G4int st);
00101 void SetAreaAccuracy(G4double ep);
00102
00103 virtual G4double GetCubicVolume();
00104
00105
00106 virtual G4double GetSurfaceArea();
00107
00108
00109
00110 public:
00111
00112 G4VCSGfaceted(__void__&);
00113
00114
00115
00116
00117 protected:
00118
00119 G4int numFace;
00120 G4VCSGface **faces;
00121 G4double fCubicVolume;
00122 G4double fSurfaceArea;
00123 mutable G4Polyhedron* fpPolyhedron;
00124
00125 virtual G4double DistanceTo( const G4ThreeVector &p,
00126 const G4bool outgoing ) const;
00127
00128 G4ThreeVector GetPointOnSurfaceGeneric()const;
00129
00130
00131
00132 void CopyStuff( const G4VCSGfaceted &source );
00133 void DeleteStuff();
00134
00135 private:
00136
00137 G4int fStatistics;
00138 G4double fCubVolEpsilon;
00139 G4double fAreaAccuracy;
00140
00141
00142 };
00143
00144 #endif