Toponaming: Remove all FC_USE_TNP_FIX protected old code
This commit is contained in:
@@ -86,49 +86,10 @@ int TopoShapeShellPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
if (!PyArg_ParseTuple(args, "O", &obj))
|
||||
return -1;
|
||||
|
||||
#ifdef FC_USE_TNP_FIX
|
||||
try {
|
||||
getTopoShapePtr()->makeElementBoolean(Part::OpCodes::Shell, getPyShapes(obj));
|
||||
}
|
||||
_PY_CATCH_OCC(return (-1))
|
||||
#else
|
||||
BRep_Builder builder;
|
||||
TopoDS_Shape shape;
|
||||
TopoDS_Shell shell;
|
||||
//BRepOffsetAPI_Sewing mkShell;
|
||||
builder.MakeShell(shell);
|
||||
|
||||
try {
|
||||
Py::Sequence list(obj);
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
if (PyObject_TypeCheck((*it).ptr(), &(Part::TopoShapeFacePy::Type))) {
|
||||
const TopoDS_Shape& sh = static_cast<TopoShapeFacePy*>((*it).ptr())->
|
||||
getTopoShapePtr()->getShape();
|
||||
if (!sh.IsNull())
|
||||
builder.Add(shell, sh);
|
||||
}
|
||||
}
|
||||
|
||||
shape = shell;
|
||||
BRepCheck_Analyzer check(shell);
|
||||
if (!check.IsValid()) {
|
||||
ShapeUpgrade_ShellSewing sewShell;
|
||||
shape = sewShell.ApplySewing(shell);
|
||||
}
|
||||
|
||||
if (shape.IsNull())
|
||||
Standard_Failure::Raise("Shape is null");
|
||||
|
||||
if (shape.ShapeType() != TopAbs_SHELL)
|
||||
Standard_Failure::Raise("Shape is not a shell");
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return -1;
|
||||
}
|
||||
|
||||
getTopoShapePtr()->setShape(shape);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -150,9 +111,7 @@ PyObject* TopoShapeShellPy::add(PyObject *args)
|
||||
if (!sh.IsNull()) {
|
||||
builder.Add(shell, sh);
|
||||
BRepCheck_Analyzer check(shell);
|
||||
#ifdef FC_USE_TNP_FIX
|
||||
getTopoShapePtr()->mapSubElement(shape);
|
||||
#endif
|
||||
if (!check.IsValid()) {
|
||||
ShapeUpgrade_ShellSewing sewShell;
|
||||
getTopoShapePtr()->setShape(sewShell.ApplySewing(shell));
|
||||
@@ -181,14 +140,10 @@ PyObject* TopoShapeShellPy::getFreeEdges(PyObject *args)
|
||||
as.CheckOrientedShells(getTopoShapePtr()->getShape(), Standard_True, Standard_True);
|
||||
|
||||
TopoDS_Compound comp = as.FreeEdges();
|
||||
#ifdef FC_USE_TNP_FIX
|
||||
TopoShape res;
|
||||
res.setShape(comp);
|
||||
res.mapSubElement(*getTopoShapePtr());
|
||||
return Py::new_reference_to(shape2pyshape(res));
|
||||
#else
|
||||
return new TopoShapeCompoundPy(new TopoShape(comp));
|
||||
#endif
|
||||
}
|
||||
|
||||
PyObject* TopoShapeShellPy::getBadEdges(PyObject *args)
|
||||
@@ -200,14 +155,10 @@ PyObject* TopoShapeShellPy::getBadEdges(PyObject *args)
|
||||
as.CheckOrientedShells(getTopoShapePtr()->getShape(), Standard_True, Standard_True);
|
||||
|
||||
TopoDS_Compound comp = as.BadEdges();
|
||||
#ifdef FC_USE_TNP_FIX
|
||||
TopoShape res;
|
||||
res.setShape(comp);
|
||||
res.mapSubElement(*getTopoShapePtr());
|
||||
return Py::new_reference_to(shape2pyshape(res));
|
||||
#else
|
||||
return new TopoShapeCompoundPy(new TopoShape(comp));
|
||||
#endif
|
||||
}
|
||||
|
||||
PyObject* TopoShapeShellPy::makeHalfSpace(PyObject *args)
|
||||
|
||||
Reference in New Issue
Block a user