Part: revert changes to ViewProviderExt::getDetails (#25912)

This commit is contained in:
PaddleStroke
2025-12-03 19:12:27 +01:00
committed by GitHub
parent be899af0ba
commit daf8790884

View File

@@ -609,39 +609,7 @@ SoDetail* ViewProviderPartExt::getDetail(const char* subelement) const
std::string element = type.first;
int index = type.second;
// 2. If standard parsing failed, try resolving as a Topological Name
if (index <= 0 && subelement && *subelement) {
// Get the underlying shape
const Part::TopoShape& shape = Part::Feature::getTopoShape(
getObject(),
Part::ShapeOption::ResolveLink | Part::ShapeOption::Transform
);
// Attempt to resolve the complex string to a sub-shape
TopoDS_Shape subShape = shape.getSubShape(subelement);
if (!subShape.IsNull()) {
// If found, identify what type it is and find its 1-based index
if (subShape.ShapeType() == TopAbs_FACE) {
element = "Face";
index = shape.findShape(subShape);
}
else if (subShape.ShapeType() == TopAbs_EDGE) {
element = "Edge";
index = shape.findShape(subShape);
}
else if (subShape.ShapeType() == TopAbs_VERTEX) {
element = "Vertex";
index = shape.findShape(subShape);
}
}
}
// 3. If we still don't have a valid index, return null
if (index <= 0) {
return nullptr;
}
// 4. Create the Coin3D Detail
// 2. Create the Coin3D Detail
if (element == "Face") {
SoFaceDetail* detail = new SoFaceDetail();
detail->setPartIndex(index - 1);