| | |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #include <Mod/Part/PartGlobal.h> |
| |
|
| | #include <Standard_Version.hxx> |
| | #include <TopoDS.hxx> |
| | #include <TopoDS_Solid.hxx> |
| | #include <Message_ProgressRange.hxx> |
| |
|
| | #include "ShapeFix/ShapeFix_SolidPy.h" |
| | #include "ShapeFix/ShapeFix_SolidPy.cpp" |
| | #include "ShapeFix/ShapeFix_ShellPy.h" |
| | #include "TopoShapeShellPy.h" |
| | #include "TopoShapeSolidPy.h" |
| |
|
| |
|
| | using namespace Part; |
| |
|
| | |
| | std::string ShapeFix_SolidPy::representation() const |
| | { |
| | return "<ShapeFix_Solid object>"; |
| | } |
| |
|
| | PyObject* ShapeFix_SolidPy::PyMake(struct _typeobject*, PyObject*, PyObject*) |
| | { |
| | |
| | return new ShapeFix_SolidPy(nullptr); |
| | } |
| |
|
| | |
| | int ShapeFix_SolidPy::PyInit(PyObject* args, PyObject* ) |
| | { |
| | PyObject* solid = nullptr; |
| | if (!PyArg_ParseTuple(args, "|O!", &TopoShapeSolidPy::Type, &solid)) { |
| | return -1; |
| | } |
| |
|
| | setHandle(new ShapeFix_Solid); |
| | if (solid) { |
| | getShapeFix_SolidPtr()->Init( |
| | TopoDS::Solid(static_cast<TopoShapePy*>(solid)->getTopoShapePtr()->getShape()) |
| | ); |
| | } |
| |
|
| | return 0; |
| | } |
| |
|
| | PyObject* ShapeFix_SolidPy::init(PyObject* args) |
| | { |
| | PyObject* solid; |
| | if (!PyArg_ParseTuple(args, "O!", &TopoShapeSolidPy::Type, &solid)) { |
| | return nullptr; |
| | } |
| |
|
| | getShapeFix_SolidPtr()->Init( |
| | TopoDS::Solid(static_cast<TopoShapePy*>(solid)->getTopoShapePtr()->getShape()) |
| | ); |
| | Py_Return; |
| | } |
| |
|
| | PyObject* ShapeFix_SolidPy::perform(PyObject* args) |
| | { |
| | if (!PyArg_ParseTuple(args, "")) { |
| | return nullptr; |
| | } |
| |
|
| | Standard_Boolean ok = getShapeFix_SolidPtr()->Perform(); |
| | return Py::new_reference_to(Py::Boolean(ok ? true : false)); |
| | } |
| |
|
| | PyObject* ShapeFix_SolidPy::solidFromShell(PyObject* args) |
| | { |
| | PyObject* shell; |
| | if (!PyArg_ParseTuple(args, "O!", &TopoShapeShellPy::Type, &shell)) { |
| | return nullptr; |
| | } |
| |
|
| | TopoDS_Shape shape = static_cast<TopoShapePy*>(shell)->getTopoShapePtr()->getShape(); |
| | TopoShape solid = getShapeFix_SolidPtr()->SolidFromShell(TopoDS::Shell(shape)); |
| | return solid.getPyObject(); |
| | } |
| |
|
| | PyObject* ShapeFix_SolidPy::solid(PyObject* args) |
| | { |
| | if (!PyArg_ParseTuple(args, "")) { |
| | return nullptr; |
| | } |
| |
|
| | TopoShape shape = getShapeFix_SolidPtr()->Solid(); |
| | return shape.getPyObject(); |
| | } |
| |
|
| | PyObject* ShapeFix_SolidPy::shape(PyObject* args) |
| | { |
| | if (!PyArg_ParseTuple(args, "")) { |
| | return nullptr; |
| | } |
| |
|
| | TopoShape shape = getShapeFix_SolidPtr()->Shape(); |
| | return shape.getPyObject(); |
| | } |
| |
|
| | PyObject* ShapeFix_SolidPy::fixShellTool(PyObject* args) |
| | { |
| | if (!PyArg_ParseTuple(args, "")) { |
| | return nullptr; |
| | } |
| |
|
| | Handle(ShapeFix_Shell) tool = getShapeFix_SolidPtr()->FixShellTool(); |
| | ShapeFix_ShellPy* shell = new ShapeFix_ShellPy(nullptr); |
| | shell->setHandle(tool); |
| | return shell; |
| | } |
| |
|
| | Py::Boolean ShapeFix_SolidPy::getFixShellMode() const |
| | { |
| | return Py::Boolean(getShapeFix_SolidPtr()->FixShellMode()); |
| | } |
| |
|
| | void ShapeFix_SolidPy::setFixShellMode(Py::Boolean arg) |
| | { |
| | getShapeFix_SolidPtr()->FixShellMode() = arg; |
| | } |
| |
|
| | Py::Boolean ShapeFix_SolidPy::getFixShellOrientationMode() const |
| | { |
| | return Py::Boolean(getShapeFix_SolidPtr()->FixShellOrientationMode()); |
| | } |
| |
|
| | void ShapeFix_SolidPy::setFixShellOrientationMode(Py::Boolean arg) |
| | { |
| | getShapeFix_SolidPtr()->FixShellOrientationMode() = arg; |
| | } |
| |
|
| | Py::Boolean ShapeFix_SolidPy::getCreateOpenSolidMode() const |
| | { |
| | return Py::Boolean(getShapeFix_SolidPtr()->CreateOpenSolidMode()); |
| | } |
| |
|
| | void ShapeFix_SolidPy::setCreateOpenSolidMode(Py::Boolean arg) |
| | { |
| | getShapeFix_SolidPtr()->CreateOpenSolidMode() = arg; |
| | } |
| |
|
| | PyObject* ShapeFix_SolidPy::getCustomAttributes(const char* ) const |
| | { |
| | return nullptr; |
| | } |
| |
|
| | int ShapeFix_SolidPy::setCustomAttributes(const char* , PyObject* ) |
| | { |
| | return 0; |
| | } |
| |
|