Commit 46de61d3509e4e44140ad96f79f30e85f646df6a
1 parent
3473eeed
fixed issue with including private headers
Showing
2 changed files
with
17 additions
and
5 deletions
openbr/openbr_plugin.cpp
| @@ -234,6 +234,11 @@ void File::appendRect(const QRectF &rect) | @@ -234,6 +234,11 @@ void File::appendRect(const QRectF &rect) | ||
| 234 | m_metadata["Rects"] = newRects; | 234 | m_metadata["Rects"] = newRects; |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | +void File::appendRect(const Rect &rect) | ||
| 238 | +{ | ||
| 239 | + appendRect(OpenCVUtils::fromRect(rect)); | ||
| 240 | +} | ||
| 241 | + | ||
| 237 | void File::appendRects(const QList<QRectF> &rects) | 242 | void File::appendRects(const QList<QRectF> &rects) |
| 238 | { | 243 | { |
| 239 | QList<QVariant> newRects = m_metadata["Rects"].toList(); | 244 | QList<QVariant> newRects = m_metadata["Rects"].toList(); |
| @@ -242,6 +247,11 @@ void File::appendRects(const QList<QRectF> &rects) | @@ -242,6 +247,11 @@ void File::appendRects(const QList<QRectF> &rects) | ||
| 242 | m_metadata["Rects"] = newRects; | 247 | m_metadata["Rects"] = newRects; |
| 243 | } | 248 | } |
| 244 | 249 | ||
| 250 | +void File::appendRects(const QList<Rect> &rects) | ||
| 251 | +{ | ||
| 252 | + appendRects(OpenCVUtils::fromRects(rects)); | ||
| 253 | +} | ||
| 254 | + | ||
| 245 | /* File - private methods */ | 255 | /* File - private methods */ |
| 246 | void File::init(const QString &file) | 256 | void File::init(const QString &file) |
| 247 | { | 257 | { |
openbr/openbr_plugin.h
| @@ -41,8 +41,6 @@ | @@ -41,8 +41,6 @@ | ||
| 41 | #include <QVector> | 41 | #include <QVector> |
| 42 | #include <opencv2/core/core.hpp> | 42 | #include <opencv2/core/core.hpp> |
| 43 | #include <openbr/openbr.h> | 43 | #include <openbr/openbr.h> |
| 44 | -#include <openbr/core/qtutils.h> | ||
| 45 | -#include <openbr/core/opencvutils.h> | ||
| 46 | 44 | ||
| 47 | /*! | 45 | /*! |
| 48 | * \defgroup cpp_plugin_sdk C++ Plugin SDK | 46 | * \defgroup cpp_plugin_sdk C++ Plugin SDK |
| @@ -222,7 +220,11 @@ struct BR_EXPORT File | @@ -222,7 +220,11 @@ struct BR_EXPORT File | ||
| 222 | template <typename T> | 220 | template <typename T> |
| 223 | void setList(const QString &key, const QList<T> &value) | 221 | void setList(const QString &key, const QList<T> &value) |
| 224 | { | 222 | { |
| 225 | - set(key, QtUtils::toVariantList(value)); | 223 | + QVariantList variantList; |
| 224 | + variantList.reserve(value.size()); | ||
| 225 | + foreach (const T &item, value) | ||
| 226 | + variantList << item; | ||
| 227 | + set(key, variantList); | ||
| 226 | } | 228 | } |
| 227 | 229 | ||
| 228 | inline void remove(const QString &key) { m_metadata.remove(key); } /*!< \brief Remove the metadata key. */ | 230 | inline void remove(const QString &key) { m_metadata.remove(key); } /*!< \brief Remove the metadata key. */ |
| @@ -315,9 +317,9 @@ struct BR_EXPORT File | @@ -315,9 +317,9 @@ struct BR_EXPORT File | ||
| 315 | QList<QRectF> namedRects() const; /*!< \brief Returns rects convertible from metadata values. */ | 317 | QList<QRectF> namedRects() const; /*!< \brief Returns rects convertible from metadata values. */ |
| 316 | QList<QRectF> rects() const; /*!< \brief Returns the file's rects list. */ | 318 | QList<QRectF> rects() const; /*!< \brief Returns the file's rects list. */ |
| 317 | void appendRect(const QRectF &rect); /*!< \brief Adds a rect to the file's rect list. */ | 319 | void appendRect(const QRectF &rect); /*!< \brief Adds a rect to the file's rect list. */ |
| 318 | - void appendRect(const cv::Rect &rect) { appendRect(OpenCVUtils::fromRect(rect)); } /*!< \brief Adds a rect to the file's rect list. */ | 320 | + void appendRect(const cv::Rect &rect); /*!< \brief Adds a rect to the file's rect list. */ |
| 319 | void appendRects(const QList<QRectF> &rects); /*!< \brief Adds rects to the file's rect list. */ | 321 | void appendRects(const QList<QRectF> &rects); /*!< \brief Adds rects to the file's rect list. */ |
| 320 | - void appendRects(const QList<cv::Rect> &rects) { appendRects(OpenCVUtils::fromRects(rects)); } /*!< \brief Adds rects to the file's rect list. */ | 322 | + void appendRects(const QList<cv::Rect> &rects); /*!< \brief Adds rects to the file's rect list. */ |
| 321 | inline void clearRects() { m_metadata["Rects"] = QList<QVariant>(); } /*!< \brief Clears the file's rect list. */ | 323 | inline void clearRects() { m_metadata["Rects"] = QList<QVariant>(); } /*!< \brief Clears the file's rect list. */ |
| 322 | inline void setRects(const QList<QRectF> &rects) { clearRects(); appendRects(rects); } /*!< \brief Overwrites the file's rect list. */ | 324 | inline void setRects(const QList<QRectF> &rects) { clearRects(); appendRects(rects); } /*!< \brief Overwrites the file's rect list. */ |
| 323 | inline void setRects(const QList<cv::Rect> &rects) { clearRects(); appendRects(rects); } /*!< \brief Overwrites the file's rect list. */ | 325 | inline void setRects(const QList<cv::Rect> &rects) { clearRects(); appendRects(rects); } /*!< \brief Overwrites the file's rect list. */ |