Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4BREPSolidCone.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$
28 //
29 // ----------------------------------------------------------------------
30 // Class G4BREPSolidCone
31 //
32 // Class description:
33 //
34 // Definition of a generic BREP cone.
35 //
36 // G4BREPSolidCone(const G4String& name,
37 // const G4ThreeVector& origin,
38 // const G4ThreeVector& axis,
39 // const G4ThreeVector& direction,
40 // G4double length,
41 // G4double radius,
42 // G4double large_radius)
43 
44 // Authors: J.Sulkimo, P.Urban.
45 // Revisions by: L.Broglia, G.Cosmo.
46 // ----------------------------------------------------------------------
47 #ifndef __G4BREPSolidCone
48 #define __G4BREPSolidCone
49 
50 #include "G4BREPSolid.hh"
51 
53 {
54  public: // with description
55 
56  G4BREPSolidCone(const G4String& name, const G4ThreeVector& origin,
57  const G4ThreeVector& axis, const G4ThreeVector& direction,
58  G4double length, G4double radius, G4double large_radius);
59  // Constructor
60 
62  // Empty destructor.
63 
64  void Initialize();
65  // Computes the bounding box for solids and surfaces.
66  // Converts concave planes to convex.
67 
68  EInside Inside(register const G4ThreeVector& Pt) const;
69  // Determines if the point Pt is inside, outside or on the surface
70  // of the solid.
71 
73  // Returns the outwards pointing unit normal of the shape for the
74  // surface closest to the point at offset p.
75 
76  G4double DistanceToIn(const G4ThreeVector& p) const;
77  // Calculate the distance to the nearest surface of a shape from an
78  // outside point p. The distance can be an underestimate.
79 
80  G4double DistanceToIn(register const G4ThreeVector& p,
81  register const G4ThreeVector& v) const;
82  // Returns the distance along the normalised vector v to the shape,
83  // from the point at offset p. If there is no intersection, returns
84  // kInfinity. The first intersection resulting from `leaving' a
85  // surface/volume is discarded. Hence, it is tolerant of points on
86  // the surface of the shape.
87 
88  G4double DistanceToOut(register const G4ThreeVector& p,
89  register const G4ThreeVector& v,
90  const G4bool calcNorm=false,
91  G4bool *validNorm=0, G4ThreeVector *n=0) const;
92  // Returns the distance along the normalised vector v to the shape,
93  // from a point at an offset p inside or on the surface of the shape.
94 
95  G4double DistanceToOut(const G4ThreeVector& p) const;
96  // Calculates the distance to the nearest surface of a shape from an
97  // inside point. The distance can be an underestimate.
98 
99  G4VSolid* Clone() const;
100  // Returns a pointer of a dynamically allocated copy of the solid.
101 
102  std::ostream& StreamInfo(std::ostream& os) const;
103  // Streams solid contents to output stream.
104 
105  public: // without description
106 
107  G4BREPSolidCone(__void__&);
108  // Fake default constructor for usage restricted to direct object
109  // persistency for clients requiring preallocation of memory for
110  // persistifiable objects.
111 
112  G4BREPSolidCone(const G4BREPSolidCone& rhs);
114  // Copy constructor and assignment operator.
115 
116  private:
117 
118  void InitializeCone();
119 
120  private:
121 
122  struct G4BREPConeParams
123  {
124  G4ThreeVector origin;
125  G4ThreeVector axis;
126  G4ThreeVector direction;
127  G4double length;
128  G4double radius;
129  G4double large_radius;
130  } constructorParams;
131 
132 };
133 
134 #endif