Do not perform the selection clear/set if only one feature is modified.
aViewer->enableMultiselection(theEnabled);
}
-void PartSet_Module::onStopSelection(const std::list<XGUI_ViewerPrs>& theFeatures, const bool isStop,
- const bool isToSelect)
+void PartSet_Module::onStopSelection(const std::list<XGUI_ViewerPrs>& theFeatures, const bool isStop)
{
XGUI_Displayer* aDisplayer = myWorkshop->displayer();
- aDisplayer->StopSelection(theFeatures, isStop, false);
if (!isStop) {
std::list<XGUI_ViewerPrs>::const_iterator anIt = theFeatures.begin(), aLast = theFeatures.end();
boost::shared_ptr<ModelAPI_Feature> aFeature;
activateFeature((*anIt).feature(), false);
}
}
- if (isToSelect)
- aDisplayer->SetSelected(theFeatures, false);
+ aDisplayer->StopSelection(theFeatures, isStop, false);
+ aDisplayer->UpdateViewer();
+}
+
+void PartSet_Module::onSetSelection(const std::list<XGUI_ViewerPrs>& theFeatures)
+{
+ XGUI_Displayer* aDisplayer = myWorkshop->displayer();
+ aDisplayer->SetSelected(theFeatures, false);
aDisplayer->UpdateViewer();
}
connect(aPreviewOp, SIGNAL(multiSelectionEnabled(bool)),
this, SLOT(onMultiSelectionEnabled(bool)));
- connect(aPreviewOp, SIGNAL(stopSelection(const std::list<XGUI_ViewerPrs>&, const bool, const bool)),
- this, SLOT(onStopSelection(const std::list<XGUI_ViewerPrs>&, const bool, const bool)));
+ connect(aPreviewOp, SIGNAL(stopSelection(const std::list<XGUI_ViewerPrs>&, const bool)),
+ this, SLOT(onStopSelection(const std::list<XGUI_ViewerPrs>&, const bool)));
+ connect(aPreviewOp, SIGNAL(setSelection(const std::list<XGUI_ViewerPrs>&)),
+ this, SLOT(onSetSelection(const std::list<XGUI_ViewerPrs>&)));
PartSet_OperationSketch* aSketchOp = dynamic_cast<PartSet_OperationSketch*>(aPreviewOp);
if (aSketchOp) {
/// SLOT, to stop or start selection mode for the features
/// \param theFeatures a list of features to be disabled
/// \param theToStop the boolean state whether it it stopped or non stopped
- /// \param isToSelect the boolean state whether the features should be selected
- void onStopSelection(const std::list<XGUI_ViewerPrs>& theFeatures, const bool isStop,
- const bool isToSelect);
+ void onStopSelection(const std::list<XGUI_ViewerPrs>& theFeatures, const bool isStop);
+
+ /// SLOT, to set selection
+ /// \param theFeatures a list of features to be selected
+ void onSetSelection(const std::list<XGUI_ViewerPrs>& theFeatures);
/// SLOT, to visualize the feature in another local context mode
/// \param theFeature the feature to be put in another local context mode
{
// do nothing in order to do not create a new feature
emit multiSelectionEnabled(false);
- emit stopSelection(myFeatures, true, false);
+ emit setSelection(std::list<XGUI_ViewerPrs>());
+ emit stopSelection(myFeatures, true);
myCurPoint.clear();
}
{
emit multiSelectionEnabled(true);
bool isSelectFeatures = myFeatures.size() > 1;
- emit stopSelection(myFeatures, false, isSelectFeatures);
+ emit stopSelection(myFeatures, false);
+ if (isSelectFeatures)
+ emit setSelection(myFeatures);
+
myFeatures.clear();
}
/// signal to enable/disable selection in the viewer
/// \param theFeatures a list of features to be disabled
/// \param theToStop the boolean state whether it it stopped or non stopped
- /// \param isToSelect the boolean state whether the features should be selected
- void stopSelection(const std::list<XGUI_ViewerPrs>& theFeatures, const bool theToStop,
- const bool isToSelect);
+ void stopSelection(const std::list<XGUI_ViewerPrs>& theFeatures, const bool theToStop);
+ /// signal to set selection in the viewer
+ /// \param theFeatures a list of features to be disabled
+ void setSelection(const std::list<XGUI_ViewerPrs>& theFeatures);
/// signal to enable/disable usual selection in the viewer
/// \param theEnabled the boolean state