Geant4  10.01.p02
UTet.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * This Software is part of the AIDA Unified Solids Library package *
4 // * See: https://aidasoft.web.cern.ch/USolids *
5 // ********************************************************************
6 //
7 // $Id:$
8 //
9 // --------------------------------------------------------------------
10 //
11 // UTet
12 //
13 // Class description:
14 //
15 // A UTet is a tetrahedrasolid.
16 //
17 // 19.07.13 Tatiana Nikitina
18 // Created from original implementation in Geant4
19 // --------------------------------------------------------------------
20 
21 #ifndef UTet_hh
22 #define UTet_hh
23 
24 #include "VUSolid.hh"
25 #include "UUtils.hh"
26 
27 class UTet : public VUSolid
28 {
29 
30  public: // with description
31 
32  UTet(const std::string& name,
33  UVector3 anchor,
34  UVector3 p2,
35  UVector3 p3,
36  UVector3 p4,
37  bool* degeneracyFlag = 0);
38 
39  virtual ~UTet();
40 
41 
42  // Methods for solid
43 
44  EnumInside Inside(const UVector3& p) const;
45 
46  bool Normal(const UVector3& aPoint, UVector3& aNormal) const;
47 
48  double SafetyFromInside(const UVector3& aPoint,
49  bool aAccurate = false) const;
50  double SafetyFromOutside(const UVector3& aPoint,
51  bool aAccurate = false) const;
52  double DistanceToIn(const UVector3& aPoint,
53  const UVector3& aDirection,
54  // UVector3 &aNormalVector,
55  double aPstep = UUtils::kInfinity) const;
56 
57  double DistanceToOut(const UVector3& aPoint,
58  const UVector3& aDirection,
59  UVector3& aNormalVector,
60  bool& aConvex,
61  double aPstep = UUtils::kInfinity) const;
62 
63  void Extent(UVector3& aMin, UVector3& aMax) const;
64 
65  double Capacity();
66  double SurfaceArea();
67 
69 
70  void ComputeBBox(UBBox* /*aBox*/, bool /*aStore = false*/) {}
71 
72  // Visualisation
73  void GetParametersList(int aNumber, double* aArray) const;
74 
75  VUSolid* Clone() const;
76 
78  std::ostream& StreamInfo(std::ostream& os) const;
79 
80  public: // without description
81 
82  UTet(__void__&);
83  // Fake default constructor for usage restricted to direct object
84  // persistency for clients requiring preallocation of memory for
85  // persistifiable objects.
86 
87  UTet(const UTet& rhs);
88  UTet& operator=(const UTet& rhs);
89  // Copy constructor and assignment operator.
90 
91  void PrintWarnings(bool flag)
92  {
93  warningFlag = flag;
94  }
95  static bool CheckDegeneracy(UVector3& anchor,
96  UVector3& p2,
97  UVector3& p3,
98  UVector3& p4);
99  std::vector<UVector3> GetVertices() const;
100  // Return the four vertices of the shape.
101 
102  private:
103 
105 
107  UVector3 p3, double& area) const;
108  static const char CVSVers[];
109 
110  private:
111 
114 
116 
119  double fDx, fDy, fDz, fTol, fMaxSize;
120 };
121 
122 #endif
static bool CheckDegeneracy(UVector3 &anchor, UVector3 &p2, UVector3 &p3, UVector3 &p4)
double fSurfaceArea
Definition: UTet.hh:104
UVector3 GetPointOnSurface() const
Definition: UTet.cc:589
UVector3 fNormal234
Definition: UTet.hh:113
double fZMax
Definition: UTet.hh:118
double fMaxSize
Definition: UTet.hh:119
double fXMin
Definition: UTet.hh:118
double fZMin
Definition: UTet.hh:118
G4String name
Definition: TRTMaterials.hh:40
void ComputeBBox(UBBox *, bool)
Definition: UTet.hh:70
UGeometryType GetEntityType() const
Definition: UTet.cc:662
UVector3 fP3
Definition: UTet.hh:112
UVector3 fP4
Definition: UTet.hh:112
double DistanceToIn(const UVector3 &aPoint, const UVector3 &aDirection, double aPstep=UUtils::kInfinity) const
Definition: UTet.cc:337
UVector3 fNormal123
Definition: UTet.hh:113
virtual ~UTet()
Definition: UTet.cc:152
void Extent(UVector3 &aMin, UVector3 &aMax) const
Definition: UTet.cc:630
double fTol
Definition: UTet.hh:119
UVector3 fP2
Definition: UTet.hh:112
double SurfaceArea()
Definition: UTet.cc:672
double fCdotN123
Definition: UTet.hh:117
bool Normal(const UVector3 &aPoint, UVector3 &aNormal) const
Definition: UTet.cc:262
static const double kInfinity
Definition: UUtils.hh:54
double fXMax
Definition: UTet.hh:118
UVector3 fAnchor
Definition: UTet.hh:112
double fCdotN234
Definition: UTet.hh:117
static const char CVSVers[]
Definition: UTet.hh:108
double SafetyFromOutside(const UVector3 &aPoint, bool aAccurate=false) const
Definition: UTet.cc:425
double Capacity()
Definition: UTet.cc:667
std::ostream & StreamInfo(std::ostream &os) const
Definition: UTet.cc:540
double fCdotN142
Definition: UTet.hh:117
const G4double p2
const G4double p1
double DistanceToOut(const UVector3 &aPoint, const UVector3 &aDirection, UVector3 &aNormalVector, bool &aConvex, double aPstep=UUtils::kInfinity) const
Definition: UTet.cc:437
UVector3 fNormal134
Definition: UTet.hh:113
double fYMin
Definition: UTet.hh:118
UVector3 fMiddle
Definition: UTet.hh:112
UVector3 fNormal142
Definition: UTet.hh:113
EnumInside
Definition: VUSolid.hh:23
UTet & operator=(const UTet &rhs)
Definition: UTet.cc:181
double SafetyFromInside(const UVector3 &aPoint, bool aAccurate=false) const
Definition: UTet.cc:520
void GetParametersList(int aNumber, double *aArray) const
Definition: UTet.cc:641
std::vector< UVector3 > GetVertices() const
Definition: UTet.cc:619
bool warningFlag
Definition: UTet.hh:115
double fDx
Definition: UTet.hh:119
UVector3 GetPointOnFace(UVector3 p1, UVector3 p2, UVector3 p3, double &area) const
Definition: UTet.cc:569
void PrintWarnings(bool flag)
Definition: UTet.hh:91
double fYMax
Definition: UTet.hh:118
std::string UGeometryType
Definition: UTypes.hh:39
double fDy
Definition: UTet.hh:119
VUSolid * Clone() const
Definition: UTet.cc:657
double fDz
Definition: UTet.hh:119
UTet(const std::string &name, UVector3 anchor, UVector3 p2, UVector3 p3, UVector3 p4, bool *degeneracyFlag=0)
Definition: UTet.cc:35
EnumInside Inside(const UVector3 &p) const
Definition: UTet.cc:231
Definition: UTet.hh:27
double fCubicVolume
Definition: UTet.hh:104
double fCdotN134
Definition: UTet.hh:117