Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 100820 2016-11-02 15:18:48Z 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 
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  void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
87 
88  G4bool CalculateExtent(const EAxis pAxis,
89  const G4VoxelLimits& pVoxelLimit,
90  const G4AffineTransform& pTransform,
91  G4double& pmin, G4double& pmax) const;
92 
93  EInside Inside(const G4ThreeVector& p) const;
94 
95  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
96 
98  const G4ThreeVector& v) const;
99 
100  G4double DistanceToIn(const G4ThreeVector& p) const;
101 
103  const G4ThreeVector& v,
104  const G4bool calcNorm=G4bool(false),
105  G4bool *validNorm=0,
106  G4ThreeVector *n=0) const;
107 
108  G4double DistanceToOut(const G4ThreeVector& p) const;
109 
111 
113 
114  G4VSolid* Clone() const;
115 
116  std::ostream& StreamInfo(std::ostream& os) const;
117 
118  // Visualisation functions
119 
120  void DescribeYourselfTo(G4VGraphicsScene& scene) const;
122 
123  public: // without description
124 
125  G4Orb(__void__&);
126  // Fake default constructor for usage restricted to direct object
127  // persistency for clients requiring preallocation of memory for
128  // persistifiable objects.
129 
130  G4Orb(const G4Orb& rhs);
131  G4Orb& operator=(const G4Orb& rhs);
132  // Copy constructor and assignment operator.
133 
134  protected:
135 
136  // Used by distanceToOut
137 
138  enum ESide {kNull,kRMax};
139 
140  // used by normal
141 
142  enum ENorm {kNRMax};
143 
144  private:
145 
146  G4double fRmax;
147  G4double fRmaxTolerance;
148 };
149 
150 #include "G4Orb.icc"
151 
152 #endif
153 
154 #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:138
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
Definition: G4Orb.hh:61
G4VSolid * Clone() const
Definition: G4Orb.cc:596
ENorm
Definition: G4Orb.hh:142
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