+bool MULTIPR_GUI::removeLowerResolution()
+{
+ // for each selected part, check if there are lower resolution
+ // and then propose to remove them before performing new process
+ QStringList partNameLowerResolution;
+ for (QStringList::const_iterator it = mSelectedParts.begin(), last = mSelectedParts.end(); it != last; it++)
+ {
+ const QString& partName = (*it);
+ QString partNameLow = partName + "_LOW";
+ QString partNameMed = partName + "_MED";
+ const char* strPartNameLow = partNameLow.latin1();
+ const char* strPartNameMed = partNameMed.latin1();
+
+ if (isPartExist(strPartNameLow))
+ {
+ partNameLowerResolution.push_back(partNameLow);
+ cout << "Part to be removed: " << partNameLow << endl;
+ }
+
+ if (isPartExist(strPartNameMed))
+ {
+ partNameLowerResolution.push_back(partNameMed);
+ cout << "Part to be removed: " << partNameMed << endl;
+ }
+ }
+
+ if (partNameLowerResolution.count() > 0)
+ {
+ if (QMessageBox::question(
+ getApp()->desktop(),
+ tr("Remove previous results"),
+ tr("Do you want to remove previous results?"),
+ tr("&Yes"), tr("&No"),
+ QString::null, 0, 1 ) )
+ {
+ return false;
+ }
+
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
+ try
+ {
+ for (QStringList::const_iterator it = partNameLowerResolution.begin(), last = partNameLowerResolution.end(); it != last; it++)
+ {
+ const QString& partName = (*it);
+ cout << "Remove " << partName.latin1() << endl;
+ mMULTIPRObj->removeParts(partName.latin1());
+ }
+
+ }
+ catch(...)
+ {
+ SUIT_MessageBox::error1(
+ getApp()->desktop(),
+ "Remove error",
+ "Error while removing previous results",
+ tr("OK") );
+ }
+
+ QApplication::restoreOverrideCursor();
+
+ getApp()->updateObjectBrowser();
+ }
+
+ return true;
+}
+
+