Toponaming/Part: Fix review items
This commit is contained in:
@@ -101,31 +101,14 @@ TopoDS_Shape Feature::getSolid(const TopoDS_Shape& shape)
|
||||
return {};
|
||||
}
|
||||
|
||||
TopoShape Feature::getSolid(const TopoShape& shape, bool force)
|
||||
TopoShape Feature::getSolid(const TopoShape& shape)
|
||||
{
|
||||
if (shape.isNull()) {
|
||||
throw Part::NullShapeException("Null shape");
|
||||
}
|
||||
int count = shape.countSubShapes(TopAbs_SOLID);
|
||||
if (count > 1) {
|
||||
if (getFeatureBody()) {
|
||||
auto res = shape;
|
||||
res.fixSolidOrientation();
|
||||
return res;
|
||||
}
|
||||
throw Base::RuntimeError(
|
||||
"Result has multiple solids.\n"
|
||||
"To allow multiple solids, please set 'SingleSolid' property of the body to false");
|
||||
}
|
||||
if (count) {
|
||||
auto res = shape.getSubTopoShape(TopAbs_SOLID, 1);
|
||||
res.fixSolidOrientation();
|
||||
return res;
|
||||
}
|
||||
if (force) {
|
||||
return TopoShape();
|
||||
}
|
||||
return shape;
|
||||
auto res = shape.getSubTopoShape(TopAbs_SOLID, 1);
|
||||
res.fixSolidOrientation();
|
||||
return res;
|
||||
}
|
||||
|
||||
int Feature::countSolids(const TopoDS_Shape& shape, TopAbs_ShapeEnum type)
|
||||
|
||||
@@ -96,7 +96,7 @@ protected:
|
||||
*/
|
||||
// TODO: Toponaming April 2024 Deprecated in favor of TopoShape method. Remove when possible.
|
||||
static TopoDS_Shape getSolid(const TopoDS_Shape&);
|
||||
TopoShape getSolid(const TopoShape&, bool force = true);
|
||||
TopoShape getSolid(const TopoShape&);
|
||||
static int countSolids(const TopoDS_Shape&, TopAbs_ShapeEnum type = TopAbs_SOLID);
|
||||
|
||||
/// Grab any point from the given face
|
||||
|
||||
Reference in New Issue
Block a user