Import Geant4 9.2.0 source tree
This commit is contained in:
@@ -24,28 +24,97 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GDMLParser.hh,v 1.10 2007/11/30 11:58:46 ztorzsok Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4GDMLParser.hh,v 1.56 2008/12/04 08:31:47 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// class G4GDMLParser
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// GDML main parser.
|
||||
|
||||
// History:
|
||||
// - Created. Zoltan Torzsok, November 2007
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef _G4GDMLPARSER_INCLUDED_
|
||||
#define _G4GDMLPARSER_INCLUDED_
|
||||
|
||||
#include "G4GDMLStructure.hh"
|
||||
#include "G4GDMLReadStructure.hh"
|
||||
#include "G4GDMLWriteStructure.hh"
|
||||
#include "G4STRead.hh"
|
||||
|
||||
#define G4GDML_DEFAULT_SCHEMALOCATION G4String("http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd")
|
||||
|
||||
class G4GDMLParser
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GDMLParser();
|
||||
G4GDMLParser(G4GDMLReadStructure*);
|
||||
~G4GDMLParser();
|
||||
//
|
||||
// Parser constructors & destructor
|
||||
|
||||
inline void Read(const G4String& filename, G4bool Validate=true);
|
||||
//
|
||||
// Imports geometry with world-volume, specified by the GDML filename
|
||||
// in input. Validation against schema is activated by default.
|
||||
|
||||
inline void ReadModule(const G4String& filename, G4bool Validate=true);
|
||||
//
|
||||
// Imports a single GDML module, specified by the GDML filename
|
||||
// in input. Validation against schema is activated by default.
|
||||
|
||||
inline void Write(const G4String& filename,
|
||||
const G4VPhysicalVolume* const pvol = 0,
|
||||
G4bool storeReferences = true,
|
||||
const G4String& SchemaLocation = G4GDML_DEFAULT_SCHEMALOCATION);
|
||||
//
|
||||
// Exports on a GDML file, specified by 'filename' a geometry tree
|
||||
// starting from 'pvol' as top volume. Uniqueness of stored entities
|
||||
// is guaranteed by storing pointer-references by default.
|
||||
// Alternative path for the schema location can be specified; by default
|
||||
// the URL to the GDML web site is used.
|
||||
|
||||
inline G4LogicalVolume* ParseST(const G4String& name,
|
||||
G4Material* medium,
|
||||
G4Material* solid);
|
||||
//
|
||||
// Imports a tessellated geometry stored as STEP-Tools files
|
||||
// 'name.geom' and 'name.tree'. It returns a pointer of a generated
|
||||
// mother volume with 'medium' material associated, including the
|
||||
// imported tessellated geometry with 'solid' material associated.
|
||||
|
||||
// Methods for Reader
|
||||
//
|
||||
inline G4double GetConstant(const G4String& name);
|
||||
inline G4double GetVariable(const G4String& name);
|
||||
inline G4double GetQuantity(const G4String& name);
|
||||
inline G4ThreeVector GetPosition(const G4String& name);
|
||||
inline G4ThreeVector GetRotation(const G4String& name);
|
||||
inline G4ThreeVector GetScale(const G4String& name);
|
||||
inline G4GDMLMatrix GetMatrix(const G4String& name);
|
||||
inline G4LogicalVolume* GetVolume(const G4String& name);
|
||||
inline G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default");
|
||||
inline G4GDMLAuxListType GetVolumeAuxiliaryInformation(const G4LogicalVolume* const logvol);
|
||||
inline void StripNamePointers() const;
|
||||
|
||||
// Methods for Writer
|
||||
//
|
||||
inline void AddModule(const G4VPhysicalVolume* const physvol);
|
||||
inline void AddModule(const G4int depth);
|
||||
inline void SetAddPointerToName(G4bool set);
|
||||
|
||||
private:
|
||||
|
||||
G4GDMLReadStructure* reader;
|
||||
G4GDMLWriteStructure* writer;
|
||||
G4bool ucode;
|
||||
|
||||
class G4GDMLParser {
|
||||
G4GDMLStructure structure;
|
||||
public:
|
||||
void Read(const G4String& fileName) { structure.Parse(fileName); }
|
||||
G4VPhysicalVolume* GetWorldVolume(const G4String& setupName="Default") { return structure.getTopVolume(setupName); }
|
||||
};
|
||||
|
||||
#include "G4GDMLParser.icc"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user