Changeset 1347 for trunk/source/persistency/gdml/include
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (14 years ago)
- Location:
- trunk/source/persistency/gdml/include
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/persistency/gdml/include/G4GDMLEvaluator.hh
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLEvaluator.hh,v 1.1 7 2009/04/24 15:34:20 gcosmoExp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLEvaluator.hh,v 1.18 2010/10/25 10:15:41 witoldp Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // … … 54 54 G4GDMLEvaluator(); 55 55 56 void Clear(); 56 57 void DefineConstant(const G4String&, G4double); 57 58 void DefineVariable(const G4String&, G4double); -
trunk/source/persistency/gdml/include/G4GDMLParameterisation.hh
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLParameterisation.hh,v 1.1 0 2008/07/16 15:46:33gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLParameterisation.hh,v 1.11 2010/10/14 16:19:40 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // … … 73 73 G4double dimension[16]; 74 74 75 PARAMETER() { memset(dimension,0,sizeof(dimension)); }75 PARAMETER() : pRot(0) { memset(dimension,0,sizeof(dimension)); } 76 76 }; 77 77 -
trunk/source/persistency/gdml/include/G4GDMLParser.hh
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLParser.hh,v 1. 59 2010/02/17 18:06:25gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLParser.hh,v 1.65 2010/11/17 10:47:02 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // … … 45 45 #include "G4GDMLWriteStructure.hh" 46 46 #include "G4STRead.hh" 47 #include "G4GDMLMessenger.hh" 48 49 #include "G4TransportationManager.hh" 50 #include "G4Navigator.hh" 51 47 52 48 53 #define G4GDML_DEFAULT_SCHEMALOCATION G4String("http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd") … … 70 75 71 76 inline void Write(const G4String& filename, 72 const G4VPhysicalVolume* constpvol = 0,77 const G4VPhysicalVolume* pvol = 0, 73 78 G4bool storeReferences = true, 74 79 const G4String& SchemaLocation = G4GDML_DEFAULT_SCHEMALOCATION); … … 79 84 // Alternative path for the schema location can be specified; by default 80 85 // the URL to the GDML web site is used. 86 87 inline void Write(const G4String& filename, 88 const G4LogicalVolume* lvol = 0, 89 G4bool storeReferences = true, 90 const G4String& SchemaLocation = G4GDML_DEFAULT_SCHEMALOCATION); 91 // 92 // Exports on a GDML file, specified by 'filename' a geometry tree 93 // starting from 'pvol' as top volume. Uniqueness of stored entities 94 // is guaranteed by storing pointer-references by default. 95 // Alternative path for the schema location can be specified; by default 96 // the URL to the GDML web site is used. Same as method above except 97 // that the logical volume is provided here. 81 98 82 99 inline G4LogicalVolume* ParseST(const G4String& name, … … 101 118 inline G4LogicalVolume* GetVolume(const G4String& name) const; 102 119 inline G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default") const; 103 inline G4GDMLAuxListType GetVolumeAuxiliaryInformation(const G4LogicalVolume* const logvol); 120 inline G4GDMLAuxListType GetVolumeAuxiliaryInformation(G4LogicalVolume* logvol) const; 121 inline const G4GDMLAuxMapType* GetAuxMap() const; 104 122 inline void StripNamePointers() const; 123 inline void SetStripFlag(G4bool); 105 124 inline void SetOverlapCheck(G4bool); 125 inline void Clear(); // Clears the evaluator 106 126 107 127 // Methods for Writer … … 115 135 G4GDMLReadStructure* reader; 116 136 G4GDMLWriteStructure* writer; 117 G4bool urcode, uwcode; 137 G4GDMLMessenger* messenger; 138 G4bool urcode, uwcode, strip; 118 139 119 140 }; -
trunk/source/persistency/gdml/include/G4GDMLParser.icc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLParser.icc,v 1. 9 2010/02/17 18:06:25gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLParser.icc,v 1.15 2010/11/17 10:47:02 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // … … 36 36 void G4GDMLParser::Read(const G4String& filename, G4bool validate) 37 37 { 38 reader->Read(filename,validate,false );38 reader->Read(filename,validate,false,strip); 39 39 } 40 40 … … 47 47 inline 48 48 void G4GDMLParser::Write(const G4String& filename, 49 const G4VPhysicalVolume* constpvol,49 const G4VPhysicalVolume* pvol, 50 50 G4bool refs, 51 51 const G4String& schemaLocation) … … 56 56 if (!pvol) 57 57 { 58 G4VPhysicalVolume* worldPV = GetWorldVolume(); 59 if (!worldPV) 60 { 61 G4Exception("G4DMLParser::Write()", "InvalidSetup", FatalException, 62 "Detector-Construction needs to be registered first!"); 63 } 64 lvol = worldPV->GetLogicalVolume(); 58 lvol = G4TransportationManager::GetTransportationManager()-> 59 GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume(); 65 60 } 66 61 else 67 62 { 68 63 lvol = pvol->GetLogicalVolume(); 64 } 65 66 writer->Write(filename,lvol,schemaLocation,depth,refs); 67 } 68 69 inline 70 void G4GDMLParser::Write(const G4String& filename, 71 const G4LogicalVolume* lvol, 72 G4bool refs, 73 const G4String& schemaLocation) 74 { 75 const G4int depth = 0; 76 77 if (!lvol) 78 { 79 lvol = G4TransportationManager::GetTransportationManager()-> 80 GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume(); 69 81 } 70 82 writer->Write(filename,lvol,schemaLocation,depth,refs); … … 145 157 inline 146 158 G4GDMLAuxListType 147 G4GDMLParser::GetVolumeAuxiliaryInformation( const G4LogicalVolume* const logvol)159 G4GDMLParser::GetVolumeAuxiliaryInformation(G4LogicalVolume* logvol) const 148 160 { 149 161 return reader->GetVolumeAuxiliaryInformation(logvol); … … 151 163 152 164 inline 165 const G4GDMLAuxMapType* G4GDMLParser::GetAuxMap() const 166 { 167 return reader->GetAuxMap(); 168 } 169 170 inline 153 171 void G4GDMLParser::StripNamePointers() const 154 172 { … … 156 174 } 157 175 176 inline void G4GDMLParser::SetStripFlag(G4bool flag) 177 { 178 strip = flag; 179 } 180 158 181 inline void G4GDMLParser::SetOverlapCheck(G4bool flag) 159 182 { … … 161 184 } 162 185 186 inline void G4GDMLParser::Clear() 187 { 188 reader->Clear(); 189 } 190 163 191 // 164 192 // Methods for Writer -
trunk/source/persistency/gdml/include/G4GDMLRead.hh
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLRead.hh,v 1.3 1 2009/05/12 15:46:43gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLRead.hh,v 1.33 2010/11/17 10:47:02 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // class G4GDMLRead … … 115 115 // More pure virtual methods implemented in the reader plugin. 116 116 117 void Read(const G4String&, G4bool validation, G4bool isModule); 117 void Read(const G4String&, G4bool validation, 118 G4bool isModule, G4bool strip=true); 118 119 // 119 120 // Main method for reading GDML files. -
trunk/source/persistency/gdml/include/G4GDMLReadStructure.hh
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLReadStructure.hh,v 1. 28 2009/09/24 15:04:34gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLReadStructure.hh,v 1.32 2010/11/02 10:39:27 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // … … 54 54 { 55 55 G4String type; 56 G4 doublevalue;56 G4String value; 57 57 }; 58 58 59 59 typedef std::vector<G4GDMLAuxPairType> G4GDMLAuxListType; 60 typedef std::map< constG4LogicalVolume*,G4GDMLAuxListType> G4GDMLAuxMapType;60 typedef std::map<G4LogicalVolume*,G4GDMLAuxListType> G4GDMLAuxMapType; 61 61 typedef std::map<G4String, G4AssemblyVolume*> G4GDMLAssemblyMapType; 62 62 … … 72 72 G4LogicalVolume* GetVolume(const G4String&) const; 73 73 G4AssemblyVolume* GetAssembly(const G4String&) const; 74 G4GDMLAuxListType GetVolumeAuxiliaryInformation( const G4LogicalVolume* const);74 G4GDMLAuxListType GetVolumeAuxiliaryInformation(G4LogicalVolume*) const; 75 75 G4VPhysicalVolume* GetWorldVolume(const G4String&); 76 76 const G4GDMLAuxMapType* GetAuxMap() const; 77 void Clear(); // Clears internal map and evaluator 77 78 78 79 virtual void VolumeRead(const xercesc::DOMElement* const); … … 101 102 G4GDMLAssemblyMapType assemblyMap; 102 103 G4LogicalVolume *pMotherLogical; 103 104 std::map<std::string, G4VPhysicalVolume*> setuptoPV; 104 105 }; 105 106
Note: See TracChangeset
for help on using the changeset viewer.