towards vis
This commit is contained in:
+9
-8
@@ -4,7 +4,7 @@
|
||||
#include <pybind11/operators.h>
|
||||
|
||||
#include "ConstructionWrapper.hh"
|
||||
#include "SystemBuilder.hh"
|
||||
#include "G4System.hh"
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
@@ -17,16 +17,17 @@ void makeConstructionWrapper(M & m, std::string name){
|
||||
|
||||
}
|
||||
template<class M>
|
||||
void makeSystemBuilder(M& m, std::string name){
|
||||
py::class_<SystemBuilder>(m, name.data()).def(py::init())
|
||||
.def("init", &SystemBuilder::init, py::arg("cw"), py::arg("gui")=false)
|
||||
.def("run_gui", &SystemBuilder::run_gui)
|
||||
.def("run_batch", &SystemBuilder::run_batch, py::arg("nEvents"), py::arg("partSpecies"), py::arg("minEnergy"), py::arg("maxEnergy"))
|
||||
.def("visualize", &SystemBuilder::visualize);
|
||||
void makeG4System(M& m, std::string name){
|
||||
py::class_<G4System>(m, name.data()).def(py::init())
|
||||
.def("init", &G4System::init, py::arg("cw"), py::arg("gui")=false)
|
||||
.def("run_gui", &G4System::run_gui)
|
||||
.def("run_batch", &G4System::run_batch, py::arg("nEvents"), py::arg("partSpecies"), py::arg("minEnergy"), py::arg("maxEnergy"))
|
||||
.def("run_visualize", &G4System::run_visualize, py::arg("partSpecies"), py::arg("minEnergy"), py::arg("maxEnergy"))
|
||||
.def("applyUICommand", &G4System::applyUICommand, py::arg("command"));
|
||||
}
|
||||
|
||||
PYBIND11_MODULE(minicalo, m) {
|
||||
m.doc() = "pybind11 plugin"; // optional module docstring
|
||||
makeConstructionWrapper(m, "ConstructionWrapper");
|
||||
makeSystemBuilder(m, "SystemBuilder");
|
||||
makeG4System(m, "G4System");
|
||||
}
|
||||
Reference in New Issue
Block a user