Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GDMLWrite Class Referenceabstract

#include <G4GDMLWrite.hh>

+ Inheritance diagram for G4GDMLWrite:

Public Member Functions

G4Transform3D Write (const G4String &filename, const G4LogicalVolume *const topLog, const G4String &schemaPath, const G4int depth, G4bool storeReferences=true)
 
void AddModule (const G4VPhysicalVolume *const topVol)
 
void AddModule (const G4int depth)
 
virtual void DefineWrite (xercesc::DOMElement *)=0
 
virtual void MaterialsWrite (xercesc::DOMElement *)=0
 
virtual void SolidsWrite (xercesc::DOMElement *)=0
 
virtual void StructureWrite (xercesc::DOMElement *)=0
 
virtual G4Transform3D TraverseVolumeTree (const G4LogicalVolume *const, const G4int)=0
 
virtual void SurfacesWrite ()=0
 
virtual void SetupWrite (xercesc::DOMElement *, const G4LogicalVolume *const)=0
 
virtual void ExtensionWrite (xercesc::DOMElement *)
 
virtual void AddExtension (xercesc::DOMElement *, const G4LogicalVolume *const)
 

Static Public Member Functions

static void SetAddPointerToName (G4bool)
 

Protected Member Functions

 G4GDMLWrite ()
 
virtual ~G4GDMLWrite ()
 
VolumeMapType & VolumeMap ()
 
G4String GenerateName (const G4String &, const void *const)
 
xercesc::DOMAttr * NewAttribute (const G4String &, const G4String &)
 
xercesc::DOMAttr * NewAttribute (const G4String &, const G4double &)
 
xercesc::DOMElement * NewElement (const G4String &)
 
G4String Modularize (const G4VPhysicalVolume *const topvol, const G4int depth)
 
G4bool FileExists (const G4String &) const
 
PhysVolumeMapType & PvolumeMap ()
 
DepthMapType & DepthMap ()
 

Protected Attributes

G4String SchemaLocation
 
xercesc::DOMDocument * doc
 
xercesc::DOMElement * extElement
 
XMLCh tempStr [10000]
 

Static Protected Attributes

static G4bool addPointerToName = true
 

Detailed Description

Definition at line 55 of file G4GDMLWrite.hh.

Constructor & Destructor Documentation

◆ G4GDMLWrite()

G4GDMLWrite::G4GDMLWrite ( )
protected

Definition at line 46 of file G4GDMLWrite.cc.

46 : doc(0), extElement(0)
47{
48}
xercesc::DOMElement * extElement
Definition: G4GDMLWrite.hh:124
xercesc::DOMDocument * doc
Definition: G4GDMLWrite.hh:123

◆ ~G4GDMLWrite()

G4GDMLWrite::~G4GDMLWrite ( )
protectedvirtual

Definition at line 50 of file G4GDMLWrite.cc.

51{
52}

Member Function Documentation

◆ AddExtension()

void G4GDMLWrite::AddExtension ( xercesc::DOMElement *  ,
const G4LogicalVolume * const   
)
virtual

Definition at line 78 of file G4GDMLWrite.cc.

80{
81 // Empty implementation. To be overwritten by user for specific extensions
82 // related to attributes associated to volumes
83}

Referenced by G4GDMLWriteStructure::TraverseVolumeTree().

◆ AddModule() [1/2]

void G4GDMLWrite::AddModule ( const G4int  depth)

Definition at line 280 of file G4GDMLWrite.cc.

281{
282 if (depth<0)
283 {
284 G4Exception("G4GDMLWrite::AddModule()", "InvalidSetup", FatalException,
285 "Depth must be a positive number!");
286 }
287 if (DepthMap().find(depth) != DepthMap().end())
288 {
289 G4Exception("G4GDMLWrite::AddModule()", "InvalidSetup", FatalException,
290 "Adding module(s) at this depth is already requested!");
291 }
292 DepthMap()[depth] = 0;
293}
@ FatalException
DepthMapType & DepthMap()
Definition: G4GDMLWrite.cc:72
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ AddModule() [2/2]

void G4GDMLWrite::AddModule ( const G4VPhysicalVolume *const  topVol)

Definition at line 247 of file G4GDMLWrite.cc.

248{
249 G4String fname = GenerateName(physvol->GetName(),physvol);
250 G4cout << "G4GDML: Adding module '" << fname << "'..." << G4endl;
251
252 if (physvol == 0)
253 {
254 G4Exception("G4GDMLWrite::AddModule()", "InvalidSetup", FatalException,
255 "Invalid NULL pointer is specified for modularization!");
256 return;
257 }
258 if (dynamic_cast<const G4PVDivision*>(physvol))
259 {
260 G4Exception("G4GDMLWrite::AddModule()", "InvalidSetup", FatalException,
261 "It is not possible to modularize by divisionvol!");
262 return;
263 }
264 if (physvol->IsParameterised())
265 {
266 G4Exception("G4GDMLWrite::AddModule()", "InvalidSetup", FatalException,
267 "It is not possible to modularize by parameterised volume!");
268 return;
269 }
270 if (physvol->IsReplicated())
271 {
272 G4Exception("G4GDMLWrite::AddModule()", "InvalidSetup", FatalException,
273 "It is not possible to modularize by replicated volume!");
274 return;
275 }
276
277 PvolumeMap()[physvol] = fname;
278}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4String GenerateName(const G4String &, const void *const)
Definition: G4GDMLWrite.cc:90
PhysVolumeMapType & PvolumeMap()
Definition: G4GDMLWrite.cc:66

◆ DefineWrite()

virtual void G4GDMLWrite::DefineWrite ( xercesc::DOMElement *  )
pure virtual

Implemented in G4GDMLWriteDefine.

Referenced by Write().

◆ DepthMap()

G4GDMLWrite::DepthMapType & G4GDMLWrite::DepthMap ( )
protected

Definition at line 72 of file G4GDMLWrite.cc.

73{
74 static DepthMapType instance;
75 return instance;
76}

Referenced by AddModule(), and Modularize().

◆ ExtensionWrite()

void G4GDMLWrite::ExtensionWrite ( xercesc::DOMElement *  )
virtual

Definition at line 85 of file G4GDMLWrite.cc.

86{
87 // Empty implementation. To be overwritten by user for specific extensions
88}

Referenced by Write().

◆ FileExists()

G4bool G4GDMLWrite::FileExists ( const G4String fname) const
protected

Definition at line 54 of file G4GDMLWrite.cc.

55{
56 struct stat FileInfo;
57 return (stat(fname.c_str(),&FileInfo) == 0);
58}

Referenced by Write().

◆ GenerateName()

G4String G4GDMLWrite::GenerateName ( const G4String name,
const void * const  ptr 
)
protected

Definition at line 90 of file G4GDMLWrite.cc.

91{
92 G4String nameOut;
93 std::stringstream stream; stream << name;
94 if (addPointerToName) { stream << ptr; };
95
96 nameOut=G4String(stream.str());
97 if(nameOut.contains(' '))
98 nameOut.erase(std::remove(nameOut.begin(),nameOut.end(),' '),nameOut.end());
99
100 return nameOut;
101}
static G4bool addPointerToName
Definition: G4GDMLWrite.hh:122
G4bool contains(const std::string &) const

Referenced by AddModule(), G4GDMLWriteSolids::BooleanWrite(), G4GDMLWriteStructure::BorderSurfaceCache(), G4GDMLWriteSolids::BoxWrite(), G4GDMLWriteSolids::ConeWrite(), G4GDMLWriteSolids::CutTubeWrite(), G4GDMLWriteStructure::DivisionvolWrite(), G4GDMLWriteSolids::ElconeWrite(), G4GDMLWriteMaterials::ElementWrite(), G4GDMLWriteSolids::EllipsoidWrite(), G4GDMLWriteSolids::EltubeWrite(), G4GDMLWriteSolids::GenTrapWrite(), G4GDMLWriteSolids::HypeWrite(), G4GDMLWriteMaterials::IsotopeWrite(), G4GDMLWriteMaterials::MaterialWrite(), G4GDMLWriteSolids::OrbWrite(), G4GDMLWriteSolids::ParaboloidWrite(), G4GDMLWriteParamvol::ParametersWrite(), G4GDMLWriteParamvol::ParamvolAlgorithmWrite(), G4GDMLWriteParamvol::ParamvolWrite(), G4GDMLWriteSolids::ParaWrite(), G4GDMLWriteStructure::PhysvolWrite(), G4GDMLWriteSolids::PolyconeWrite(), G4GDMLWriteSolids::PolyhedraWrite(), G4GDMLWriteMaterials::PropertyVectorWrite(), G4GDMLWriteMaterials::PropertyWrite(), G4GDMLWriteStructure::ReplicavolWrite(), G4GDMLWriteSetup::SetupWrite(), G4GDMLWriteStructure::SkinSurfaceCache(), G4GDMLWriteSolids::SphereWrite(), G4GDMLWriteSolids::TessellatedWrite(), G4GDMLWriteSolids::TetWrite(), G4GDMLWriteSolids::TorusWrite(), G4GDMLWriteSolids::TrapWrite(), G4GDMLWriteStructure::TraverseVolumeTree(), G4GDMLWriteSolids::TrdWrite(), G4GDMLWriteSolids::TubeWrite(), G4GDMLWriteSolids::TwistedboxWrite(), G4GDMLWriteSolids::TwistedtrapWrite(), G4GDMLWriteSolids::TwistedtrdWrite(), G4GDMLWriteSolids::TwistedtubsWrite(), and G4GDMLWriteSolids::XtruWrite().

◆ MaterialsWrite()

virtual void G4GDMLWrite::MaterialsWrite ( xercesc::DOMElement *  )
pure virtual

Implemented in G4GDMLWriteMaterials.

Referenced by Write().

◆ Modularize()

G4String G4GDMLWrite::Modularize ( const G4VPhysicalVolume *const  topvol,
const G4int  depth 
)
protected

Definition at line 295 of file G4GDMLWrite.cc.

297{
298 if (PvolumeMap().find(physvol) != PvolumeMap().end())
299 {
300 return PvolumeMap()[physvol]; // Modularize via physvol
301 }
302
303 if (DepthMap().find(depth) != DepthMap().end()) // Modularize via depth
304 {
305 std::stringstream stream;
306 stream << "depth" << depth << "_module" << DepthMap()[depth] << ".gdml";
307 DepthMap()[depth]++; // There can be more modules at this depth!
308 return G4String(stream.str());
309 }
310
311 return G4String(""); // Empty string for module name = no modularization
312 // was requested at that level/physvol!
313}

Referenced by G4GDMLWriteStructure::TraverseVolumeTree().

◆ NewAttribute() [1/2]

xercesc::DOMAttr * G4GDMLWrite::NewAttribute ( const G4String name,
const G4double value 
)
protected

Definition at line 113 of file G4GDMLWrite.cc.

115{
116 xercesc::XMLString::transcode(name,tempStr,99);
117 xercesc::DOMAttr* att = doc->createAttribute(tempStr);
118 std::ostringstream ostream;
119 ostream.precision(15);
120 ostream << value;
121 G4String str = ostream.str();
122 xercesc::XMLString::transcode(str,tempStr,99);
123 att->setValue(tempStr);
124 return att;
125}
XMLCh tempStr[10000]
Definition: G4GDMLWrite.hh:125

◆ NewAttribute() [2/2]

xercesc::DOMAttr * G4GDMLWrite::NewAttribute ( const G4String name,
const G4String value 
)
protected

Definition at line 103 of file G4GDMLWrite.cc.

105{
106 xercesc::XMLString::transcode(name,tempStr,99);
107 xercesc::DOMAttr* att = doc->createAttribute(tempStr);
108 xercesc::XMLString::transcode(value,tempStr,99);
109 att->setValue(tempStr);
110 return att;
111}

Referenced by G4GDMLWriteMaterials::AtomWrite(), G4GDMLWriteSolids::BooleanWrite(), G4GDMLWriteStructure::BorderSurfaceCache(), G4GDMLWriteParamvol::Box_dimensionsWrite(), G4GDMLWriteSolids::BoxWrite(), G4GDMLWriteParamvol::Cone_dimensionsWrite(), G4GDMLWriteSolids::ConeWrite(), G4GDMLWriteSolids::CutTubeWrite(), G4GDMLWriteStructure::DivisionvolWrite(), G4GDMLWriteMaterials::DWrite(), G4GDMLWriteSolids::ElconeWrite(), G4GDMLWriteMaterials::ElementWrite(), G4GDMLWriteSolids::EllipsoidWrite(), G4GDMLWriteSolids::EltubeWrite(), G4GDMLWriteSolids::GenTrapWrite(), G4GDMLWriteParamvol::Hype_dimensionsWrite(), G4GDMLWriteSolids::HypeWrite(), G4GDMLWriteMaterials::IsotopeWrite(), G4GDMLWriteMaterials::MaterialWrite(), G4GDMLWriteMaterials::MEEWrite(), G4GDMLWriteSolids::OpticalSurfaceWrite(), G4GDMLWriteParamvol::Orb_dimensionsWrite(), G4GDMLWriteSolids::OrbWrite(), G4GDMLWriteParamvol::Para_dimensionsWrite(), G4GDMLWriteSolids::ParaboloidWrite(), G4GDMLWriteParamvol::ParametersWrite(), G4GDMLWriteParamvol::ParamvolWrite(), G4GDMLWriteSolids::ParaWrite(), G4GDMLWriteStructure::PhysvolWrite(), G4GDMLWriteSolids::PolyconeWrite(), G4GDMLWriteSolids::PolyhedraWrite(), G4GDMLWriteDefine::Position_vectorWrite(), G4GDMLWriteMaterials::PropertyVectorWrite(), G4GDMLWriteMaterials::PropertyWrite(), G4GDMLWriteMaterials::PWrite(), G4GDMLWriteStructure::ReplicavolWrite(), G4GDMLWriteDefine::Rotation_vectorWrite(), G4GDMLWriteDefine::Scale_vectorWrite(), G4GDMLWriteSetup::SetupWrite(), G4GDMLWriteStructure::SkinSurfaceCache(), G4GDMLWriteParamvol::Sphere_dimensionsWrite(), G4GDMLWriteSolids::SphereWrite(), G4GDMLWriteSolids::TessellatedWrite(), G4GDMLWriteSolids::TetWrite(), G4GDMLWriteParamvol::Torus_dimensionsWrite(), G4GDMLWriteSolids::TorusWrite(), G4GDMLWriteParamvol::Trap_dimensionsWrite(), G4GDMLWriteSolids::TrapWrite(), G4GDMLWriteStructure::TraverseVolumeTree(), G4GDMLWriteParamvol::Trd_dimensionsWrite(), G4GDMLWriteSolids::TrdWrite(), G4GDMLWriteParamvol::Tube_dimensionsWrite(), G4GDMLWriteSolids::TubeWrite(), G4GDMLWriteSolids::TwistedboxWrite(), G4GDMLWriteSolids::TwistedtrapWrite(), G4GDMLWriteSolids::TwistedtrdWrite(), G4GDMLWriteSolids::TwistedtubsWrite(), G4GDMLWriteMaterials::TWrite(), Write(), G4GDMLWriteSolids::XtruWrite(), and G4GDMLWriteSolids::ZplaneWrite().

◆ NewElement()

xercesc::DOMElement * G4GDMLWrite::NewElement ( const G4String name)
protected

Definition at line 127 of file G4GDMLWrite.cc.

128{
129 xercesc::XMLString::transcode(name,tempStr,99);
130 return doc->createElement(tempStr);
131}

Referenced by G4GDMLWriteMaterials::AtomWrite(), G4GDMLWriteSolids::BooleanWrite(), G4GDMLWriteStructure::BorderSurfaceCache(), G4GDMLWriteParamvol::Box_dimensionsWrite(), G4GDMLWriteSolids::BoxWrite(), G4GDMLWriteParamvol::Cone_dimensionsWrite(), G4GDMLWriteSolids::ConeWrite(), G4GDMLWriteSolids::CutTubeWrite(), G4GDMLWriteDefine::DefineWrite(), G4GDMLWriteStructure::DivisionvolWrite(), G4GDMLWriteMaterials::DWrite(), G4GDMLWriteSolids::ElconeWrite(), G4GDMLWriteMaterials::ElementWrite(), G4GDMLWriteSolids::EllipsoidWrite(), G4GDMLWriteSolids::EltubeWrite(), G4GDMLWriteSolids::GenTrapWrite(), G4GDMLWriteParamvol::Hype_dimensionsWrite(), G4GDMLWriteSolids::HypeWrite(), G4GDMLWriteMaterials::IsotopeWrite(), G4GDMLWriteMaterials::MaterialsWrite(), G4GDMLWriteMaterials::MaterialWrite(), G4GDMLWriteMaterials::MEEWrite(), G4GDMLWriteSolids::OpticalSurfaceWrite(), G4GDMLWriteParamvol::Orb_dimensionsWrite(), G4GDMLWriteSolids::OrbWrite(), G4GDMLWriteParamvol::Para_dimensionsWrite(), G4GDMLWriteSolids::ParaboloidWrite(), G4GDMLWriteParamvol::ParametersWrite(), G4GDMLWriteParamvol::ParamvolWrite(), G4GDMLWriteSolids::ParaWrite(), G4GDMLWriteStructure::PhysvolWrite(), G4GDMLWriteSolids::PolyconeWrite(), G4GDMLWriteSolids::PolyhedraWrite(), G4GDMLWriteDefine::Position_vectorWrite(), G4GDMLWriteMaterials::PropertyVectorWrite(), G4GDMLWriteMaterials::PropertyWrite(), G4GDMLWriteMaterials::PWrite(), G4GDMLWriteStructure::ReplicavolWrite(), G4GDMLWriteDefine::Rotation_vectorWrite(), G4GDMLWriteDefine::Scale_vectorWrite(), G4GDMLWriteSetup::SetupWrite(), G4GDMLWriteStructure::SkinSurfaceCache(), G4GDMLWriteSolids::SolidsWrite(), G4GDMLWriteParamvol::Sphere_dimensionsWrite(), G4GDMLWriteSolids::SphereWrite(), G4GDMLWriteStructure::StructureWrite(), G4GDMLWriteSolids::TessellatedWrite(), G4GDMLWriteSolids::TetWrite(), G4GDMLWriteParamvol::Torus_dimensionsWrite(), G4GDMLWriteSolids::TorusWrite(), G4GDMLWriteParamvol::Trap_dimensionsWrite(), G4GDMLWriteSolids::TrapWrite(), G4GDMLWriteStructure::TraverseVolumeTree(), G4GDMLWriteParamvol::Trd_dimensionsWrite(), G4GDMLWriteSolids::TrdWrite(), G4GDMLWriteParamvol::Tube_dimensionsWrite(), G4GDMLWriteSolids::TubeWrite(), G4GDMLWriteSolids::TwistedboxWrite(), G4GDMLWriteSolids::TwistedtrapWrite(), G4GDMLWriteSolids::TwistedtrdWrite(), G4GDMLWriteSolids::TwistedtubsWrite(), G4GDMLWriteMaterials::TWrite(), G4GDMLWriteSolids::XtruWrite(), and G4GDMLWriteSolids::ZplaneWrite().

◆ PvolumeMap()

G4GDMLWrite::PhysVolumeMapType & G4GDMLWrite::PvolumeMap ( )
protected

Definition at line 66 of file G4GDMLWrite.cc.

67{
68 static PhysVolumeMapType instance;
69 return instance;
70}

Referenced by AddModule(), and Modularize().

◆ SetAddPointerToName()

void G4GDMLWrite::SetAddPointerToName ( G4bool  set)
static

Definition at line 315 of file G4GDMLWrite.cc.

316{
317 addPointerToName = set;
318}

◆ SetupWrite()

virtual void G4GDMLWrite::SetupWrite ( xercesc::DOMElement *  ,
const G4LogicalVolume * const   
)
pure virtual

Implemented in G4GDMLWriteSetup.

Referenced by Write().

◆ SolidsWrite()

virtual void G4GDMLWrite::SolidsWrite ( xercesc::DOMElement *  )
pure virtual

Implemented in G4GDMLWriteSolids.

Referenced by Write().

◆ StructureWrite()

virtual void G4GDMLWrite::StructureWrite ( xercesc::DOMElement *  )
pure virtual

Implemented in G4GDMLWriteStructure.

Referenced by Write().

◆ SurfacesWrite()

virtual void G4GDMLWrite::SurfacesWrite ( )
pure virtual

Implemented in G4GDMLWriteStructure.

Referenced by Write().

◆ TraverseVolumeTree()

virtual G4Transform3D G4GDMLWrite::TraverseVolumeTree ( const G4LogicalVolume * const  ,
const  G4int 
)
pure virtual

Implemented in G4GDMLWriteStructure.

Referenced by Write().

◆ VolumeMap()

G4GDMLWrite::VolumeMapType & G4GDMLWrite::VolumeMap ( )
protected

Definition at line 60 of file G4GDMLWrite.cc.

61{
62 static VolumeMapType instance;
63 return instance;
64}

Referenced by G4GDMLWriteStructure::TraverseVolumeTree(), and Write().

◆ Write()

G4Transform3D G4GDMLWrite::Write ( const G4String filename,
const G4LogicalVolume *const  topLog,
const G4String schemaPath,
const G4int  depth,
G4bool  storeReferences = true 
)

Definition at line 133 of file G4GDMLWrite.cc.

138{
139 SchemaLocation = setSchemaLocation;
140 addPointerToName = refs;
141
142 if (depth==0) { G4cout << "G4GDML: Writing '" << fname << "'..." << G4endl; }
143 else { G4cout << "G4GDML: Writing module '" << fname << "'..." << G4endl; }
144
145 if (FileExists(fname))
146 {
147 G4String ErrorMessage = "File '"+fname+"' already exists!";
148 G4Exception("G4GDMLWrite::Write()", "InvalidSetup",
149 FatalException, ErrorMessage);
150 }
151
152 VolumeMap().clear(); // The module map is global for all modules,
153 // so clear it only at once!
154
155 xercesc::XMLString::transcode("LS", tempStr, 99);
156 xercesc::DOMImplementationRegistry::getDOMImplementation(tempStr);
157 xercesc::XMLString::transcode("Range", tempStr, 99);
158 xercesc::DOMImplementation* impl =
159 xercesc::DOMImplementationRegistry::getDOMImplementation(tempStr);
160 xercesc::XMLString::transcode("gdml", tempStr, 99);
161 doc = impl->createDocument(0,tempStr,0);
162 xercesc::DOMElement* gdml = doc->getDocumentElement();
163
164#if XERCES_VERSION_MAJOR >= 3
165 // DOM L3 as per Xerces 3.0 API
166 xercesc::DOMLSSerializer* writer =
167 ((xercesc::DOMImplementationLS*)impl)->createLSSerializer();
168
169 xercesc::DOMConfiguration *dc = writer->getDomConfig();
170 dc->setParameter(xercesc::XMLUni::fgDOMWRTFormatPrettyPrint, true);
171
172#else
173
174 xercesc::DOMWriter* writer =
175 ((xercesc::DOMImplementationLS*)impl)->createDOMWriter();
176
177 if (writer->canSetFeature(xercesc::XMLUni::fgDOMWRTFormatPrettyPrint, true))
178 writer->setFeature(xercesc::XMLUni::fgDOMWRTFormatPrettyPrint, true);
179
180#endif
181
182 gdml->setAttributeNode(NewAttribute("xmlns:xsi",
183 "http://www.w3.org/2001/XMLSchema-instance"));
184 gdml->setAttributeNode(NewAttribute("xsi:noNamespaceSchemaLocation",
186
187 ExtensionWrite(gdml);
188 DefineWrite(gdml);
189 MaterialsWrite(gdml);
190 SolidsWrite(gdml);
191 StructureWrite(gdml);
192 SetupWrite(gdml,logvol);
193
194 G4Transform3D R = TraverseVolumeTree(logvol,depth);
195
197 xercesc::XMLFormatTarget *myFormTarget =
198 new xercesc::LocalFileFormatTarget(fname.c_str());
199
200 try
201 {
202#if XERCES_VERSION_MAJOR >= 3
203 // DOM L3 as per Xerces 3.0 API
204 xercesc::DOMLSOutput *theOutput =
205 ((xercesc::DOMImplementationLS*)impl)->createLSOutput();
206 theOutput->setByteStream(myFormTarget);
207 writer->write(doc, theOutput);
208#else
209 writer->writeNode(myFormTarget, *doc);
210#endif
211 }
212 catch (const xercesc::XMLException& toCatch)
213 {
214 char* message = xercesc::XMLString::transcode(toCatch.getMessage());
215 G4cout << "G4GDML: Exception message is: " << message << G4endl;
216 xercesc::XMLString::release(&message);
218 }
219 catch (const xercesc::DOMException& toCatch)
220 {
221 char* message = xercesc::XMLString::transcode(toCatch.msg);
222 G4cout << "G4GDML: Exception message is: " << message << G4endl;
223 xercesc::XMLString::release(&message);
225 }
226 catch (...)
227 {
228 G4cout << "G4GDML: Unexpected Exception!" << G4endl;
230 }
231
232 delete myFormTarget;
233 writer->release();
234
235 if (depth==0)
236 {
237 G4cout << "G4GDML: Writing '" << fname << "' done !" << G4endl;
238 }
239 else
240 {
241 G4cout << "G4GDML: Writing module '" << fname << "' done !" << G4endl;
242 }
243
244 return R;
245}
virtual void SurfacesWrite()=0
virtual void MaterialsWrite(xercesc::DOMElement *)=0
G4bool FileExists(const G4String &) const
Definition: G4GDMLWrite.cc:54
G4String SchemaLocation
Definition: G4GDMLWrite.hh:121
virtual void SetupWrite(xercesc::DOMElement *, const G4LogicalVolume *const)=0
virtual G4Transform3D TraverseVolumeTree(const G4LogicalVolume *const, const G4int)=0
virtual void DefineWrite(xercesc::DOMElement *)=0
xercesc::DOMAttr * NewAttribute(const G4String &, const G4String &)
Definition: G4GDMLWrite.cc:103
virtual void ExtensionWrite(xercesc::DOMElement *)
Definition: G4GDMLWrite.cc:85
virtual void SolidsWrite(xercesc::DOMElement *)=0
VolumeMapType & VolumeMap()
Definition: G4GDMLWrite.cc:60
virtual void StructureWrite(xercesc::DOMElement *)=0
static const Transform3D Identity
Definition: Transform3D.h:197

Referenced by G4GDMLWriteStructure::TraverseVolumeTree().

Member Data Documentation

◆ addPointerToName

G4bool G4GDMLWrite::addPointerToName = true
staticprotected

Definition at line 122 of file G4GDMLWrite.hh.

Referenced by GenerateName(), SetAddPointerToName(), and Write().

◆ doc

xercesc::DOMDocument* G4GDMLWrite::doc
protected

Definition at line 123 of file G4GDMLWrite.hh.

Referenced by NewAttribute(), NewElement(), and Write().

◆ extElement

xercesc::DOMElement* G4GDMLWrite::extElement
protected

Definition at line 124 of file G4GDMLWrite.hh.

◆ SchemaLocation

G4String G4GDMLWrite::SchemaLocation
protected

Definition at line 121 of file G4GDMLWrite.hh.

Referenced by G4GDMLWriteStructure::TraverseVolumeTree(), and Write().

◆ tempStr

XMLCh G4GDMLWrite::tempStr[10000]
protected

Definition at line 125 of file G4GDMLWrite.hh.

Referenced by NewAttribute(), NewElement(), and Write().


The documentation for this class was generated from the following files: