+ //if (!theHighlighted.empty()) {
+ // // if there is highlighted object, we check whether it is in the list of selected objects
+ // // in that case this object is a handle of the moved lines. If there no such object in the selection,
+ // // the hightlighted object should moved and the selection is skipped. The skipped selection will be
+ // // deselected in the viewer by blockSelection signal in the startOperation method.
+ // bool isSelected = false;
+ // std::list<ModuleBase_ViewerPrs>::const_iterator anIt = theSelected.begin(),
+ // aLast = theSelected.end();
+ // for (; anIt != aLast && !isSelected; anIt++) {
+ // isSelected = ModelAPI_Feature::feature((*anIt).object()) == feature();
+ // }
+ // if (!isSelected)
+ // myFeatures = theHighlighted;
+ // else
+ // myFeatures = theSelected;
+ //} else
+ myFeatures = theSelection->getSelected();
+ QList<ModuleBase_ViewerPrs> aHighlighted = theSelection->getHighlighted();
+ // add highlighted elements if they are not selected
+ foreach (ModuleBase_ViewerPrs aPrs, aHighlighted) {
+ if (!isContains(myFeatures, aPrs))
+ myFeatures.append(aPrs);
+ }
+ // Remove current feature if it is in the list (it will be moved as main feature)
+ foreach (ModuleBase_ViewerPrs aPrs, myFeatures) {
+ FeaturePtr aF = ModelAPI_Feature::feature(aPrs.object());
+ if (ModelAPI_Feature::feature(aPrs.object()) == feature()) {
+ myFeatures.removeOne(aPrs);
+ break;
+ }
+ }