33 #include <opencv2/features2d/features2d.hpp>    35 #include <QtCore/QMultiMap>    41 class QGraphicsRectItem;
    56         ObjWidget(
int id, 
const std::vector<cv::KeyPoint> & keypoints, 
const QMultiMap<int,int> & words, 
const QImage & image, QWidget * parent = 0);
    60         void updateImage(
const QImage & image);
    61         void updateData(
const std::vector<cv::KeyPoint> & keypoints, 
const QMultiMap<int, int> & words=QMultiMap<int, int>());
    62         void updateWords(
const QMultiMap<int,int> & words);
    63         void setTextLabel(
const QString & text);
    64         void resetKptsColor();
    65         void resetKptsWordID();
    66         void setKptColor(
int index, 
const QColor & color);
    67         void setKptWordID(
int index, 
int wordId);
    68         void setGraphicsViewMode(
bool on);
    69         void setAutoScale(
bool autoScale);
    70         void setSizedFeatures(
bool on);
    71         void setMirrorView(
bool on);
    72         void setAlpha(
int alpha);
    73         void setDeletable(
bool deletable);
    74         void setImageShown(
bool shown);
    75         void setFeaturesShown(
bool shown);
    76         void addRect(QGraphicsRectItem * rect);
    79         int id()
 const {
return id_;}
    80         const QColor & 
color()
 const {
return color_;}
    81         const std::vector<cv::KeyPoint> 
keypoints()
 const {
return keypoints_;}
    82         const QMap<int,int> & 
words()
 const {
return words_;}
    83         const QPixmap & 
pixmap()
 const {
return pixmap_;}
    84         QColor defaultColor(
int id) 
const;
    85         bool isImageShown() 
const;
    86         bool isFeaturesShown() 
const;
    87         bool isSizedFeatures() 
const;
    88         bool isMirrorView() 
const;
    90         std::vector<cv::KeyPoint> selectedKeypoints() 
const;
    91         QList<QGraphicsItem*> selectedItems() 
const;
    93         QPixmap getSceneAsPixmap();
    96         virtual void paintEvent(QPaintEvent *event);
    97         virtual void contextMenuEvent(QContextMenuEvent * event);
    98         virtual void resizeEvent(QResizeEvent* event);
    99         virtual void mousePressEvent(QMouseEvent * event);
   100         virtual void mouseMoveEvent(QMouseEvent * event);
   101         virtual void mouseReleaseEvent(QMouseEvent * event);
   105         void selectionChanged();
   106         void roiChanged(
const cv::Rect &);
   109         void setupGraphicsView();
   110         void drawKeypoints(QPainter * painter = 0);
   112         void updateItemsShown();
   113         void computeScaleOffsets(
float & scale, 
float & offsetX, 
float & offsetY);
 
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)