+ if (aShapePtr->isEqual(aShape)) {
+ aValid = true;
+ }
+ else {
+ ResultConstructionPtr aConstr =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
+ if (!aConstr.get()) {
+ // non-construction results should be accepted by this filter, e.g. body results
+ aValid = true;
+ }
+ else {
+ // it provides selection only on composite features, construction without composite
+ // feature is not selectable.
+ FeaturePtr aFeature = ModelAPI_Feature::feature(aConstr);
+ CompositeFeaturePtr aComposite =
+ std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
+ aValid = aComposite && aComposite->numberOfSubs() > 0;
+ if (!aValid)
+ theError = "Uses composite construction feature without sub-features.";
+ }
+ }