Geant4_10
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 76263 2013-11-08 11:41:52Z 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 
57 
58 #include "G4CSGSolid.hh"
59 
60 class G4Orb : public G4CSGSolid
61 {
62  public: // with description
63 
64  G4Orb(const G4String& pName, G4double pRmax);
65 
66  virtual ~G4Orb() ;
67 
68  // Accessors
69 
70  inline G4double GetRadius() const;
71 
72  // Modifiers
73 
74  inline void SetRadius(G4double newRmax);
75 
76  // Methods for solid
77 
78  inline G4double GetCubicVolume();
79  inline G4double GetSurfaceArea();
80 
82  const G4int n,
83  const G4VPhysicalVolume* pRep);
84 
85  G4bool CalculateExtent(const EAxis pAxis,
86  const G4VoxelLimits& pVoxelLimit,
87  const G4AffineTransform& pTransform,
88  G4double& pmin, G4double& pmax) const;
89 
90  EInside Inside(const G4ThreeVector& p) const;
91 
92  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
93 
95  const G4ThreeVector& v) const;
96 
97  G4double DistanceToIn(const G4ThreeVector& p) const;
98 
100  const G4ThreeVector& v,
101  const G4bool calcNorm=G4bool(false),
102  G4bool *validNorm=0,
103  G4ThreeVector *n=0) const;
104 
105  G4double DistanceToOut(const G4ThreeVector& p) const;
106 
108 
110 
111  G4VSolid* Clone() const;
112 
113  std::ostream& StreamInfo(std::ostream& os) const;
114 
115  // Visualisation functions
116 
117  void DescribeYourselfTo(G4VGraphicsScene& scene) const;
119 
120  public: // without description
121 
122  G4Orb(__void__&);
123  // Fake default constructor for usage restricted to direct object
124  // persistency for clients requiring preallocation of memory for
125  // persistifiable objects.
126 
127  G4Orb(const G4Orb& rhs);
128  G4Orb& operator=(const G4Orb& rhs);
129  // Copy constructor and assignment operator.
130 
131  protected:
132 
133  // Used by distanceToOut
134 
135  enum ESide {kNull,kRMax};
136 
137  // used by normal
138 
139  enum ENorm {kNRMax};
140 
141  private:
142 
143  G4double fRmax;
144  G4double fRmaxTolerance;
145 };
146 
147 #include "G4Orb.icc"
148 
149 #endif
150 
151 #endif
void SetRadius(G4double newRmax)
G4Orb & operator=(const G4Orb &rhs)
Definition: G4Orb.cc:124
virtual ~G4Orb()
Definition: G4Orb.cc:107
G4double GetSurfaceArea()
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
Definition: G4Orb.cc:158
const char * p
Definition: xmltok.h:285
void DescribeYourselfTo(G4VGraphicsScene &scene) const
Definition: G4Orb.cc:714
G4ThreeVector GetPointOnSurface() const
Definition: G4Orb.cc:694
ESide
Definition: G4Orb.hh:135
int G4int
Definition: G4Types.hh:78
EInside Inside(const G4ThreeVector &p) const
Definition: G4Orb.cc:321
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Orb.cc:383
G4Polyhedron * CreatePolyhedron() const
Definition: G4Orb.cc:719
G4double GetRadius() const
G4Orb(const G4String &pName, G4double pRmax)
Definition: G4Orb.cc:73
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Orb.cc:674
Char_t n[5]
G4GeometryType GetEntityType() const
Definition: G4Orb.cc:656
bool G4bool
Definition: G4Types.hh:79
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Orb.cc:147
Definition: G4Orb.hh:60
tuple v
Definition: test.py:18
G4VSolid * Clone() const
Definition: G4Orb.cc:665
ENorm
Definition: G4Orb.hh:139
EInside
Definition: geomdefs.hh:58
G4double GetCubicVolume()
EAxis
Definition: geomdefs.hh:54
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=G4bool(false), G4bool *validNorm=0, G4ThreeVector *n=0) const
Definition: G4Orb.cc:493
double G4double
Definition: G4Types.hh:76
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
Definition: G4Orb.cc:353