- ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theResult);
-
- // Check that the shape of necessary type
- std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
- if (!aShapePtr)
- return false;
- TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
- if (aShape.IsNull())
- return false;
-
- TopAbs_ShapeEnum aShapeType = aShape.ShapeType();
- if (aShapeType == TopAbs_COMPOUND) {
- foreach (QString aType, myShapeTypes) {
- TopExp_Explorer aEx(aShape, shapeType(aType));
- if (aEx.More())
- return true;
- }
- } else {
- foreach (QString aType, myShapeTypes) {
- if (shapeType(aType) == aShapeType)
- return true;
- }
- }
- return false;
-}
-
-//********************************************************************
-bool ModuleBase_WidgetShapeSelector::acceptSubShape(std::shared_ptr<GeomAPI_Shape> theShape) const
-{
- TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
- foreach (QString aType, myShapeTypes) {
- if (aShape.ShapeType() == shapeType(aType))
- return true;
- }
- return false;
-}
-
-//********************************************************************
-bool ModuleBase_WidgetShapeSelector::acceptObjectType(const ObjectPtr theObject) const
-{
- // Definition of types is not obligatory. If types are not defined then
- // it means that accepted any type
- if (myObjectTypes.isEmpty())
- return true;
-
- foreach (QString aType, myObjectTypes) {
- if (aType.toLower() == "construction") {
- ResultConstructionPtr aConstr =
- std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theObject);
- return (aConstr != NULL);
- } // ToDo: Process other types of objects
+ GeomShapePtr aShape;
+ DataPtr aData = myFeature->data();
+ if (aData->isValid()) {
+ AttributePtr anAttribute = myFeature->data()->attribute(attributeID());
+ aShape = ModuleBase_Tools::getShape(anAttribute, myWorkshop);