1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
// std lib related includes
#include <tuple>
// pybind 11 related includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
// Standard Handle
#include <Standard_Handle.hxx>
// includes to resolve forward declarations
#include <Adaptor2d_Curve2d.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Adaptor3d_Surface.hxx>
#include <TopoDS_Shape.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Adaptor3d_Surface.hxx>
#include <TopoDS_Shape.hxx>
#include <Adaptor2d_Curve2d.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Adaptor3d_Surface.hxx>
#include <TopoDS_Shape.hxx>
// module includes
#include <StlAPI.hxx>
#include <StlAPI_Reader.hxx>
#include <StlAPI_Writer.hxx>
// template related includes
// user-defined pre
#include "OCP_specific.inc"
// user-defined inclusion per module
// Module definiiton
void register_StlAPI(py::module &main_module) {
py::module m = static_cast<py::module>(main_module.attr("StlAPI"));
py::object klass;
//Python trampoline classes
// classes
// Class StlAPI from ./opencascade/StlAPI.hxx
klass = m.attr("StlAPI");
// default constructor
register_default_constructor<StlAPI , shared_ptr<StlAPI>>(m,"StlAPI");
// nested enums
static_cast<py::class_<StlAPI , shared_ptr<StlAPI> >>(klass)
// constructors
// custom constructors
// methods
// methods using call by reference i.s.o. return
// static methods
.def_static("Write_s",
(Standard_Boolean (*)( const TopoDS_Shape & , const Standard_CString , const Standard_Boolean ) ) static_cast<Standard_Boolean (*)( const TopoDS_Shape & , const Standard_CString , const Standard_Boolean ) >(&StlAPI::Write),
R"#(Convert and write shape to STL format. File is written in binary if aAsciiMode is False otherwise it is written in Ascii (by default).)#" , py::arg("theShape"), py::arg("theFile"), py::arg("theAsciiMode")=static_cast<const Standard_Boolean>(Standard_True)
)
.def_static("Read_s",
(Standard_Boolean (*)( TopoDS_Shape & , const Standard_CString ) ) static_cast<Standard_Boolean (*)( TopoDS_Shape & , const Standard_CString ) >(&StlAPI::Read),
R"#(None)#" , py::arg("theShape"), py::arg("aFile")
)
// static methods using call by reference i.s.o. return
// operators
// additional methods and static methods
// properties
// methods returning by ref wrapped as properties
;
// Class StlAPI_Reader from ./opencascade/StlAPI_Reader.hxx
klass = m.attr("StlAPI_Reader");
// default constructor
register_default_constructor<StlAPI_Reader , shared_ptr<StlAPI_Reader>>(m,"StlAPI_Reader");
// nested enums
static_cast<py::class_<StlAPI_Reader , shared_ptr<StlAPI_Reader> >>(klass)
// constructors
// custom constructors
// methods
.def("Read",
(Standard_Boolean (StlAPI_Reader::*)( TopoDS_Shape & , const Standard_CString ) ) static_cast<Standard_Boolean (StlAPI_Reader::*)( TopoDS_Shape & , const Standard_CString ) >(&StlAPI_Reader::Read),
R"#(Reads STL file to the TopoDS_Shape (each triangle is converted to the face).)#" , py::arg("theShape"), py::arg("theFileName")
)
// methods using call by reference i.s.o. return
// static methods
// static methods using call by reference i.s.o. return
// operators
// additional methods and static methods
// properties
// methods returning by ref wrapped as properties
;
// Class StlAPI_Writer from ./opencascade/StlAPI_Writer.hxx
klass = m.attr("StlAPI_Writer");
// nested enums
static_cast<py::class_<StlAPI_Writer , shared_ptr<StlAPI_Writer> >>(klass)
// constructors
.def(py::init< >() )
// custom constructors
// methods
.def("Write",
(Standard_Boolean (StlAPI_Writer::*)( const TopoDS_Shape & , const Standard_CString , const Message_ProgressRange & ) ) static_cast<Standard_Boolean (StlAPI_Writer::*)( const TopoDS_Shape & , const Standard_CString , const Message_ProgressRange & ) >(&StlAPI_Writer::Write),
R"#(Converts a given shape to STL format and writes it to file with a given filename.)#" , py::arg("theShape"), py::arg("theFileName"), py::arg("theProgress")=static_cast<const Message_ProgressRange &>(Message_ProgressRange ( ))
)
// methods using call by reference i.s.o. return
// static methods
// static methods using call by reference i.s.o. return
// operators
// additional methods and static methods
// properties
// methods returning by ref wrapped as properties
.def_property("ASCIIMode",
[](StlAPI_Writer& self){return self.ASCIIMode();} ,
[](StlAPI_Writer& self, Standard_Boolean val){self.ASCIIMode() = val;}, R"#(Returns the address to the flag defining the mode for writing the file. This address may be used to either read or change the flag. If the mode returns True (default value) the generated file is an ASCII file. If the mode returns False, the generated file is a binary file.)#"
)
;
// functions
// ./opencascade/StlAPI.hxx
// ./opencascade/StlAPI_Reader.hxx
// ./opencascade/StlAPI_Writer.hxx
// Additional functions
// operators
// register typdefs
// exceptions
// user-defined post-inclusion per module in the body
};
// user-defined post-inclusion per module
// user-defined post
|