34 #include <boost/python.hpp> 35 #include "G4UImanager.hh" 36 #include "G4UIcommandTree.hh" 48 &G4UImanager::ApplyCommand;
58 G4UImanager* UImgr= G4UImanager::GetUIpointer();
59 G4int returnVal= UImgr-> ApplyCommand(cmdstr);
60 if( returnVal == fCommandSucceeded )
return returnVal;
62 G4int paramIndex= returnVal % 100;
63 G4int commandStatus= returnVal - paramIndex;
65 switch(commandStatus) {
66 case fCommandSucceeded:
69 case fCommandNotFound:
70 G4cout <<
"command <" << UImgr-> SolveAlias(cmdstr)
71 <<
"> not found" << G4endl;
74 case fIllegalApplicationState:
75 G4cout <<
"illegal application state -- command refused" 79 case fParameterOutOfRange:
82 case fParameterOutOfCandidates:
83 G4cout <<
"Parameter is out of candidate list (index " 88 case fParameterUnreadable:
89 G4cout <<
"Parameter is wrong type and/or is not omittable (index " 90 << paramIndex <<
")" << G4endl;
97 G4cout <<
"command refused (" << commandStatus <<
")" << G4endl;
120 class_<G4UImanager, boost::noncopyable>
121 (
"G4UImanager",
"UI manager class", no_init)
122 .def(
"GetUIpointer", &G4UImanager::GetUIpointer,
123 return_value_policy<reference_existing_object>())
124 .staticmethod(
"GetUIpointer")
126 .def(
"GetCurrentValues", &G4UImanager::GetCurrentValues)
127 .def(
"ExecuteMacroFile", &G4UImanager::ExecuteMacroFile)
130 .def(
"CreateHTML", &G4UImanager::CreateHTML, f_CreateHTML())
131 .def(
"SetMacroSearchPath", &G4UImanager::SetMacroSearchPath)
132 .def(
"GetMacroSearchPath", &G4UImanager::GetMacroSearchPath,
133 return_value_policy<return_by_value>())
135 .def(
"SetPauseAtBeginOfEvent", &G4UImanager::SetPauseAtBeginOfEvent)
136 .def(
"GetPauseAtBeginOfEvent", &G4UImanager::GetPauseAtBeginOfEvent)
137 .def(
"SetPauseAtEndOfEvent", &G4UImanager::SetPauseAtEndOfEvent)
138 .def(
"GetPauseAtEndOfEvent", &G4UImanager::GetPauseAtEndOfEvent)
139 .def(
"SetVerboseLevel", &G4UImanager::SetVerboseLevel)
140 .def(
"GetVerboseLevel", &G4UImanager::GetVerboseLevel)
142 .def(
"GetTree", &G4UImanager::GetTree,
143 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 *)