hpp-plot: include/hpp/plot/graph-widget.hh Source File

hpp-plot 9.0.2 Plotting tools for HPP

Loading...
Searching...
No Matches
graph-widget.hh
Go to the documentation of this file.
1// BSD 2-Clause License
2
3// Copyright (c) 2015 - 2018, hpp-plot
4// Authors: Heidy Dallard, Joseph Mirabel
5// All rights reserved.
6
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions
9// are met:
10
11// * Redistributions of source code must retain the above copyright
12// notice, this list of conditions and the following disclaimer.
13
14// * Redistributions in binary form must reproduce the above copyright
15// notice, this list of conditions and the following disclaimer in
16// the documentation and/or other materials provided with the
17// distribution.
18
19// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30// OF THE POSSIBILITY OF SUCH DAMAGE.
31
32#ifndef HPP_PLOT_GRAPHWIDGET_HH
33#define HPP_PLOT_GRAPHWIDGET_HH
34
35#include <QGVScene.h>
36
37#include <QComboBox>
38#include <QGraphicsScene>
39#include <QGraphicsView>
40#include <QTextEdit>
41#include <QWidget>
42
43namespace hpp {
44 namespace plot {
45 class GraphView : public QGraphicsView {
46 public:
47 GraphView(QWidget* parent = NULL);
48
49 // QWidget interface
50 protected:
51 void wheelEvent(QWheelEvent*);
52};
53
54 class GraphWidget : public QWidget {
55 Q_OBJECT
56
57 public:
58 GraphWidget(QString name = QString(), QWidget* parent = NULL);
59
60 ~GraphWidget();
61
62 public Q_SLOTS:
63 void updateGraph();
64 void updateEdges();
65 void saveDotFile();
66
67 protected Q_SLOTS:
68 virtual void nodeContextMenu(QGVNode* node);
69 virtual void nodeDoubleClick(QGVNode* node);
70 virtual void edgeContextMenu(QGVEdge* edge);
71 virtual void edgeDoubleClick(QGVEdge* edge);
72
73 protected:
74 virtual void fillScene();
75 QGVScene* scene_;
76 QWidget* buttonBox_;
77 QTextEdit* elmtInfo_;
78 QTextEdit* loggingInfo_;
79 QTextEdit* constraintInfo_;
80
81 private:
82 GraphView* view_;
83 QComboBox* algList_;
84 bool layoutShouldBeFreed_;
85};
86} // namespace plot
87} // namespace hpp
88
89#endif // HPP_PLOT_GRAPHWIDGET_HH
QGVScene.h
QGVEdge
QGVNode
QGVScene
hpp::plot::GraphView
Definition graph-widget.hh:45
hpp::plot::GraphView::wheelEvent
void wheelEvent(QWheelEvent *)
Definition graph-widget.cc:60
hpp::plot::GraphWidget
Definition graph-widget.hh:54
hpp::plot::GraphWidget::edgeContextMenu
virtual void edgeContextMenu(QGVEdge *edge)
Definition graph-widget.cc:205
hpp::plot::GraphWidget::buttonBox_
QWidget * buttonBox_
Definition graph-widget.hh:76
hpp::plot::GraphWidget::elmtInfo_
QTextEdit * elmtInfo_
Definition graph-widget.hh:77
hpp::plot::GraphWidget::scene_
QGVScene * scene_
Definition graph-widget.hh:75
hpp::plot::GraphWidget::nodeDoubleClick
virtual void nodeDoubleClick(QGVNode *node)
Definition graph-widget.cc:201
hpp::plot::GraphWidget::updateGraph
void updateGraph()
Definition graph-widget.cc:161
hpp::plot::GraphWidget::fillScene
virtual void fillScene()
Definition graph-widget.cc:207
hpp::plot::GraphWidget::~GraphWidget
~GraphWidget()
Definition graph-widget.cc:159
hpp::plot::GraphWidget::constraintInfo_
QTextEdit * constraintInfo_
Definition graph-widget.hh:79
hpp::plot::GraphWidget::loggingInfo_
QTextEdit * loggingInfo_
Definition graph-widget.hh:78
hpp::plot::GraphWidget::nodeContextMenu
virtual void nodeContextMenu(QGVNode *node)
Definition graph-widget.cc:199
hpp::plot::GraphWidget::saveDotFile
void saveDotFile()
Definition graph-widget.cc:191
hpp::plot::GraphWidget::updateEdges
void updateEdges()
Definition graph-widget.cc:184
hpp::plot::GraphWidget::edgeDoubleClick
virtual void edgeDoubleClick(QGVEdge *edge)
Definition graph-widget.cc:203
hpp