Geant4-11
pyG4GDMLParser.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// ====================================================================
27// pyG4GDMLParser.cc
28//
29// 2007 Q
30// ====================================================================
31
32#include <boost/python.hpp>
33#include "G4GDMLParser.hh"
34#include "G4LogicalVolume.hh"
35#include "G4Material.hh"
36#include "G4Version.hh"
37
38using namespace boost::python;
39
40// ====================================================================
41// thin wrappers
42// ====================================================================
43namespace pyG4GDMLParser {
44
46 GetWorldVolume, 0, 1)
47
48void (G4GDMLParser::*f1_Write)
49 (const G4String&, const G4VPhysicalVolume*, G4bool,
51
53 (const G4String&, const G4LogicalVolume*, G4bool,
55
58BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ReadModule, ReadModule, 1, 2)
60
61}
62
63using namespace pyG4GDMLParser;
64
65// ====================================================================
66// module definition
67// ====================================================================
69{
70 class_<G4GDMLParser, boost::noncopyable>
71 ("G4GDMLParser", "GDML parser")
72 // ---
73 .def("Read", &G4GDMLParser::Read, f_Read())
74 .def("ReadModule", &G4GDMLParser::ReadModule, f_ReadModule())
75 .def("ParseST", &G4GDMLParser::ParseST,
76 return_value_policy<reference_existing_object>())
77 .def("Write", f1_Write, f_Write())
78 .def("Write", f2_Write, g_Write())
79 .def("GetWorldVolume", &G4GDMLParser::GetWorldVolume,
80 f_GetWorldVolume()
81 [return_value_policy<reference_existing_object>()])
82 ;
83}
84
bool G4bool
Definition: G4Types.hh:86
G4LogicalVolume * ParseST(const G4String &name, G4Material *medium, G4Material *solid)
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
void Read(const G4String &filename, G4bool Validate=true)
void ReadModule(const G4String &filename, G4bool Validate=true)
void Write(const G4String &filename, const G4VPhysicalVolume *pvol=0, G4bool storeReferences=true, const G4String &SchemaLocation=G4GDML_DEFAULT_SCHEMALOCATION)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetWorldVolume, GetWorldVolume, 0, 1) void(G4GDMLParser void(G4GDMLParser::* f2_Write)(const G4String &, const G4LogicalVolume *, G4bool, const G4String &)
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ClearWaitingStack, ClearWaitingStack, 0, 1) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetNWaitingTrack
void export_G4GDMLParser()