Toposhape/Part: Bring in element methods in FeaturePart, TopoShapePy::Init and TopoShape::GetPyObject

This commit is contained in:
Zheng, Lei
2024-02-27 15:12:25 -05:00
committed by bgbsww
parent 12389fc549
commit a21d7bbaf3
4 changed files with 445 additions and 20 deletions

View File

@@ -557,44 +557,44 @@ PyObject * TopoShape::getPyObject()
{
Base::PyObjectBase* prop = nullptr;
if (_Shape.IsNull()) {
prop = new TopoShapePy(new TopoShape(_Shape));
prop = new TopoShapePy(new TopoShape(*this));
}
else {
TopAbs_ShapeEnum type = _Shape.ShapeType();
switch (type)
{
case TopAbs_COMPOUND:
prop = new TopoShapeCompoundPy(new TopoShape(_Shape));
prop = new TopoShapeCompoundPy(new TopoShape(*this));
break;
case TopAbs_COMPSOLID:
prop = new TopoShapeCompSolidPy(new TopoShape(_Shape));
prop = new TopoShapeCompSolidPy(new TopoShape(*this));
break;
case TopAbs_SOLID:
prop = new TopoShapeSolidPy(new TopoShape(_Shape));
prop = new TopoShapeSolidPy(new TopoShape(*this));
break;
case TopAbs_SHELL:
prop = new TopoShapeShellPy(new TopoShape(_Shape));
prop = new TopoShapeShellPy(new TopoShape(*this));
break;
case TopAbs_FACE:
prop = new TopoShapeFacePy(new TopoShape(_Shape));
prop = new TopoShapeFacePy(new TopoShape(*this));
break;
case TopAbs_WIRE:
prop = new TopoShapeWirePy(new TopoShape(_Shape));
prop = new TopoShapeWirePy(new TopoShape(*this));
break;
case TopAbs_EDGE:
prop = new TopoShapeEdgePy(new TopoShape(_Shape));
prop = new TopoShapeEdgePy(new TopoShape(*this));
break;
case TopAbs_VERTEX:
prop = new TopoShapeVertexPy(new TopoShape(_Shape));
prop = new TopoShapeVertexPy(new TopoShape(*this));
break;
case TopAbs_SHAPE:
default:
prop = new TopoShapePy(new TopoShape(_Shape));
prop = new TopoShapePy(new TopoShape(*this));
break;
}
}
prop->setNotTracking();
prop->setNotTracking(); // TODO: Does this still belong here?
return prop;
}