bool aCanErase = true;\r
// when the sketch operation is active, results of sketch sub-feature can not be hidden\r
if (myCurrentSketch.get()) {\r
- ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);\r
- if (aResult.get()) {\r
- // Display sketcher objects\r
- for (int i = 0; i < myCurrentSketch->numberOfSubs() && aCanErase; i++) {\r
-\r
- FeaturePtr aFeature = myCurrentSketch->subFeature(i);\r
- std::list<ResultPtr> aResults = aFeature->results();\r
- std::list<ResultPtr>::const_iterator anIt;\r
- for (anIt = aResults.begin(); anIt != aResults.end() && aCanErase; ++anIt) {\r
- aCanErase = *anIt != aResult;\r
- }\r
- }\r
- }\r
+ return !isObjectOfSketch(theObject);\r
}\r
return aCanErase;\r
}\r