/* OCP.IGESControl — IGES read and write. The reader inherits its transfer surface from XSControl_Reader. What is specific here is the unit probe: the app reads the file's declared units off the model's global section (IGESModel().GlobalSection().UnitName()), which is why IGESData_IGESModel and IGESData_GlobalSection have to be registered even though the app imports neither by name. The writer is used only by the test suite, to produce IGES payloads to import back; it is bound because those tests are part of the Inc 4 gate. GIL held, per mod_XSControl.cpp — the IGES reader is explicitly documented as not thread-safe. */ #include "../common/occt_module.h" #include "../common/occt_policies.h" #include #include #include #include #include #include #include #include void register_IGESControl(nb::module_ &root) { nb::module_ m = ocp_submodule(root, "IGESControl"); nb::class_ controller(m, "IGESControl_Controller"); OCP_DEF_S( controller, "Init", []() { return IGESControl_Controller::Init(); }); nb::class_(m, "IGESControl_Reader") .def(nb::init<>()) .def("IGESModel", &IGESControl_Reader::IGESModel); nb::class_(m, "IGESControl_Writer") .def(nb::init<>()) .def(nb::init(), "unit_name"_a, "modecr"_a = 0) // AddShape carries a Message_ProgressRange the app never supplies. .def( "AddShape", [](IGESControl_Writer &self, const TopoDS_Shape &sh) { return self.AddShape(sh); }, "sh"_a, OCP_NOGIL) .def("ComputeModel", &IGESControl_Writer::ComputeModel, OCP_NOGIL) .def( "Write", [](IGESControl_Writer &self, const Standard_CString file, const Standard_Boolean fnes) { return self.Write(file, fnes); }, "file"_a, "fnes"_a = Standard_False); }