Transform patterns can be created from multiple base features

The infrastructure/piping seems to have been in place for a long while.
Not tested for all variations of pattern transforms.
The major enabler was removing the `break`.
Some extra piping added to let the code at call-site decide if to select multiple features or not.
This commit is contained in:
Pierre LeMoine
2020-12-31 05:19:30 +01:00
committed by wmayer
parent 3991a93d5a
commit 67aee7cd21
4 changed files with 14 additions and 7 deletions

View File

@@ -80,6 +80,7 @@ const QString TaskFeaturePick::getFeatureStatusString(const featureStatus st)
TaskFeaturePick::TaskFeaturePick(std::vector<App::DocumentObject*>& objects,
const std::vector<featureStatus>& status,
bool singleFeatureSelect,
QWidget* parent)
: TaskBox(Gui::BitmapFactory().pixmap("edit-select-box"),
tr("Select feature"), true, parent)
@@ -100,6 +101,10 @@ TaskFeaturePick::TaskFeaturePick(std::vector<App::DocumentObject*>& objects,
connect(ui->listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(onDoubleClick(QListWidgetItem *)));
if (!singleFeatureSelect) {
ui->listWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
}
enum { axisBit=0, planeBit = 1};
// NOTE: generally there shouldn't be more then one origin
@@ -276,7 +281,6 @@ std::vector<App::DocumentObject*> TaskFeaturePick::buildFeatures()
result.push_back(obj);
}
break;
}
index++;
@@ -525,10 +529,11 @@ TaskDlgFeaturePick::TaskDlgFeaturePick( std::vector<App::DocumentObject*> &objec
const std::vector<TaskFeaturePick::featureStatus> &status,
boost::function<bool (std::vector<App::DocumentObject*>)> afunc,
boost::function<void (std::vector<App::DocumentObject*>)> wfunc,
bool singleFeatureSelect,
boost::function<void (void)> abortfunc /* = NULL */ )
: TaskDialog(), accepted(false)
{
pick = new TaskFeaturePick(objects, status);
pick = new TaskFeaturePick(objects, status, singleFeatureSelect);
Content.push_back(pick);
acceptFunction = afunc;