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;
67 bool isGraphicsViewMode()
const;
68 bool isGraphicsViewScaled()
const;
69 bool isGraphicsViewScaledToHeight()
const;
70 const QColor & getDefaultBackgroundColor()
const;
71 const QColor & getDefaultFeatureColor()
const;
72 const QColor & getDefaultMatchingFeatureColor()
const;
73 const QColor & getDefaultMatchingLineColor()
const;
74 const QColor & getBackgroundColor()
const;
75 float getDepthColorMapRange()
const;
78 float viewScale()
const;
80 void setFeaturesShown(
bool shown);
81 void setImageShown(
bool shown);
82 void setImageDepthShown(
bool shown);
83 void setLinesShown(
bool shown);
84 void setGraphicsViewMode(
bool on);
85 void setGraphicsViewScaled(
bool scaled);
86 void setGraphicsViewScaledToHeight(
bool scaled);
87 void setDefaultBackgroundColor(
const QColor & color);
88 void setDefaultFeatureColor(
const QColor & color);
89 void setDefaultMatchingFeatureColor(
const QColor & color);
90 void setDefaultMatchingLineColor(
const QColor & color);
91 void setBackgroundColor(
const QColor & color);
92 void setDepthColorMapRange(
float value);
94 void setFeatures(
const std::multimap<int, cv::KeyPoint> & refWords,
const cv::Mat & depth = cv::Mat(),
const QColor & color = Qt::yellow);
95 void setFeatures(
const std::vector<cv::KeyPoint> & features,
const cv::Mat & depth = cv::Mat(),
const QColor & color = Qt::yellow);
96 void addFeature(
int id,
const cv::KeyPoint & kpt,
float depth, QColor color);
97 void addLine(
float x1,
float y1,
float x2,
float y2, QColor color,
const QString & text = QString());
98 void setImage(
const QImage & image);
99 void setImageDepth(
const cv::Mat & imageDepth);
100 void setImageDepth(
const QImage & image);
101 void setFeatureColor(
int id, QColor color);
102 void setFeaturesColor(QColor color);
103 void setAlpha(
int alpha);
104 void setFeaturesSize(
int size);
105 void setLinesWidth(
int width);
106 void setSceneRect(
const QRectF & rect);
108 const QMultiMap<int, rtabmap::KeypointItem *> &
getFeatures()
const {
return _features;}
111 void clearFeatures();
114 virtual QSize sizeHint()
const;
117 void configChanged();
120 virtual void paintEvent(QPaintEvent *event);
121 virtual void resizeEvent(QResizeEvent* event);
122 virtual void contextMenuEvent(QContextMenuEvent *
e);
125 void sceneRectChanged(
const QRectF &rect);
128 void updateOpacity();
129 void computeScaleOffsets(
const QRect & targetRect,
float &
scale,
float & offsetX,
float & offsetY)
const;
QMultiMap< int, rtabmap::KeypointItem * > _features
QAction * _showImageDepth
int getLinesWidth() const
QAction * _setFeaturesSize
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
int getFeaturesSize() const
QAction * _colorMapBlueToRed
QIcon createIcon(const QColor &color)
QAction * _setFeatureColor
QColor _defaultMatchingLineColor
QAction * _colorMapBlackToWhite
float _depthColorMapRange
QAction * _graphicsViewNoScaling
const QMultiMap< int, rtabmap::KeypointItem * > & getFeatures() const
QAction * _graphicsViewScaled
QGraphicsPixmapItem * _imageDepthItem