G4BREPSolidCone.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // ----------------------------------------------------------------------
00030 // Class G4BREPSolidCone
00031 //
00032 // Class description:
00033 //
00034 //  Definition of a generic BREP cone.
00035 //
00036 //  G4BREPSolidCone(const G4String& name,
00037 //                  const G4ThreeVector& origin,
00038 //                  const G4ThreeVector& axis,
00039 //                  const G4ThreeVector& direction,
00040 //                        G4double length,
00041 //                        G4double radius,
00042 //                        G4double large_radius)
00043 
00044 // Authors: J.Sulkimo, P.Urban.
00045 // Revisions by: L.Broglia, G.Cosmo.
00046 // ----------------------------------------------------------------------
00047 #ifndef __G4BREPSolidCone
00048 #define __G4BREPSolidCone
00049 
00050 #include "G4BREPSolid.hh"
00051 
00052 class G4BREPSolidCone : public G4BREPSolid
00053 {
00054  public:  // with description
00055 
00056   G4BREPSolidCone(const G4String& name, const G4ThreeVector& origin,
00057                   const G4ThreeVector& axis, const G4ThreeVector& direction,               
00058                   G4double length, G4double radius, G4double large_radius);
00059     // Constructor
00060 
00061   ~G4BREPSolidCone();
00062     // Empty destructor.
00063 
00064   void Initialize();
00065     // Computes the bounding box for solids and surfaces.
00066     // Converts concave planes to convex.
00067 
00068   EInside Inside(register const G4ThreeVector& Pt) const;
00069     // Determines if the point Pt is inside, outside or on the surface
00070     // of the solid.
00071 
00072   G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const;
00073     // Returns the outwards pointing unit normal of the shape for the
00074     // surface closest to the point at offset p.
00075 
00076   G4double DistanceToIn(const G4ThreeVector& p) const;
00077     // Calculate the distance to the nearest surface of a shape from an
00078     // outside point p. The distance can be an underestimate.
00079 
00080   G4double DistanceToIn(register const G4ThreeVector& p, 
00081                         register const G4ThreeVector& v) const;
00082     // Returns the distance along the normalised vector v to the shape,
00083     // from the point at offset p. If there is no intersection, returns
00084     // kInfinity. The first intersection resulting from `leaving' a
00085     // surface/volume is discarded. Hence, it is tolerant of points on
00086     // the surface of the shape.
00087 
00088   G4double DistanceToOut(register const G4ThreeVector& p, 
00089                          register const G4ThreeVector& v, 
00090                          const G4bool calcNorm=false, 
00091                          G4bool *validNorm=0, G4ThreeVector *n=0) const;
00092     // Returns the distance along the normalised vector v to the shape,
00093     // from a point at an offset p inside or on the surface of the shape.
00094 
00095   G4double DistanceToOut(const G4ThreeVector& p) const;
00096     // Calculates the distance to the nearest surface of a shape from an
00097     // inside point. The distance can be an underestimate.
00098 
00099   G4VSolid* Clone() const;
00100     // Returns a pointer of a dynamically allocated copy of the solid.
00101 
00102   std::ostream& StreamInfo(std::ostream& os) const;
00103     // Streams solid contents to output stream.
00104 
00105  public:  // without description
00106 
00107   G4BREPSolidCone(__void__&);
00108     // Fake default constructor for usage restricted to direct object
00109     // persistency for clients requiring preallocation of memory for
00110     // persistifiable objects.
00111 
00112   G4BREPSolidCone(const G4BREPSolidCone& rhs);
00113   G4BREPSolidCone& operator=(const G4BREPSolidCone& rhs);
00114     // Copy constructor and assignment operator.
00115   
00116  private:
00117 
00118   void InitializeCone();
00119 
00120  private:
00121      
00122   struct G4BREPConeParams
00123   {
00124     G4ThreeVector origin;
00125     G4ThreeVector axis;
00126     G4ThreeVector direction;
00127     G4double      length;
00128     G4double      radius;
00129     G4double      large_radius;
00130   } constructorParams;
00131 
00132 };
00133 
00134 #endif

Generated on Mon May 27 17:47:47 2013 for Geant4 by  doxygen 1.4.7