Geant4_10
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 72937 2013-08-14 13:20:38Z 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 
55 class G4EllipticalTube : public G4VSolid
56 {
57  public: // with description
58 
60  G4double theDx,
61  G4double theDy,
62  G4double theDz );
63 
64  virtual ~G4EllipticalTube();
65 
66  // Standard solid methods
67 
68  G4bool CalculateExtent( const EAxis pAxis,
69  const G4VoxelLimits& pVoxelLimit,
70  const G4AffineTransform& pTransform,
71  G4double& pmin, G4double& pmax ) const;
72 
73  EInside Inside( const G4ThreeVector& p ) const;
74 
75  G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
76 
78  const G4ThreeVector& v ) const;
79  G4double DistanceToIn( const G4ThreeVector& p ) const;
81  const G4ThreeVector& v,
82  const G4bool calcNorm=false,
83  G4bool *validNorm=0,
84  G4ThreeVector *n=0 ) const;
85  G4double DistanceToOut( const G4ThreeVector& p ) const;
86 
88 
89  G4VSolid* Clone() const;
90 
91  std::ostream& StreamInfo(std::ostream& os) const;
92 
95 
97 
98  // Visualisation methods
99 
101  G4Polyhedron* GetPolyhedron () const;
102  void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
103  G4VisExtent GetExtent() const;
104 
105  // Accessors
106 
107  inline G4double GetDx() const;
108  inline G4double GetDy() const;
109  inline G4double GetDz() const;
110 
111  inline void SetDx( const G4double newDx );
112  inline void SetDy( const G4double newDy );
113  inline void SetDz( const G4double newDz );
114 
115  public: // without description
116 
117  G4EllipticalTube(__void__&);
118  // Fake default constructor for usage restricted to direct object
119  // persistency for clients requiring preallocation of memory for
120  // persistifiable objects.
121 
124  // Copy constructor and assignment operator.
125 
126  protected: // without description
127 
129 
130  // Utility
131 
132  inline G4double CheckXY( const G4double x,
133  const G4double y,
134  const G4double toler ) const;
135  inline G4double CheckXY( const G4double x, const G4double y ) const;
136 
137  G4int IntersectXY( const G4ThreeVector &p,
138  const G4ThreeVector &v, G4double s[2] ) const;
139 
140  private:
141 
142  G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
143  // Algorithm for SurfaceNormal() following the original
144  // specification for points not on the surface.
145 
146  G4double halfTol;
147 
148  G4double fCubicVolume;
149  G4double fSurfaceArea;
150  mutable G4Polyhedron* fpPolyhedron;
151 
152 };
153 
154 #include "G4EllipticalTube.icc"
155 
156 #endif
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4double GetDy() const
G4double GetSurfaceArea()
const XML_Char * s
Definition: expat.h:262
virtual ~G4EllipticalTube()
const char * p
Definition: xmltok.h:285
void SetDy(const G4double newDy)
G4ThreeVector GetPointOnSurface() const
const XML_Char * name
Definition: expat.h:151
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)
Double_t y
Definition: plot.C:279
G4double CheckXY(const G4double x, const G4double y, const G4double toler) const
Char_t n[5]
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
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
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