G4PhysicalVolumeSearchScene.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 // John Allison  10th August 1998.
00031 // An artificial scene to find physical volumes.
00032 
00033 #ifndef G4PHYSICALVOLUMESEARCHSCENE_HH
00034 #define G4PHYSICALVOLUMESEARCHSCENE_HH
00035 
00036 #include "G4VGraphicsScene.hh"
00037 #include "G4VisExtent.hh"
00038 #include "G4Box.hh"
00039 #include "G4Cons.hh"
00040 #include "G4Tubs.hh"
00041 #include "G4Trd.hh"
00042 #include "G4Trap.hh"
00043 #include "G4Sphere.hh"
00044 #include "G4Para.hh"
00045 #include "G4Torus.hh"
00046 #include "G4Polycone.hh"
00047 #include "G4Polyhedra.hh"
00048 #include "G4VPhysicalVolume.hh"
00049 #include "G4LogicalVolume.hh"
00050 #include "G4PhysicalVolumeModel.hh"
00051 
00052 class G4PhysicalVolumeSearchScene: public G4VGraphicsScene {
00053 
00054 public:
00055   G4PhysicalVolumeSearchScene
00056   (G4PhysicalVolumeModel*,
00057    const G4String& requiredPhysicalVolumeName,
00058    G4int requiredCopyNo);
00059   virtual ~G4PhysicalVolumeSearchScene ();
00060   void PreAddSolid (const G4Transform3D& objectTransformation,
00061                     const G4VisAttributes&);
00062   void PostAddSolid ();
00063   void AddSolid (const G4Box& solid) {FindVolume (solid);}
00064   void AddSolid (const G4Cons & solid) {FindVolume (solid);}
00065   void AddSolid (const G4Tubs& solid) {FindVolume (solid);}
00066   void AddSolid (const G4Trd& solid) {FindVolume (solid);}
00067   void AddSolid (const G4Trap& solid) {FindVolume (solid);}
00068   void AddSolid (const G4Sphere& solid) {FindVolume (solid);}
00069   void AddSolid (const G4Para& solid) {FindVolume (solid);}
00070   void AddSolid (const G4Torus& solid) {FindVolume (solid);}
00071   void AddSolid (const G4Polycone& solid) {FindVolume (solid);}
00072   void AddSolid (const G4Polyhedra& solid) {FindVolume (solid);}
00073   void AddSolid (const G4VSolid& solid) {FindVolume (solid);}
00074   void AddCompound (const G4VTrajectory&) {}
00075   void AddCompound (const G4VHit&) {}
00076   void AddCompound (const G4VDigi&) {}
00077   void AddCompound (const G4THitsMap<G4double>&) {}
00078   
00079   const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>&
00080                         GetFoundFullPVPath     () const;
00081   G4int                 GetFoundDepth          () const;
00082   G4VPhysicalVolume*    GetFoundVolume         () const;
00083   const G4Transform3D&  GetFoundTransformation () const;
00084 
00086   // Functions not used but required by the abstract interface.
00087 
00088   virtual void BeginPrimitives (const G4Transform3D&) {}
00089   virtual void EndPrimitives () {}
00090   virtual void BeginPrimitives2D (const G4Transform3D&) {}
00091   virtual void EndPrimitives2D () {}
00092   virtual void AddPrimitive (const G4Polyline&)   {}
00093   virtual void AddPrimitive (const G4Scale&)       {}
00094   virtual void AddPrimitive (const G4Text&)       {}
00095   virtual void AddPrimitive (const G4Circle&)     {}
00096   virtual void AddPrimitive (const G4Square&)     {}
00097   virtual void AddPrimitive (const G4Polymarker&) {}
00098   virtual void AddPrimitive (const G4Polyhedron&) {}
00099   virtual void AddPrimitive (const G4NURBS&)      {}
00100 
00101 private:
00102   void FindVolume (const G4VSolid&);
00103   const G4PhysicalVolumeModel* fpPVModel;
00104   G4String             fRequiredPhysicalVolumeName;
00105   G4int                fRequiredCopyNo;
00106   const G4Transform3D* fpCurrentObjectTransformation;
00107   std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
00108                        fFoundFullPVPath;            // Found full path.
00109   G4int                fFoundDepth;                 // Found depth.
00110   G4VPhysicalVolume*   fpFoundPV;                   // Found physical volume.
00111   G4LogicalVolume*     fpFoundLV;                   // Found logical volume.
00112   G4Transform3D        fFoundObjectTransformation;  // Found transformation.
00113   G4bool               fMultipleOccurrence;
00114 };
00115 
00116 #include "G4PhysicalVolumeSearchScene.icc"
00117 
00118 #endif

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