Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4Para.hh
이 파일의 문서화 페이지로 가기
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: G4Para.hh 105075 2017-07-11 14:22:53Z gcosmo $
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // G4Para
34 //
35 // Class description:
36 //
37 // A G4Parallepiped, essentially a box with half lengths dx,dy,dz
38 // `skewed' so that there are angles theta & phi of the polar line
39 // joining the faces at +-dz in z, and alpha formed by the y axis
40 // and the plane joinng the centre of the faces G4Parallel to the
41 // z-x plane at -dy and +dy.
42 //
43 // A G4Para is defined by:
44 // dx,dy,dz - Half-length in x,y,z
45 // alpha - Angle formed by the y axis and by the plane joining
46 // the centre of the faces G4Parallel to the z-x plane
47 // at -dy and +dy
48 // theta - Polar angle of the line joining the centres of the
49 // faces at -dz and +dz in z
50 // phi - Azimuthal angle of the line joining the centres of the
51 // faces at -dz and +dz in z
52 // Member data:
53 //
54 // Note that the angles parameters are not stored - precomputed trig is
55 // stored instead.
56 //
57 // fDx Half-length in x
58 // fDy Half-length in y
59 // fDz Half-length in z
60 //
61 // fTalpha Tan of alpha
62 // fTthetaCphi Tan theta * Cos phi
63 // fTthetaSphi Tan theta * Sin phi
64 
65 // History:
66 // 21.3.94 P.Kent Old C++ code converted to tolerant geometry
67 // 31.10.96 V.Grichine Modifications according G4Box/Tubs before to commit
68 // 18.11.99 V.Grichine , kUndefined was added to ESide
69 // --------------------------------------------------------------------
70 
71 #ifndef G4Para_HH
72 #define G4Para_HH
73 
74 #if defined(G4GEOM_USE_USOLIDS)
75 #define G4GEOM_USE_UPARA 1
76 #endif
77 
78 #if defined(G4GEOM_USE_UPARA)
79  #define G4UPara G4Para
80  #include "G4UPara.hh"
81 #else
82 
83 #include "G4CSGSolid.hh"
84 #include "G4Polyhedron.hh"
85 
86 class G4Para : public G4CSGSolid
87 {
88  public: // with description
89 
90  G4Para(const G4String& pName,
91  G4double pDx, G4double pDy, G4double pDz,
92  G4double pAlpha, G4double pTheta, G4double pPhi);
93 
94  G4Para(const G4String& pName,
95  const G4ThreeVector pt[8]);
96 
97  virtual ~G4Para();
98 
99  // Accessors
100 
101  inline G4double GetZHalfLength() const;
102  inline G4ThreeVector GetSymAxis() const;
103  inline G4double GetYHalfLength() const;
104  inline G4double GetXHalfLength() const;
105  inline G4double GetTanAlpha() const;
106 
107  // Modifiers
108 
109  inline void SetXHalfLength(G4double val);
110  inline void SetYHalfLength(G4double val);
111  inline void SetZHalfLength(G4double val);
112  inline void SetAlpha(G4double alpha);
113  inline void SetTanAlpha(G4double val);
114  inline void SetThetaAndPhi(double pTheta, double pPhi);
115 
116  void SetAllParameters(G4double pDx, G4double pDy, G4double pDz,
117  G4double pAlpha, G4double pTheta, G4double pPhi);
118 
119  // Methods of solid
120 
123 
125  const G4int n,
126  const G4VPhysicalVolume* pRep);
127 
128  void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
129 
130  G4bool CalculateExtent(const EAxis pAxis,
131  const G4VoxelLimits& pVoxelLimit,
132  const G4AffineTransform& pTransform,
133  G4double& pMin, G4double& pMax) const;
134 
135  EInside Inside(const G4ThreeVector& p) const;
136 
137  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
138 
140  const G4ThreeVector& v) const;
141  G4double DistanceToIn(const G4ThreeVector& p) const;
142 
144  const G4bool calcNorm=G4bool(false),
145  G4bool *validNorm=0, G4ThreeVector *n=0) const;
146  G4double DistanceToOut(const G4ThreeVector& p) const;
147 
149 
151 
152  G4VSolid* Clone() const;
153 
154  std::ostream& StreamInfo(std::ostream& os) const;
155 
156  // Visualisation functions
157 
158  void DescribeYourselfTo (G4VGraphicsScene& scene) const;
159  G4Polyhedron* CreatePolyhedron () const;
160 
161  public: // without description
162 
163  G4Para(__void__&);
164  // Fake default constructor for usage restricted to direct object
165  // persistency for clients requiring preallocation of memory for
166  // persistifiable objects
167 
168  G4Para(const G4Para& rhs);
169  G4Para& operator=(const G4Para& rhs);
170  // Copy constructor and assignment operator
171 
172  private:
173 
174  void CheckParameters();
175  // Check parameters
176 
177  void MakePlanes();
178  // Set side planes
179 
181  // Algorithm for SurfaceNormal() following the original
182  // specification for points not on the surface
183 
184  private:
185 
189  struct { G4double a,b,c,d; } fPlanes[4];
190 };
191 
192 #include "G4Para.icc"
193 
194 #endif
195 
196 #endif
G4double b
Definition: G4Para.hh:189
G4ThreeVector GetPointOnSurface() const
Definition: G4Para.cc:857
void SetAlpha(G4double alpha)
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=G4bool(false), G4bool *validNorm=0, G4ThreeVector *n=0) const
Definition: G4Para.cc:665
void SetYHalfLength(G4double val)
G4double GetTanAlpha() const
struct G4Para::@33 fPlanes[4]
G4VSolid * Clone() const
Definition: G4Para.cc:818
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
Definition: G4Para.cc:449
G4double fTthetaSphi
Definition: G4Para.hh:188
const char * p
Definition: xmltok.h:285
G4ThreeVector ApproxSurfaceNormal(const G4ThreeVector &p) const
Definition: G4Para.cc:530
G4double GetCubicVolume()
Definition: G4Para.cc:284
G4double GetXHalfLength() const
G4ThreeVector GetSymAxis() const
void SetXHalfLength(G4double val)
G4double a
Definition: G4Para.hh:189
void SetAllParameters(G4double pDx, G4double pDy, G4double pDz, G4double pAlpha, G4double pTheta, G4double pPhi)
Definition: G4Para.cc:200
void MakePlanes()
Definition: G4Para.cc:245
void SetTanAlpha(G4double val)
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Para.cc:827
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Para.cc:554
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4double fDz
Definition: G4Para.hh:187
void SetZHalfLength(G4double val)
G4double halfCarTolerance
Definition: G4Para.hh:186
G4double c
Definition: G4Para.hh:189
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
Definition: G4Para.cc:374
static const G4double alpha
TMarker * pt
Definition: egs.C:25
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
Definition: G4Para.cc:331
G4double fDx
Definition: G4Para.hh:187
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Para.cc:320
void CheckParameters()
Definition: G4Para.cc:224
G4GeometryType GetEntityType() const
Definition: G4Para.cc:809
int G4int
Definition: G4Types.hh:78
EInside
Definition: geomdefs.hh:58
EAxis
Definition: geomdefs.hh:54
G4double GetSurfaceArea()
Definition: G4Para.cc:298
G4double fTthetaCphi
Definition: G4Para.hh:188
virtual ~G4Para()
Definition: G4Para.cc:152
EInside Inside(const G4ThreeVector &p) const
Definition: G4Para.cc:429
G4Polyhedron * CreatePolyhedron() const
Definition: G4Para.cc:915
G4Para & operator=(const G4Para &rhs)
Definition: G4Para.cc:172
void DescribeYourselfTo(G4VGraphicsScene &scene) const
Definition: G4Para.cc:910
Char_t n[5]
G4double GetZHalfLength() const
G4double fDy
Definition: G4Para.hh:187
G4double d
Definition: G4Para.hh:189
Definition: G4Para.hh:86
G4double fTalpha
Definition: G4Para.hh:188
void SetThetaAndPhi(double pTheta, double pPhi)
G4double GetYHalfLength() const
G4Para(const G4String &pName, G4double pDx, G4double pDy, G4double pDz, G4double pAlpha, G4double pTheta, G4double pPhi)
Definition: G4Para.cc:68