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: pyG4UnitsTable.cc,v 1.5 2008/12/03 07:34:50 kmura Exp $ |
---|
27 | // $Name: geant4-09-04-beta-01 $ |
---|
28 | // ==================================================================== |
---|
29 | // pyG4UnitsTable.cc |
---|
30 | // |
---|
31 | // 2005 Q |
---|
32 | // ==================================================================== |
---|
33 | #include <boost/python.hpp> |
---|
34 | #include "pyG4indexing.hh" |
---|
35 | #include "G4UnitsTable.hh" |
---|
36 | |
---|
37 | using namespace boost::python; |
---|
38 | |
---|
39 | // ==================================================================== |
---|
40 | // module definition |
---|
41 | // ==================================================================== |
---|
42 | void export_G4UnitsTable() |
---|
43 | { |
---|
44 | class_<G4UnitsTable>("G4UnitsTable", "Units Table") |
---|
45 | .def(vector_indexing_suite<G4UnitsTable>()) |
---|
46 | ; |
---|
47 | |
---|
48 | class_<G4UnitsContainer>("G4UnitsContainer", "Units Container") |
---|
49 | .def(vector_indexing_suite<G4UnitsContainer>()) |
---|
50 | ; |
---|
51 | |
---|
52 | class_<G4UnitDefinition, boost::noncopyable> |
---|
53 | ("G4UnitDefinition", "Unit Definition", no_init) |
---|
54 | .def(init<const G4String&, const G4String&, const G4String&, G4double>()) |
---|
55 | // --- |
---|
56 | .def("GetName", &G4UnitDefinition::GetName, |
---|
57 | return_value_policy<return_by_value>()) |
---|
58 | .def("GetSymbol", &G4UnitDefinition::GetSymbol, |
---|
59 | return_value_policy<return_by_value>()) |
---|
60 | .def("GetValue", &G4UnitDefinition::GetValue) |
---|
61 | .def("PrintDefinition", &G4UnitDefinition::PrintDefinition) |
---|
62 | // --- |
---|
63 | .def("BuildUnitsTable", &G4UnitDefinition::BuildUnitsTable) |
---|
64 | .staticmethod("BuildUnitsTable") |
---|
65 | .def("PrintUnitsTable", &G4UnitDefinition::PrintUnitsTable) |
---|
66 | .staticmethod("PrintUnitsTable") |
---|
67 | .def("GetUnitsTable", &G4UnitDefinition::GetUnitsTable, |
---|
68 | return_value_policy<reference_existing_object>()) |
---|
69 | .staticmethod("GetUnitsTable") |
---|
70 | // --- |
---|
71 | .def("GetValueOf", &G4UnitDefinition::GetValueOf) |
---|
72 | .staticmethod("GetValueOf") |
---|
73 | .def("GetCategory", &G4UnitDefinition::GetCategory) |
---|
74 | .staticmethod("GetCategory") |
---|
75 | ; |
---|
76 | |
---|
77 | class_<G4UnitsCategory, boost::noncopyable> |
---|
78 | ("G4UnitsCategory", "Units Category", no_init) |
---|
79 | .def(init<const G4String&>()) |
---|
80 | // --- |
---|
81 | .def("GetName", &G4UnitsCategory::GetName, |
---|
82 | return_value_policy<return_by_value>()) |
---|
83 | .def("GetUnitsList", &G4UnitsCategory::GetUnitsList, |
---|
84 | return_value_policy<reference_existing_object>()) |
---|
85 | .def("GetNameMxLen", &G4UnitsCategory::GetNameMxLen) |
---|
86 | .def("GetSymbMxLen", &G4UnitsCategory::GetSymbMxLen) |
---|
87 | .def("UpdateNameMxLen", &G4UnitsCategory::UpdateNameMxLen) |
---|
88 | .def("UpdateSymbMxLen", &G4UnitsCategory::UpdateSymbMxLen) |
---|
89 | .def("PrintCategory", &G4UnitsCategory::PrintCategory) |
---|
90 | ; |
---|
91 | |
---|
92 | class_<G4BestUnit>("G4BestUnit", "present best unit", no_init) |
---|
93 | .def(init<G4double, const G4String&>()) |
---|
94 | .def(init<const G4ThreeVector&, const G4String&>()) |
---|
95 | // --- |
---|
96 | .def("GetCategory", &G4BestUnit::GetCategory, |
---|
97 | return_value_policy<return_by_value>()) |
---|
98 | .def("GetIndexOfCategory", &G4BestUnit::GetIndexOfCategory) |
---|
99 | .def(self_ns::str(self)) |
---|
100 | ; |
---|
101 | |
---|
102 | } |
---|
103 | |
---|