Geant4  10.00.p01
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  //G4Visualisation
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  const char* CVSHeaderVers()
92  {
93  return "$Id: G4Tet.hh 66356 2012-12-18 09:02:32Z gcosmo $";
94  }
95  const char* CVSFileVers()
96  {
97  return CVSVers;
98  }
99  void PrintWarnings(bool flag)
100  {
101  warningFlag = flag;
102  }
103  static bool CheckDegeneracy(UVector3& anchor,
104  UVector3& p2,
105  UVector3& p3,
106  UVector3& p4);
107  std::vector<UVector3> GetVertices() const;
108  // Return the four vertices of the shape.
109 
110  protected: // with description
111 
112  /* UVectorList*
113  CreateRotatedVertices(const G4AffineTransform& pTransform) const;
114  // Create the List of transformed vertices in the format required
115  // for G4VSolid:: ClipCrossSection and ClipBetweenSections.
116  */
117  private:
118 
120 
122  UVector3 p3, double& area) const;
123  static const char CVSVers[];
124 
125  private:
126 
129 
131 
134  double fDx, fDy, fDz, fTol, fMaxSize;
135 };
136 
137 #endif
static bool CheckDegeneracy(UVector3 &anchor, UVector3 &p2, UVector3 &p3, UVector3 &p4)
double fSurfaceArea
Definition: UTet.hh:119
UVector3 GetPointOnSurface() const
Definition: UTet.cc:574
UVector3 fNormal234
Definition: UTet.hh:128
double fZMax
Definition: UTet.hh:133
double fMaxSize
Definition: UTet.hh:134
double fXMin
Definition: UTet.hh:133
double fZMin
Definition: UTet.hh:133
G4String name
Definition: TRTMaterials.hh:40
void ComputeBBox(UBBox *, bool)
Definition: UTet.hh:70
UGeometryType GetEntityType() const
Definition: UTet.cc:647
UVector3 fP3
Definition: UTet.hh:127
UVector3 fP4
Definition: UTet.hh:127
double DistanceToIn(const UVector3 &aPoint, const UVector3 &aDirection, double aPstep=UUtils::kInfinity) const
Definition: UTet.cc:322
UVector3 fNormal123
Definition: UTet.hh:128
virtual ~UTet()
Definition: UTet.cc:137
void Extent(UVector3 &aMin, UVector3 &aMax) const
Definition: UTet.cc:615
double fTol
Definition: UTet.hh:134
UVector3 fP2
Definition: UTet.hh:127
double SurfaceArea()
Definition: UTet.cc:657
double fCdotN123
Definition: UTet.hh:132
bool Normal(const UVector3 &aPoint, UVector3 &aNormal) const
Definition: UTet.cc:247
static const double kInfinity
Definition: UUtils.hh:54
double fXMax
Definition: UTet.hh:133
UVector3 fAnchor
Definition: UTet.hh:127
double fCdotN234
Definition: UTet.hh:132
static const char CVSVers[]
Definition: UTet.hh:123
double SafetyFromOutside(const UVector3 &aPoint, bool aAccurate=false) const
Definition: UTet.cc:410
double Capacity()
Definition: UTet.cc:652
std::ostream & StreamInfo(std::ostream &os) const
Definition: UTet.cc:525
double fCdotN142
Definition: UTet.hh:132
double DistanceToOut(const UVector3 &aPoint, const UVector3 &aDirection, UVector3 &aNormalVector, bool &aConvex, double aPstep=UUtils::kInfinity) const
Definition: UTet.cc:422
UVector3 fNormal134
Definition: UTet.hh:128
double fYMin
Definition: UTet.hh:133
UVector3 fMiddle
Definition: UTet.hh:127
UVector3 fNormal142
Definition: UTet.hh:128
EnumInside
Definition: VUSolid.hh:23
UTet & operator=(const UTet &rhs)
Definition: UTet.cc:167
double SafetyFromInside(const UVector3 &aPoint, bool aAccurate=false) const
Definition: UTet.cc:505
void GetParametersList(int aNumber, double *aArray) const
Definition: UTet.cc:626
std::vector< UVector3 > GetVertices() const
Definition: UTet.cc:604
bool warningFlag
Definition: UTet.hh:130
double fDx
Definition: UTet.hh:134
const char * CVSFileVers()
Definition: UTet.hh:95
const char * CVSHeaderVers()
Definition: UTet.hh:91
UVector3 GetPointOnFace(UVector3 p1, UVector3 p2, UVector3 p3, double &area) const
Definition: UTet.cc:554
void PrintWarnings(bool flag)
Definition: UTet.hh:99
double fYMax
Definition: UTet.hh:133
std::string UGeometryType
Definition: UTypes.hh:70
double fDy
Definition: UTet.hh:134
VUSolid * Clone() const
Definition: UTet.cc:642
double fDz
Definition: UTet.hh:134
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:217
Definition: UTet.hh:27
double fCubicVolume
Definition: UTet.hh:119
double fCdotN134
Definition: UTet.hh:132