Geant4  10.01.p03
G4GenericPolycone.hh
Go to the documentation of this file.
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: G4GenerciPolycone.hh 72077 2013-07-08 12:31:44Z tnikitin $
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 //
34 // G4GenericPolycone
35 //
36 // Class description:
37 //
38 // Class implementing a GenericPolycone constructed by points with
39 // (r,z)coordinates, allows Z 'go back'
40 //
41 //
42 // G4GenericPolycone( const G4String& name,
43 // G4double phiStart, // initial phi starting angle
44 // G4double phiTotal, // total phi angle
45 // G4int numRZ, // number corners in r,z space
46 // const G4double r[], // r coordinate of these corners
47 // const G4double z[]) // z coordinate of these corners
48 //
49 //
50 // --------------------------------------------------------------------
51 #ifndef G4GenericPolycone_hh
52 #define G4GenericPolycone_hh
53 
54 #if defined(G4GEOM_USE_USOLIDS)
55 #define G4GEOM_USE_UGENERICPOLYCONE 1
56 #endif
57 
58 #if defined(G4GEOM_USE_UGENERICPOLYCONE)
59  #define G4UGenericPolycone G4GenericPolycone
60  #include "G4UGenericPolycone.hh"
61 #else
62 
63 #include "G4VCSGfaceted.hh"
64 #include "G4PolyconeSide.hh"
65 
67 class G4ReduciblePolygon;
68 class G4VCSGface;
69 
71 {
72 
73  public: // with description
74 
76  G4double phiStart, // initial phi starting angle
77  G4double phiTotal, // total phi angle
78  G4int numRZ, // number corners in r,z space
79  const G4double r[], // r coordinate of these corners
80  const G4double z[] ); // z coordinate of these corners
81 
82  virtual ~G4GenericPolycone();
83 
84  // Methods for solid
85 
86  EInside Inside( const G4ThreeVector &p ) const;
87  G4double DistanceToIn( const G4ThreeVector &p, const G4ThreeVector &v ) const;
88  G4double DistanceToIn( const G4ThreeVector &p ) const;
89 
91 
93 
94  G4VSolid* Clone() const;
95 
96  std::ostream& StreamInfo(std::ostream& os) const;
97 
99 
100  G4bool Reset();
101 
102  // Accessors
103 
104  inline G4double GetStartPhi() const;
105  inline G4double GetEndPhi() const;
106  inline G4bool IsOpen() const;
107  inline G4int GetNumRZCorner() const;
108  inline G4PolyconeSideRZ GetCorner(G4int index) const;
109 
110  public: // without description
111 
112  G4GenericPolycone(__void__&);
113  // Fake default constructor for usage restricted to direct object
114  // persistency for clients requiring preallocation of memory for
115  // persistifiable objects.
116 
117  G4GenericPolycone( const G4GenericPolycone &source );
119  // Copy constructor and assignment operator.
120 
121  protected: // without description
122 
123  // Generic initializer, called by all constructors
124 
125  // void SetOriginalParameters(G4ReduciblePolygon *rz);
126 
127  void Create( G4double phiStart, // initial phi starting angle
128  G4double phiTotal, // total phi angle
129  G4ReduciblePolygon *rz ); // r/z coordinate of these corners
130 
131  void CopyStuff( const G4GenericPolycone &source );
132 
133  // Methods for random point generation
134 
135  protected: // without description
136 
137  // Here are our parameters
138 
139  G4double startPhi; // Starting phi value (0 < phiStart < 2pi)
140  G4double endPhi; // end phi value (0 < endPhi-phiStart < 2pi)
141  G4bool phiIsOpen; // true if there is a phi segment
142  G4int numCorner; // number RZ points
143  G4PolyconeSideRZ *corners; // corner r,z points
144 
145  // Our quick test
146 
148 
149 };
150 
151 #include "G4GenericPolycone.icc"
152 
153 #endif
154 
155 #endif
G4PolyconeSideRZ GetCorner(G4int index) const
G4PolyconeSideRZ * corners
CLHEP::Hep3Vector G4ThreeVector
G4double z
Definition: TRTMaterials.hh:39
G4String name
Definition: TRTMaterials.hh:40
int G4int
Definition: G4Types.hh:78
G4GenericPolycone(const G4String &name, G4double phiStart, G4double phiTotal, G4int numRZ, const G4double r[], const G4double z[])
G4double GetEndPhi() const
G4GeometryType GetEntityType() const
G4Polyhedron * CreatePolyhedron() const
G4ThreeVector GetPointOnSurface() const
G4EnclosingCylinder * enclosingCylinder
G4bool IsOpen() const
void Create(G4double phiStart, G4double phiTotal, G4ReduciblePolygon *rz)
void CopyStuff(const G4GenericPolycone &source)
bool G4bool
Definition: G4Types.hh:79
std::ostream & StreamInfo(std::ostream &os) const
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4double GetStartPhi() const
G4GenericPolycone & operator=(const G4GenericPolycone &source)
EInside Inside(const G4ThreeVector &p) const
EInside
Definition: geomdefs.hh:58
double G4double
Definition: G4Types.hh:76
G4VSolid * Clone() const
G4int GetNumRZCorner() const