1 #ifndef CVVISUAL_SINGLE_COLOR_KEY_PEN 2 #define CVVISUAL_SINGLE_COLOR_KEY_PEN 3 4 #include <QColorDialog> 5 #include <QPen> 6 7 #include "keypointsettings.hpp" 8 9 namespace cvv 10 { 11 namespace qtutil 12 { 13 14 /** 15 * This KeyPointPen return for all CVVKeyPoints the same Color, 16 * the Color can be chosen by an QColorDialog 17 */ 18 19 class SingleColorKeyPen : public KeyPointSettings 20 { 21 Q_OBJECT 22 public: 23 /** 24 * @brief the consructor 25 * @param parent the parent Widget 26 */ 27 SingleColorKeyPen(std::vector<cv::KeyPoint> ,QWidget *parent = nullptr); 28 29 /** 30 * @brief the destructor 31 */ ~SingleColorKeyPen()32 ~SingleColorKeyPen() 33 { colordia_->deleteLater();} 34 35 /** 36 * @brief this method returns the same PEn for all CVVKeyPoints 37 * @return the same Pen for all CVVKeyPoint 38 */ 39 virtual void setSettings(CVVKeyPoint &keypoint) override; 40 public 41 slots: 42 43 /** 44 * @brief this method updates the Color of the Pen which will be 45 * returned in getPen() 46 * @param color the new Color 47 */ 48 void updateColor(const QColor &color); 49 50 private 51 slots: colorButtonClicked()52 void colorButtonClicked() 53 {colordia_->show();} 54 55 private: 56 QColorDialog *colordia_; 57 QColor color_; 58 }; 59 } 60 } 61 #endif 62