Geant4  10.01.p01
UPolycone.icc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * This Software is part of the AIDA Unified Solids Library package *
4 // * See: https://aidasoft.web.cern.ch/USolids *
5 // ********************************************************************
6 //
7 // $Id:$
8 //
9 // --------------------------------------------------------------------
10 //
11 // UPolycone.icc
12 //
13 // Implementation of inline methods of UPolycone
14 //
15 // 19.04.13 Marek Gayer
16 // Created from original implementation in Geant4
17 // --------------------------------------------------------------------
18 
19 inline
20 double UPolycone::GetStartPhi() const
21 {
22  return startPhi;
23 }
24 
25 inline
26 double UPolycone::GetEndPhi() const
27 {
28  return endPhi;
29 }
30 
31 inline
32 bool UPolycone::IsOpen() const
33 {
34  return phiIsOpen;
35 }
36 
37 inline
38 bool UPolycone::IsGeneric() const
39 {
40  return false;
41 }
42 
43 inline
44 int UPolycone::GetNumRZCorner() const
45 {
46  return numCorner;
47 }
48 
49 inline
50 UPolyconeSideRZ UPolycone::GetCorner(int index) const
51 {
52  return corners[index];
53 }
54 
55 inline
56 UPolyconeHistorical* UPolycone::GetOriginalParameters() const
57 {
58  return fOriginalParameters;
59 }
60 
61 inline
62 void UPolycone::SetOriginalParameters(UPolyconeHistorical* pars)
63 {
64  if (!pars)
65  // UException("UPolycone::SetOriginalParameters()", "GeomSolids0002",
66  // FatalException, "NULL pointer to parameters!");
67  *fOriginalParameters = *pars;
68  fCubicVolume = 0.;
69  fpPolyhedron = 0;
70 }
71 
72 inline
73 void UPolycone::SetOriginalParameters()
74 {
75  int numPlanes = (int)numCorner / 2;
76 
77  fOriginalParameters = new UPolyconeHistorical;
78 
79  fOriginalParameters->fZValues.resize(numPlanes);
80  fOriginalParameters->Rmin.resize(numPlanes);
81  fOriginalParameters->Rmax.resize(numPlanes);
82 
83  for (int j = 0; j < numPlanes; j++)
84  {
85  fOriginalParameters->fZValues[j] = corners[numPlanes + j].z;
86  fOriginalParameters->Rmax[j] = corners[numPlanes + j].r;
87  fOriginalParameters->Rmin[j] = corners[numPlanes - 1 - j].r;
88  }
89 
90  fOriginalParameters->fStartAngle = startPhi;
91  fOriginalParameters->fOpeningAngle = endPhi - startPhi;
92  fOriginalParameters->fNumZPlanes = numPlanes;
93 }