SubShapeBinder: Add support for point.
This commit is contained in:
@@ -1076,6 +1076,7 @@ static TopoShape _getTopoShape(const App::DocumentObject* obj,
|
||||
shape = TopoShape(tag, hasher, _shape);
|
||||
}
|
||||
}
|
||||
|
||||
if (!shape.isNull()) {
|
||||
shape.transformShape(mat * linkMat, false, true);
|
||||
return shape;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
# include <BRep_Builder.hxx>
|
||||
# include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
# include <BRepBuilderAPI_MakeFace.hxx>
|
||||
# include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#endif
|
||||
|
||||
#include <unordered_map>
|
||||
@@ -194,6 +195,10 @@ void ShapeBinder::getFilteredReferences(const App::PropertyLinkSubList* prop,
|
||||
obj = plane;
|
||||
break;
|
||||
}
|
||||
if (auto point = dynamic_cast<App::Point*>(it)) {
|
||||
obj = point;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,6 +249,13 @@ Part::TopoShape ShapeBinder::buildShapeFromReferences(App::GeoFeature* obj, std:
|
||||
shape.setPlacement(obj->Placement.getValue());
|
||||
return shape;
|
||||
}
|
||||
else if (obj->isDerivedFrom<App::Point>()) {
|
||||
gp_Pnt point;
|
||||
BRepBuilderAPI_MakeVertex mkPoint(point);
|
||||
Part::TopoShape shape(mkPoint.Shape());
|
||||
shape.setPlacement(obj->Placement.getValue());
|
||||
return shape;
|
||||
}
|
||||
|
||||
return TopoDS_Shape();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user