- aFeature = theHighlighted.front().feature();
- if (!aFeature && !theSelected.empty()) // changed for a constrain
- aFeature = theSelected.front().feature();
-
- if (!aFeature || aFeature != feature())
- {
- commit();
- emit featureConstructed(feature(), FM_Deactivation);
-
- bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
- if(aHasShift && !theHighlighted.empty()) {
- QFeatureList aSelected;
- aSelected.push_back(feature());
- aSelected.push_back(theHighlighted.front().feature());
- emit setSelection(aSelected);
- }
- else if (aFeature) {
- restartOperation(PartSet_OperationFeatureEdit::Type(), aFeature);
+ aObject = theHighlighted.front().object();
+ if (!aObject && !theSelected.empty()) // changed for a constrain
+ aObject = theSelected.front().object();
+
+ FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
+ if (!aFeature || aFeature != feature()) {
+ if (commit()) {
+ emit featureConstructed(feature(), FM_Deactivation);
+
+ //bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
+ //if (aHasShift && !theHighlighted.empty()) {
+ // QList<ObjectPtr> aSelected;
+ // std::list<ModuleBase_ViewerPrs>::const_iterator aIt;
+ // for (aIt = theSelected.cbegin(); aIt != theSelected.cend(); ++aIt)
+ // aSelected.append((*aIt).object());
+ /*for (aIt = theHighlighted.cbegin(); aIt != theHighlighted.cend(); ++aIt) {
+ if (!aSelected.contains((*aIt).object()))
+ aSelected.append((*aIt).object());
+ }*/
+ //aSelected.push_back(feature());
+ //aSelected.push_back(theHighlighted.front().object());
+ //emit setSelection(aSelected);
+ //} else
+ if (aFeature) {
+ restartOperation(PartSet_OperationFeatureEdit::Type(), aFeature);
+ }