G4ReflectedSolid.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 G4ReflectedSolid
00031 //
00032 // Class description:
00033 //
00034 // A Reflected solid is a solid that has been shifted from its original
00035 // frame of reference to a new one.
00036 
00037 // History:
00038 //
00039 // 23.07.01 V.Grichine: created
00040 // 15.02.02 V.Grichine: get/set methods for fPtr(Direct)Transform3D
00041 // --------------------------------------------------------------------
00042 #ifndef G4ReflectedSolid_HH
00043 #define G4ReflectedSolid_HH
00044 
00045 #include "G4VSolid.hh"
00046 #include "G4RotationMatrix.hh"
00047 #include "G4ThreeVector.hh"
00048 #include "G4Transform3D.hh"
00049 #include "G4AffineTransform.hh"
00050 
00051 class G4ReflectedSolid : public G4VSolid
00052 {
00053   public:  // with description
00054 
00055     G4ReflectedSolid( const G4String& pName,
00056                             G4VSolid* pSolid ,
00057                       const G4Transform3D& transform  ) ;
00058       // For use in instantiating a transient instance.
00059 
00060     virtual ~G4ReflectedSolid() ;
00061       // Virtual destructor.
00062 
00063   public:  // without description 
00064 
00065     // Includes all the methods that a solid requires.
00066 
00067     EInside Inside( const G4ThreeVector& p ) const; 
00068 
00069     G4bool CalculateExtent( const EAxis pAxis,
00070                             const G4VoxelLimits& pVoxelLimit,
00071                             const G4AffineTransform& pTransform,
00072                                   G4double& pMin, G4double& pMax) const;
00073 
00074     G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
00075 
00076     G4double DistanceToIn( const G4ThreeVector& p,
00077                            const G4ThreeVector& v  ) const;
00078 
00079     G4double DistanceToIn( const G4ThreeVector& p) const;
00080 
00081     G4double DistanceToOut( const G4ThreeVector& p,
00082                             const G4ThreeVector& v,
00083                             const G4bool calcNorm=false,
00084                                   G4bool *validNorm=0,
00085                                   G4ThreeVector *n=0      ) const;
00086 
00087     G4double DistanceToOut( const G4ThreeVector& p ) const ;
00088 
00089     void ComputeDimensions(       G4VPVParameterisation* p,
00090                             const G4int n,
00091                             const G4VPhysicalVolume* pRep );
00092 
00093     G4ThreeVector GetPointOnSurface() const;
00094 
00095     G4VSolid* Clone() const;
00096 
00097   public:  // with description 
00098 
00099     virtual G4GeometryType  GetEntityType() const;
00100 
00101     virtual const G4ReflectedSolid* GetReflectedSolidPtr() const;
00102     virtual       G4ReflectedSolid* GetReflectedSolidPtr();
00103       // If the Solid is a "G4ReflectedSolid",
00104       // return a self pointer else return 0.
00105 
00106     G4VSolid*                GetConstituentMovedSolid() const;
00107 
00108     G4Transform3D        GetTransform3D() const; 
00109     void       SetTransform3D(G4Transform3D&);
00110     G4Transform3D        GetDirectTransform3D() const; 
00111     void       SetDirectTransform3D(G4Transform3D&);
00112       // Accessors methods.
00113 
00114     std::ostream& StreamInfo(std::ostream& os) const;
00115 
00116   public:  // without description
00117 
00118     G4ReflectedSolid(const G4ReflectedSolid& rhs);
00119     G4ReflectedSolid& operator=(const G4ReflectedSolid& rhs);
00120       // Copy constructor and assignment operator.
00121 
00122     void DescribeYourselfTo ( G4VGraphicsScene& scene ) const ;
00123     G4Polyhedron* CreatePolyhedron () const ;
00124     G4NURBS*      CreateNURBS      () const ;
00125     G4Polyhedron* GetPolyhedron    () const;
00126       // For creating graphical representations (ie for visualisation).
00127 
00128   protected:
00129 
00130     G4AffineTransform        GetTransform() const; 
00131     void       SetTransform(G4AffineTransform&);
00132     G4AffineTransform        GetDirectTransform() const; 
00133     void       SetDirectTransform(G4AffineTransform&);
00134     G4RotationMatrix         GetFrameRotation() const;
00135     void  SetFrameRotation(const G4RotationMatrix&);
00136     G4ThreeVector            GetFrameTranslation() const; 
00137     void  SetFrameTranslation(const G4ThreeVector&); 
00138       // Get/Set the rotation/translation, as applied to the
00139       // frame of reference.
00140 
00141     G4RotationMatrix         GetObjectRotation() const;
00142     void  SetObjectRotation(const G4RotationMatrix&);
00143     G4ThreeVector            GetObjectTranslation() const; 
00144     void  SetObjectTranslation(const G4ThreeVector&); 
00145       // Get/Set the rotation/translation, as applied to the object.
00146 
00147     G4VSolid*          fPtrSolid        ;
00148     G4AffineTransform* fPtrTransform    ;
00149     G4AffineTransform* fDirectTransform ;
00150 
00151     G4Transform3D*     fPtrTransform3D    ;
00152     G4Transform3D*     fDirectTransform3D ;
00153 
00154     mutable G4Polyhedron* fpPolyhedron;  // Caches reflected G4Polyhedron.
00155 
00156 } ;
00157 
00158 #endif

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