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> 55 void saveSettings(QSettings & settings,
const QString & group =
"")
const;
56 void loadSettings(QSettings & settings,
const QString & group =
"");
58 QRectF sceneRect()
const;
59 bool isImageShown()
const;
60 bool isImageDepthShown()
const;
61 bool isFeaturesShown()
const;
62 bool isLinesShown()
const;
65 bool isGraphicsViewMode()
const;
66 bool isGraphicsViewScaled()
const;
67 bool isGraphicsViewScaledToHeight()
const;
68 const QColor & getDefaultBackgroundColor()
const;
69 const QColor & getBackgroundColor()
const;
71 float viewScale()
const;
73 void setFeaturesShown(
bool shown);
74 void setImageShown(
bool shown);
75 void setImageDepthShown(
bool shown);
76 void setLinesShown(
bool shown);
77 void setGraphicsViewMode(
bool on);
78 void setGraphicsViewScaled(
bool scaled);
79 void setGraphicsViewScaledToHeight(
bool scaled);
80 void setDefaultBackgroundColor(
const QColor & color);
81 void setBackgroundColor(
const QColor & color);
83 void setFeatures(
const std::multimap<int, cv::KeyPoint> & refWords,
const cv::Mat & depth = cv::Mat(),
const QColor & color = Qt::yellow);
84 void setFeatures(
const std::vector<cv::KeyPoint> & features,
const cv::Mat & depth = cv::Mat(),
const QColor & color = Qt::yellow);
85 void addFeature(
int id,
const cv::KeyPoint & kpt,
float depth, QColor color);
86 void addLine(
float x1,
float y1,
float x2,
float y2, QColor color,
const QString & text = QString());
87 void setImage(
const QImage & image);
88 void setImageDepth(
const cv::Mat & imageDepth);
89 void setImageDepth(
const QImage & image);
90 void setFeatureColor(
int id, QColor color);
91 void setFeaturesColor(QColor color);
92 void setAlpha(
int alpha);
93 void setFeaturesSize(
int size);
94 void setSceneRect(
const QRectF & rect);
96 const QMultiMap<int, rtabmap::KeypointItem *> &
getFeatures()
const {
return _features;}
102 virtual QSize sizeHint()
const;
105 void configChanged();
108 virtual void paintEvent(QPaintEvent *event);
109 virtual void resizeEvent(QResizeEvent* event);
110 virtual void contextMenuEvent(QContextMenuEvent *
e);
113 void sceneRectChanged(
const QRectF &rect);
116 void updateOpacity();
117 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
QGraphicsView * _graphicsView
QAction * _graphicsViewMode
QGraphicsPixmapItem * _imageItem
QAction * _colorMapWhiteToBlack
QAction * _colorMapBlueToRed
QAction * _colorMapBlackToWhite
QAction * _graphicsViewNoScaling
int getFeaturesSize() const
QAction * _graphicsViewScaled
QGraphicsPixmapItem * _imageDepthItem