This commit adds getShape and setShape to TopoShape
This commit is contained in:
committed by
wmayer
parent
5a30a43862
commit
7f4a437cc2
@@ -69,7 +69,7 @@ int TopoShapeCompoundPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
if (PyObject_TypeCheck((*it).ptr(), &(Part::TopoShapePy::Type))) {
|
||||
const TopoDS_Shape& sh = static_cast<TopoShapePy*>((*it).ptr())->
|
||||
getTopoShapePtr()->_Shape;
|
||||
getTopoShapePtr()->getShape();
|
||||
if (!sh.IsNull())
|
||||
builder.Add(Comp, sh);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ int TopoShapeCompoundPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
return -1;
|
||||
}
|
||||
|
||||
getTopoShapePtr()->_Shape = Comp;
|
||||
getTopoShapePtr()->setShape(Comp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -92,11 +92,11 @@ PyObject* TopoShapeCompoundPy::add(PyObject *args)
|
||||
return NULL;
|
||||
|
||||
BRep_Builder builder;
|
||||
TopoDS_Shape& comp = getTopoShapePtr()->_Shape;
|
||||
TopoDS_Shape comp = getTopoShapePtr()->getShape();
|
||||
|
||||
try {
|
||||
const TopoDS_Shape& sh = static_cast<TopoShapePy*>(obj)->
|
||||
getTopoShapePtr()->_Shape;
|
||||
getTopoShapePtr()->getShape();
|
||||
if (!sh.IsNull())
|
||||
builder.Add(comp, sh);
|
||||
}
|
||||
@@ -106,6 +106,8 @@ PyObject* TopoShapeCompoundPy::add(PyObject *args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
getTopoShapePtr()->setShape(comp);
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
@@ -117,7 +119,7 @@ PyObject* TopoShapeCompoundPy::connectEdgesToWires(PyObject *args)
|
||||
return 0;
|
||||
|
||||
try {
|
||||
const TopoDS_Shape& s = getTopoShapePtr()->_Shape;
|
||||
const TopoDS_Shape& s = getTopoShapePtr()->getShape();
|
||||
|
||||
Handle(TopTools_HSequenceOfShape) hEdges = new TopTools_HSequenceOfShape();
|
||||
Handle(TopTools_HSequenceOfShape) hWires = new TopTools_HSequenceOfShape();
|
||||
@@ -135,7 +137,7 @@ PyObject* TopoShapeCompoundPy::connectEdgesToWires(PyObject *args)
|
||||
builder.Add(comp, hWires->Value(i));
|
||||
}
|
||||
|
||||
getTopoShapePtr()->_Shape = comp;
|
||||
getTopoShapePtr()->setShape(comp);
|
||||
return new TopoShapeCompoundPy(new TopoShape(comp));
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
|
||||
Reference in New Issue
Block a user