From e454db0ac919a12e21b75ac3afddfc67f17fdfe1 Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Wed, 5 Mar 2014 11:47:33 -0500 Subject: [PATCH] Modifications to GalleryCompareTransform --- openbr/plugins/distance.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/openbr/plugins/distance.cpp b/openbr/plugins/distance.cpp index b3c9d70..7bc24b3 100644 --- a/openbr/plugins/distance.cpp +++ b/openbr/plugins/distance.cpp @@ -460,12 +460,13 @@ BR_REGISTER(Distance, SumDistance) class GalleryCompareTransform : public Transform { Q_OBJECT - Q_PROPERTY(br::Distance *distance READ get_distance WRITE set_distance RESET reset_distance STORED false) + Q_PROPERTY(QString distanceAlgorithm READ get_distanceAlgorithm WRITE set_distanceAlgorithm RESET reset_distanceAlgorithm STORED false) Q_PROPERTY(QString galleryName READ get_galleryName WRITE set_galleryName RESET reset_galleryName STORED false) - BR_PROPERTY(br::Distance*, distance, NULL) + BR_PROPERTY(QString, distanceAlgorithm, "") BR_PROPERTY(QString, galleryName, "") TemplateList gallery; + QSharedPointer distance; void project(const Template &src, Template &dst) const { @@ -479,8 +480,14 @@ class GalleryCompareTransform : public Transform void init() { - if (!galleryName.isEmpty()) + if (!galleryName.isEmpty()) { gallery = TemplateList::fromGallery(galleryName); + qDebug() << "Gal compare reading templates from " << galleryName; + } + if (!distanceAlgorithm.isEmpty()) + { + distance = Distance::fromAlgorithm(distanceAlgorithm); + } } }; -- libgit2 0.21.4