1 #ifndef CVVISUAL_CVV_POINT_MATCH 2 #define CVVISUAL_CVV_POINT_MATCH 3 4 #include <QBrush> 5 6 #include "cvvmatch.hpp" 7 8 namespace cvv 9 { 10 namespace qtutil 11 { 12 13 /** 14 * @brief This CVVMatch will be shown as circles with a given Color and radius 15 * this CVVMatches will be used in DepthView 16 */ 17 class CVVPointMatch : public CVVMatch 18 { 19 Q_OBJECT 20 public: 21 /** 22 * @brief the constructor 23 * @param left_key the left KeyPointPen 24 * @param right_key the right KeyPointPen 25 * @param matchValue the match distance 26 * @param isLeftKey if true the match is at Pos of the left key, 27 * otherwise it is at the 28 * pos of the right key 29 * @param radius the radius of the MatchPoint 30 * @param pen the pen 31 * @param brush the brush 32 * @param parent the parent Widget 33 */ 34 CVVPointMatch(CVVKeyPoint *left_key, CVVKeyPoint *right_key, 35 const cv::DMatch &match, bool isLeftKey = true, 36 qreal radius = 1, const QPen &pen = QPen{ Qt::red }, 37 const QBrush &brush = QBrush{ Qt::red }, 38 QGraphicsItem *parent = nullptr); 39 40 /** 41 * @brief returns the boundingrect of this Mathc 42 * @return the boundingrect of this Mathc 43 */ 44 virtual QRectF boundingRect() const override; 45 46 /** 47 * @brief the paint function 48 */ 49 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *, 50 QWidget *) override; 51 52 public 53 slots: 54 55 /** 56 * @brief this slot will be called if the right keypoint has changed 57 * @param visible if the rightKey in the visibleArea of its image 58 */ 59 virtual void updateRightKey(bool visible) override; 60 61 /** 62 * @brief this slot will be called if the left keypoint has changed 63 * @param visible if the leftKey in the visibleArea of its image 64 */ 65 virtual void updateLeftKey(bool visible) override; 66 67 protected: 68 bool isLeftKey_; 69 qreal radius_; 70 QBrush brush_; 71 }; 72 } 73 } 74 #endif 75