Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
81 
82  bool Reset();
83 
84  // Accessors
85 
86  inline double GetStartPhi() const;
87  inline double GetEndPhi() const;
88  inline bool IsOpen() const;
89  inline int GetNumRZCorner() const;
90  inline UPolyconeSideRZ GetCorner(int index) const;
91 
92 
93  public: // without description
94 
95  //UPolycone(__void__&);
96  // Fake default constructor for usage restricted to direct object
97  // persistency for clients requiring preallocation of memory for
98  // persistifiable objects.
99 
100  UGenericPolycone(const UGenericPolycone& source);
102  // Copy constructor and assignment operator.
103 
104  protected: // without description
105 
106  // Generic initializer, called by all constructors
107 
108 
109  void Create(double phiStart, // initial phi starting angle
110  double phiTotal, // total phi angle
111  UReduciblePolygon* rz); // r/z coordinate of these corners
112 
113  void CopyStuff(const UGenericPolycone& source);
114 
115  // Methods for random point generation
116 
117 
118 
119  void GetParametersList(int /*aNumber*/, double* /*aArray*/) const {}
120 
121  void ComputeBBox(UBBox* /*aBox*/, bool /*aStore*/)
122  {
123  // Computes bounding box.
124  std::cout << "ComputeBBox - Not implemented" << std::endl;
125  }
126 
127  void Extent(UVector3& aMin, UVector3& aMax) const;
128 
129  protected: // without description
130 
131  // Here are our parameters
132 
133  double startPhi; // Starting phi value (0 < phiStart < 2pi)
134  double endPhi; // end phi value (0 < endPhi-phiStart < 2pi)
135  bool phiIsOpen; // true if there is a phi segment
136  int numCorner; // number RZ points
137  UPolyconeSideRZ* corners; // corner r,z points
138 
139  // Our quick test
140 
142 
143 };
144 
145 #include "UGenericPolycone.icc"
146 
147 #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
const char * p
Definition: xmltok.h:285
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)
const XML_Char * name
UPolyconeSideRZ GetCorner(int index) const
UEnclosingCylinder * enclosingCylinder
void Extent(UVector3 &aMin, UVector3 &aMax) const
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:70
VUSolid * Clone() const
bool IsOpen() const
double DistanceToIn(const UVector3 &p, const UVector3 &v, double aPstep=UUtils::kInfinity) const