Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
pyG4UnitsTable.cc File Reference
#include <boost/python.hpp>
#include "pyG4indexing.hh"
#include "G4UnitsTable.hh"

Go to the source code of this file.

Functions

void export_G4UnitsTable ()
 

Function Documentation

void export_G4UnitsTable ( )

Definition at line 41 of file pyG4UnitsTable.cc.

References G4UnitDefinition::BuildUnitsTable(), G4UnitDefinition::GetCategory(), G4BestUnit::GetCategory(), G4BestUnit::GetIndexOfCategory(), G4UnitDefinition::GetName(), G4UnitsCategory::GetName(), G4UnitsCategory::GetNameMxLen(), G4UnitsCategory::GetSymbMxLen(), G4UnitDefinition::GetSymbol(), G4UnitsCategory::GetUnitsList(), G4UnitDefinition::GetUnitsTable(), G4UnitDefinition::GetValue(), G4UnitDefinition::GetValueOf(), G4UnitsCategory::PrintCategory(), G4UnitDefinition::PrintDefinition(), G4UnitDefinition::PrintUnitsTable(), G4UnitsCategory::UpdateNameMxLen(), and G4UnitsCategory::UpdateSymbMxLen().

Referenced by BOOST_PYTHON_MODULE().

42 {
43  class_<G4UnitsTable>("G4UnitsTable", "Units Table")
45  ;
46 
47  class_<G4UnitsContainer>("G4UnitsContainer", "Units Container")
49  ;
50 
51  class_<G4UnitDefinition, boost::noncopyable>
52  ("G4UnitDefinition", "Unit Definition", no_init)
53  .def(init<const G4String&, const G4String&, const G4String&, G4double>())
54  // ---
55  .def("GetName", &G4UnitDefinition::GetName,
56  return_value_policy<return_by_value>())
57  .def("GetSymbol", &G4UnitDefinition::GetSymbol,
58  return_value_policy<return_by_value>())
59  .def("GetValue", &G4UnitDefinition::GetValue)
60  .def("PrintDefinition", &G4UnitDefinition::PrintDefinition)
61  // ---
62  .def("BuildUnitsTable", &G4UnitDefinition::BuildUnitsTable)
63  .staticmethod("BuildUnitsTable")
64  .def("PrintUnitsTable", &G4UnitDefinition::PrintUnitsTable)
65  .staticmethod("PrintUnitsTable")
66  .def("GetUnitsTable", &G4UnitDefinition::GetUnitsTable,
67  return_value_policy<reference_existing_object>())
68  .staticmethod("GetUnitsTable")
69  // ---
70  .def("GetValueOf", &G4UnitDefinition::GetValueOf)
71  .staticmethod("GetValueOf")
72  .def("GetCategory", &G4UnitDefinition::GetCategory)
73  .staticmethod("GetCategory")
74  ;
75 
76  class_<G4UnitsCategory, boost::noncopyable>
77  ("G4UnitsCategory", "Units Category", no_init)
78  .def(init<const G4String&>())
79  // ---
80  .def("GetName", &G4UnitsCategory::GetName,
81  return_value_policy<return_by_value>())
82  .def("GetUnitsList", &G4UnitsCategory::GetUnitsList,
83  return_value_policy<reference_existing_object>())
84  .def("GetNameMxLen", &G4UnitsCategory::GetNameMxLen)
85  .def("GetSymbMxLen", &G4UnitsCategory::GetSymbMxLen)
86  .def("UpdateNameMxLen", &G4UnitsCategory::UpdateNameMxLen)
87  .def("UpdateSymbMxLen", &G4UnitsCategory::UpdateSymbMxLen)
88  .def("PrintCategory", &G4UnitsCategory::PrintCategory)
89  ;
90 
91  class_<G4BestUnit>("G4BestUnit", "present best unit", no_init)
92  .def(init<G4double, const G4String&>())
93  .def(init<const G4ThreeVector&, const G4String&>())
94  // ---
95  .def("GetCategory", &G4BestUnit::GetCategory,
96  return_value_policy<return_by_value>())
97  .def("GetIndexOfCategory", &G4BestUnit::GetIndexOfCategory)
98  .def(self_ns::str(self))
99  ;
100 
101 }
G4int GetNameMxLen() const
static void BuildUnitsTable()
const G4String & GetCategory() const
G4int GetSymbMxLen() const
const G4String & GetSymbol() const
G4UnitsContainer & GetUnitsList()
static G4double GetValueOf(const G4String &)
void UpdateSymbMxLen(G4int len)
const G4String & GetName() const
static G4UnitsTable & GetUnitsTable()
static G4String GetCategory(const G4String &)
static void PrintUnitsTable()
const G4String & GetName() const
G4double GetValue() const
void UpdateNameMxLen(G4int len)
size_t GetIndexOfCategory() const