Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 105148 2017-07-14 08:35:13Z 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 #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  inline G4double GetRadialTolerance() const;
73 
74  // Modifiers
75 
76  inline void SetRadius(G4double newRmax);
77 
78  // Methods for solid
79 
80  inline G4double GetCubicVolume();
81  inline G4double GetSurfaceArea();
82 
84  const G4int n,
85  const G4VPhysicalVolume* pRep);
86 
87  void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
88 
89  G4bool CalculateExtent(const EAxis pAxis,
90  const G4VoxelLimits& pVoxelLimit,
91  const G4AffineTransform& pTransform,
92  G4double& pmin, G4double& pmax) const;
93 
94  EInside Inside(const G4ThreeVector& p) const;
95 
96  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
97 
99  const G4ThreeVector& v) const;
100 
101  G4double DistanceToIn(const G4ThreeVector& p) const;
102 
104  const G4ThreeVector& v,
105  const G4bool calcNorm=G4bool(false),
106  G4bool *validNorm=0,
107  G4ThreeVector *n=0) const;
108 
109  G4double DistanceToOut(const G4ThreeVector& p) const;
110 
112 
114 
115  G4VSolid* Clone() const;
116 
117  std::ostream& StreamInfo(std::ostream& os) const;
118 
119  // Visualisation functions
120 
121  void DescribeYourselfTo(G4VGraphicsScene& scene) const;
123 
124  public: // without description
125 
126  G4Orb(__void__&);
127  // Fake default constructor for usage restricted to direct object
128  // persistency for clients requiring preallocation of memory for
129  // persistifiable objects.
130 
131  G4Orb(const G4Orb& rhs);
132  G4Orb& operator=(const G4Orb& rhs);
133  // Copy constructor and assignment operator.
134 
135  protected:
136 
137  // Used by distanceToOut
138 
139  enum ESide {kNull,kRMax};
140 
141  // used by normal
142 
143  enum ENorm {kNRMax};
144 
145  private:
146 
147  G4double fRmax;
148  G4double fRmaxTolerance;
149 };
150 
151 #include "G4Orb.icc"
152 
153 #endif
154 
155 #endif
void SetRadius(G4double newRmax)
void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
Definition: G4Orb.cc:160
G4Orb & operator=(const G4Orb &rhs)
Definition: G4Orb.cc:126
virtual ~G4Orb()
Definition: G4Orb.cc:109
G4double GetSurfaceArea()
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
Definition: G4Orb.cc:184
const char * p
Definition: xmltok.h:285
void DescribeYourselfTo(G4VGraphicsScene &scene) const
Definition: G4Orb.cc:645
G4ThreeVector GetPointOnSurface() const
Definition: G4Orb.cc:625
ESide
Definition: G4Orb.hh:139
int G4int
Definition: G4Types.hh:78
EInside Inside(const G4ThreeVector &p) const
Definition: G4Orb.cc:269
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Orb.cc:314
G4Polyhedron * CreatePolyhedron() const
Definition: G4Orb.cc:650
G4double GetRadius() const
G4Orb(const G4String &pName, G4double pRmax)
Definition: G4Orb.cc:75
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Orb.cc:605
G4GeometryType GetEntityType() const
Definition: G4Orb.cc:587
bool G4bool
Definition: G4Types.hh:79
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Orb.cc:149
const G4int n
Definition: G4Orb.hh:61
tuple v
Definition: test.py:18
G4VSolid * Clone() const
Definition: G4Orb.cc:596
ENorm
Definition: G4Orb.hh:143
G4double GetRadialTolerance() const
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:424
double G4double
Definition: G4Types.hh:76
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
Definition: G4Orb.cc:299