G4EllipticalTube.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: G4EllipticalTube.hh 67011 2013-01-29 16:17:41Z gcosmo $
00028 //
00029 // --------------------------------------------------------------------
00030 // GEANT 4 class header file
00031 //
00032 // G4EllipticalTube
00033 //
00034 // Class description:
00035 //
00036 //   Declaration of a CSG volume representing a tube with elliptical
00037 //   cross section (geant3 solid 'ELTU'):
00038 //   
00039 //   G4EllipticalTube( const G4String& name, 
00040 //                           G4double  Dx,
00041 //                           G4double  Dy,
00042 //                           G4double  Dz )
00043 //
00044 //   The equation of the surface in x/y is 1.0 = (x/dx)**2 + (y/dy)**2
00045 
00046 // Author: 
00047 //   David C. Williams (davidw@scipp.ucsc.edu)
00048 // --------------------------------------------------------------------
00049 
00050 #ifndef G4EllipticalTube_hh
00051 #define G4EllipticalTube_hh
00052 
00053 #include "G4VSolid.hh"
00054 
00055 class G4EllipticalTube : public G4VSolid
00056 {
00057   public:  // with description
00058 
00059     G4EllipticalTube( const G4String &name, 
00060                             G4double theDx,
00061                             G4double theDy,
00062                             G4double theDz );
00063 
00064     virtual ~G4EllipticalTube();
00065 
00066     // Standard solid methods
00067 
00068     G4bool CalculateExtent( const EAxis pAxis,
00069                             const G4VoxelLimits& pVoxelLimit,
00070                             const G4AffineTransform& pTransform,
00071                                   G4double& pmin, G4double& pmax ) const;
00072   
00073     EInside Inside( const G4ThreeVector& p ) const;
00074 
00075     G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
00076 
00077     G4double DistanceToIn( const G4ThreeVector& p,
00078                            const G4ThreeVector& v ) const;
00079     G4double DistanceToIn( const G4ThreeVector& p ) const;
00080     G4double DistanceToOut( const G4ThreeVector& p,
00081                             const G4ThreeVector& v,
00082                             const G4bool calcNorm=false,
00083                                   G4bool *validNorm=0,
00084                                   G4ThreeVector *n=0 ) const;
00085     G4double DistanceToOut( const G4ThreeVector& p ) const;
00086 
00087     G4GeometryType GetEntityType() const;
00088 
00089     G4VSolid* Clone() const;
00090 
00091     std::ostream& StreamInfo(std::ostream& os) const;
00092 
00093     G4double GetCubicVolume();
00094     G4double GetSurfaceArea();
00095 
00096     G4ThreeVector GetPointOnSurface() const;
00097 
00098     // Visualisation methods
00099 
00100     G4Polyhedron* CreatePolyhedron() const;
00101     G4Polyhedron* GetPolyhedron () const;
00102     void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
00103     G4VisExtent GetExtent() const;
00104 
00105     // Accessors
00106 
00107     inline G4double GetDx() const;
00108     inline G4double GetDy() const;
00109     inline G4double GetDz() const;
00110   
00111     inline void SetDx( const G4double newDx );
00112     inline void SetDy( const G4double newDy );
00113     inline void SetDz( const G4double newDz );
00114  
00115   public:  // without description
00116 
00117     G4EllipticalTube(__void__&);
00118       // Fake default constructor for usage restricted to direct object
00119       // persistency for clients requiring preallocation of memory for
00120       // persistifiable objects.
00121 
00122     G4EllipticalTube(const G4EllipticalTube& rhs);
00123     G4EllipticalTube& operator=(const G4EllipticalTube& rhs); 
00124       // Copy constructor and assignment operator.
00125 
00126   protected:  // without description
00127 
00128     G4double dx, dy, dz;
00129   
00130     // Utility
00131 
00132     inline G4double CheckXY( const G4double x,
00133                              const G4double y,
00134                              const G4double toler ) const;
00135     inline G4double CheckXY( const G4double x, const G4double y ) const;
00136 
00137     G4int IntersectXY( const G4ThreeVector &p,
00138                        const G4ThreeVector &v, G4double s[2] ) const;
00139 
00140   private:
00141 
00142     G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
00143       // Algorithm for SurfaceNormal() following the original
00144       // specification for points not on the surface.
00145 
00146     G4double fCubicVolume;
00147     G4double fSurfaceArea;
00148     mutable G4Polyhedron* fpPolyhedron;
00149 
00150 };
00151 
00152 #include "G4EllipticalTube.icc"
00153 
00154 #endif

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