35 #include <boost/python.hpp> 36 #include "G4UImanager.hh" 37 #include "G4UIcommandTree.hh" 49 &G4UImanager::ApplyCommand;
59 G4UImanager* UImgr= G4UImanager::GetUIpointer();
60 G4int returnVal= UImgr-> ApplyCommand(cmdstr);
61 if( returnVal == fCommandSucceeded )
return returnVal;
63 G4int paramIndex= returnVal % 100;
64 G4int commandStatus= returnVal - paramIndex;
66 switch(commandStatus) {
67 case fCommandSucceeded:
70 case fCommandNotFound:
71 G4cout <<
"command <" << UImgr-> SolveAlias(cmdstr)
72 <<
"> not found" << G4endl;
75 case fIllegalApplicationState:
76 G4cout <<
"illegal application state -- command refused" 80 case fParameterOutOfRange:
83 case fParameterOutOfCandidates:
84 G4cout <<
"Parameter is out of candidate list (index " 89 case fParameterUnreadable:
90 G4cout <<
"Parameter is wrong type and/or is not omittable (index " 91 << paramIndex <<
")" << G4endl;
98 G4cout <<
"command refused (" << commandStatus <<
")" << G4endl;
121 class_<G4UImanager, boost::noncopyable>
122 (
"G4UImanager",
"UI manager class", no_init)
123 .def(
"GetUIpointer", &G4UImanager::GetUIpointer,
124 return_value_policy<reference_existing_object>())
125 .staticmethod(
"GetUIpointer")
127 .def(
"GetCurrentValues", &G4UImanager::GetCurrentValues)
128 .def(
"ExecuteMacroFile", &G4UImanager::ExecuteMacroFile)
131 .def(
"CreateHTML", &G4UImanager::CreateHTML, f_CreateHTML())
132 .def(
"SetMacroSearchPath", &G4UImanager::SetMacroSearchPath)
133 .def(
"GetMacroSearchPath", &G4UImanager::GetMacroSearchPath,
134 return_value_policy<return_by_value>())
136 .def(
"SetPauseAtBeginOfEvent", &G4UImanager::SetPauseAtBeginOfEvent)
137 .def(
"GetPauseAtBeginOfEvent", &G4UImanager::GetPauseAtBeginOfEvent)
138 .def(
"SetPauseAtEndOfEvent", &G4UImanager::SetPauseAtEndOfEvent)
139 .def(
"GetPauseAtEndOfEvent", &G4UImanager::GetPauseAtEndOfEvent)
140 .def(
"SetVerboseLevel", &G4UImanager::SetVerboseLevel)
141 .def(
"GetVerboseLevel", &G4UImanager::GetVerboseLevel)
143 .def(
"GetTree", &G4UImanager::GetTree,
144 return_value_policy<reference_existing_object>())
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateTubeVolume, CreateTubeVolume, 4, 6) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(f_CreateConeVolume
void export_G4UImanager()
G4int ApplyUICommand_1(const G4String &cmdstr)
G4int ApplyUICommand_2(const std::string &cmdstr)
G4int(G4UImanager::* f2_ApplyCommand)(const G4String &)
G4int(G4UImanager::* f1_ApplyCommand)(const char *)