}
//********************************************************************
+#include <AIS_ListIteratorOfListOfInteractive.hxx>
+#include <ModuleBase_ResultPrs.h>
void ModuleBase_WidgetMultiSelector::onSelectionChanged()
{
ModuleBase_ISelection* aSelection = myWorkshop->selection();
GeomShapePtr aShape;
for (aIt = aOwnersList.cbegin(); aIt != aOwnersList.cend(); aShpIt.Next(), aIt++) {
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(*aIt);
- if (myFeature) {
- // We can not select a result of our feature
- const std::list<ResultPtr>& aResList = myFeature->results();
- std::list<ResultPtr>::const_iterator aIt;
- bool isSkipSelf = false;
- for (aIt = aResList.cbegin(); aIt != aResList.cend(); ++aIt) {
- if ((*aIt) == aResult) {
- isSkipSelf = true;
- break;
+ // this case should be moved to PartSet module after redesign this class
+ if (aShpIt.Value().ShapeType() == TopAbs_COMPOUND) {
+ int aValue = 0;
+ AIS_ListOfInteractive aList;
+ aSelection->selectedAISObjects(aList);
+ AIS_ListIteratorOfListOfInteractive aLIt(aList);
+ Handle(AIS_InteractiveObject) anAISIO;
+ for(; aLIt.More(); aLIt.Next()){
+ anAISIO = aLIt.Value();
+ Handle(ModuleBase_ResultPrs) aResultPrs = Handle(ModuleBase_ResultPrs)::DownCast(anAISIO);
+ if (!aResultPrs.IsNull()) {
+ const std::list<std::shared_ptr<GeomAPI_Shape> >& aResultFaces = aResultPrs->facesList();
+ std::list<std::shared_ptr<GeomAPI_Shape>>::const_iterator aIt;
+ for (aIt = aResultFaces.cbegin(); aIt != aResultFaces.cend(); ++aIt) {
+ TopoDS_Shape aFace = (*aIt)->impl<TopoDS_Shape>();
+
+ aShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
+ aShape->setImpl(new TopoDS_Shape(aShpIt.Value()));
+
+ mySelection.append(GeomSelection(aResult, aShape));
+ }
}
}
- if(isSkipSelf)
- continue;
}
- aShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
- aShape->setImpl(new TopoDS_Shape(aShpIt.Value()));
- mySelection.append(GeomSelection(aResult, aShape));
+ else {
+ if (myFeature) {
+ // We can not select a result of our feature
+ const std::list<ResultPtr>& aResList = myFeature->results();
+ std::list<ResultPtr>::const_iterator aIt;
+ bool isSkipSelf = false;
+ for (aIt = aResList.cbegin(); aIt != aResList.cend(); ++aIt) {
+ if ((*aIt) == aResult) {
+ isSkipSelf = true;
+ break;
+ }
+ }
+ if(isSkipSelf)
+ continue;
+ }
+ aShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
+ aShape->setImpl(new TopoDS_Shape(aShpIt.Value()));
+
+ mySelection.append(GeomSelection(aResult, aShape));
+ }
}
//updateSelectionList();
emit valuesChanged();