Geant4  10.01.p03
UGenericPolycone.hh
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 // UGenericPolycone
12 //
13 // Class description:
14 //
15 // Implementing a CSG-like type "PCON" volume with possibility of
16 // specifying also 'decreasing' Z sections:
17 //
18 // UGenericPolycone( const std::string& name,
19 // double phiStart, // initial phi starting angle
20 // double phiTotal, // total phi angle
21 // int numRZ, // number corners in r,z space
22 // const double r[], // r coordinate of these corners
23 // const double z[]) // z coordinate of these corners
24 //
25 // 19.10.13 Tatiana Nikitina
26 // Created from original implementation in Geant4
27 // --------------------------------------------------------------------
28 
29 #ifndef UGenericPolycone_hh
30 #define UGenericPolycone_hh
31 
32 #include "UVCSGfaceted.hh"
33 #include "UPolyconeSide.hh"
34 
35 class UEnclosingCylinder;
36 class UReduciblePolygon;
37 class UVCSGface;
38 
40 {
41 
42  public: // with description
43 
44  UGenericPolycone(const std::string& name,
45  double phiStart, // initial phi starting angle
46  double phiTotal, // total phi angle
47  int numZPlanes, // number of z planes
48  const double zPlane[], // position of z planes
49  const double rInner[], // tangent distance to inner surface
50  const double rOuter[]); // tangent distance to outer surface
51 
52  UGenericPolycone(const std::string& name,
53  double phiStart, // initial phi starting angle
54  double phiTotal, // total phi angle
55  int numRZ, // number corners in r,z space
56  const double r[], // r coordinate of these corners
57  const double z[]); // z coordinate of these corners
58 
59  virtual ~UGenericPolycone();
60 
61  // Methods for solid
62 
63  VUSolid::EnumInside Inside(const UVector3& p) const;
64  double DistanceToIn(const UVector3& p, const UVector3& v, double aPstep = UUtils::kInfinity) const;
65  // double SafetyFromOutside( const UVector3 &p, bool aAccurate=false) const;
66 
68 
69  /*
70  void ComputeDimensions( UVPVParameterisation* p,
71  const int n,
72  const UVPhysicalVolume* pRep );
73  */
74 
76 
77  VUSolid* Clone() const;
78 
79  std::ostream& StreamInfo(std::ostream& os) const;
80  bool Reset();
81 
82  // Accessors
83 
84  inline double GetStartPhi() const;
85  inline double GetEndPhi() const;
86  inline bool IsOpen() const;
87  inline int GetNumRZCorner() const;
88  inline UPolyconeSideRZ GetCorner(int index) const;
89 
90 
91  public: // without description
92 
93  //UPolycone(__void__&);
94  // Fake default constructor for usage restricted to direct object
95  // persistency for clients requiring preallocation of memory for
96  // persistifiable objects.
97 
98  UGenericPolycone(const UGenericPolycone& source);
100  // Copy constructor and assignment operator.
101 
102  protected: // without description
103 
104  // Generic initializer, called by all constructors
105 
106 
107  void Create(double phiStart, // initial phi starting angle
108  double phiTotal, // total phi angle
109  UReduciblePolygon* rz); // r/z coordinate of these corners
110 
111  void CopyStuff(const UGenericPolycone& source);
112 
113  // Methods for random point generation
114 
115 
116 
117  void GetParametersList(int /*aNumber*/, double* /*aArray*/) const {}
118 
119  void ComputeBBox(UBBox* /*aBox*/, bool /*aStore*/)
120  {
121  // Computes bounding box.
122  std::cout << "ComputeBBox - Not implemented" << std::endl;
123  }
124 
125  void Extent(UVector3& aMin, UVector3& aMax) const;
126 
127  protected: // without description
128 
129  // Here are our parameters
130 
131  double startPhi; // Starting phi value (0 < phiStart < 2pi)
132  double endPhi; // end phi value (0 < endPhi-phiStart < 2pi)
133  bool phiIsOpen; // true if there is a phi segment
134  int numCorner; // number RZ points
135  UPolyconeSideRZ* corners; // corner r,z points
136 
137  // Our quick test
138 
140 
141 };
142 
143 #include "UGenericPolycone.icc"
144 
145 #endif
std::ostream & StreamInfo(std::ostream &os) const
void ComputeBBox(UBBox *, bool)
UPolyconeSideRZ * corners
UVector3 GetPointOnSurface() const
UGeometryType GetEntityType() const
double GetStartPhi() const
G4double z
Definition: TRTMaterials.hh:39
VUSolid::EnumInside Inside(const UVector3 &p) const
G4String name
Definition: TRTMaterials.hh:40
UGenericPolycone(const std::string &name, double phiStart, double phiTotal, int numZPlanes, const double zPlane[], const double rInner[], const double rOuter[])
void Create(double phiStart, double phiTotal, UReduciblePolygon *rz)
UPolyconeSideRZ GetCorner(int index) const
UEnclosingCylinder * enclosingCylinder
void Extent(UVector3 &aMin, UVector3 &aMax) const
static const double kInfinity
Definition: UUtils.hh:54
int GetNumRZCorner() const
virtual ~UGenericPolycone()
void CopyStuff(const UGenericPolycone &source)
void GetParametersList(int, double *) const
EnumInside
Definition: VUSolid.hh:23
double GetEndPhi() const
UGenericPolycone & operator=(const UGenericPolycone &source)
std::string UGeometryType
Definition: UTypes.hh:39
VUSolid * Clone() const
bool IsOpen() const
double DistanceToIn(const UVector3 &p, const UVector3 &v, double aPstep=UUtils::kInfinity) const