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
00045
00046 #ifndef G4VFacet_hh
00047 #define G4VFacet_hh
00048
00049 #include <iostream>
00050 #include <vector>
00051
00052 #include "globals.hh"
00053 #include "G4ThreeVector.hh"
00054 #include "G4VSolid.hh"
00055
00056 enum G4FacetVertexType {ABSOLUTE, RELATIVE};
00057
00058 class G4TessellatedSolid;
00059
00060 class G4VFacet
00061 {
00062 public:
00063
00064 virtual ~G4VFacet ();
00065
00066 G4bool operator== (const G4VFacet &right) const;
00067
00068 virtual G4int GetNumberOfVertices () const = 0;
00069 virtual G4ThreeVector GetVertex (G4int i) const = 0;
00070 virtual void SetVertex (G4int i, const G4ThreeVector &val) = 0;
00071 virtual G4GeometryType GetEntityType () const = 0;
00072 virtual G4ThreeVector GetSurfaceNormal () const = 0;
00073 virtual G4bool IsDefined () const = 0;
00074 virtual G4ThreeVector GetCircumcentre () const = 0;
00075 virtual G4double GetRadius () const = 0;
00076 virtual G4VFacet *GetClone () = 0;
00077 virtual G4double Distance (const G4ThreeVector&, G4double) = 0;
00078 virtual G4double Distance (const G4ThreeVector&, G4double,
00079 const G4bool) = 0;
00080 virtual G4double Extent (const G4ThreeVector) = 0;
00081 virtual G4bool Intersect (const G4ThreeVector&, const G4ThreeVector &,
00082 const G4bool , G4double &, G4double &,
00083 G4ThreeVector &) = 0;
00084 virtual G4double GetArea() = 0;
00085 virtual G4ThreeVector GetPointOnFace() const = 0;
00086
00087 void ApplyTranslation (const G4ThreeVector v);
00088
00089 std::ostream &StreamInfo(std::ostream &os) const;
00090
00091 G4bool IsInside(const G4ThreeVector &p) const;
00092
00093 virtual G4int AllocatedMemory() = 0;
00094 virtual void SetVertexIndex (G4int i, G4int j) = 0;
00095 virtual G4int GetVertexIndex (G4int i) const = 0;
00096
00097 virtual void SetVertices(std::vector<G4ThreeVector> *vertices) = 0;
00098
00099 protected:
00100
00101 static const G4double dirTolerance;
00102 static const G4double kCarTolerance;
00103 };
00104
00105 #endif