Geant4  10.01.p03
UGenericTrap.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 // UGenericTrap.icc
12 //
13 // 21.10.13 Tatiana Nikitina, CERN; Ivana Hrivnacova, IPN Orsay
14 // Adapted from Root Arb8 implementation
15 // --------------------------------------------------------------------
16 
17 inline
18 double UGenericTrap::GetZHalfLength() const
19 {
20  return fDz;
21 }
22 
23 inline
24 void UGenericTrap::SetZHalfLength(double halfZ)
25 {
26  fDz = halfZ;
27 }
28 
29 // --------------------------------------------------------------------
30 
31 inline
32 int UGenericTrap::GetNofVertices() const
33 {
34  return fVertices.size();
35 }
36 
37 // --------------------------------------------------------------------
38 
39 inline
40 UVector2 UGenericTrap::GetVertex(int index) const
41 {
42  if (index < 0 || index >= int(fVertices.size()))
43  {
44  UUtils::Exception("UGenericTrap::GetVertex()", "GeomSolids0003",
45  UFatalError, 1, "Index outside range.");
46  }
47  return fVertices[index];
48 }
49 
50 // --------------------------------------------------------------------
51 
52 inline
53 const std::vector<UVector2>& UGenericTrap::GetVertices() const
54 {
55  return fVertices;
56 }
57 
58 // --------------------------------------------------------------------
59 
60 inline
61 
62 double UGenericTrap::GetTwistAngle(int index) const
63 {
64  if ((index < 0) || (index >= int(fVertices.size())))
65  {
66  UUtils::Exception ("UGenericTrap::GetTwistAngle()", "GeomSolids0003",
67  UFatalError, 1, "Index outside range.");
68  }
69  return fTwist[index];
70 }
71 
72 // --------------------------------------------------------------------
73 
74 inline
75 bool UGenericTrap::IsTwisted() const
76 {
77  return fIsTwisted;
78 }
79 
80 // --------------------------------------------------------------------
81 
82 inline
83 void UGenericTrap::SetTwistAngle(int index, double twist)
84 {
85  if ((index < 0) || (index >= int(fVertices.size())))
86  {
87  UUtils::Exception ("UGenericTrap::SetTwistAngle()", "GeomSolids0003",
88  UFatalError, 1, "Index outside range.");
89  }
90  fTwist[index] = twist;
91 }
92 
93 // --------------------------------------------------------------------
94 
95 inline
96 int UGenericTrap::GetVisSubdivisions()const
97 {
98  return fVisSubdivisions;
99 }
100 
101 // --------------------------------------------------------------------
102 
103 inline
104 void UGenericTrap::SetVisSubdivisions(int subdiv)
105 {
106  fVisSubdivisions = subdiv;
107 }
108 
109 // --------------------------------------------------------------------
110 
111 inline
112 UVector3 UGenericTrap::GetMinimumBBox() const
113 {
114  return fMinBBoxVector;
115 }
116 
117 // --------------------------------------------------------------------
118 
119 inline
120 UVector3 UGenericTrap::GetMaximumBBox() const
121 {
122  return fMaxBBoxVector;
123 }
124 
125 // --------------------------------------------------------------------
126