#include "ModuleBase_ISelection.h"
#include "ModuleBase_ViewerPrs.h"
+#include "ModelAPI_Feature.h"
#include <StdSelect_BRepOwner.hxx>
#include <TopoDS_Vertex.hxx>
{
ResultPtr aResult;
- if (thePrs->object().get())
- aResult = std::dynamic_pointer_cast<ModelAPI_Result>(thePrs->object());
+ if (thePrs->object().get()) {
+ ObjectPtr aObject = thePrs->object();
+ aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aObject);
+ if (!aResult.get()) {
+ FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
+ if (aFeature.get()) {
+ aResult = aFeature->firstResult();
+ }
+ }
+ }
else if (!thePrs->owner().IsNull()) {
ObjectPtr anObject = getSelectableObject(thePrs->owner());
aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
// if an owner is null, the selection happens in the Object browser.
// creates a selection owner on the base of object shape and the object AIS object
- if ((aOwnersList.Size() > 0) && thePrs->object().get()) {
+ if ((aOwnersList.Size() == 0) && thePrs->object().get()) {
ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
GeomShapePtr aShape = aResult.get() ? aResult->shape() : GeomShapePtr();
// some results have no shape, e.g. the parameter one. So, they should not be validated