[834] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
[842] | 27 | // $Id: G4PhysicalVolumeSearchScene.hh,v 1.18 2008/01/04 21:59:15 allison Exp $ |
---|
[954] | 28 | // GEANT4 tag $Name: $ |
---|
[834] | 29 | // |
---|
| 30 | // |
---|
| 31 | // John Allison 10th August 1998. |
---|
| 32 | // An artificial scene to find physical volumes. |
---|
| 33 | |
---|
| 34 | #ifndef G4PHYSICALVOLUMESEARCHSCENE_HH |
---|
| 35 | #define G4PHYSICALVOLUMESEARCHSCENE_HH |
---|
| 36 | |
---|
| 37 | #include "G4VGraphicsScene.hh" |
---|
| 38 | #include "G4VisExtent.hh" |
---|
| 39 | #include "G4Box.hh" |
---|
| 40 | #include "G4Cons.hh" |
---|
| 41 | #include "G4Tubs.hh" |
---|
| 42 | #include "G4Trd.hh" |
---|
| 43 | #include "G4Trap.hh" |
---|
| 44 | #include "G4Sphere.hh" |
---|
| 45 | #include "G4Para.hh" |
---|
| 46 | #include "G4Torus.hh" |
---|
| 47 | #include "G4Polycone.hh" |
---|
| 48 | #include "G4Polyhedra.hh" |
---|
| 49 | #include "G4VPhysicalVolume.hh" |
---|
| 50 | #include "G4LogicalVolume.hh" |
---|
| 51 | |
---|
| 52 | class G4PhysicalVolumeSearchScene: public G4VGraphicsScene { |
---|
| 53 | |
---|
| 54 | public: |
---|
| 55 | G4PhysicalVolumeSearchScene |
---|
| 56 | (G4PhysicalVolumeModel*, |
---|
| 57 | const G4String& requiredPhysicalVolumeName, |
---|
| 58 | G4int requiredCopyNo); |
---|
| 59 | virtual ~G4PhysicalVolumeSearchScene (); |
---|
| 60 | void PreAddSolid (const G4Transform3D& objectTransformation, |
---|
| 61 | const G4VisAttributes&); |
---|
| 62 | void PostAddSolid (); |
---|
| 63 | void AddSolid (const G4Box& s) {FindVolume (s);} |
---|
| 64 | void AddSolid (const G4Cons & s) {FindVolume (s);} |
---|
| 65 | void AddSolid (const G4Tubs& s) {FindVolume (s);} |
---|
| 66 | void AddSolid (const G4Trd& s) {FindVolume (s);} |
---|
| 67 | void AddSolid (const G4Trap& s) {FindVolume (s);} |
---|
| 68 | void AddSolid (const G4Sphere& s) {FindVolume (s);} |
---|
| 69 | void AddSolid (const G4Para& s) {FindVolume (s);} |
---|
| 70 | void AddSolid (const G4Torus& s) {FindVolume (s);} |
---|
| 71 | void AddSolid (const G4Polycone& s) {FindVolume (s);} |
---|
| 72 | void AddSolid (const G4Polyhedra& s) {FindVolume (s);} |
---|
| 73 | void AddSolid (const G4VSolid& s) {FindVolume (s);} |
---|
| 74 | void AddCompound (const G4VTrajectory&) {} |
---|
| 75 | void AddCompound (const G4VHit&) {} |
---|
| 76 | G4int GetFoundDepth () const; |
---|
| 77 | G4VPhysicalVolume* GetFoundVolume () const; |
---|
| 78 | const G4Transform3D& GetFoundTransformation () const; |
---|
| 79 | |
---|
| 80 | //////////////////////////////////////////////////////////////// |
---|
| 81 | // Functions not used but required by the abstract interface. |
---|
| 82 | |
---|
| 83 | virtual void BeginPrimitives (const G4Transform3D&) {} |
---|
| 84 | virtual void EndPrimitives () {} |
---|
[842] | 85 | virtual void BeginPrimitives2D (const G4Transform3D&) {} |
---|
[834] | 86 | virtual void EndPrimitives2D () {} |
---|
| 87 | virtual void AddPrimitive (const G4Polyline&) {} |
---|
| 88 | virtual void AddPrimitive (const G4Scale&) {} |
---|
| 89 | virtual void AddPrimitive (const G4Text&) {} |
---|
| 90 | virtual void AddPrimitive (const G4Circle&) {} |
---|
| 91 | virtual void AddPrimitive (const G4Square&) {} |
---|
| 92 | virtual void AddPrimitive (const G4Polymarker&) {} |
---|
| 93 | virtual void AddPrimitive (const G4Polyhedron&) {} |
---|
| 94 | virtual void AddPrimitive (const G4NURBS&) {} |
---|
| 95 | |
---|
| 96 | private: |
---|
| 97 | void FindVolume (const G4VSolid&); |
---|
| 98 | const G4PhysicalVolumeModel* fpPVModel; |
---|
| 99 | G4String fRequiredPhysicalVolumeName; |
---|
| 100 | G4int fRequiredCopyNo; |
---|
| 101 | const G4Transform3D* fpCurrentObjectTransformation; |
---|
| 102 | G4int fFoundDepth; // Found depth. |
---|
| 103 | G4VPhysicalVolume* fpFoundPV; // Found physical volume. |
---|
| 104 | G4LogicalVolume* fpFoundLV; // Found logical volume. |
---|
| 105 | G4Transform3D fFoundObjectTransformation; // Found transformation. |
---|
| 106 | G4bool fMultipleOccurrence; |
---|
| 107 | }; |
---|
| 108 | |
---|
| 109 | #include "G4PhysicalVolumeSearchScene.icc" |
---|
| 110 | |
---|
| 111 | #endif |
---|