Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
@@ -5,17 +5,16 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FCylindricalSurface.hh,v 1.7 2000/02/16 12:02:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4FCylindricalSurface.hh,v 1.10 2000/11/08 14:22:01 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// ----------------------------------------------------------------------
// Class G4FCylindricalSurface
//
// Class Description:
//
// Definition of a generic bounded cylindrical surface.
//
#ifndef __FCYLINDER_H
#define __FCYLINDER_H
#include "G4PointRat.hh"
#include "G4Axis2Placement3D.hh"
#include "G4Surface.hh"
// Position.axis| radius
// >|---|<---------
// |
@@ -28,126 +27,122 @@
// h | | | |
// -- +---|---+
// Position
// The code for G4CylindricalSurface has been derived from the original
// implementation in the "Gismo" package.
//
// Author: A.Breakstone
// Adaptation: J.Sulkimo, P.Urban.
// Revisions by: L.Broglia, G.Cosmo.
// ----------------------------------------------------------------------
#ifndef __FCYLINDER_H
#define __FCYLINDER_H
#include "G4PointRat.hh"
#include "G4Axis2Placement3D.hh"
#include "G4Surface.hh"
class G4FCylindricalSurface: public G4Surface
class G4FCylindricalSurface : public G4Surface
{
public: // with description
G4FCylindricalSurface();
// Default constructor.
G4FCylindricalSurface( const G4Point3D& o,
const G4Vector3D& a,
G4double r,
G4double l );
// o : origin.
// a : axis.
// r : radius.
// l : length.
virtual ~G4FCylindricalSurface();
// Destructor.
inline G4int operator==( const G4FCylindricalSurface& c ) const;
// Equality operator.
virtual G4Vector3D SurfaceNormal( const G4Point3D& p ) const;
// Returns the Normal unit vector to the G4FCylindricalSurface at a point
// p on (or nearly on) the G4FCylindricalSurface.
virtual G4int Inside( const G4Vector3D& x ) const;
// Returns 1 if the point x is Inside the G4FCylindricalSurface,
// returns 0 otherwise.
inline G4String GetEntityType() const;
// Returns the shape identifier.
G4int Intersect(const G4Ray&);
// Counts the number of intersections of a bounded cylindrical surface
// by a ray. At first, it calculates the intersections with the infinite
// cylindrical surface. Then, it counts the intersections within the
// finite cylindrical surface boundaries, and sets the "distance" to the
// closest distance from the start point to the nearest intersection.
// If the point is on the surface it returns either the intersection with
// the opposite surface or kInfinity.
// If no intersection is found, it sets distance = kInfinity and returns 0.
virtual G4double HowNear( const G4Vector3D& x ) const;
// Computes the shortest distance from the point x to the
// G4FCylindricalSurface. The distance will be always positive.
void CalcBBox();
// Computes the bounding box.
virtual const char* NameOf() const;
// Returns the class name.
virtual void PrintOn( G4std::ostream& os = G4cout ) const;
// Printing function.
virtual G4int WithinBoundary( const G4Vector3D& x ) const;
// Returns 1 if the point x is within the boundary, 0 otherwise.
virtual G4double Scale() const;
// Return the radius of a G4FCylindricalSurface.
// Used for Scale-invariant tests of surface thickness.
// If the radius is zero, it returns the length.
virtual G4double Area() const;
// Calculates the area of a G4FCylindricalSurface.
virtual void resize( G4double r, G4double l );
// Changes the radius and length of the G4FCylindricalSurface:
// the first (input) argument is the new radius;
// the second (input) argument is the new length.
inline G4double GetLength() const;
inline G4Vector3D GetAxis() const;
inline G4double GetRadius() const;
void SetRadius( G4double r );
// Get/Set methods for the geometrical data of the G4FCylindricalSurface.
public: // without description
void InitValues();
// Re-calculates the private values of the G4FCylindrical surface
// before the Intersect and HowNear function if the G4FCylindrical
// was created by the STEP interface.
protected:
G4Axis2Placement3D Position;
G4double radius;
G4double length;
private:
public:
G4FCylindricalSurface(const G4FCylindricalSurface&);
G4FCylindricalSurface& operator=(const G4FCylindricalSurface&);
// Private copy constructor and assignment operator.
// default constructor
G4FCylindricalSurface()
{
length = 1.0;
}
// Constructor utilized by the G4BREPSolidPCone
// first argument is the origin
// second argument is the axis
// third argument is the radius
// fourth argument is the length
G4FCylindricalSurface( const G4Point3D& o,
const G4Vector3D& a,
const G4double r,
const G4double l );
// destructor
~G4FCylindricalSurface() {}
// copy constructor
G4FCylindricalSurface(const G4FCylindricalSurface& c);
virtual G4Vector3D SurfaceNormal( const G4Point3D& p ) const;
virtual int Inside( const G4Vector3D& x ) const;
//
G4String GetEntityType()
{
return G4String("Cylindrical_Surface");
}
// This function count the number of intersections of a
// bounded cylindrical surface by a ray.
// At first, calculates the intersections with the infinite
// cylindrical surfsace. After, count the intersections within the
// finite cylindrical surface boundaries, and set "distance" to the
// closest distance from the start point to the nearest intersection
// If the point is on the surface it returns or the intersection with
// the opposite surface or kInfinity
// If no intersection is founded, set distance = kInfinity and
// return 0
int Intersect(const G4Ray&);
// Shortest distance from the point x to the G4FCylindricalSurface.
// The distance will be always positive.
virtual G4double HowNear( const G4Vector3D& x ) const;
//
void CalcBBox();
// function to return class name
virtual const char* NameOf() const
{
return "G4FCylindricalSurface";
}
// printing function
virtual void PrintOn( G4std::ostream& os = G4cout ) const;
// equality operator
int operator==( const G4FCylindricalSurface& c );
// function which returns true (1) if the point x is within the boundary
// returns false (0) otherwise
virtual int WithinBoundary( const G4Vector3D& x ) const;
// function to return the radius of a G4FCylindricalSurface.
// Used for Scale-invariant tests of surface thickness.
// If the radius is zero, returns the length.
virtual G4double Scale() const;
// function to calculate the Area of a G4FCylindricalSurface
virtual G4double Area() const
{
return ( 2.0 * M_PI * radius * length );
}
// function to change the radius and length of the G4FCylindricalSurface
// the first (input) argument is the new radius
// the second (input) argument is the new length
virtual void resize( G4double r, G4double l );
// function to return the length of the G4FCylindricalSurface
G4double GetLength() const
{
return length;
}
G4Vector3D GetAxis() const { return Position.GetAxis(); }
G4double GetRadius() const { return radius; }
void SetRadius( G4double r );
// Re-calculates the private values of the G4FCylindrical surface
// before the Intersect and HowNear function if the G4FCylindrical
// was created by the STEP interface
void InitValues();
};
#include "G4FCylindricalSurface.icc"
#endif