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: G4tgrSolidBoolean.hh 69803 2013-05-15 15:24:50Z gcosmo $ 00028 // 00029 // 00030 // class G4tgrSolidBoolean 00031 // 00032 // Class description: 00033 // 00034 // A G4tgrSolidBoolean is an G4tgrSolid object with a solid made out of 00035 // the Boolean operation of two solids. The type of operation can be: 00036 // Union, Substraction, Intersection. 00037 00038 // History: 00039 // - Created. P.Arce, CIEMAT (November 2007) 00040 // ------------------------------------------------------------------------- 00041 00042 #ifndef G4tgrSolidBoolean_h 00043 #define G4tgrSolidBoolean_h 00044 00045 #include "globals.hh" 00046 00047 #include <vector> 00048 00049 #include "G4tgrSolid.hh" 00050 00051 class G4tgrSolidBoolean : public G4tgrSolid 00052 { 00053 public: // with description 00054 00055 G4tgrSolidBoolean(const std::vector<G4String>& wl); 00056 ~G4tgrSolidBoolean(); 00057 00058 friend std::ostream& operator<<(std::ostream&, const G4tgrSolidBoolean&); 00059 00060 // Accessors 00061 00062 inline const G4tgrSolid* GetSolid(G4int ii) const; 00063 const G4String& GetRelativeRotMatName() const; 00064 G4ThreeVector GetRelativePlace() const; 00065 00066 private: 00067 00068 // Solid types (Box, Tube, etc) of the solids composing the Boolean solid 00069 00070 std::vector< std::vector<G4double>* > theSolidParams; 00071 // Vectors of parameters. 00072 00073 G4String theRelativeRotMatName; 00074 G4ThreeVector theRelativePlace; 00075 // Relative placement and rotation of solid 2 w.r.t. solid 1 00076 00077 std::vector<const G4tgrSolid*> theSolids; 00078 // The two G4tgrSolid's that combine to make this one 00079 00080 }; 00081 00082 inline const G4tgrSolid* G4tgrSolidBoolean::GetSolid( G4int ii ) const 00083 { 00084 if((ii != 0) && (ii != 1)) 00085 { 00086 std::ostringstream message; 00087 message << "Only two G4tgrSolids (0,1) possible ! Asking for... " 00088 << ii; 00089 G4Exception("G4tgrSolidBoolean::GetSolid()", "InvalidInput", 00090 FatalException, message); 00091 } 00092 return theSolids[ii]; 00093 } 00094 00095 #endif