Commit 72c1beba1071826e18b8e8037e95dfe6e18ea62b
1 parent
e918ff5e
added range parameters to SelectPointsTransform
Showing
1 changed file
with
12 additions
and
0 deletions
openbr/plugins/metadata/selectpoints.cpp
| @@ -29,8 +29,20 @@ class SelectPointsTransform : public UntrainableMetadataTransform | @@ -29,8 +29,20 @@ class SelectPointsTransform : public UntrainableMetadataTransform | ||
| 29 | Q_OBJECT | 29 | Q_OBJECT |
| 30 | Q_PROPERTY(QList<int> indices READ get_indices WRITE set_indices RESET reset_indices STORED false) | 30 | Q_PROPERTY(QList<int> indices READ get_indices WRITE set_indices RESET reset_indices STORED false) |
| 31 | Q_PROPERTY(bool invert READ get_invert WRITE set_invert RESET reset_invert STORED false) // keep the points _not_ in the list | 31 | Q_PROPERTY(bool invert READ get_invert WRITE set_invert RESET reset_invert STORED false) // keep the points _not_ in the list |
| 32 | + Q_PROPERTY(int rangeStart READ get_rangeStart WRITE set_rangeStart RESET reset_rangeStart STORED false) | ||
| 33 | + Q_PROPERTY(int rangeEnd READ get_rangeEnd WRITE set_rangeEnd RESET reset_rangeEnd STORED false) | ||
| 32 | BR_PROPERTY(QList<int>, indices, QList<int>()) | 34 | BR_PROPERTY(QList<int>, indices, QList<int>()) |
| 33 | BR_PROPERTY(bool, invert, false) | 35 | BR_PROPERTY(bool, invert, false) |
| 36 | + BR_PROPERTY(int, rangeStart, -1) | ||
| 37 | + BR_PROPERTY(int, rangeEnd, -1) | ||
| 38 | + | ||
| 39 | + void init() | ||
| 40 | + { | ||
| 41 | + if ((rangeStart != -1) && (rangeEnd != -1)) | ||
| 42 | + for (int i=rangeStart; i<=rangeEnd; i++) | ||
| 43 | + if (!indices.contains(i)) | ||
| 44 | + indices.append(i); | ||
| 45 | + } | ||
| 34 | 46 | ||
| 35 | void projectMetadata(const File &src, File &dst) const | 47 | void projectMetadata(const File &src, File &dst) const |
| 36 | { | 48 | { |