+ make try/catch block around sortEdges
+ set shape immutable when getting from feature + no use of tuples in removeShape git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5402 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
@@ -1320,14 +1320,21 @@ static PyObject * sortEdges(PyObject *self, PyObject *args)
|
||||
}
|
||||
}
|
||||
|
||||
std::list<TopoDS_Edge> sorted = sort_Edges(Precision::Confusion(), edges);
|
||||
try {
|
||||
std::list<TopoDS_Edge> sorted = sort_Edges(Precision::Confusion(), edges);
|
||||
|
||||
Py::List sorted_list;
|
||||
for (std::list<TopoDS_Edge>::iterator it = sorted.begin(); it != sorted.end(); ++it) {
|
||||
sorted_list.append(Py::Object(new TopoShapeEdgePy(new TopoShape(*it)),true));
|
||||
Py::List sorted_list;
|
||||
for (std::list<TopoDS_Edge>::iterator it = sorted.begin(); it != sorted.end(); ++it) {
|
||||
sorted_list.append(Py::Object(new TopoShapeEdgePy(new TopoShape(*it)),true));
|
||||
}
|
||||
|
||||
return Py::new_reference_to(sorted_list);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
PyErr_SetString(PyExc_Exception, e->GetMessageString());
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Py::new_reference_to(sorted_list);
|
||||
}
|
||||
|
||||
static PyObject * cast_to_shape(PyObject *self, PyObject *args)
|
||||
|
||||
Reference in New Issue
Block a user