Import Geant4 9.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:15:05 +02:00
parent b79225fb37
commit 74cad5e589
3877 changed files with 234205 additions and 167127 deletions
+65 -42
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4GDMLWrite.hh,v 1.37 2008/08/19 15:03:17 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4GDMLWrite.hh,v 1.41 2009/04/24 15:34:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
//
// class G4GDMLWrite
@@ -41,66 +41,89 @@
#ifndef _G4GDMLWRITE_INCLUDED_
#define _G4GDMLWRITE_INCLUDED_
#include <sys/stat.h>
#include <iostream>
#include <map>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/framework/LocalFileFormatTarget.hpp>
#include "G4LogicalVolume.hh"
#include "G4Transform3D.hh"
#include "G4PVDivision.hh"
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4GDMLWrite
{
typedef std::map<const G4LogicalVolume*,G4Transform3D> VolumeMapType;
typedef std::map<const G4VPhysicalVolume*,G4String> PhysVolumeMapType;
typedef std::map<G4int,G4int> DepthMapType;
typedef std::map<const G4LogicalVolume*,G4Transform3D> VolumeMapType;
typedef std::map<const G4VPhysicalVolume*,G4String> PhysVolumeMapType;
typedef std::map<G4int,G4int> DepthMapType;
public: // without description
public: // with description
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);
static void SetAddPointerToName(G4bool);
G4Transform3D Write(const G4String& filename,
const G4LogicalVolume* const topLog,
const G4String& schemaPath,
const G4int depth, G4bool storeReferences=true);
//
// Main method for writing GDML files.
protected:
void AddModule(const G4VPhysicalVolume* const topVol);
void AddModule(const G4int depth);
//
// Split geometry structure in modules, by volume subtree or level
G4String SchemaLocation;
static void SetAddPointerToName(G4bool);
//
// Specify if to add or not memory addresses to IDs.
VolumeMapType& VolumeMap();
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;
//
// Pure virtual methods implemented in concrete writer plugin's classes
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&);
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 SetupWrite(xercesc::DOMElement*,
const G4LogicalVolume* const)=0;
G4String Modularize(const G4VPhysicalVolume* const topvol,
const G4int depth);
virtual void ExtensionWrite(xercesc::DOMElement*);
virtual void AddExtension(xercesc::DOMElement*,
const G4LogicalVolume* const);
//
// To be implemented in the client code for handling extensions
// to the GDML schema, identified with the tag "extension".
// The implementation should be placed inside a user-class
// inheriting from G4GDMLWriteStructure and being registered
// as argument to G4GDMLParser.
private:
protected:
G4bool FileExists(const G4String&) const;
PhysVolumeMapType& PvolumeMap();
DepthMapType& DepthMap();
G4GDMLWrite();
virtual ~G4GDMLWrite();
private:
VolumeMapType& VolumeMap();
static G4bool addPointerToName;
xercesc::DOMDocument* doc;
XMLCh tempStr[100];
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:
G4String SchemaLocation;
static G4bool addPointerToName;
xercesc::DOMDocument* doc;
xercesc::DOMElement* extElement;
XMLCh tempStr[100];
};