/* * GraphViewer.h * * Created on: 2014-01-24 * Author: mathieu */ #ifndef GRAPHVIEWER_H_ #define GRAPHVIEWER_H_ #include #include #include #include class QGraphicsItem; class QGraphicsPixmapItem; namespace rtabmap { class NodeItem; class LinkItem; class GraphViewer : public QGraphicsView { public: GraphViewer(QWidget * parent = 0); virtual ~GraphViewer(); void updateGraph(const std::map & poses, const std::multimap & constraints, const std::map > & scans); void clearGraph(); void setWorkingDirectory(const QString & path) {_workingDirectory = path;} void setGridCellSize(float size) {Q_ASSERT(_gridCellSize>0.0f); _gridCellSize= size;} protected: virtual void wheelEvent ( QWheelEvent * event ); virtual void contextMenuEvent(QContextMenuEvent * event); private: QString _workingDirectory; QColor _nodeColor; QColor _neighborColor; QColor _loopClosureColor; QGraphicsItem * _root; QMap _nodeItems; QMap _neighborLinkItems; QMap _loopLinkItems; float _nodeRadius; float _linkWidth; QGraphicsPixmapItem * _gridMap; float _gridCellSize; }; } /* namespace rtabmap */ #endif /* GRAPHVIEWER_H_ */