diff --git a/crates/opencascade-sys/include/wrapper.hxx b/crates/opencascade-sys/include/wrapper.hxx index 6f91248c..16c43934 100644 --- a/crates/opencascade-sys/include/wrapper.hxx +++ b/crates/opencascade-sys/include/wrapper.hxx @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -256,6 +257,8 @@ inline std::unique_ptr TopoDS_Compound_as_shape(std::unique_ptr TopoDS_Shell_as_shape(std::unique_ptr shell) { return shell; } + inline const TopoDS_Builder &BRep_Builder_upcast_to_topods_builder(const BRep_Builder &builder) { return builder; } // Transforms diff --git a/crates/opencascade-sys/src/lib.rs b/crates/opencascade-sys/src/lib.rs index 8f713a2c..3642c720 100644 --- a/crates/opencascade-sys/src/lib.rs +++ b/crates/opencascade-sys/src/lib.rs @@ -426,17 +426,23 @@ pub mod ffi { compound: UniquePtr, ) -> UniquePtr; + pub fn TopoDS_Shell_as_shape(shell: UniquePtr) -> UniquePtr; + type BRep_Builder; type TopoDS_Builder; #[cxx_name = "construct_unique"] pub fn TopoDS_Compound_ctor() -> UniquePtr; + #[cxx_name = "construct_unique"] + pub fn TopoDS_Shell_ctor() -> UniquePtr; + #[cxx_name = "construct_unique"] pub fn BRep_Builder_ctor() -> UniquePtr; pub fn BRep_Builder_upcast_to_topods_builder(builder: &BRep_Builder) -> &TopoDS_Builder; pub fn MakeCompound(self: &TopoDS_Builder, compound: Pin<&mut TopoDS_Compound>); + pub fn MakeShell(self: &TopoDS_Builder, compound: Pin<&mut TopoDS_Shell>); pub fn Add(self: &TopoDS_Builder, shape: Pin<&mut TopoDS_Shape>, compound: &TopoDS_Shape); // BRepBuilder @@ -907,6 +913,17 @@ pub mod ffi { #[cxx_name = "SetTranslationPart"] pub fn set_translation_vec(self: Pin<&mut gp_Trsf>, translation: &gp_Vec); + type BRepBuilderAPI_MakeSolid; + + #[cxx_name = "construct_unique"] + pub fn BRepBuilderAPI_MakeSolid_ctor( + shell: &TopoDS_Shell, + ) -> UniquePtr; + + pub fn Shape(self: Pin<&mut BRepBuilderAPI_MakeSolid>) -> &TopoDS_Shape; + pub fn Build(self: Pin<&mut BRepBuilderAPI_MakeSolid>, progress: &Message_ProgressRange); + pub fn IsDone(self: &BRepBuilderAPI_MakeSolid) -> bool; + type BRepBuilderAPI_MakeShapeOnMesh; #[cxx_name = "construct_unique"] @@ -1079,9 +1096,12 @@ pub mod ffi { pub fn TopLoc_Location_Transformation(location: &TopLoc_Location) -> UniquePtr; type Handle_Poly_Triangulation; + + /// # Safety + /// This method is safe assuming that `triangulation` points to a valid constructed object or is a null pointer. #[cxx_name = "construct_unique"] - pub fn Handle_Poly_Triangulation_ctor( - triangulation: &Handle_Poly_Triangulation, + pub unsafe fn Handle_Poly_Triangulation_ctor( + triangulation: *const Poly_Triangulation, ) -> UniquePtr; pub fn IsNull(self: &Handle_Poly_Triangulation) -> bool;