X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModuleBase%2FModuleBase_WidgetSelector.cpp;h=11811c4220061e53355709ed179bf44471f4fd49;hb=d75b1b5c09b57fd8326d846118fa3246a9857492;hp=fda60cc0ea2030903ce8aa1ba33688a20ce6f9ad;hpb=2e00b9d5d2a6833475ff12078e8a50bdca014119;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.cpp b/src/ModuleBase/ModuleBase_WidgetSelector.cpp index fda60cc0e..11811c422 100755 --- a/src/ModuleBase/ModuleBase_WidgetSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelector.cpp @@ -60,7 +60,7 @@ void ModuleBase_WidgetSelector::onSelectionChanged() //******************************************************************** void ModuleBase_WidgetSelector::updateOnSelectionChanged(const bool theDone) { - // "false" flag should be used here, it connects to the #26658 OCC bug, when the user click in + // "false" flag should be used here, it connects to the #26658 OCC bug, when the user click in // the same place repeatedly without mouse moved. In the case validation by filters is not // perfromed, so an invalid object is selected. E.g. distance constraint, selection of a point. // the 3rd click in the same point allow using this point. @@ -80,7 +80,8 @@ void ModuleBase_WidgetSelector::updateOnSelectionChanged(const bool theDone) QIntList ModuleBase_WidgetSelector::getShapeTypes() const { QIntList aShapeTypes = shapeTypes(); - if (/*aShapeTypes.contains(TopAbs_SOLID) ||*/ // this type should be mentioned in XML, poor selection otherwise + // this type should be mentioned in XML, poor selection otherwise + if (/*aShapeTypes.contains(TopAbs_SOLID) ||*/ aShapeTypes.contains(ModuleBase_ResultPrs::Sel_Result/*TopAbs_SHAPE*/)) { // it should be selectable for both, "solids" and "objects" types aShapeTypes.append(TopAbs_COMPSOLID); @@ -164,7 +165,7 @@ void ModuleBase_WidgetSelector::activateCustom() { connect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()), Qt::UniqueConnection); - + activateSelectionAndFilters(true); // Restore selection in the viewer by the attribute selection list @@ -197,7 +198,8 @@ bool ModuleBase_WidgetSelector::setSelectionCustom(const ModuleBase_ViewerPrsPtr getGeomSelection(thePrs, anObject, aShape); // the last flag is to be depending on hasObject is called before. To be corrected later - return ModuleBase_Tools::setObject(attribute(), anObject, aShape, myWorkshop, myIsInValidate, true); + return ModuleBase_Tools::setObject(attribute(), anObject, aShape, + myWorkshop, myIsInValidate, true); } //******************************************************************** @@ -209,6 +211,8 @@ void ModuleBase_WidgetSelector::deactivate() /// clear temporary cash AttributePtr anAttribute = attribute(); + if (!anAttribute.get()) + return; std::string aType = anAttribute->attributeType(); if (anAttribute->attributeType() == ModelAPI_AttributeSelection::typeId()) { AttributeSelectionPtr aSelectAttr = @@ -217,7 +221,7 @@ void ModuleBase_WidgetSelector::deactivate() } else if (anAttribute->attributeType() == ModelAPI_AttributeSelectionList::typeId()) { AttributeSelectionListPtr aSelectAttr = - std::dynamic_pointer_cast(anAttribute); + std::dynamic_pointer_cast(anAttribute); aSelectAttr->removeTemporaryValues(); } }