Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 // $Id: pyG4GDMLParser.cc 66892 2013-01-17 10:57:59Z gunter $
27 // ====================================================================
28 // pyG4GDMLParser.cc
29 //
30 // 2007 Q
31 // ====================================================================
32 #ifdef ENABLE_GDML
33 
34 #include <boost/python.hpp>
35 #include "G4GDMLParser.hh"
36 #include "G4LogicalVolume.hh"
37 #include "G4Material.hh"
38 #include "G4Version.hh"
39 
40 using namespace boost::python;
41 
42 // ====================================================================
43 // thin wrappers
44 // ====================================================================
45 namespace pyG4GDMLParser {
46 
48  GetWorldVolume, 0, 1);
49 
50 void (G4GDMLParser::*f1_Write)
51  (const G4String&, const G4VPhysicalVolume*, G4bool,
52  const G4String&) = &G4GDMLParser::Write;
53 
54 void (G4GDMLParser::*f2_Write)
55  (const G4String&, const G4LogicalVolume*, G4bool,
56  const G4String&) = &G4GDMLParser::Write;
57 
58 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(g_Write, Write, 2, 4);
59 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_Read, Read, 1, 2);
60 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ReadModule, ReadModule, 1, 2);
61 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_Write, Write, 1, 4);
62 
63 }
64 
65 using namespace pyG4GDMLParser;
66 
67 // ====================================================================
68 // module definition
69 // ====================================================================
70 void export_G4GDMLParser()
71 {
72  class_<G4GDMLParser, boost::noncopyable>
73  ("G4GDMLParser", "GDML parser")
74  // ---
75  .def("Read", &G4GDMLParser::Read, f_Read())
76  .def("ReadModule", &G4GDMLParser::ReadModule, f_ReadModule())
77  .def("ParseST", &G4GDMLParser::ParseST,
78  return_value_policy<reference_existing_object>())
79  .def("Write", f1_Write, f_Write())
80  .def("Write", f2_Write, g_Write())
81  .def("GetWorldVolume", &G4GDMLParser::GetWorldVolume,
82  f_GetWorldVolume()
83  [return_value_policy<reference_existing_object>()])
84  ;
85 }
86 
87 #endif
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateTubeVolume, CreateTubeVolume, 4, 6) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateConeVolume
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
bool G4bool
Definition: G4Types.hh:79
void Write(const G4String &filename, const G4VPhysicalVolume *pvol=0, G4bool storeReferences=true, const G4String &SchemaLocation=G4GDML_DEFAULT_SCHEMALOCATION)
G4LogicalVolume * ParseST(const G4String &name, G4Material *medium, G4Material *solid)
void Read(const G4String &filename, G4bool Validate=true)
void ReadModule(const G4String &filename, G4bool Validate=true)
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData