action("SHADING_CMD")->setEnabled(true);
action("WIREFRAME_CMD")->setEnabled(true);
}
+ if (hasFeature && myWorkshop->canMoveFeature())
+ action("MOVE_CMD")->setEnabled(true);
} // end multi-selection
// Check folder management commands state if only features are selected
aActions.append(action("ADD_OUT_FOLDER_BEFORE_CMD"));
aActions.append(action("ADD_OUT_FOLDER_AFTER_CMD"));
aActions.append(mySeparator3);
- //aActions.append(action("MOVE_CMD"));
+ aActions.append(action("MOVE_CMD"));
aActions.append(action("COLOR_CMD"));
aActions.append(action("DEFLECTION_CMD"));
aActions.append(action("TRANSPARENCY_CMD"));
}
//**************************************************************
+bool compareFeature(const FeaturePtr& theF1, const FeaturePtr& theF2) {
+ DocumentPtr aDoc = theF1->document();
+ return aDoc->index(theF1) < aDoc->index(theF2);
+}
void XGUI_Workshop::moveObjects()
{
if (!abortAllOperations())
if (!XGUI_Tools::canRemoveOrRename(desktop(), aFeatures))
return;
+ // Sort features by index in document
+ std::list<FeaturePtr> aFList(aFeatures.begin(), aFeatures.end());
+ aFList.sort(compareFeature);
+
DocumentPtr anActiveDocument = aMgr->activeDocument();
FeaturePtr aCurrentFeature = anActiveDocument->currentFeature(true);
- std::set<FeaturePtr>::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end();
+ std::list<FeaturePtr>::const_iterator anIt = aFList.begin(), aLast = aFList.end();
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = *anIt;
if (!aFeature.get() || !myModule->canApplyAction(aFeature, anActionId))