ModuleBase_IWorkshop* theWorkshop,
const Config_WidgetAPI* theData,
const std::string& theParentId)
- : ModuleBase_WidgetValidated(theParent, theData, theParentId),
- myWorkshop(theWorkshop)
+ : ModuleBase_WidgetValidated(theParent, theWorkshop, theData, theParentId)
{
}
QList<ModuleBase_ViewerPrs> aSelected = myWorkshop->selection()->getSelected(
ModuleBase_ISelection::AllControls);
- bool isDone = setSelection(aSelected);
+ bool isDone = setSelection(aSelected, true);
emit valuesChanged();
// the updateObject method should be called to flush the updated sigal. The workshop listens it,
// Restore selection in the viewer by the attribute selection list
myWorkshop->setSelected(getAttributeSelection());
- activateFilters(myWorkshop, true);
+ activateFilters(true);
}
//********************************************************************
-#include <ModuleBase_IViewer.h>
-#include <SelectMgr_ListIteratorOfListOfFilter.hxx>
-#include <StdSelect_BRepOwner.hxx>
bool ModuleBase_WidgetSelector::isValidSelectionCustom(const ModuleBase_ViewerPrs& thePrs)
{
GeomShapePtr aShape = myWorkshop->selection()->getShape(thePrs);
FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(aResult);
aValid = aSelectedFeature != myFeature;
}
-
- // selection happens in the Object browser.
- // it creates a selection owner and check whether the viewer filters process it
- if (thePrs.owner().IsNull() && thePrs.object().get()) {
- ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
- if (aResult.get())
- aShape = aResult->shape();
-
- const TopoDS_Shape aTDShape = aShape->impl<TopoDS_Shape>();
-
- Handle(AIS_InteractiveObject) anIO = myWorkshop->selection()->getIO(thePrs);
- Handle(StdSelect_BRepOwner) aShapeOwner = new StdSelect_BRepOwner(aTDShape, anIO);
-
- const SelectMgr_ListOfFilter& aFilters = myWorkshop->viewer()->AISContext()->Filters();
- SelectMgr_ListIteratorOfListOfFilter anIt(aFilters);
- for (; anIt.More() && aValid; anIt.Next()) {
- Handle(SelectMgr_Filter) aFilter = anIt.Value();
- if (aFilter == myWorkshop->validatorFilter())
- continue;
-
- aValid = aFilter->IsOk(aShapeOwner);
- }
- aShapeOwner.Nullify();
- }
return aValid;
}
{
disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
activateSelection(false);
- activateFilters(myWorkshop, false);
+ activateFilters(false);
}