Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4EllipticalTube.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 result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4EllipticalTube.hh 99781 2016-10-05 10:18:54Z gcosmo $
28 //
29 // --------------------------------------------------------------------
30 // GEANT 4 class header file
31 //
32 // G4EllipticalTube
33 //
34 // Class description:
35 //
36 // Declaration of a CSG volume representing a tube with elliptical
37 // cross section (geant3 solid 'ELTU'):
38 //
39 // G4EllipticalTube( const G4String& name,
40 // G4double Dx,
41 // G4double Dy,
42 // G4double Dz )
43 //
44 // The equation of the surface in x/y is 1.0 = (x/dx)**2 + (y/dy)**2
45 
46 // Author:
47 // David C. Williams (davidw@scipp.ucsc.edu)
48 // --------------------------------------------------------------------
49 
50 #ifndef G4EllipticalTube_hh
51 #define G4EllipticalTube_hh
52 
53 #include "G4VSolid.hh"
54 #include "G4Polyhedron.hh"
55 
56 class G4EllipticalTube : public G4VSolid
57 {
58  public: // with description
59 
61  G4double theDx,
62  G4double theDy,
63  G4double theDz );
64 
65  virtual ~G4EllipticalTube();
66 
67  // Standard solid methods
68 
69  void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
70 
71  G4bool CalculateExtent( const EAxis pAxis,
72  const G4VoxelLimits& pVoxelLimit,
73  const G4AffineTransform& pTransform,
74  G4double& pmin, G4double& pmax ) const;
75 
76  EInside Inside( const G4ThreeVector& p ) const;
77 
78  G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
79 
81  const G4ThreeVector& v ) const;
82  G4double DistanceToIn( const G4ThreeVector& p ) const;
84  const G4ThreeVector& v,
85  const G4bool calcNorm=false,
86  G4bool *validNorm=0,
87  G4ThreeVector *n=0 ) const;
88  G4double DistanceToOut( const G4ThreeVector& p ) const;
89 
91 
92  G4VSolid* Clone() const;
93 
94  std::ostream& StreamInfo(std::ostream& os) const;
95 
98 
100 
101  // Visualisation methods
102 
104  G4Polyhedron* GetPolyhedron () const;
105  void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
106  G4VisExtent GetExtent() const;
107 
108  // Accessors
109 
110  inline G4double GetDx() const;
111  inline G4double GetDy() const;
112  inline G4double GetDz() const;
113 
114  inline void SetDx( const G4double newDx );
115  inline void SetDy( const G4double newDy );
116  inline void SetDz( const G4double newDz );
117 
118  public: // without description
119 
120  G4EllipticalTube(__void__&);
121  // Fake default constructor for usage restricted to direct object
122  // persistency for clients requiring preallocation of memory for
123  // persistifiable objects.
124 
127  // Copy constructor and assignment operator.
128 
129  protected: // without description
130 
132 
133  // Utility
134 
135  inline G4double CheckXY( const G4double x,
136  const G4double y,
137  const G4double toler ) const;
138  inline G4double CheckXY( const G4double x, const G4double y ) const;
139 
140  G4int IntersectXY( const G4ThreeVector &p,
141  const G4ThreeVector &v, G4double s[2] ) const;
142 
143  private:
144 
145  G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
146  // Algorithm for SurfaceNormal() following the original
147  // specification for points not on the surface.
148 
149  G4double halfTol;
150 
151  G4double fCubicVolume;
152  G4double fSurfaceArea;
153  mutable G4bool fRebuildPolyhedron;
154  mutable G4Polyhedron* fpPolyhedron;
155 };
156 
157 #include "G4EllipticalTube.icc"
158 
159 #endif
const XML_Char * name
Definition: expat.h:151
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4double GetDy() const
G4double GetSurfaceArea()
virtual ~G4EllipticalTube()
const char * p
Definition: xmltok.h:285
void SetDy(const G4double newDy)
G4ThreeVector GetPointOnSurface() const
tuple x
Definition: test.py:50
G4VisExtent GetExtent() const
void DescribeYourselfTo(G4VGraphicsScene &scene) const
int G4int
Definition: G4Types.hh:78
G4Polyhedron * GetPolyhedron() const
G4EllipticalTube & operator=(const G4EllipticalTube &rhs)
const XML_Char * s
Definition: expat.h:262
G4double CheckXY(const G4double x, const G4double y, const G4double toler) const
G4double GetDz() const
G4int IntersectXY(const G4ThreeVector &p, const G4ThreeVector &v, G4double s[2]) const
G4double GetCubicVolume()
bool G4bool
Definition: G4Types.hh:79
void SetDz(const G4double newDz)
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const
void SetDx(const G4double newDx)
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
const G4int n
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
std::ostream & StreamInfo(std::ostream &os) const
G4double GetDx() const
tuple v
Definition: test.py:18
G4Polyhedron * CreatePolyhedron() const
EInside
Definition: geomdefs.hh:58
EAxis
Definition: geomdefs.hh:54
void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
double G4double
Definition: G4Types.hh:76
G4EllipticalTube(const G4String &name, G4double theDx, G4double theDy, G4double theDz)
G4GeometryType GetEntityType() const
G4VSolid * Clone() const
EInside Inside(const G4ThreeVector &p) const