mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
Faster graph zoom by using a snapshot-preview (#1728)
* Faster graph zoom by using a snapshot-preview * Added "Fast Zooming..." menu option --------- Co-authored-by: matlabbe <matlabbe@gmail.com>
This commit is contained in:
@@ -33,6 +33,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QGraphicsView>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QTimer>
|
||||
#include <QGraphicsPixmapItem>
|
||||
#include <rtabmap/core/Link.h>
|
||||
#include <rtabmap/core/GPS.h>
|
||||
#include <opencv2/opencv.hpp>
|
||||
@@ -130,6 +132,7 @@ public:
|
||||
bool isOrientationENU() const;
|
||||
ViewPlane getViewPlane() const;
|
||||
bool isEnsureFrameVisible() const;
|
||||
int getFastZoomMinNodes() const;
|
||||
|
||||
// setters
|
||||
void setWorkingDirectory(const QString & path);
|
||||
@@ -170,6 +173,7 @@ public:
|
||||
void setOrientationENU(bool enabled);
|
||||
void setViewPlane(ViewPlane plane);
|
||||
void setEnsureFrameVisible(bool visible);
|
||||
void setFastZoomMinNodes(int value);
|
||||
|
||||
Q_SIGNALS:
|
||||
void configChanged();
|
||||
@@ -184,11 +188,14 @@ protected:
|
||||
virtual void wheelEvent ( QWheelEvent * event );
|
||||
virtual void mouseMoveEvent(QMouseEvent * event);
|
||||
virtual void mousePressEvent(QMouseEvent * event);
|
||||
virtual void mouseReleaseEvent(QMouseEvent * event);
|
||||
virtual void contextMenuEvent(QContextMenuEvent * event);
|
||||
|
||||
private:
|
||||
void setupGraphicsScene();
|
||||
|
||||
void startZoomOverlay();
|
||||
void updateZoomOverlay();
|
||||
void stopZoomOverlay();
|
||||
private:
|
||||
QString _workingDirectory;
|
||||
QColor _nodeColor;
|
||||
@@ -248,6 +255,11 @@ private:
|
||||
ViewPlane _viewPlane;
|
||||
bool _ensureFrameVisible;
|
||||
QPoint _previousMousePos;
|
||||
QPoint _initialMousePos;
|
||||
QTimer _zoomDebounceTimer;
|
||||
QGraphicsPixmapItem * _zoomOverlayItem;
|
||||
bool _zoomOverlayActive;
|
||||
int _fastZoomMinNodes;
|
||||
};
|
||||
|
||||
} /* namespace rtabmap */
|
||||
|
||||
Reference in New Issue
Block a user