#include <Events_InfoMessage.h>
#include <GeomAPI_Edge.h>
#include <GeomAPI_Pnt.h>
+#include <GeomAPI_ShapeIterator.h>
#include <GeomAPI_Vertex.h>
#include <GeomAlgoAPI_CompoundBuilder.h>
#include <GeomAlgoAPI_NExplode.h>
{
myRef.setID(theID);
ModelAPI_AttributeSelection::setID(theID);
+ FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
+ // TODO: check if parent list have geometrical selection flag.
+ myIsGeometricalSelection =
+ ModelAPI_Session::get()->validators()->isGeometricalSelection(aFeature->getKind(), id());
}
ResultPtr Model_AttributeSelection::context()
if (aEraseResults) // erase results without flash deleted and redisplay: do it after Select
aFeatureOwner->removeResults(0, false, false);
}
- aSel.Select(aNewSub, aNewContext);
+ aSel.Select(aNewSub, aNewContext, myIsGeometricalSelection);
// face may become divided after the model update, so, new labels may be added to the scope
myScope.Clear();
return "";
}
+ if (myIsGeometricalSelection
+ && aSubSh.get()
+ && aSubSh->isCompound())
+ {
+ GeomAPI_ShapeIterator anIt(aSubSh);
+ aSubSh = anIt.current();
+ }
+
Model_SelectionNaming aSelNaming(selectionLabel());
std::string aResult = aSelNaming.namingName(
aCont, aSubSh, theDefaultName, owner()->document() != aCont->document());