X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_SketcherMgr.cpp;h=22c4b653a1c586ccf11b1a317a6da2db49a12372;hb=fb54db5e1466b16dfc029c4a7364a67a9a6a8c24;hp=06fbec26cddd5bf4e0e5f2647c27293ae1e39cf2;hpb=28bbf47d23aa7fc8217e1cbf9ab089acef27cec3;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 06fbec26c..22c4b653a 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -89,15 +90,15 @@ //#define DEBUG_CURSOR /// Returns list of unique objects by sum of objects from List1 and List2 -/*QList getSumList(const QList& theList1, - const QList& theList2) +/*QList getSumList(const QList& theList1, + const QList& theList2) { - QList aRes; - foreach (ModuleBase_ViewerPrs aPrs, theList1) { + QList aRes; + foreach (ModuleBase_ViewerPrsPtr aPrs, theList1) { if (!aRes.contains(aPrs)) aRes.append(aPrs); } - foreach (ModuleBase_ViewerPrs aPrs, theList2) { + foreach (ModuleBase_ViewerPrsPtr aPrs, theList2) { if (!aRes.contains(aPrs)) aRes.append(aPrs); } @@ -109,18 +110,18 @@ // \param theSketch a sketch to project a vertex shape of a presentation to the plane // and find the corresponded attribute // \param theFeatureList an output list of features -void fillFeatureList(const QList& theList, +void fillFeatureList(const QList& theList, const FeaturePtr theSketch, QList& theFeatureList) { - QList aRes; + QList aRes; - QList::const_iterator anIt = theList.begin(), + QList::const_iterator anIt = theList.begin(), aLast = theList.end(); for (; anIt != aLast; anIt++) { - ModuleBase_ViewerPrs aPrs = *anIt; - FeaturePtr aFeature = ModelAPI_Feature::feature(aPrs.object()); + ModuleBase_ViewerPrsPtr aPrs = *anIt; + FeaturePtr aFeature = ModelAPI_Feature::feature(aPrs->object()); if (aFeature.get() && !theFeatureList.contains(aFeature)) theFeatureList.append(aFeature); } @@ -890,18 +891,13 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation) myModule->workshop()->viewer()->addSelectionFilter(myPlaneFilter); bool aHasPlane = false; std::shared_ptr aPln; - if (aFOperation->isEditOperation()) { - // If it is editing of sketch then it means that plane is already defined - aPln = PartSet_Tools::sketchPlane(myCurrentSketch); - if (aPln.get()) - aHasPlane = true; - } + aPln = PartSet_Tools::sketchPlane(myCurrentSketch); myPlaneFilter->setPlane(aPln); Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY)); - // all sketch objects should be activated in the sketch selection modes by edit operation start - // in case of creation operation, there is an active widget, which activates own selection mode - if (aFOperation->isEditOperation() && aHasPlane) + // all displayed objects should be activated in current selection modes according to switched + // plane filter + if (aPln.get()) aConnector->activateModuleSelectionModes(); } @@ -1621,7 +1617,7 @@ void PartSet_SketcherMgr::storeSelection(const bool theHighlightedOnly) ModuleBase_IWorkshop* aWorkshop = myModule->workshop(); ModuleBase_ISelection* aSelect = aWorkshop->selection(); - QList aHighlighted = aSelect->getHighlighted(); + QList aHighlighted = aSelect->getHighlighted(); QList aFeatureList; if (theHighlightedOnly) { @@ -1630,7 +1626,7 @@ void PartSet_SketcherMgr::storeSelection(const bool theHighlightedOnly) else { fillFeatureList(aHighlighted, myCurrentSketch, aFeatureList); - QList aSelected = aSelect->getSelected(ModuleBase_ISelection::AllControls); + QList aSelected = aSelect->getSelected(ModuleBase_ISelection::AllControls); fillFeatureList(aSelected, myCurrentSketch, aFeatureList); }