Changeset 1347 for trunk/source/persistency/gdml
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (14 years ago)
- Location:
- trunk/source/persistency/gdml
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/persistency/gdml/GNUmakefile
r850 r1347 1 # $Id: GNUmakefile,v 1.1 0 2008/07/02 14:15:16gcosmo Exp $1 # $Id: GNUmakefile,v 1.12 2010/11/02 10:40:24 gcosmo Exp $ 2 2 # ----------------------------------------------------------------------- 3 3 # GNUmakefile for persistency library. Gabriele Cosmo, 16/11/96. … … 12 12 include $(G4INSTALL)/config/architecture.gmk 13 13 14 CPPFLAGS += -I$(G4INSTALL)/source/global/management/include \ 15 -I$(G4INSTALL)/source/global/HEPGeometry/include \ 16 -I$(G4INSTALL)/source/global/HEPNumerics/include \ 17 -I$(G4INSTALL)/source/digits_hits/hits/include \ 18 -I$(G4INSTALL)/source/digits_hits/digits/include \ 19 -I$(G4INSTALL)/source/particles/management/include \ 20 -I$(G4INSTALL)/source/run/include \ 21 -I$(G4INSTALL)/source/event/include \ 22 -I$(G4INSTALL)/source/track/include \ 23 -I$(G4INSTALL)/source/tracking/include \ 24 -I$(G4INSTALL)/source/intercoms/include \ 25 -I$(G4INSTALL)/source/geometry/management/include \ 26 -I$(G4INSTALL)/source/geometry/volumes/include \ 27 -I$(G4INSTALL)/source/geometry/navigation/include \ 28 -I$(G4INSTALL)/source/geometry/solids/CSG/include \ 29 -I$(G4INSTALL)/source/geometry/solids/Boolean/include \ 30 -I$(G4INSTALL)/source/geometry/solids/specific/include \ 31 -I$(G4INSTALL)/source/geometry/divisions/include \ 32 -I$(G4INSTALL)/source/materials/include \ 33 -I$(G4INSTALL)/source/graphics_reps/include 14 CPPFLAGS += \ 15 -I$(G4BASE)/global/management/include \ 16 -I$(G4BASE)/global/HEPGeometry/include \ 17 -I$(G4BASE)/global/HEPNumerics/include \ 18 -I$(G4BASE)/global/HEPRandom/include \ 19 -I$(G4BASE)/digits_hits/hits/include \ 20 -I$(G4BASE)/digits_hits/digits/include \ 21 -I$(G4BASE)/particles/management/include \ 22 -I$(G4BASE)/run/include \ 23 -I$(G4BASE)/event/include \ 24 -I$(G4BASE)/track/include \ 25 -I$(G4BASE)/tracking/include \ 26 -I$(G4BASE)/intercoms/include \ 27 -I$(G4BASE)/processes/management/include \ 28 -I$(G4BASE)/geometry/management/include \ 29 -I$(G4BASE)/geometry/volumes/include \ 30 -I$(G4BASE)/geometry/navigation/include \ 31 -I$(G4BASE)/geometry/solids/CSG/include \ 32 -I$(G4BASE)/geometry/solids/Boolean/include \ 33 -I$(G4BASE)/geometry/solids/specific/include \ 34 -I$(G4BASE)/geometry/divisions/include \ 35 -I$(G4BASE)/materials/include \ 36 -I$(G4BASE)/graphics_reps/include 34 37 35 38 ifdef G4LIB_USE_GDML -
trunk/source/persistency/gdml/History
r1315 r1347 1 $Id: History,v 1.12 0 2010/06/02 13:55:02gcosmo Exp $1 $Id: History,v 1.128 2010/11/30 08:56:16 gcosmo Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20 30 Nov 2010 Gabriele Cosmo (gdml-V09-03-10) 21 - Fixed ambiguity in signature of Write() method in G4GDMLParser. 22 23 17 Nov 2010 Gabriele Cosmo (gdml-V09-03-09) 24 - Added possibility to de-activate/activate names stripping when reading files, 25 by invoking a new method G4GDMLParser::SetStripFlag(bool) before importing 26 the GDML file. Stripping is activated by default. 27 - Corrected initialization of messenger for all constructors of G4GDMLParser. 28 29 04 Nov 2010 Gabriele Cosmo (gdml-V09-03-08) 30 - Fixed compilation warning on G4GDMLEvaluator. 31 32 02 Nov 2010 Gabriele Cosmo (gdml-V09-03-07) 33 - Fixed minor left Coverity reports. 34 - Some code cleanup and updated CMake scripts. 35 36 25 Oct 2010 Witold Pokorski 37 - New class G4GDMLMessenger instantiated with G4GDMLParser and defining 38 UI commands for importing and exporting GDML files, through the various 39 options the parser provides. 40 - Corrected GetWorldVolume() in G4GDMLReadStructure, to make use of structure 41 stored in memory in case geometry is already imported. 42 43 14 Oct 2010 Gabriele Cosmo (gdml-V09-03-06) 44 - Fixed dummy initialisation of members in constructors in classes 45 G4GDMLParameterisation, G4GDMLReadParamvol, G4GDMLReadStructure, 46 G4GDMLWrite, G4GDMLWriteDefine, G4GDMLWriteMaterials, G4GDMLWriteSolids. 47 - Added exceptions asserting validity of dynamic casted pointers. 48 49 11 Oct 2010 Witold Pokorski (gdml-V09-03-05) 50 - Added GetAuxMap() method to G4GDMLParser and removed 'const' qualifier to 51 types in internal map of logical-volumes. Changed value type to 'string' in 52 G4GDMLAuxPairType to avoid extra type evaluation while parsing. 53 54 19 Aug 2010 Gabriele Cosmo (gdml-V09-03-04) 55 - Fixed printout of unit in G4GDMLWriteStructure for replicas and divisions, 56 in the case of angles. 19 57 20 58 02 Jun 2010 Gabriele Cosmo (gdml-V09-03-03) -
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 -
trunk/source/persistency/gdml/src/G4GDMLEvaluator.cc
r1228 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLEvaluator.cc,v 1.2 3 2009/04/24 15:34:20gcosmo Exp $27 // $Id: G4GDMLEvaluator.cc,v 1.26 2010/11/04 11:33:49 gcosmo Exp $ 28 28 // GEANT4 tag $ Name:$ 29 29 // … … 45 45 eval.setStdMath(); 46 46 eval.setSystemOfUnits(meter,kilogram,second,ampere,kelvin,mole,candela); 47 } 48 49 void G4GDMLEvaluator::Clear() 50 { 51 eval.clear(); 52 eval.setStdMath(); 53 eval.setSystemOfUnits(meter,kilogram,second,ampere,kelvin,mole,candela); 54 55 variableList.clear(); 47 56 } 48 57 … … 153 162 if (open==close) { return in; } 154 163 155 if ( open>close)164 if ((open>close) || (open==std::string::npos) || (close==std::string::npos)) 156 165 { 157 166 G4String error_msg = "Bracket mismatch: " + in; 158 167 G4Exception("G4GDMLEvaluator::SolveBrackets()", "InvalidExpression", 159 168 FatalException, error_msg); 169 return in; 160 170 } 161 171 -
trunk/source/persistency/gdml/src/G4GDMLParser.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLParser.cc,v 1.1 4 2009/04/15 13:29:30gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLParser.cc,v 1.18 2010/11/17 11:36:45 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // … … 36 36 37 37 G4GDMLParser::G4GDMLParser() 38 : urcode(false), uwcode(false) 38 : urcode(false), uwcode(false), strip(true) 39 39 { 40 40 reader = new G4GDMLReadStructure; 41 41 writer = new G4GDMLWriteStructure; 42 messenger = new G4GDMLMessenger(this); 43 42 44 xercesc::XMLPlatformUtils::Initialize(); 43 45 } … … 48 50 reader = extr; 49 51 writer = new G4GDMLWriteStructure; 52 messenger = new G4GDMLMessenger(this); 53 50 54 xercesc::XMLPlatformUtils::Initialize(); 51 55 } … … 57 61 reader = extr; 58 62 writer = extw; 63 messenger = new G4GDMLMessenger(this); 64 59 65 xercesc::XMLPlatformUtils::Initialize(); 60 66 } … … 65 71 if (!urcode) { delete reader; } 66 72 if (!uwcode) { delete writer; } 73 delete messenger; 67 74 } -
trunk/source/persistency/gdml/src/G4GDMLRead.cc
r1337 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GDMLRead.cc,v 1. 47 2009/05/12 15:46:43gcosmo Exp $27 // GEANT4 tag $Name: g eant4-09-04-beta-01$26 // $Id: G4GDMLRead.cc,v 1.50 2010/11/17 10:47:02 gcosmo Exp $ 27 // GEANT4 tag $Name: gdml-V09-03-09 $ 28 28 // 29 29 // class G4GDMLRead Implementation … … 199 199 const xercesc::DOMAttr* const attribute 200 200 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 201 if (!attribute) 202 { 203 G4Exception("G4GDMLRead::LoopRead()", "InvalidRead", 204 FatalException, "No attribute found!"); 205 return; 206 } 201 207 const G4String attribute_name = Transcode(attribute->getName()); 202 208 const G4String attribute_value = Transcode(attribute->getValue()); … … 266 272 void G4GDMLRead::Read(const G4String& fileName, 267 273 G4bool validation, 268 G4bool isModule) 274 G4bool isModule, 275 G4bool strip) 269 276 { 270 277 if (isModule) … … 305 312 G4Exception("G4GDMLRead::Read()", "InvalidRead", 306 313 FatalException, error_msg); 314 return; 307 315 } 308 316 xercesc::DOMElement* element = doc->getDocumentElement(); … … 312 320 G4Exception("G4GDMLRead::Read()", "InvalidRead", 313 321 FatalException, "Empty document!"); 322 return; 314 323 } 315 324 … … 321 330 const xercesc::DOMElement* const child 322 331 = dynamic_cast<xercesc::DOMElement*>(iter); 332 if (!child) 333 { 334 G4Exception("G4GDMLRead::Read()", "InvalidRead", 335 FatalException, "No child found!"); 336 return; 337 } 323 338 const G4String tag = Transcode(child->getTagName()); 324 339 … … 337 352 } 338 353 339 if (parser) { delete parser; }340 if (handler) { delete handler; }354 delete parser; 355 delete handler; 341 356 342 357 if (isModule) … … 347 362 { 348 363 G4cout << "G4GDML: Reading '" << fileName << "' done!" << G4endl; 349 StripNames();350 } 351 } 364 if (strip) { StripNames(); } 365 } 366 } -
trunk/source/persistency/gdml/src/G4GDMLReadDefine.cc
r1337 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GDMLReadDefine.cc,v 1.2 5 2010/02/17 18:06:25gcosmo Exp $27 // GEANT4 tag $Name: g eant4-09-04-beta-01$26 // $Id: G4GDMLReadDefine.cc,v 1.26 2010/10/14 16:19:40 gcosmo Exp $ 27 // GEANT4 tag $Name: gdml-V09-03-09 $ 28 28 // 29 29 // class G4GDMLReadDefine Implementation … … 42 42 G4GDMLMatrix::G4GDMLMatrix(size_t rows0, size_t cols0) 43 43 { 44 if ((rows <=0) || (cols<=0))44 if ((rows0==0) || (cols0==0)) 45 45 { 46 46 G4Exception("G4GDMLMatrix::G4GDMLMatrix(r,c)", "InvalidSetup", … … 161 161 const xercesc::DOMAttr* const attribute 162 162 = dynamic_cast<xercesc::DOMAttr*>(node); 163 if (!attribute) 164 { 165 G4Exception("G4GDMLRead::ConstantRead()", "InvalidRead", 166 FatalException, "No attribute found!"); 167 return; 168 } 163 169 const G4String attName = Transcode(attribute->getName()); 164 170 const G4String attValue = Transcode(attribute->getValue()); … … 190 196 const xercesc::DOMAttr* const attribute 191 197 = dynamic_cast<xercesc::DOMAttr*>(node); 198 if (!attribute) 199 { 200 G4Exception("G4GDMLRead::ExpressionRead()", "InvalidRead", 201 FatalException, "No attribute found!"); 202 return; 203 } 192 204 const G4String attName = Transcode(attribute->getName()); 193 205 const G4String attValue = Transcode(attribute->getValue()); … … 221 233 const xercesc::DOMAttr* const attribute 222 234 = dynamic_cast<xercesc::DOMAttr*>(node); 235 if (!attribute) 236 { 237 G4Exception("G4GDMLRead::MatrixRead()", "InvalidRead", 238 FatalException, "No attribute found!"); 239 return; 240 } 223 241 const G4String attName = Transcode(attribute->getName()); 224 242 const G4String attValue = Transcode(attribute->getValue()); … … 271 289 const xercesc::DOMAttr* const attribute 272 290 = dynamic_cast<xercesc::DOMAttr*>(node); 291 if (!attribute) 292 { 293 G4Exception("G4GDMLRead::PositionRead()", "InvalidRead", 294 FatalException, "No attribute found!"); 295 return; 296 } 273 297 const G4String attName = Transcode(attribute->getName()); 274 298 const G4String attValue = Transcode(attribute->getValue()); … … 304 328 const xercesc::DOMAttr* const attribute 305 329 = dynamic_cast<xercesc::DOMAttr*>(node); 330 if (!attribute) 331 { 332 G4Exception("G4GDMLRead::RotationRead()", "InvalidRead", 333 FatalException, "No attribute found!"); 334 return; 335 } 306 336 const G4String attName = Transcode(attribute->getName()); 307 337 const G4String attValue = Transcode(attribute->getValue()); … … 335 365 const xercesc::DOMAttr* const attribute 336 366 = dynamic_cast<xercesc::DOMAttr*>(node); 367 if (!attribute) 368 { 369 G4Exception("G4GDMLRead::ScaleRead()", "InvalidRead", 370 FatalException, "No attribute found!"); 371 return; 372 } 337 373 const G4String attName = Transcode(attribute->getName()); 338 374 const G4String attValue = Transcode(attribute->getValue()); … … 366 402 const xercesc::DOMAttr* const attribute 367 403 = dynamic_cast<xercesc::DOMAttr*>(node); 404 if (!attribute) 405 { 406 G4Exception("G4GDMLRead::VariableRead()", "InvalidRead", 407 FatalException, "No attribute found!"); 408 return; 409 } 368 410 const G4String attName = Transcode(attribute->getName()); 369 411 const G4String attValue = Transcode(attribute->getValue()); … … 395 437 const xercesc::DOMAttr* const attribute 396 438 = dynamic_cast<xercesc::DOMAttr*>(node); 439 if (!attribute) 440 { 441 G4Exception("G4GDMLRead::QuantityRead()", "InvalidRead", 442 FatalException, "No attribute found!"); 443 return; 444 } 397 445 const G4String attName = Transcode(attribute->getName()); 398 446 const G4String attValue = Transcode(attribute->getValue()); … … 419 467 const xercesc::DOMElement* const child 420 468 = dynamic_cast<xercesc::DOMElement*>(iter); 469 if (!child) 470 { 471 G4Exception("G4GDMLRead::DefineRead()", "InvalidRead", 472 FatalException, "No child found!"); 473 return; 474 } 421 475 const G4String tag = Transcode(child->getTagName()); 422 476 … … 458 512 const xercesc::DOMAttr* const attribute 459 513 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 514 if (!attribute) 515 { 516 G4Exception("G4GDMLRead::VectorRead()", "InvalidRead", 517 FatalException, "No attribute found!"); 518 return; 519 } 460 520 const G4String attName = Transcode(attribute->getName()); 461 521 const G4String attValue = Transcode(attribute->getValue()); … … 487 547 const xercesc::DOMAttr* const attribute 488 548 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 549 if (!attribute) 550 { 551 G4Exception("G4GDMLRead::Read()", "InvalidRead", 552 FatalException, "No attribute found!"); 553 return ref; 554 } 489 555 const G4String attName = Transcode(attribute->getName()); 490 556 const G4String attValue = Transcode(attribute->getValue()); -
trunk/source/persistency/gdml/src/G4GDMLReadMaterials.cc
r1228 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLReadMaterials.cc,v 1.2 0 2009/04/24 15:34:20 gcosmo Exp $27 // $Id: G4GDMLReadMaterials.cc,v 1.21 2010/10/14 16:19:40 gcosmo Exp $ 28 28 // GEANT4 tag $ Name:$ 29 29 // … … 69 69 const xercesc::DOMAttr* const attribute 70 70 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 71 if (!attribute) 72 { 73 G4Exception("G4GDMLReadMaterials::AtomRead()", "InvalidRead", 74 FatalException, "No attribute found!"); 75 return value; 76 } 71 77 const G4String attName = Transcode(attribute->getName()); 72 78 const G4String attValue = Transcode(attribute->getValue()); … … 98 104 const xercesc::DOMAttr* const attribute 99 105 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 106 if (!attribute) 107 { 108 G4Exception("G4GDMLReadMaterials::CompositeRead()", "InvalidRead", 109 FatalException, "No attribute found!"); 110 return n; 111 } 100 112 const G4String attName = Transcode(attribute->getName()); 101 113 const G4String attValue = Transcode(attribute->getValue()); … … 127 139 const xercesc::DOMAttr* const attribute 128 140 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 141 if (!attribute) 142 { 143 G4Exception("G4GDMLReadMaterials::DRead()", "InvalidRead", 144 FatalException, "No attribute found!"); 145 return value; 146 } 129 147 const G4String attName = Transcode(attribute->getName()); 130 148 const G4String attValue = Transcode(attribute->getValue()); … … 155 173 const xercesc::DOMAttr* const attribute 156 174 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 175 if (!attribute) 176 { 177 G4Exception("G4GDMLReadMaterials::PRead()", "InvalidRead", 178 FatalException, "No attribute found!"); 179 return value; 180 } 157 181 const G4String attName = Transcode(attribute->getName()); 158 182 const G4String attValue = Transcode(attribute->getValue()); … … 183 207 const xercesc::DOMAttr* const attribute 184 208 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 209 if (!attribute) 210 { 211 G4Exception("G4GDMLReadMaterials::TRead()", "InvalidRead", 212 FatalException, "No attribute found!"); 213 return value; 214 } 185 215 const G4String attName = Transcode(attribute->getName()); 186 216 const G4String attValue = Transcode(attribute->getValue()); … … 215 245 const xercesc::DOMAttr* const attribute 216 246 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 247 if (!attribute) 248 { 249 G4Exception("G4GDMLReadMaterials::ElementRead()", "InvalidRead", 250 FatalException, "No attribute found!"); 251 return; 252 } 217 253 const G4String attName = Transcode(attribute->getName()); 218 254 const G4String attValue = Transcode(attribute->getValue()); … … 232 268 const xercesc::DOMElement* const child 233 269 = dynamic_cast<xercesc::DOMElement*>(iter); 270 if (!child) 271 { 272 G4Exception("G4GDMLReadMaterials::ElementRead()", "InvalidRead", 273 FatalException, "No child found!"); 274 return; 275 } 234 276 const G4String tag = Transcode(child->getTagName()); 235 277 … … 268 310 const xercesc::DOMAttr* const attribute 269 311 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 312 if (!attribute) 313 { 314 G4Exception("G4GDMLReadMaterials::FractionRead()", "InvalidRead", 315 FatalException, "No attribute found!"); 316 return n; 317 } 270 318 const G4String attName = Transcode(attribute->getName()); 271 319 const G4String attValue = Transcode(attribute->getValue()); … … 300 348 const xercesc::DOMAttr* const attribute 301 349 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 350 if (!attribute) 351 { 352 G4Exception("G4GDMLReadMaterials::IsotopeRead()", "InvalidRead", 353 FatalException, "No attribute found!"); 354 return; 355 } 302 356 const G4String attName = Transcode(attribute->getName()); 303 357 const G4String attValue = Transcode(attribute->getValue()); … … 315 369 const xercesc::DOMElement* const child 316 370 = dynamic_cast<xercesc::DOMElement*>(iter); 371 if (!child) 372 { 373 G4Exception("G4GDMLReadMaterials::IsotopeRead()", "InvalidRead", 374 FatalException, "No child found!"); 375 return; 376 } 317 377 const G4String tag = Transcode(child->getTagName()); 318 378 … … 348 408 const xercesc::DOMAttr* const attribute 349 409 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 410 if (!attribute) 411 { 412 G4Exception("G4GDMLReadMaterials::MaterialRead()", "InvalidRead", 413 FatalException, "No attribute found!"); 414 return; 415 } 350 416 const G4String attName = Transcode(attribute->getName()); 351 417 const G4String attValue = Transcode(attribute->getValue()); … … 370 436 const xercesc::DOMElement* const child 371 437 = dynamic_cast<xercesc::DOMElement*>(iter); 438 if (!child) 439 { 440 G4Exception("G4GDMLReadMaterials::MaterialRead()", "InvalidRead", 441 FatalException, "No child found!"); 442 return; 443 } 372 444 const G4String tag = Transcode(child->getTagName()); 373 445 … … 401 473 const xercesc::DOMElement* const child 402 474 = dynamic_cast<xercesc::DOMElement*>(iter); 475 if (!child) 476 { 477 G4Exception("G4GDMLReadMaterials::MaterialRead()", "InvalidRead", 478 FatalException, "No child found!"); 479 return; 480 } 403 481 const G4String tag = Transcode(child->getTagName()); 404 482 … … 417 495 const xercesc::DOMElement* const child 418 496 = dynamic_cast<xercesc::DOMElement*>(iter); 497 if (!child) 498 { 499 G4Exception("G4GDMLReadMaterials::MixtureRead()", "InvalidRead", 500 FatalException, "No child found!"); 501 return; 502 } 419 503 const G4String tag = Transcode(child->getTagName()); 420 504 … … 439 523 const xercesc::DOMElement* const child 440 524 = dynamic_cast<xercesc::DOMElement*>(iter); 525 if (!child) 526 { 527 G4Exception("G4GDMLReadMaterials::MixtureRead()", "InvalidRead", 528 FatalException, "No child found!"); 529 return; 530 } 441 531 const G4String tag = Transcode(child->getTagName()); 442 532 … … 493 583 const xercesc::DOMAttr* const attribute 494 584 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 585 if (!attribute) 586 { 587 G4Exception("G4GDMLReadMaterials::PropertyRead()", "InvalidRead", 588 FatalException, "No attribute found!"); 589 return; 590 } 495 591 const G4String attName = Transcode(attribute->getName()); 496 592 const G4String attValue = Transcode(attribute->getValue()); … … 543 639 const xercesc::DOMElement* const child 544 640 = dynamic_cast<xercesc::DOMElement*>(iter); 641 if (!child) 642 { 643 G4Exception("G4GDMLReadMaterials::MaterialsRead()", "InvalidRead", 644 FatalException, "No child found!"); 645 return; 646 } 545 647 const G4String tag = Transcode(child->getTagName()); 546 648 -
trunk/source/persistency/gdml/src/G4GDMLReadParamvol.cc
r1337 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GDMLReadParamvol.cc,v 1.1 3 2009/04/24 15:34:20 gcosmo Exp $27 // GEANT4 tag $Name: g eant4-09-04-beta-01$26 // $Id: G4GDMLReadParamvol.cc,v 1.14 2010/10/14 16:19:40 gcosmo Exp $ 27 // GEANT4 tag $Name: gdml-V09-03-09 $ 28 28 // 29 29 // class G4GDMLReadParamvol Implementation … … 40 40 #include "G4VPhysicalVolume.hh" 41 41 42 G4GDMLReadParamvol::G4GDMLReadParamvol() : G4GDMLReadSetup() 42 G4GDMLReadParamvol::G4GDMLReadParamvol() 43 : G4GDMLReadSetup(), parameterisation(0) 43 44 { 44 45 } … … 67 68 const xercesc::DOMAttr* const attribute 68 69 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 70 if (!attribute) 71 { 72 G4Exception("G4GDMLReadParamvol::Box_dimensionsRead()", 73 "InvalidRead", FatalException, "No attribute found!"); 74 return; 75 } 69 76 const G4String attName = Transcode(attribute->getName()); 70 77 const G4String attValue = Transcode(attribute->getValue()); … … 100 107 const xercesc::DOMAttr* const attribute 101 108 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 109 if (!attribute) 110 { 111 G4Exception("G4GDMLReadParamvol::Trd_dimensionsRead()", 112 "InvalidRead", FatalException, "No attribute found!"); 113 return; 114 } 102 115 const G4String attName = Transcode(attribute->getName()); 103 116 const G4String attValue = Transcode(attribute->getValue()); … … 138 151 const xercesc::DOMAttr* const attribute 139 152 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 153 if (!attribute) 154 { 155 G4Exception("G4GDMLReadParamvol::Trap_dimensionsRead()", 156 "InvalidRead", FatalException, "No attribute found!"); 157 return; 158 } 140 159 const G4String attName = Transcode(attribute->getName()); 141 160 const G4String attValue = Transcode(attribute->getValue()); … … 202 221 const xercesc::DOMAttr* const attribute 203 222 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 223 if (!attribute) 224 { 225 G4Exception("G4GDMLReadParamvol::Tube_dimensionsRead()", 226 "InvalidRead", FatalException, "No attribute found!"); 227 return; 228 } 204 229 const G4String attName = Transcode(attribute->getName()); 205 230 const G4String attValue = Transcode(attribute->getValue()); … … 248 273 const xercesc::DOMAttr* const attribute 249 274 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 275 if (!attribute) 276 { 277 G4Exception("G4GDMLReadParamvol::Cone_dimensionsRead()", 278 "InvalidRead", FatalException, "No attribute found!"); 279 return; 280 } 250 281 const G4String attName = Transcode(attribute->getName()); 251 282 const G4String attValue = Transcode(attribute->getValue()); … … 300 331 const xercesc::DOMAttr* const attribute 301 332 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 333 if (!attribute) 334 { 335 G4Exception("G4GDMLReadParamvol::Sphere_dimensionsRead()", 336 "InvalidRead", FatalException, "No attribute found!"); 337 return; 338 } 302 339 const G4String attName = Transcode(attribute->getName()); 303 340 const G4String attValue = Transcode(attribute->getValue()); … … 348 385 const xercesc::DOMAttr* const attribute 349 386 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 387 if (!attribute) 388 { 389 G4Exception("G4GDMLReadParamvol::Orb_dimensionsRead()", 390 "InvalidRead", FatalException, "No attribute found!"); 391 return; 392 } 350 393 const G4String attName = Transcode(attribute->getName()); 351 394 const G4String attValue = Transcode(attribute->getValue()); … … 378 421 const xercesc::DOMAttr* const attribute 379 422 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 423 if (!attribute) 424 { 425 G4Exception("G4GDMLReadParamvol::Torus_dimensionsRead()", 426 "InvalidRead", FatalException, "No attribute found!"); 427 return; 428 } 380 429 const G4String attName = Transcode(attribute->getName()); 381 430 const G4String attValue = Transcode(attribute->getValue()); … … 424 473 const xercesc::DOMAttr* const attribute 425 474 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 475 if (!attribute) 476 { 477 G4Exception("G4GDMLReadParamvol::Para_dimensionsRead()", 478 "InvalidRead", FatalException, "No attribute found!"); 479 return; 480 } 426 481 const G4String attName = Transcode(attribute->getName()); 427 482 const G4String attValue = Transcode(attribute->getValue()); … … 473 528 const xercesc::DOMAttr* const attribute 474 529 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 530 if (!attribute) 531 { 532 G4Exception("G4GDMLReadParamvol::Hype_dimensionsRead()", 533 "InvalidRead", FatalException, "No attribute found!"); 534 return; 535 } 475 536 const G4String attName = Transcode(attribute->getName()); 476 537 const G4String attValue = Transcode(attribute->getValue()); … … 514 575 const xercesc::DOMElement* const child 515 576 = dynamic_cast<xercesc::DOMElement*>(iter); 577 if (!child) 578 { 579 G4Exception("G4GDMLReadParamvol::ParametersRead()", 580 "InvalidRead", FatalException, "No child found!"); 581 return; 582 } 516 583 const G4String tag = Transcode(child->getTagName()); 517 584 if (tag=="rotation") { VectorRead(child,rotation); } else … … 560 627 const xercesc::DOMElement* const child 561 628 = dynamic_cast<xercesc::DOMElement*>(iter); 629 if (!child) 630 { 631 G4Exception("G4GDMLReadParamvol::ParameterisedRead()", 632 "InvalidRead", FatalException, "No child found!"); 633 return; 634 } 562 635 const G4String tag = Transcode(child->getTagName()); 563 636 … … 578 651 const xercesc::DOMAttr* const attribute 579 652 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 653 if (!attribute) 654 { 655 G4Exception("G4GDMLReadParamvol::ParameterisedRead()", 656 "InvalidRead", FatalException, "No attribute found!"); 657 return; 658 } 580 659 const G4String attName = Transcode(attribute->getName()); 581 660 const G4String attValue = Transcode(attribute->getValue()); … … 602 681 const xercesc::DOMElement* const child 603 682 = dynamic_cast<xercesc::DOMElement*>(iter); 683 if (!child) 684 { 685 G4Exception("G4GDMLReadParamvol::Paramvol_contentRead()", "InvalidRead", 686 FatalException, "No child found!"); 687 return; 688 } 604 689 const G4String tag = Transcode(child->getTagName()); 605 690 if (tag=="parameterised_position_size") { ParameterisedRead(child); }else … … 622 707 const xercesc::DOMElement* const child 623 708 = dynamic_cast<xercesc::DOMElement*>(iter); 709 if (!child) 710 { 711 G4Exception("G4GDMLReadParamvol::ParamvolRead()", "InvalidRead", 712 FatalException, "No child found!"); 713 return; 714 } 624 715 const G4String tag = Transcode(child->getTagName()); 625 716 -
trunk/source/persistency/gdml/src/G4GDMLReadSetup.cc
r1337 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GDMLReadSetup.cc,v 1.1 0 2009/03/24 15:47:33gcosmo Exp $27 // GEANT4 tag $Name: g eant4-09-04-beta-01$26 // $Id: G4GDMLReadSetup.cc,v 1.11 2010/10/14 16:19:40 gcosmo Exp $ 27 // GEANT4 tag $Name: gdml-V09-03-09 $ 28 28 // 29 29 // class G4GDMLReadSetup Implementation … … 79 79 const xercesc::DOMAttr* const attribute 80 80 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 81 if (!attribute) 82 { 83 G4Exception("G4GDMLReadSetup::SetupRead()", 84 "InvalidRead", FatalException, "No attribute found!"); 85 return; 86 } 81 87 const G4String attName = Transcode(attribute->getName()); 82 88 const G4String attValue = Transcode(attribute->getValue()); … … 92 98 const xercesc::DOMElement* const child 93 99 = dynamic_cast<xercesc::DOMElement*>(iter); 100 if (!child) 101 { 102 G4Exception("G4GDMLReadSetup::SetupRead()", 103 "InvalidRead", FatalException, "No child found!"); 104 return; 105 } 94 106 const G4String tag = Transcode(child->getTagName()); 95 107 -
trunk/source/persistency/gdml/src/G4GDMLReadSolids.cc
r1337 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GDMLReadSolids.cc,v 1.3 1 2010/06/03 14:19:49gcosmo Exp $27 // GEANT4 tag $Name: g eant4-09-04-beta-01$26 // $Id: G4GDMLReadSolids.cc,v 1.32 2010/10/14 16:19:40 gcosmo Exp $ 27 // GEANT4 tag $Name: gdml-V09-03-09 $ 28 28 // 29 29 // class G4GDMLReadSolids Implementation … … 102 102 const xercesc::DOMAttr* const attribute 103 103 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 104 if (!attribute) 105 { 106 G4Exception("G4GDMLReadSolids::BooleanRead()", 107 "InvalidRead", FatalException, "No attribute found!"); 108 return; 109 } 104 110 const G4String attName = Transcode(attribute->getName()); 105 111 const G4String attValue = Transcode(attribute->getValue()); … … 115 121 const xercesc::DOMElement* const child 116 122 = dynamic_cast<xercesc::DOMElement*>(iter); 123 if (!child) 124 { 125 G4Exception("G4GDMLReadSolids::BooleanRead()", 126 "InvalidRead", FatalException, "No child found!"); 127 return; 128 } 117 129 const G4String tag = Transcode(child->getTagName()); 118 130 … … 186 198 const xercesc::DOMAttr* const attribute 187 199 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 200 if (!attribute) 201 { 202 G4Exception("G4GDMLReadSolids::BoxRead()", 203 "InvalidRead", FatalException, "No attribute found!"); 204 return; 205 } 188 206 const G4String attName = Transcode(attribute->getName()); 189 207 const G4String attValue = Transcode(attribute->getValue()); … … 231 249 const xercesc::DOMAttr* const attribute 232 250 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 251 if (!attribute) 252 { 253 G4Exception("G4GDMLReadSolids::ConeRead()", 254 "InvalidRead", FatalException, "No attribute found!"); 255 return; 256 } 233 257 const G4String attName = Transcode(attribute->getName()); 234 258 const G4String attValue = Transcode(attribute->getValue()); … … 281 305 const xercesc::DOMAttr* const attribute 282 306 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 307 if (!attribute) 308 { 309 G4Exception("G4GDMLReadSolids::ElconeRead()", 310 "InvalidRead", FatalException, "No attribute found!"); 311 return; 312 } 283 313 const G4String attName = Transcode(attribute->getName()); 284 314 const G4String attValue = Transcode(attribute->getValue()); … … 325 355 const xercesc::DOMAttr* const attribute 326 356 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 357 if (!attribute) 358 { 359 G4Exception("G4GDMLReadSolids::EllipsoidRead()", 360 "InvalidRead", FatalException, "No attribute found!"); 361 return; 362 } 327 363 const G4String attName = Transcode(attribute->getName()); 328 364 const G4String attValue = Transcode(attribute->getValue()); … … 369 405 const xercesc::DOMAttr* const attribute 370 406 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 407 if (!attribute) 408 { 409 G4Exception("G4GDMLReadSolids::EltubeRead()", 410 "InvalidRead", FatalException, "No attribute found!"); 411 return; 412 } 371 413 const G4String attName = Transcode(attribute->getName()); 372 414 const G4String attValue = Transcode(attribute->getValue()); … … 405 447 const xercesc::DOMAttr* const attribute 406 448 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 449 if (!attribute) 450 { 451 G4Exception("G4GDMLReadSolids::XtruRead()", 452 "InvalidRead", FatalException, "No attribute found!"); 453 return; 454 } 407 455 const G4String attName = Transcode(attribute->getName()); 408 456 const G4String attValue = Transcode(attribute->getValue()); … … 422 470 const xercesc::DOMElement* const child 423 471 = dynamic_cast<xercesc::DOMElement*>(iter); 472 if (!child) 473 { 474 G4Exception("G4GDMLReadSolids::XtruRead()", 475 "InvalidRead", FatalException, "No child found!"); 476 return; 477 } 424 478 const G4String tag = Transcode(child->getTagName()); 425 479 … … 458 512 const xercesc::DOMAttr* const attribute 459 513 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 514 if (!attribute) 515 { 516 G4Exception("G4GDMLReadSolids::HypeRead()", 517 "InvalidRead", FatalException, "No attribute found!"); 518 return; 519 } 460 520 const G4String attName = Transcode(attribute->getName()); 461 521 const G4String attValue = Transcode(attribute->getValue()); … … 500 560 const xercesc::DOMAttr* const attribute 501 561 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 562 if (!attribute) 563 { 564 G4Exception("G4GDMLReadSolids::OrbRead()", 565 "InvalidRead", FatalException, "No attribute found!"); 566 return; 567 } 502 568 const G4String attName = Transcode(attribute->getName()); 503 569 const G4String attValue = Transcode(attribute->getValue()); … … 539 605 const xercesc::DOMAttr* const attribute 540 606 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 607 if (!attribute) 608 { 609 G4Exception("G4GDMLReadSolids::ParaRead()", 610 "InvalidRead", FatalException, "No attribute found!"); 611 return; 612 } 541 613 const G4String attName = Transcode(attribute->getName()); 542 614 const G4String attValue = Transcode(attribute->getValue()); … … 587 659 const xercesc::DOMAttr* const attribute 588 660 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 661 if (!attribute) 662 { 663 G4Exception("G4GDMLReadSolids::ParaboloidRead()", 664 "InvalidRead", FatalException, "No attribute found!"); 665 return; 666 } 589 667 const G4String attName = Transcode(attribute->getName()); 590 668 const G4String attValue = Transcode(attribute->getValue()); … … 628 706 const xercesc::DOMAttr* const attribute 629 707 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 708 if (!attribute) 709 { 710 G4Exception("G4GDMLReadSolids::PolyconeRead()", 711 "InvalidRead", FatalException, "No attribute found!"); 712 return; 713 } 630 714 const G4String attName = Transcode(attribute->getName()); 631 715 const G4String attValue = Transcode(attribute->getValue()); … … 650 734 const xercesc::DOMElement* const child 651 735 = dynamic_cast<xercesc::DOMElement*>(iter); 736 if (!child) 737 { 738 G4Exception("G4GDMLReadSolids::PolyconeRead()", 739 "InvalidRead", FatalException, "No child found!"); 740 return; 741 } 652 742 const G4String tag = Transcode(child->getTagName()); 653 743 … … 696 786 const xercesc::DOMAttr* const attribute 697 787 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 788 if (!attribute) 789 { 790 G4Exception("G4GDMLReadSolids::PolyhedraRead()", 791 "InvalidRead", FatalException, "No attribute found!"); 792 return; 793 } 698 794 const G4String attName = Transcode(attribute->getName()); 699 795 const G4String attValue = Transcode(attribute->getValue()); … … 719 815 const xercesc::DOMElement* const child 720 816 = dynamic_cast<xercesc::DOMElement*>(iter); 817 if (!child) 818 { 819 G4Exception("G4GDMLReadSolids::PolyhedraRead()", 820 "InvalidRead", FatalException, "No child found!"); 821 return; 822 } 721 823 const G4String tag = Transcode(child->getTagName()); 722 824 … … 765 867 const xercesc::DOMAttr* const attribute 766 868 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 869 if (!attribute) 870 { 871 G4Exception("G4GDMLReadSolids::QuadrangularRead()", 872 "InvalidRead", FatalException, "No attribute found!"); 873 return 0; 874 } 767 875 const G4String attName = Transcode(attribute->getName()); 768 876 const G4String attValue = Transcode(attribute->getValue()); … … 808 916 const xercesc::DOMAttr* const attribute 809 917 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 918 if (!attribute) 919 { 920 G4Exception("G4GDMLReadSolids::ReflectedSolidRead()", 921 "InvalidRead", FatalException, "No attribute found!"); 922 return; 923 } 810 924 const G4String attName = Transcode(attribute->getName()); 811 925 const G4String attValue = Transcode(attribute->getValue()); … … 856 970 const xercesc::DOMAttr* const attribute 857 971 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 972 if (!attribute) 973 { 974 G4Exception("G4GDMLReadSolids::SectionRead()", 975 "InvalidRead", FatalException, "No attribute found!"); 976 return G4ExtrudedSolid::ZSection(zPosition,Offset,scalingFactor); 977 } 858 978 const G4String attName = Transcode(attribute->getName()); 859 979 const G4String attValue = Transcode(attribute->getValue()); … … 899 1019 const xercesc::DOMAttr* const attribute 900 1020 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1021 if (!attribute) 1022 { 1023 G4Exception("G4GDMLReadSolids::SphereRead()", 1024 "InvalidRead", FatalException, "No attribute found!"); 1025 return; 1026 } 901 1027 const G4String attName = Transcode(attribute->getName()); 902 1028 const G4String attValue = Transcode(attribute->getValue()); … … 942 1068 const xercesc::DOMAttr* const attribute 943 1069 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1070 if (!attribute) 1071 { 1072 G4Exception("G4GDMLReadSolids::TessellatedRead()", 1073 "InvalidRead", FatalException, "No attribute found!"); 1074 return; 1075 } 944 1076 const G4String attName = Transcode(attribute->getName()); 945 1077 const G4String attValue = Transcode(attribute->getValue()); … … 957 1089 const xercesc::DOMElement* const child 958 1090 = dynamic_cast<xercesc::DOMElement*>(iter); 1091 if (!child) 1092 { 1093 G4Exception("G4GDMLReadSolids::TessellatedRead()", 1094 "InvalidRead", FatalException, "No child found!"); 1095 return; 1096 } 959 1097 const G4String tag = Transcode(child->getTagName()); 960 1098 … … 990 1128 const xercesc::DOMAttr* const attribute 991 1129 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1130 if (!attribute) 1131 { 1132 G4Exception("G4GDMLReadSolids::TetRead()", 1133 "InvalidRead", FatalException, "No attribute found!"); 1134 return; 1135 } 992 1136 const G4String attName = Transcode(attribute->getName()); 993 1137 const G4String attValue = Transcode(attribute->getValue()); … … 1033 1177 const xercesc::DOMAttr* const attribute 1034 1178 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1179 if (!attribute) 1180 { 1181 G4Exception("G4GDMLReadSolids::TorusRead()", 1182 "InvalidRead", FatalException, "No attribute found!"); 1183 return; 1184 } 1035 1185 const G4String attName = Transcode(attribute->getName()); 1036 1186 const G4String attValue = Transcode(attribute->getValue()); … … 1079 1229 const xercesc::DOMAttr* const attribute 1080 1230 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1231 if (!attribute) 1232 { 1233 G4Exception("G4GDMLReadSolids::GenTrapRead()", 1234 "InvalidRead", FatalException, "No attribute found!"); 1235 return; 1236 } 1081 1237 const G4String attName = Transcode(attribute->getName()); 1082 1238 const G4String attValue = Transcode(attribute->getValue()); … … 1147 1303 const xercesc::DOMAttr* const attribute 1148 1304 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1305 if (!attribute) 1306 { 1307 G4Exception("G4GDMLReadSolids::TrapRead()", 1308 "InvalidRead", FatalException, "No attribute found!"); 1309 return; 1310 } 1149 1311 const G4String attName = Transcode(attribute->getName()); 1150 1312 const G4String attValue = Transcode(attribute->getValue()); … … 1205 1367 const xercesc::DOMAttr* const attribute 1206 1368 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1369 if (!attribute) 1370 { 1371 G4Exception("G4GDMLReadSolids::TrdRead()", 1372 "InvalidRead", FatalException, "No attribute found!"); 1373 return; 1374 } 1207 1375 const G4String attName = Transcode(attribute->getName()); 1208 1376 const G4String attValue = Transcode(attribute->getValue()); … … 1249 1417 const xercesc::DOMAttr* const attribute 1250 1418 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1419 if (!attribute) 1420 { 1421 G4Exception("G4GDMLReadSolids::TriangularRead()", 1422 "InvalidRead", FatalException, "No attribute found!"); 1423 return 0; 1424 } 1251 1425 const G4String attName = Transcode(attribute->getName()); 1252 1426 const G4String attValue = Transcode(attribute->getValue()); … … 1290 1464 const xercesc::DOMAttr* const attribute 1291 1465 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1466 if (!attribute) 1467 { 1468 G4Exception("G4GDMLReadSolids::TubeRead()", 1469 "InvalidRead", FatalException, "No attribute found!"); 1470 return; 1471 } 1292 1472 const G4String attName = Transcode(attribute->getName()); 1293 1473 const G4String attValue = Transcode(attribute->getValue()); … … 1337 1517 const xercesc::DOMAttr* const attribute 1338 1518 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1519 if (!attribute) 1520 { 1521 G4Exception("G4GDMLReadSolids::TwistedboxRead()", 1522 "InvalidRead", FatalException, "No attribute found!"); 1523 return; 1524 } 1339 1525 const G4String attName = Transcode(attribute->getName()); 1340 1526 const G4String attValue = Transcode(attribute->getValue()); … … 1389 1575 const xercesc::DOMAttr* const attribute 1390 1576 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1577 if (!attribute) 1578 { 1579 G4Exception("G4GDMLReadSolids::TwistedtrapRead()", 1580 "InvalidRead", FatalException, "No attribute found!"); 1581 return; 1582 } 1391 1583 const G4String attName = Transcode(attribute->getName()); 1392 1584 const G4String attValue = Transcode(attribute->getValue()); … … 1451 1643 const xercesc::DOMAttr* const attribute 1452 1644 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1645 if (!attribute) 1646 { 1647 G4Exception("G4GDMLReadSolids::TwistedtrdRead()", 1648 "InvalidRead", FatalException, "No attribute found!"); 1649 return; 1650 } 1453 1651 const G4String attName = Transcode(attribute->getName()); 1454 1652 const G4String attValue = Transcode(attribute->getValue()); … … 1501 1699 const xercesc::DOMAttr* const attribute 1502 1700 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1701 if (!attribute) 1702 { 1703 G4Exception("G4GDMLReadSolids::TwistedtubsRead()", 1704 "InvalidRead", FatalException, "No attribute found!"); 1705 return; 1706 } 1503 1707 const G4String attName = Transcode(attribute->getName()); 1504 1708 const G4String attValue = Transcode(attribute->getValue()); … … 1541 1745 const xercesc::DOMAttr* const attribute 1542 1746 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1747 if (!attribute) 1748 { 1749 G4Exception("G4GDMLReadSolids::TwoDimVertexRead()", 1750 "InvalidRead", FatalException, "No attribute found!"); 1751 return vec; 1752 } 1543 1753 const G4String attName = Transcode(attribute->getName()); 1544 1754 const G4String attValue = Transcode(attribute->getValue()); … … 1554 1764 ZplaneRead(const xercesc::DOMElement* const zplaneElement) 1555 1765 { 1556 zplaneType zplane ;1766 zplaneType zplane = {0.,0.,0.}; 1557 1767 1558 1768 const xercesc::DOMNamedNodeMap* const attributes … … 1569 1779 const xercesc::DOMAttr* const attribute 1570 1780 = dynamic_cast<xercesc::DOMAttr*>(node); 1781 if (!attribute) 1782 { 1783 G4Exception("G4GDMLReadSolids::ZplaneRead()", 1784 "InvalidRead", FatalException, "No attribute found!"); 1785 return zplane; 1786 } 1571 1787 const G4String attName = Transcode(attribute->getName()); 1572 1788 const G4String attValue = Transcode(attribute->getValue()); … … 1603 1819 const xercesc::DOMAttr* const attribute 1604 1820 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 1821 if (!attribute) 1822 { 1823 G4Exception("G4GDMLReadSolids::OpticalSurfaceRead()", 1824 "InvalidRead", FatalException, "No attribute found!"); 1825 return; 1826 } 1605 1827 const G4String attName = Transcode(attribute->getName()); 1606 1828 const G4String attValue = Transcode(attribute->getValue()); … … 1705 1927 const xercesc::DOMElement* const child 1706 1928 = dynamic_cast<xercesc::DOMElement*>(iter); 1929 if (!child) 1930 { 1931 G4Exception("G4GDMLReadSolids::SolidsRead()", 1932 "InvalidRead", FatalException, "No child found!"); 1933 return; 1934 } 1707 1935 const G4String tag = Transcode(child->getTagName()); 1708 1936 if (tag=="define") { DefineRead(child); } else -
trunk/source/persistency/gdml/src/G4GDMLReadStructure.cc
r1337 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GDMLReadStructure.cc,v 1.6 2 2009/09/24 15:04:34gcosmo Exp $27 // GEANT4 tag $Name: g eant4-09-04-beta-01$26 // $Id: G4GDMLReadStructure.cc,v 1.67 2010/11/02 10:39:27 gcosmo Exp $ 27 // GEANT4 tag $Name: gdml-V09-03-09 $ 28 28 // 29 29 // class G4GDMLReadStructure Implementation … … 47 47 #include "G4VisAttributes.hh" 48 48 49 G4GDMLReadStructure::G4GDMLReadStructure() : G4GDMLReadParamvol() 49 G4GDMLReadStructure::G4GDMLReadStructure() 50 : G4GDMLReadParamvol(), pMotherLogical(0) 50 51 { 51 52 } … … 58 59 AuxiliaryRead(const xercesc::DOMElement* const auxiliaryElement) 59 60 { 60 G4GDMLAuxPairType auxpair ;61 G4GDMLAuxPairType auxpair = {"",""}; 61 62 62 63 const xercesc::DOMNamedNodeMap* const attributes … … 74 75 const xercesc::DOMAttr* const attribute 75 76 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 77 if (!attribute) 78 { 79 G4Exception("G4GDMLReadStructure::AuxiliaryRead()", 80 "InvalidRead", FatalException, "No attribute found!"); 81 return auxpair; 82 } 76 83 const G4String attName = Transcode(attribute->getName()); 77 84 const G4String attValue = Transcode(attribute->getValue()); 78 85 79 86 if (attName=="auxtype") { auxpair.type = attValue; } else 80 if (attName=="auxvalue") { auxpair.value = eval.Evaluate(attValue); } 87 // if (attName=="auxvalue") { auxpair.value = eval.Evaluate(attValue); } 88 if (attName=="auxvalue") { auxpair.value = attValue; } 81 89 } 82 90 … … 107 115 const xercesc::DOMAttr* const attribute 108 116 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 117 if (!attribute) 118 { 119 G4Exception("G4GDMLReadStructure::BorderSurfaceRead()", 120 "InvalidRead", FatalException, "No attribute found!"); 121 return; 122 } 109 123 const G4String attName = Transcode(attribute->getName()); 110 124 const G4String attValue = Transcode(attribute->getValue()); … … 123 137 const xercesc::DOMElement* const child 124 138 = dynamic_cast<xercesc::DOMElement*>(iter); 139 if (!child) 140 { 141 G4Exception("G4GDMLReadStructure::BorderSurfaceRead()", 142 "InvalidRead", FatalException, "No child found!"); 143 return; 144 } 125 145 const G4String tag = Transcode(child->getTagName()); 126 146 … … 162 182 const xercesc::DOMAttr* const attribute 163 183 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 184 if (!attribute) 185 { 186 G4Exception("G4GDMLReadStructure::DivisionvolRead()", 187 "InvalidRead", FatalException, "No attribute found!"); 188 return; 189 } 164 190 const G4String attName = Transcode(attribute->getName()); 165 191 const G4String attValue = Transcode(attribute->getValue()); … … 190 216 const xercesc::DOMElement* const child 191 217 = dynamic_cast<xercesc::DOMElement*>(iter); 218 if (!child) 219 { 220 G4Exception("G4GDMLReadStructure::DivisionvolRead()", 221 "InvalidRead", FatalException, "No child found!"); 222 return; 223 } 192 224 const G4String tag = Transcode(child->getTagName()); 193 225 194 226 if (tag=="volumeref") { logvol = GetVolume(GenerateName(RefRead(child))); } 195 227 } 228 229 if (!logvol) { return; } 196 230 197 231 G4PVDivisionFactory::GetInstance(); … … 239 273 const xercesc::DOMAttr* const attribute 240 274 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 275 if (!attribute) 276 { 277 G4Exception("G4GDMLReadStructure::FileRead()", 278 "InvalidRead", FatalException, "No attribute found!"); 279 return 0; 280 } 241 281 const G4String attName = Transcode(attribute->getName()); 242 282 const G4String attValue = Transcode(attribute->getValue()); … … 299 339 const xercesc::DOMAttr* const attribute 300 340 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 341 if (!attribute) 342 { 343 G4Exception("G4GDMLReadStructure::PhysvolRead()", 344 "InvalidRead", FatalException, "No attribute found!"); 345 return; 346 } 301 347 const G4String attName = Transcode(attribute->getName()); 302 348 const G4String attValue = Transcode(attribute->getValue()); … … 312 358 const xercesc::DOMElement* const child 313 359 = dynamic_cast<xercesc::DOMElement*>(iter); 360 if (!child) 361 { 362 G4Exception("G4GDMLReadStructure::PhysvolRead()", 363 "InvalidRead", FatalException, "No child found!"); 364 return; 365 } 314 366 const G4String tag = Transcode(child->getTagName()); 315 367 … … 339 391 G4Exception("G4GDMLReadStructure::PhysvolRead()", "ReadError", 340 392 FatalException, error_msg); 393 return; 341 394 } 342 395 } … … 347 400 if (pAssembly) // Fill assembly structure 348 401 { 402 if (!logvol) { return; } 349 403 pAssembly->AddPlacedVolume(logvol, transform); 350 404 } … … 357 411 else 358 412 { 413 if (!logvol) { return; } 359 414 G4String pv_name = logvol->GetName() + "_PV"; 360 415 G4PhysicalVolumesPair pair = G4ReflectionFactory::Instance() … … 378 433 const xercesc::DOMElement* const child 379 434 = dynamic_cast<xercesc::DOMElement*>(iter); 435 if (!child) 436 { 437 G4Exception("G4GDMLReadStructure::ReplicavolRead()", 438 "InvalidRead", FatalException, "No child found!"); 439 return; 440 } 380 441 const G4String tag = Transcode(child->getTagName()); 381 442 … … 386 447 else if (tag=="replicate_along_axis") 387 448 { 388 ReplicaRead(child,logvol,number);449 if (logvol) { ReplicaRead(child,logvol,number); } 389 450 } 390 451 else … … 415 476 const xercesc::DOMElement* const child 416 477 = dynamic_cast<xercesc::DOMElement*>(iter); 478 if (!child) 479 { 480 G4Exception("G4GDMLReadStructure::ReplicaRead()", 481 "InvalidRead", FatalException, "No child found!"); 482 return; 483 } 417 484 const G4String tag = Transcode(child->getTagName()); 418 485 … … 451 518 AxisRead(const xercesc::DOMElement* const axisElement) 452 519 { 453 454 520 EAxis axis = kUndefined; 455 521 … … 468 534 const xercesc::DOMAttr* const attribute 469 535 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 536 if (!attribute) 537 { 538 G4Exception("G4GDMLReadStructure::AxisRead()", 539 "InvalidRead", FatalException, "No attribute found!"); 540 return axis; 541 } 470 542 const G4String attName = Transcode(attribute->getName()); 471 543 const G4String attValue = Transcode(attribute->getValue()); … … 503 575 const xercesc::DOMAttr* const attribute 504 576 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 577 if (!attribute) 578 { 579 G4Exception("G4GDMLReadStructure::QuantityRead()", 580 "InvalidRead", FatalException, "No attribute found!"); 581 return value; 582 } 505 583 const G4String attName = Transcode(attribute->getName()); 506 584 const G4String attValue = Transcode(attribute->getValue()); … … 531 609 const xercesc::DOMElement* const child 532 610 = dynamic_cast<xercesc::DOMElement*>(iter); 611 if (!child) 612 { 613 G4Exception("G4GDMLReadStructure::VolumeRead()", 614 "InvalidRead", FatalException, "No child found!"); 615 return; 616 } 533 617 const G4String tag = Transcode(child->getTagName()); 534 618 … … 565 649 const xercesc::DOMElement* const child 566 650 = dynamic_cast<xercesc::DOMElement*>(iter); 651 if (!child) 652 { 653 G4Exception("G4GDMLReadStructure::AssemblyRead()", 654 "InvalidRead", FatalException, "No child found!"); 655 return; 656 } 567 657 const G4String tag = Transcode(child->getTagName()); 568 658 … … 600 690 const xercesc::DOMAttr* const attribute 601 691 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 692 if (!attribute) 693 { 694 G4Exception("G4GDMLReadStructure::SkinsurfaceRead()", 695 "InvalidRead", FatalException, "No attribute found!"); 696 return; 697 } 602 698 const G4String attName = Transcode(attribute->getName()); 603 699 const G4String attValue = Transcode(attribute->getValue()); … … 616 712 const xercesc::DOMElement* const child 617 713 = dynamic_cast<xercesc::DOMElement*>(iter); 714 if (!child) 715 { 716 G4Exception("G4GDMLReadStructure::SkinsurfaceRead()", 717 "InvalidRead", FatalException, "No child found!"); 718 return; 719 } 618 720 const G4String tag = Transcode(child->getTagName()); 619 721 … … 643 745 const xercesc::DOMElement* const child 644 746 = dynamic_cast<xercesc::DOMElement*>(iter); 747 if (!child) 748 { 749 G4Exception("G4GDMLReadStructure::Volume_contentRead()", 750 "InvalidRead", FatalException, "No child found!"); 751 return; 752 } 645 753 const G4String tag = Transcode(child->getTagName()); 646 754 … … 674 782 const xercesc::DOMAttr* const attribute 675 783 = dynamic_cast<xercesc::DOMAttr*>(attribute_node); 784 if (!attribute) 785 { 786 G4Exception("G4GDMLReadStructure::Volume_contentRead()", 787 "InvalidRead", FatalException, "No attribute found!"); 788 return; 789 } 676 790 const G4String attName = Transcode(attribute->getName()); 677 791 const G4String attValue = Transcode(attribute->getValue()); … … 711 825 const xercesc::DOMElement* const child 712 826 = dynamic_cast<xercesc::DOMElement*>(iter); 827 if (!child) 828 { 829 G4Exception("G4GDMLReadStructure::StructureRead()", 830 "InvalidRead", FatalException, "No child found!"); 831 return; 832 } 713 833 const G4String tag = Transcode(child->getTagName()); 714 834 … … 768 888 769 889 G4GDMLAuxListType G4GDMLReadStructure:: 770 GetVolumeAuxiliaryInformation( const G4LogicalVolume* const logvol)890 GetVolumeAuxiliaryInformation(G4LogicalVolume* logvol) const 771 891 { 772 892 G4GDMLAuxMapType::const_iterator pos = auxMap.find(logvol); … … 786 906 G4LogicalVolume* volume = GetVolume(Strip(GetSetup(setupName))); 787 907 volume->SetVisAttributes(G4VisAttributes::Invisible); 788 G4VPhysicalVolume* pvWorld = 789 new G4PVPlacement(0,G4ThreeVector(0,0,0),volume,setupName,0,0,0); 908 909 G4VPhysicalVolume* pvWorld = 0; 910 911 if(setuptoPV[setupName]) 912 { 913 pvWorld = setuptoPV[setupName]; 914 } 915 else 916 { 917 pvWorld = new G4PVPlacement(0,G4ThreeVector(0,0,0),volume, 918 volume->GetName()+"_PV",0,0,0); 919 setuptoPV[setupName] = pvWorld; 920 } 790 921 return pvWorld; 791 922 } 923 924 void G4GDMLReadStructure::Clear() 925 { 926 eval.Clear(); 927 setuptoPV.clear(); 928 } -
trunk/source/persistency/gdml/src/G4GDMLWrite.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLWrite.cc,v 1.5 5 2009/04/24 15:34:20gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLWrite.cc,v 1.58 2010/11/02 10:55:03 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // class G4GDMLWrite Implementation … … 45 45 G4bool G4GDMLWrite::addPointerToName = true; 46 46 47 G4GDMLWrite::G4GDMLWrite() : extElement(0)47 G4GDMLWrite::G4GDMLWrite() : doc(0), extElement(0) 48 48 { 49 49 } … … 155 155 156 156 xercesc::XMLString::transcode("LS", tempStr, 99); 157 xercesc::DOMImplementationRegistry::getDOMImplementation(tempStr); 158 xercesc::XMLString::transcode("Range", tempStr, 99); 157 159 xercesc::DOMImplementation* impl = 158 160 xercesc::DOMImplementationRegistry::getDOMImplementation(tempStr); 159 xercesc::XMLString::transcode("Range", tempStr, 99);160 impl = xercesc::DOMImplementationRegistry::getDOMImplementation(tempStr);161 161 xercesc::XMLString::transcode("gdml", tempStr, 99); 162 162 doc = impl->createDocument(0,tempStr,0); … … 255 255 G4Exception("G4GDMLWrite::AddModule()", "InvalidSetup", FatalException, 256 256 "Invalid NULL pointer is specified for modularization!"); 257 return; 257 258 } 258 259 if (dynamic_cast<const G4PVDivision*>(physvol)) … … 260 261 G4Exception("G4GDMLWrite::AddModule()", "InvalidSetup", FatalException, 261 262 "It is not possible to modularize by divisionvol!"); 263 return; 262 264 } 263 265 if (physvol->IsParameterised()) … … 265 267 G4Exception("G4GDMLWrite::AddModule()", "InvalidSetup", FatalException, 266 268 "It is not possible to modularize by parameterised volume!"); 269 return; 267 270 } 268 271 if (physvol->IsReplicated()) … … 270 273 G4Exception("G4GDMLWrite::AddModule()", "InvalidSetup", FatalException, 271 274 "It is not possible to modularize by replicated volume!"); 275 return; 272 276 } 273 277 -
trunk/source/persistency/gdml/src/G4GDMLWriteDefine.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLWriteDefine.cc,v 1. 19 2009/03/24 15:47:33gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLWriteDefine.cc,v 1.20 2010/10/14 16:19:40 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // class G4GDMLWriteDefine Implementation … … 40 40 const G4double G4GDMLWriteDefine::kLinearPrecision = DBL_EPSILON; 41 41 42 G4GDMLWriteDefine::G4GDMLWriteDefine() : G4GDMLWrite() 42 G4GDMLWriteDefine::G4GDMLWriteDefine() 43 : G4GDMLWrite(), defineElement(0) 43 44 { 44 45 } -
trunk/source/persistency/gdml/src/G4GDMLWriteMaterials.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLWriteMaterials.cc,v 1.2 5 2010/02/18 17:38:24gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLWriteMaterials.cc,v 1.26 2010/10/14 16:19:40 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // class G4GDMLWriteMaterials Implementation … … 41 41 #include "G4Material.hh" 42 42 43 G4GDMLWriteMaterials:: 44 G4GDMLWriteMaterials() : G4GDMLWriteDefine() 45 { 46 } 47 48 G4GDMLWriteMaterials:: 49 ~G4GDMLWriteMaterials() 43 G4GDMLWriteMaterials::G4GDMLWriteMaterials() 44 : G4GDMLWriteDefine(), materialsElement(0) 45 { 46 } 47 48 G4GDMLWriteMaterials::~G4GDMLWriteMaterials() 50 49 { 51 50 } -
trunk/source/persistency/gdml/src/G4GDMLWriteSolids.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLWriteSolids.cc,v 1.6 8 2010/06/03 14:19:49gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLWriteSolids.cc,v 1.69 2010/10/14 16:19:40 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // class G4GDMLWriteSolids Implementation … … 68 68 #include "G4SurfaceProperty.hh" 69 69 70 G4GDMLWriteSolids:: 71 G4GDMLWriteSolids() : G4GDMLWriteMaterials() 72 { 73 } 74 75 G4GDMLWriteSolids:: 76 ~G4GDMLWriteSolids() 70 G4GDMLWriteSolids::G4GDMLWriteSolids() 71 : G4GDMLWriteMaterials(), solidsElement(0) 72 { 73 } 74 75 G4GDMLWriteSolids::~G4GDMLWriteSolids() 77 76 { 78 77 } -
trunk/source/persistency/gdml/src/G4GDMLWriteStructure.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GDMLWriteStructure.cc,v 1.8 1 2010/05/20 12:56:57gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4GDMLWriteStructure.cc,v 1.83 2010/10/14 16:19:40 gcosmo Exp $ 28 // GEANT4 tag $Name: gdml-V09-03-09 $ 29 29 // 30 30 // class G4GDMLWriteStructure Implementation … … 75 75 else if (axis==kZAxis) { axisString = "kZAxis"; } 76 76 else if (axis==kRho) { axisString = "kRho"; } 77 else if (axis==kPhi) { axisString = "kPhi"; unitString = " degree"; }77 else if (axis==kPhi) { axisString = "kPhi"; unitString = "rad"; } 78 78 79 79 const G4String name … … 188 188 { dirElement->setAttributeNode(NewAttribute("rho","1")); } 189 189 else if(axis==kPhi) 190 { dirElement->setAttributeNode(NewAttribute("phi","1")); } 190 { dirElement->setAttributeNode(NewAttribute("phi","1")); 191 unitString="rad"; } 191 192 replicateElement->appendChild(dirElement); 192 193 … … 231 232 if (FindOpticalSurface(psurf)) 232 233 { 233 OpticalSurfaceWrite(solidsElement, 234 dynamic_cast<const G4OpticalSurface*>(psurf)); 234 const G4OpticalSurface* opsurf = 235 dynamic_cast<const G4OpticalSurface*>(psurf); 236 if (!opsurf) 237 { 238 G4Exception("G4GDMLWriteStructure::BorderSurfaceCache()", 239 "InvalidSetup", FatalException, "No optical surface found!"); 240 return; 241 } 242 OpticalSurfaceWrite(solidsElement, opsurf); 235 243 } 236 244 … … 260 268 if (FindOpticalSurface(psurf)) 261 269 { 262 OpticalSurfaceWrite(solidsElement, 263 dynamic_cast<const G4OpticalSurface*>(psurf)); 270 const G4OpticalSurface* opsurf = 271 dynamic_cast<const G4OpticalSurface*>(psurf); 272 if (!opsurf) 273 { 274 G4Exception("G4GDMLWriteStructure::SkinSurfaceCache()", 275 "InvalidSetup", FatalException, "No optical surface found!"); 276 return; 277 } 278 OpticalSurfaceWrite(solidsElement, opsurf); 264 279 } 265 280 -
trunk/source/persistency/gdml/src/G4STRead.cc
r1337 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4STRead.cc,v 1. 4 2009/04/24 15:34:20gcosmo Exp $27 // GEANT4 tag $Name: g eant4-09-04-beta-01$26 // $Id: G4STRead.cc,v 1.6 2010/11/02 10:39:27 gcosmo Exp $ 27 // GEANT4 tag $Name: gdml-V09-03-09 $ 28 28 // 29 29 // class G4STRead Implementation … … 123 123 stream >> level >> name >> r1 >> r2 >> r3 >> n1 >> r4 >> r5 >> r6 124 124 >> n2 >> r7 >> r8 >> r9 >> n3 >> pX >> pY >> pZ >> n4 >> n5; 125 126 name.resize(name.rfind("_")); 125 std::string::size_type idx = name.rfind("_"); 126 if (idx!=std::string::npos) 127 { 128 name.resize(idx); 129 } 130 else 131 { 132 G4Exception("G4STRead::PhysvolRead()", "ReadError", 133 FatalException, "Invalid input stream!"); 134 return; 135 } 127 136 128 137 G4cout << "G4STRead: Placing tessellated solid: " << name << G4endl;
Note: See TracChangeset
for help on using the changeset viewer.