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 G4GDMLReadStructure 00031 // 00032 // Class description: 00033 // 00034 // GDML class for import of structures. 00035 00036 // History: 00037 // - Created. Zoltan Torzsok, November 2007 00038 // ------------------------------------------------------------------------- 00039 00040 #ifndef _G4GDMLREADSTRUCTURE_INCLUDED_ 00041 #define _G4GDMLREADSTRUCTURE_INCLUDED_ 00042 00043 #include "G4Types.hh" 00044 #include "geomdefs.hh" 00045 00046 #include "G4GDMLReadParamvol.hh" 00047 00048 class G4AssemblyVolume; 00049 class G4LogicalVolume; 00050 class G4VPhysicalVolume; 00051 00052 struct G4GDMLAuxPairType 00053 { 00054 G4String type; 00055 G4String value; 00056 }; 00057 00058 typedef std::vector<G4GDMLAuxPairType> G4GDMLAuxListType; 00059 typedef std::map<G4LogicalVolume*,G4GDMLAuxListType> G4GDMLAuxMapType; 00060 typedef std::map<G4String, G4AssemblyVolume*> G4GDMLAssemblyMapType; 00061 00062 class G4GDMLReadStructure : public G4GDMLReadParamvol 00063 { 00064 00065 public: 00066 00067 G4GDMLReadStructure(); 00068 virtual ~G4GDMLReadStructure(); 00069 00070 G4VPhysicalVolume* GetPhysvol(const G4String&) const; 00071 G4LogicalVolume* GetVolume(const G4String&) const; 00072 G4AssemblyVolume* GetAssembly(const G4String&) const; 00073 G4GDMLAuxListType GetVolumeAuxiliaryInformation(G4LogicalVolume*) const; 00074 G4VPhysicalVolume* GetWorldVolume(const G4String&); 00075 const G4GDMLAuxMapType* GetAuxMap() const; 00076 void Clear(); // Clears internal map and evaluator 00077 00078 virtual void VolumeRead(const xercesc::DOMElement* const); 00079 virtual void Volume_contentRead(const xercesc::DOMElement* const); 00080 virtual void StructureRead(const xercesc::DOMElement* const); 00081 00082 protected: 00083 00084 G4GDMLAuxPairType AuxiliaryRead(const xercesc::DOMElement* const); 00085 void AssemblyRead(const xercesc::DOMElement* const); 00086 void DivisionvolRead(const xercesc::DOMElement* const); 00087 G4LogicalVolume* FileRead(const xercesc::DOMElement* const); 00088 void PhysvolRead(const xercesc::DOMElement* const, 00089 G4AssemblyVolume* assembly=0); 00090 void ReplicavolRead(const xercesc::DOMElement* const, G4int number); 00091 void ReplicaRead(const xercesc::DOMElement* const replicaElement, 00092 G4LogicalVolume* logvol,G4int number); 00093 EAxis AxisRead(const xercesc::DOMElement* const axisElement); 00094 G4double QuantityRead(const xercesc::DOMElement* const readElement); 00095 void BorderSurfaceRead(const xercesc::DOMElement* const); 00096 void SkinSurfaceRead(const xercesc::DOMElement* const); 00097 00098 protected: 00099 00100 G4GDMLAuxMapType auxMap; 00101 G4GDMLAssemblyMapType assemblyMap; 00102 G4LogicalVolume *pMotherLogical; 00103 std::map<std::string, G4VPhysicalVolume*> setuptoPV; 00104 }; 00105 00106 #endif