From e6dc1bb9e8203a183ef1a009f57efb81976f8eaa Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 30 Dec 2014 12:15:41 -0500 Subject: [PATCH] allow SelectPoints to specify which points to exclude instead of include --- openbr/plugins/template.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/openbr/plugins/template.cpp b/openbr/plugins/template.cpp index b771c4f..20af15d 100644 --- a/openbr/plugins/template.cpp +++ b/openbr/plugins/template.cpp @@ -162,15 +162,18 @@ class SelectPointsTransform : public UntrainableMetadataTransform { Q_OBJECT Q_PROPERTY(QList indices READ get_indices WRITE set_indices RESET reset_indices STORED false) + Q_PROPERTY(bool invert READ get_invert WRITE set_invert RESET reset_invert STORED false) // keep the points _not_ in the list BR_PROPERTY(QList, indices, QList()) + BR_PROPERTY(bool, invert, false) void projectMetadata(const File &src, File &dst) const { - dst = src; - QList origPoints = src.points(); - dst.clearPoints(); - for (int i = 0; i < indices.size(); i++) - dst.appendPoint(origPoints[indices[i]]); + const QList srcPoints = src.points(); + QList dstPoints; + for (int i=0; i