From: vsv Date: Tue, 28 Oct 2014 17:30:12 +0000 (+0300) Subject: Provide dimensions edit X-Git-Tag: V_0.5~66^2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9c037e806d4fb7a1c6129713020962a2e6f52411;p=modules%2Fshaper.git Provide dimensions edit --- diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index b4c4c01d1..3f29da130 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -279,7 +280,24 @@ bool ModuleBase_Operation::activateByPreselection() void ModuleBase_Operation::initSelection(ModuleBase_ISelection* theSelection) { - myPreSelection = theSelection->getSelected(); + myPreSelection.clear(); + + // Check that the selected result are not results of operation feature + QList aSelected = theSelection->getSelected(); + FeaturePtr aFeature = feature(); + if (aFeature) { + std::list aResults = aFeature->results(); + QList aResList; + std::list::const_iterator aIt; + for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) + aResList.append(*aIt); + + foreach (ModuleBase_ViewerPrs aPrs, aSelected) { + if ((!aResList.contains(aPrs.object())) && (aPrs.object() != aFeature)) + myPreSelection.append(aPrs); + } + } else + myPreSelection = aSelected; } void ModuleBase_Operation::onWidgetActivated(ModuleBase_ModelWidget* theWidget) diff --git a/src/ModuleBase/ModuleBase_ViewerFilters.cpp b/src/ModuleBase/ModuleBase_ViewerFilters.cpp index 6d2209de5..4b6e571df 100644 --- a/src/ModuleBase/ModuleBase_ViewerFilters.cpp +++ b/src/ModuleBase/ModuleBase_ViewerFilters.cpp @@ -76,5 +76,6 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(const Handle(SelectMgr_Enti } } } - return Standard_False; + // This is not object controlled by the filter + return Standard_True; } diff --git a/src/PartSet/PartSet_OperationSketch.cpp b/src/PartSet/PartSet_OperationSketch.cpp index 804086bbe..331f7e63e 100644 --- a/src/PartSet/PartSet_OperationSketch.cpp +++ b/src/PartSet/PartSet_OperationSketch.cpp @@ -87,12 +87,13 @@ void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, ModuleBase_IVi void PartSet_OperationSketch::selectionChanged(ModuleBase_ISelection* theSelection) { - if (hasSketchPlane()) + if (hasSketchPlane()) return; QList aSelected = theSelection->getSelected(); if (!aSelected.empty()) { ModuleBase_ViewerPrs aPrs = aSelected.first(); + // We have to select a plane before any operation const TopoDS_Shape& aShape = aPrs.shape(); if (!aShape.IsNull()) setSketchPlane(aShape);