Geant4  10.01.p01
G4Tet.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the intellectual property of the *
19 // * Vanderbilt University Free Electron Laser Center *
20 // * Vanderbilt University, Nashville, TN, USA *
21 // * Development supported by: *
22 // * United States MFEL program under grant FA9550-04-1-0045 *
23 // * and NASA under contract number NNG04CT05P. *
24 // * Written by Marcus H. Mendenhall and Robert A. Weller. *
25 // * *
26 // * Contributed to the Geant4 Core, January, 2005. *
27 // * *
28 // ********************************************************************
29 //
30 //
31 // $Id: G4Tet.hh 83572 2014-09-01 15:23:27Z gcosmo $
32 //
33 //
34 // --------------------------------------------------------------------
35 // GEANT 4 class header file
36 //
37 // G4Tet
38 //
39 // Class description:
40 //
41 // A G4Tet is a tetrahedrasolid.
42 //
43 
44 // History:
45 // -------
46 // 03.09.2004 - M.H.Mendenhall & R.A.Weller (Vanderbilt University, USA)
47 // 10.02.2005 - D.Anninos (CERN) - Added GetPointOnSurface() method.
48 // 12.11.2006 - M.H.Mendenhall - Added GetSurfaceArea() concrete implementation.
49 // 20.09.2010 - G.Cosmo (CERN) - Added copy-ctor and operator=().
50 // --------------------------------------------------------------------
51 #ifndef G4TET_HH
52 #define G4TET_HH
53 
54 #if defined(G4GEOM_USE_USOLIDS)
55 #define G4GEOM_USE_UTET 1
56 #endif
57 
58 #if defined(G4GEOM_USE_UTET)
59  #define G4UTet G4Tet
60  #include "G4UTet.hh"
61 #else
62 
63 #include "G4VSolid.hh"
64 
65 class G4Tet : public G4VSolid
66 {
67 
68  public: // with description
69 
70  G4Tet(const G4String& pName,
71  G4ThreeVector anchor,
72  G4ThreeVector p2,
73  G4ThreeVector p3,
74  G4ThreeVector p4,
75  G4bool *degeneracyFlag=0);
76 
77  virtual ~G4Tet();
78 
80  const G4int n,
81  const G4VPhysicalVolume* pRep);
82 
83  G4bool CalculateExtent(const EAxis pAxis,
84  const G4VoxelLimits& pVoxelLimit,
85  const G4AffineTransform& pTransform,
86  G4double& pmin, G4double& pmax) const;
87  // Methods for solid
88 
89  EInside Inside(const G4ThreeVector& p) const;
90 
91  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
92 
93  G4double DistanceToIn(const G4ThreeVector& p, const G4ThreeVector& v) const;
94 
95  G4double DistanceToIn(const G4ThreeVector& p) const;
96 
98  const G4bool calcNorm=false,
99  G4bool *validNorm=0, G4ThreeVector *n=0) const;
100 
101  G4double DistanceToOut(const G4ThreeVector& p) const;
102 
105 
107 
108  G4VSolid* Clone() const;
109 
110  std::ostream& StreamInfo(std::ostream& os) const;
111 
113 
114  // Functions for visualization
115 
116  void DescribeYourselfTo (G4VGraphicsScene& scene) const;
117  G4VisExtent GetExtent () const;
118  G4Polyhedron* CreatePolyhedron () const;
119  G4Polyhedron* GetPolyhedron () const;
120 
121  public: // without description
122 
123  G4Tet(__void__&);
124  // Fake default constructor for usage restricted to direct object
125  // persistency for clients requiring preallocation of memory for
126  // persistifiable objects.
127 
128  G4Tet(const G4Tet& rhs);
129  G4Tet& operator=(const G4Tet& rhs);
130  // Copy constructor and assignment operator.
131 
132  const char* CVSHeaderVers()
133  { return "$Id: G4Tet.hh 83572 2014-09-01 15:23:27Z gcosmo $"; }
134  const char* CVSFileVers()
135  { return CVSVers; }
137  { warningFlag=flag; }
138  static G4bool CheckDegeneracy(G4ThreeVector anchor,
139  G4ThreeVector p2,
140  G4ThreeVector p3,
141  G4ThreeVector p4);
142  std::vector<G4ThreeVector> GetVertices() const;
143  // Return the four vertices of the shape.
144 
145  protected: // with description
146 
148  CreateRotatedVertices(const G4AffineTransform& pTransform) const;
149  // Create the List of transformed vertices in the format required
150  // for G4VSolid:: ClipCrossSection and ClipBetweenSections.
151 
152  private:
153 
155 
158 
160  G4ThreeVector p3, G4double& area) const;
161  static const char CVSVers[];
162 
163  private:
164 
167 
169 
173 };
174 
175 #endif
176 
177 #endif
G4ThreeVector fP4
Definition: G4Tet.hh:165
G4double fTol
Definition: G4Tet.hh:172
G4double fYMin
Definition: G4Tet.hh:171
G4double fXMax
Definition: G4Tet.hh:171
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const
Definition: G4Tet.cc:580
G4ThreeVector fNormal142
Definition: G4Tet.hh:166
G4bool fRebuildPolyhedron
Definition: G4Tet.hh:156
G4double fDz
Definition: G4Tet.hh:172
G4ThreeVector fP2
Definition: G4Tet.hh:165
CLHEP::Hep3Vector G4ThreeVector
G4ThreeVector GetPointOnSurface() const
Definition: G4Tet.cc:769
G4double fYMax
Definition: G4Tet.hh:171
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Tet.cc:487
G4GeometryType GetEntityType() const
Definition: G4Tet.cc:701
G4ThreeVector fNormal123
Definition: G4Tet.hh:166
G4double fCdotN142
Definition: G4Tet.hh:170
G4ThreeVector fP3
Definition: G4Tet.hh:165
G4double fCdotN134
Definition: G4Tet.hh:170
void PrintWarnings(G4bool flag)
Definition: G4Tet.hh:136
int G4int
Definition: G4Types.hh:78
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
Definition: G4Tet.cc:301
G4double fMaxSize
Definition: G4Tet.hh:172
std::vector< G4ThreeVector > GetVertices() const
Definition: G4Tet.cc:790
G4ThreeVector fAnchor
Definition: G4Tet.hh:165
G4double fZMin
Definition: G4Tet.hh:171
G4double fXMin
Definition: G4Tet.hh:171
Definition: G4Tet.hh:65
void DescribeYourselfTo(G4VGraphicsScene &scene) const
Definition: G4Tet.cc:825
bool G4bool
Definition: G4Types.hh:79
G4ThreeVector GetPointOnFace(G4ThreeVector p1, G4ThreeVector p2, G4ThreeVector p3, G4double &area) const
Definition: G4Tet.cc:748
static G4bool CheckDegeneracy(G4ThreeVector anchor, G4ThreeVector p2, G4ThreeVector p3, G4ThreeVector p4)
Definition: G4Tet.cc:275
std::vector< G4ThreeVector > G4ThreeVectorList
Definition: G4VSolid.hh:79
G4ThreeVector fMiddle
Definition: G4Tet.hh:165
const G4int n
G4double fSurfaceArea
Definition: G4Tet.hh:154
G4Polyhedron * CreatePolyhedron() const
Definition: G4Tet.cc:843
G4double fCdotN234
Definition: G4Tet.hh:170
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Tet.cc:719
G4double fDy
Definition: G4Tet.hh:172
EInside
Definition: geomdefs.hh:58
G4ThreeVector fNormal134
Definition: G4Tet.hh:166
EAxis
Definition: geomdefs.hh:54
G4double GetCubicVolume()
Definition: G4Tet.cc:805
const char * CVSFileVers()
Definition: G4Tet.hh:134
G4double fCdotN123
Definition: G4Tet.hh:170
G4double fCubicVolume
Definition: G4Tet.hh:154
G4double fDx
Definition: G4Tet.hh:172
G4double GetSurfaceArea()
Definition: G4Tet.cc:814
EInside Inside(const G4ThreeVector &p) const
Definition: G4Tet.cc:396
const char * CVSHeaderVers()
Definition: G4Tet.hh:132
G4VisExtent GetExtent() const
Definition: G4Tet.cc:834
static const char CVSVers[]
Definition: G4Tet.hh:161
G4VSolid * Clone() const
Definition: G4Tet.cc:710
G4ThreeVectorList * CreateRotatedVertices(const G4AffineTransform &pTransform) const
Definition: G4Tet.cc:670
G4ThreeVector fNormal234
Definition: G4Tet.hh:166
G4Tet & operator=(const G4Tet &rhs)
Definition: G4Tet.cc:242
double G4double
Definition: G4Types.hh:76
virtual ~G4Tet()
Definition: G4Tet.cc:212
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Tet.cc:291
G4Polyhedron * fpPolyhedron
Definition: G4Tet.hh:157
G4Polyhedron * GetPolyhedron() const
Definition: G4Tet.cc:862
G4bool warningFlag
Definition: G4Tet.hh:168
G4Tet(const G4String &pName, G4ThreeVector anchor, G4ThreeVector p2, G4ThreeVector p3, G4ThreeVector p4, G4bool *degeneracyFlag=0)
Definition: G4Tet.cc:96
G4double fZMax
Definition: G4Tet.hh:171
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
Definition: G4Tet.cc:427