28 #ifndef RTABMAP_IMAGEVIEW_H_ 29 #define RTABMAP_IMAGEVIEW_H_ 33 #include <QGraphicsView> 34 #include <QtCore/QRectF> 35 #include <QtCore/QMultiMap> 36 #include <QtCore/QSettings> 37 #include <opencv2/features2d/features2d.hpp> 56 void saveSettings(QSettings & settings,
const QString & group =
"")
const;
57 void loadSettings(QSettings & settings,
const QString & group =
"");
59 QRectF sceneRect()
const;
60 bool isImageShown()
const;
61 bool isImageDepthShown()
const;
62 bool isFeaturesShown()
const;
63 bool isLinesShown()
const;
66 bool isGraphicsViewMode()
const;
67 bool isGraphicsViewScaled()
const;
68 bool isGraphicsViewScaledToHeight()
const;
69 const QColor & getDefaultBackgroundColor()
const;
70 const QColor & getDefaultFeatureColor()
const;
71 const QColor & getDefaultMatchingFeatureColor()
const;
72 const QColor & getDefaultMatchingLineColor()
const;
73 const QColor & getBackgroundColor()
const;
76 float viewScale()
const;
78 void setFeaturesShown(
bool shown);
79 void setImageShown(
bool shown);
80 void setImageDepthShown(
bool shown);
81 void setLinesShown(
bool shown);
82 void setGraphicsViewMode(
bool on);
83 void setGraphicsViewScaled(
bool scaled);
84 void setGraphicsViewScaledToHeight(
bool scaled);
85 void setDefaultBackgroundColor(
const QColor & color);
86 void setDefaultFeatureColor(
const QColor & color);
87 void setDefaultMatchingFeatureColor(
const QColor & color);
88 void setDefaultMatchingLineColor(
const QColor & color);
89 void setBackgroundColor(
const QColor & color);
91 void setFeatures(
const std::multimap<int, cv::KeyPoint> & refWords,
const cv::Mat & depth = cv::Mat(),
const QColor & color = Qt::yellow);
92 void setFeatures(
const std::vector<cv::KeyPoint> & features,
const cv::Mat & depth = cv::Mat(),
const QColor & color = Qt::yellow);
93 void addFeature(
int id,
const cv::KeyPoint & kpt,
float depth, QColor color);
94 void addLine(
float x1,
float y1,
float x2,
float y2, QColor color,
const QString & text = QString());
95 void setImage(
const QImage & image);
96 void setImageDepth(
const cv::Mat & imageDepth);
97 void setImageDepth(
const QImage & image);
98 void setFeatureColor(
int id, QColor color);
99 void setFeaturesColor(QColor color);
100 void setAlpha(
int alpha);
101 void setFeaturesSize(
int size);
102 void setSceneRect(
const QRectF & rect);
104 const QMultiMap<int, rtabmap::KeypointItem *> &
getFeatures()
const {
return _features;}
107 void clearFeatures();
110 virtual QSize sizeHint()
const;
113 void configChanged();
116 virtual void paintEvent(QPaintEvent *event);
117 virtual void resizeEvent(QResizeEvent* event);
118 virtual void contextMenuEvent(QContextMenuEvent *
e);
121 void sceneRectChanged(
const QRectF &rect);
124 void updateOpacity();
125 void computeScaleOffsets(
const QRect & targetRect,
float &
scale,
float & offsetX,
float & offsetY)
const;
QMultiMap< int, rtabmap::KeypointItem * > _features
QAction * _showImageDepth
QAction * _setFeaturesSize
const QMultiMap< int, rtabmap::KeypointItem * > & getFeatures() const
QList< QGraphicsLineItem * > _lines
GLM_FUNC_DECL genType e()
QAction * _graphicsViewScaledToHeight
QAction * _colorMapRedToBlue
QAction * _setMatchingFeatureColor
QGraphicsView * _graphicsView
QAction * _graphicsViewMode
QGraphicsPixmapItem * _imageItem
QAction * _colorMapWhiteToBlack
QColor _defaultMatchingFeatureColor
QColor _defaultFeatureColor
QAction * _setMatchingLineColor
QAction * _colorMapBlueToRed
QIcon createIcon(const QColor &color)
QAction * _setFeatureColor
QColor _defaultMatchingLineColor
QAction * _colorMapBlackToWhite
QAction * _graphicsViewNoScaling
int getFeaturesSize() const
QAction * _graphicsViewScaled
QGraphicsPixmapItem * _imageDepthItem