Geant4-11
pyG4NistManager.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// pyG4NistManager.cc
28//
29// 2005 Q
30// ===================================================================
31#include <boost/python.hpp>
32#include "G4Version.hh"
33#if G4VERSION_NUMBER >= 710
34#include "G4NistManager.hh"
35
36using namespace boost::python;
37
38// ====================================================================
39// thin wrappers
40// ====================================================================
41namespace pyG4NistManager {
42
43// FindOrBuildElement
44G4Element*(G4NistManager::*f1_FindOrBuildElement)(G4int, G4bool)
46
47G4Element*(G4NistManager::*f2_FindOrBuildElement)(const G4String&, G4bool)
49
51 FindOrBuildElement, 1, 2)
52
53// PrintElement
54void(G4NistManager::*f1_PrintElement)(const G4String&) const
55 = &G4NistManager::PrintElement;
56void(G4NistManager::*f2_PrintElement)(G4int) const
57 = &G4NistManager::PrintElement;
58
59// FindOrBuildMaterial
60BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_FindOrBuildMaterial,
61 FindOrBuildMaterial, 1, 2)
62
63// ConstructNewMaterial
64G4Material*(G4NistManager::*f1_ConstructNewMaterial)
65 (const G4String&, const std::vector<G4String>&,
66 const std::vector<G4int>&, G4double, G4bool,
68 = &G4NistManager::ConstructNewMaterial;
69
70G4Material*(G4NistManager::*f2_ConstructNewMaterial)
71 (const G4String&, const std::vector<G4String>&,
72 const std::vector<G4double>&, G4double, G4bool,
74 = &G4NistManager::ConstructNewMaterial;
75
76BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ConstructNewMaterial,
77 ConstructNewMaterial, 4, 8)
78
79BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ConstructNewGasMaterial,
80 ConstructNewGasMaterial, 4, 5)
81
82}
83
84using namespace pyG4NistManager;
85
86#endif
87
88// ====================================================================
89// module definition
90// ====================================================================
92{
93#if G4VERSION_NUMBER >= 710
94
95 class_<G4NistManager, boost::noncopyable>
96 ("G4NistManager", "manager class for NIST materials", no_init)
97 // ---
98 .def("Instance", &G4NistManager::Instance,
99 return_value_policy<reference_existing_object>())
100 .staticmethod("Instance")
101 // ---
102 .def("SetVerbose", &G4NistManager::SetVerbose)
103 .def("GetVerbose", &G4NistManager::GetVerbose)
104 // ---
105#if G4VERSION_NUMBER < 910
106 .def("RegisterElement", &G4NistManager::RegisterElement)
107 .def("DeRegisterElement", &G4NistManager::DeRegisterElement)
108#endif
109 .def("GetElement", &G4NistManager::GetElement,
110 return_internal_reference<>())
111 .def("FindOrBuildElement", f1_FindOrBuildElement,
112 f_FindOrBuildElement()
113 [return_value_policy<reference_existing_object>()])
114 .def("FindOrBuildElement", f2_FindOrBuildElement,
115 f_FindOrBuildElement()
116 [return_value_policy<reference_existing_object>()])
117 .def("GetNumberOfElements", &G4NistManager::GetNumberOfElements)
118 .def("GetZ", &G4NistManager::GetZ)
119 .def("GetIsotopeMass", &G4NistManager::GetIsotopeMass)
120 .def("PrintElement", f1_PrintElement)
121 .def("PrintElement", f2_PrintElement)
122 .def("PrintG4Element", &G4NistManager::PrintG4Element)
123 // ---
124#if G4VERSION_NUMBER < 910
125 .def("RegisterMaterial", &G4NistManager::RegisterMaterial)
126 .def("DeRegisterMaterial", &G4NistManager::DeRegisterMaterial)
127#endif
128 .def("GetMaterial", &G4NistManager::GetMaterial,
129 return_value_policy<reference_existing_object>())
130 .def("FindOrBuildMaterial", &G4NistManager::FindOrBuildMaterial,
131 f_FindOrBuildMaterial()
132 [return_value_policy<reference_existing_object>()])
133 .def("ConstructNewMaterial", f1_ConstructNewMaterial,
134 f_ConstructNewMaterial()
135 [return_value_policy<reference_existing_object>()])
136 .def("ConstructNewMaterial", f2_ConstructNewMaterial,
137 f_ConstructNewMaterial()
138 [return_value_policy<reference_existing_object>()])
139#if G4VERSION_NUMBER >= 910
140 .def("ConstructNewGasMaterial", &G4NistManager::ConstructNewGasMaterial,
141 f_ConstructNewGasMaterial()
142 [return_value_policy<reference_existing_object>()])
143#endif
144 .def("GetNumberOfMaterials", &G4NistManager::GetNumberOfMaterials)
145 .def("ListMaterials", &G4NistManager::ListMaterials)
146 .def("PrintG4Material", &G4NistManager::PrintG4Material)
147 ;
148#endif
149}
G4State
Definition: G4Material.hh:111
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4Material * ConstructNewGasMaterial(const G4String &name, const G4String &nameNist, G4double temp, G4double pres, G4bool isotopes=true)
G4int GetVerbose() const
G4double GetIsotopeMass(G4int Z, G4int N) const
G4Element * GetElement(size_t index) const
void ListMaterials(const G4String &) const
void PrintG4Material(const G4String &) const
void PrintG4Element(const G4String &) const
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
G4int GetZ(const G4String &symb) const
size_t GetNumberOfElements() const
static G4NistManager * Instance()
void SetVerbose(G4int)
size_t GetNumberOfMaterials() const
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
G4Material * GetMaterial(size_t index) const
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_ClearWaitingStack, ClearWaitingStack, 0, 1) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_GetNWaitingTrack
void export_G4NistManager()