Geant4  10.02.p02
G4Orb.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: G4Orb.hh 79491 2014-03-05 15:24:29Z gcosmo $
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // G4Orb
34 //
35 // Class description:
36 //
37 // A G4Orb is a simple case of G4Sphere. It has only:
38 // fRmax outer radius
39 
40 // History:
41 // 20.08.03 V.Grichine - created
42 // --------------------------------------------------------------------
43 
44 #ifndef G4Orb_HH
45 #define G4Orb_HH
46 
47 #if defined(G4GEOM_USE_USOLIDS)
48 #define G4GEOM_USE_UORB 1
49 #endif
50 
51 #if defined(G4GEOM_USE_UORB)
52  #define G4UOrb G4Orb
53  #include "G4UOrb.hh"
54 #else
55 
56 #include <CLHEP/Units/PhysicalConstants.h>
57 
58 #include "G4CSGSolid.hh"
59 #include "G4Polyhedron.hh"
60 
61 class G4Orb : public G4CSGSolid
62 {
63  public: // with description
64 
65  G4Orb(const G4String& pName, G4double pRmax);
66 
67  virtual ~G4Orb() ;
68 
69  // Accessors
70 
71  inline G4double GetRadius() const;
72 
73  // Modifiers
74 
75  inline void SetRadius(G4double newRmax);
76 
77  // Methods for solid
78 
79  inline G4double GetCubicVolume();
80  inline G4double GetSurfaceArea();
81 
83  const G4int n,
84  const G4VPhysicalVolume* pRep);
85 
86  G4bool CalculateExtent(const EAxis pAxis,
87  const G4VoxelLimits& pVoxelLimit,
88  const G4AffineTransform& pTransform,
89  G4double& pmin, G4double& pmax) const;
90 
91  EInside Inside(const G4ThreeVector& p) const;
92 
93  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
94 
96  const G4ThreeVector& v) const;
97 
98  G4double DistanceToIn(const G4ThreeVector& p) const;
99 
101  const G4ThreeVector& v,
102  const G4bool calcNorm=G4bool(false),
103  G4bool *validNorm=0,
104  G4ThreeVector *n=0) const;
105 
106  G4double DistanceToOut(const G4ThreeVector& p) const;
107 
109 
111 
112  G4VSolid* Clone() const;
113 
114  std::ostream& StreamInfo(std::ostream& os) const;
115 
116  // Visualisation functions
117 
118  void DescribeYourselfTo(G4VGraphicsScene& scene) const;
120 
121  public: // without description
122 
123  G4Orb(__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  G4Orb(const G4Orb& rhs);
129  G4Orb& operator=(const G4Orb& rhs);
130  // Copy constructor and assignment operator.
131 
132  protected:
133 
134  // Used by distanceToOut
135 
136  enum ESide {kNull,kRMax};
137 
138  // used by normal
139 
140  enum ENorm {kNRMax};
141 
142  private:
143 
146 };
147 
148 #include "G4Orb.icc"
149 
150 #endif
151 
152 #endif
void SetRadius(G4double newRmax)
G4Orb & operator=(const G4Orb &rhs)
Definition: G4Orb.cc:123
CLHEP::Hep3Vector G4ThreeVector
virtual ~G4Orb()
Definition: G4Orb.cc:106
G4double GetSurfaceArea()
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
Definition: G4Orb.cc:157
void DescribeYourselfTo(G4VGraphicsScene &scene) const
Definition: G4Orb.cc:713
G4ThreeVector GetPointOnSurface() const
Definition: G4Orb.cc:693
ESide
Definition: G4Orb.hh:136
int G4int
Definition: G4Types.hh:78
EInside Inside(const G4ThreeVector &p) const
Definition: G4Orb.cc:320
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Orb.cc:382
G4Polyhedron * CreatePolyhedron() const
Definition: G4Orb.cc:718
G4double GetRadius() const
G4Orb(const G4String &pName, G4double pRmax)
Definition: G4Orb.cc:72
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Orb.cc:673
G4GeometryType GetEntityType() const
Definition: G4Orb.cc:655
bool G4bool
Definition: G4Types.hh:79
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Orb.cc:146
const G4int n
Definition: G4Orb.hh:61
G4VSolid * Clone() const
Definition: G4Orb.cc:664
G4double fRmax
Definition: G4Orb.hh:144
ENorm
Definition: G4Orb.hh:140
EInside
Definition: geomdefs.hh:58
G4double GetCubicVolume()
EAxis
Definition: geomdefs.hh:54
G4double fRmaxTolerance
Definition: G4Orb.hh:145
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=G4bool(false), G4bool *validNorm=0, G4ThreeVector *n=0) const
Definition: G4Orb.cc:492
double G4double
Definition: G4Types.hh:76
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
Definition: G4Orb.cc:352