Geant4  10.01.p03
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 83572 2014-09-01 15:23:27Z 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  G4bool CalculateExtent( const EAxis pAxis,
70  const G4VoxelLimits& pVoxelLimit,
71  const G4AffineTransform& pTransform,
72  G4double& pmin, G4double& pmax ) const;
73 
74  EInside Inside( const G4ThreeVector& p ) const;
75 
76  G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
77 
79  const G4ThreeVector& v ) const;
80  G4double DistanceToIn( const G4ThreeVector& p ) const;
82  const G4ThreeVector& v,
83  const G4bool calcNorm=false,
84  G4bool *validNorm=0,
85  G4ThreeVector *n=0 ) const;
86  G4double DistanceToOut( const G4ThreeVector& p ) const;
87 
89 
90  G4VSolid* Clone() const;
91 
92  std::ostream& StreamInfo(std::ostream& os) const;
93 
96 
98 
99  // Visualisation methods
100 
102  G4Polyhedron* GetPolyhedron () const;
103  void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
104  G4VisExtent GetExtent() const;
105 
106  // Accessors
107 
108  inline G4double GetDx() const;
109  inline G4double GetDy() const;
110  inline G4double GetDz() const;
111 
112  inline void SetDx( const G4double newDx );
113  inline void SetDy( const G4double newDy );
114  inline void SetDz( const G4double newDz );
115 
116  public: // without description
117 
118  G4EllipticalTube(__void__&);
119  // Fake default constructor for usage restricted to direct object
120  // persistency for clients requiring preallocation of memory for
121  // persistifiable objects.
122 
125  // Copy constructor and assignment operator.
126 
127  protected: // without description
128 
130 
131  // Utility
132 
133  inline G4double CheckXY( const G4double x,
134  const G4double y,
135  const G4double toler ) const;
136  inline G4double CheckXY( const G4double x, const G4double y ) const;
137 
138  G4int IntersectXY( const G4ThreeVector &p,
139  const G4ThreeVector &v, G4double s[2] ) const;
140 
141  private:
142 
144  // Algorithm for SurfaceNormal() following the original
145  // specification for points not on the surface.
146 
148 
153 };
154 
155 #include "G4EllipticalTube.icc"
156 
157 #endif
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4double GetDy() const
CLHEP::Hep3Vector G4ThreeVector
G4double GetSurfaceArea()
virtual ~G4EllipticalTube()
G4String name
Definition: TRTMaterials.hh:40
void SetDy(const G4double newDy)
G4ThreeVector GetPointOnSurface() const
G4VisExtent GetExtent() const
void DescribeYourselfTo(G4VGraphicsScene &scene) const
int G4int
Definition: G4Types.hh:78
G4ThreeVector ApproxSurfaceNormal(const G4ThreeVector &p) const
G4Polyhedron * GetPolyhedron() const
G4Polyhedron * fpPolyhedron
G4EllipticalTube & operator=(const G4EllipticalTube &rhs)
static const double s
Definition: G4SIunits.hh:150
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
G4Polyhedron * CreatePolyhedron() const
EInside
Definition: geomdefs.hh:58
EAxis
Definition: geomdefs.hh:54
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