Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4FCylindricalSurface.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$
28 //
29 // ----------------------------------------------------------------------
30 // Class G4FCylindricalSurface
31 //
32 // Class Description:
33 //
34 // Definition of a generic bounded cylindrical surface.
35 //
36 // Position.axis| radius
37 // >|---|<---------
38 // |
39 // -- +---|---+
40 // l | | | |
41 // e | | | |
42 // n | | | |
43 // g | | | |
44 // t | | | |
45 // h | | | |
46 // -- +---|---+
47 // Position
48 
49 // The code for G4CylindricalSurface has been derived from the original
50 // implementation in the "Gismo" package.
51 //
52 // Author: A.Breakstone
53 // Adaptation: J.Sulkimo, P.Urban.
54 // Revisions by: L.Broglia, G.Cosmo.
55 // ----------------------------------------------------------------------
56 #ifndef __FCYLINDER_H
57 #define __FCYLINDER_H
58 
59 #include "G4PointRat.hh"
60 #include "G4Axis2Placement3D.hh"
61 #include "G4Surface.hh"
62 
63 
65 {
66 
67  public: // with description
68 
70  // Default constructor.
71 
73  const G4Vector3D& a,
74  G4double r,
75  G4double l );
76  // o : origin.
77  // a : axis.
78  // r : radius.
79  // l : length.
80 
81  virtual ~G4FCylindricalSurface();
82  // Destructor.
83 
84  inline G4int operator==( const G4FCylindricalSurface& c ) const;
85  // Equality operator.
86 
87  virtual G4Vector3D SurfaceNormal( const G4Point3D& p ) const;
88  // Returns the Normal unit vector to the G4FCylindricalSurface at a point
89  // p on (or nearly on) the G4FCylindricalSurface.
90 
91  virtual G4int Inside( const G4Vector3D& x ) const;
92  // Returns 1 if the point x is Inside the G4FCylindricalSurface,
93  // returns 0 otherwise.
94 
95  inline G4String GetEntityType() const;
96  // Returns the shape identifier.
97 
98  G4int Intersect(const G4Ray&);
99  // Counts the number of intersections of a bounded cylindrical surface
100  // by a ray. At first, it calculates the intersections with the infinite
101  // cylindrical surface. Then, it counts the intersections within the
102  // finite cylindrical surface boundaries, and sets the "distance" to the
103  // closest distance from the start point to the nearest intersection.
104  // If the point is on the surface it returns either the intersection with
105  // the opposite surface or kInfinity.
106  // If no intersection is found, it sets distance = kInfinity and returns 0.
107 
108  virtual G4double HowNear( const G4Vector3D& x ) const;
109  // Computes the shortest distance from the point x to the
110  // G4FCylindricalSurface. The distance will be always positive.
111 
112  void CalcBBox();
113  // Computes the bounding box.
114 
115  virtual const char* NameOf() const;
116  // Returns the class name.
117 
118  virtual void PrintOn( std::ostream& os = G4cout ) const;
119  // Printing function.
120 
121  virtual G4int WithinBoundary( const G4Vector3D& x ) const;
122  // Returns 1 if the point x is within the boundary, 0 otherwise.
123 
124  virtual G4double Scale() const;
125  // Return the radius of a G4FCylindricalSurface.
126  // Used for Scale-invariant tests of surface thickness.
127  // If the radius is zero, it returns the length.
128 
129  virtual G4double Area() const;
130  // Calculates the area of a G4FCylindricalSurface.
131 
132  virtual void resize( G4double r, G4double l );
133  // Changes the radius and length of the G4FCylindricalSurface:
134  // the first (input) argument is the new radius;
135  // the second (input) argument is the new length.
136 
137  inline G4double GetLength() const;
138  inline G4Vector3D GetAxis() const;
139  inline G4double GetRadius() const;
140  void SetRadius( G4double r );
141  // Get/Set methods for the geometrical data of the G4FCylindricalSurface.
142 
143  public: // without description
144 
145  void InitValues();
146  // Re-calculates the private values of the G4FCylindrical surface
147  // before the Intersect and HowNear function if the G4FCylindrical
148  // was created by the STEP interface.
149 
150  protected:
151 
155 
156  private:
157 
159  G4FCylindricalSurface& operator=(const G4FCylindricalSurface&);
160  // Private copy constructor and assignment operator.
161 
162 };
163 
164 #include "G4FCylindricalSurface.icc"
165 
166 #endif