├── Qt Graphiz Visualizer ├── QGraphViz.pro ├── QGVCore │ ├── private │ │ ├── QGVCore.cpp │ │ ├── QGVEdgePrivate.cpp │ │ ├── QGVGraphPrivate.cpp │ │ ├── QGVGvcPrivate.cpp │ │ ├── QGVEdgePrivate.h │ │ ├── QGVGraphPrivate.h │ │ ├── QGVNodePrivate.cpp │ │ ├── QGVNodePrivate.h │ │ ├── QGVGvcPrivate.h │ │ └── QGVCore.h │ ├── qgv.h │ ├── QGVCore-uninstalled.pc.in │ ├── QGVCore.pc.in │ ├── GraphViz.pri │ ├── QGVCore.pro │ ├── QGVSubGraph.h │ ├── QGVEdge.h │ ├── QGVNode.h │ ├── QGVScene.h │ ├── QGVNode.cpp │ ├── QGVSubGraph.cpp │ ├── CMakeLists.txt │ ├── QGVEdge.cpp │ └── QGVScene.cpp ├── Sample │ ├── Gnome-System-Run-64.png │ ├── Gnome-Stock-Person-64.png │ ├── Gnome-Network-Server-64.png │ ├── Gnome-Network-Transmit-64.png │ ├── ress.qrc │ ├── Sample.pro │ ├── graphvizwrapper.h │ ├── QGraphicsViewEc.h │ ├── MainWindow.h │ ├── QGraphicsViewEc.cpp │ ├── CMakeLists.txt │ ├── MainWindow.ui │ ├── main.cpp │ └── MainWindow.cpp ├── FAQ.txt ├── README.md ├── cmake │ ├── cmake_uninstall.cmake.in │ └── modules │ │ └── FindGraphviz.cmake ├── LICENSE.txt ├── CMakeLists.txt ├── QGraphViz.pro.user.98d90d7 └── QGraphViz.pro.user └── README.md /Qt Graphiz Visualizer/QGraphViz.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | CONFIG += ordered 4 | 5 | SUBDIRS += QGVCore 6 | SUBDIRS += Sample 7 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/private/QGVCore.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syedahmedjamil/qt-graphviz-visualizer/HEAD/Qt Graphiz Visualizer/QGVCore/private/QGVCore.cpp -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/Gnome-System-Run-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syedahmedjamil/qt-graphviz-visualizer/HEAD/Qt Graphiz Visualizer/Sample/Gnome-System-Run-64.png -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/Gnome-Stock-Person-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syedahmedjamil/qt-graphviz-visualizer/HEAD/Qt Graphiz Visualizer/Sample/Gnome-Stock-Person-64.png -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/Gnome-Network-Server-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syedahmedjamil/qt-graphviz-visualizer/HEAD/Qt Graphiz Visualizer/Sample/Gnome-Network-Server-64.png -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/Gnome-Network-Transmit-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syedahmedjamil/qt-graphviz-visualizer/HEAD/Qt Graphiz Visualizer/Sample/Gnome-Network-Transmit-64.png -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/qgv.h: -------------------------------------------------------------------------------- 1 | #ifndef QGV_H 2 | #define QGV_H 3 | 4 | #include 5 | 6 | #ifdef QGVCORE_LIB 7 | #define QGVCORE_EXPORT Q_DECL_EXPORT 8 | #else 9 | #define QGVCORE_EXPORT Q_DECL_IMPORT 10 | #endif 11 | 12 | #endif // QGV_H 13 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/ress.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Gnome-Network-Server-64.png 4 | Gnome-Network-Transmit-64.png 5 | Gnome-Stock-Person-64.png 6 | Gnome-System-Run-64.png 7 | 8 | 9 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/private/QGVEdgePrivate.cpp: -------------------------------------------------------------------------------- 1 | #include "QGVEdgePrivate.h" 2 | 3 | QGVEdgePrivate::QGVEdgePrivate(Agedge_t *edge) 4 | { 5 | setEdge(edge); 6 | } 7 | 8 | void QGVEdgePrivate::setEdge(Agedge_t *edge) 9 | { 10 | _edge = edge; 11 | } 12 | 13 | Agedge_t* QGVEdgePrivate::edge() const 14 | { 15 | return _edge; 16 | } 17 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/private/QGVGraphPrivate.cpp: -------------------------------------------------------------------------------- 1 | #include "QGVGraphPrivate.h" 2 | 3 | QGVGraphPrivate::QGVGraphPrivate(Agraph_t *graph) 4 | { 5 | setGraph(graph); 6 | } 7 | 8 | void QGVGraphPrivate::setGraph(Agraph_t *graph) 9 | { 10 | _graph = graph; 11 | } 12 | 13 | Agraph_t* QGVGraphPrivate::graph() const 14 | { 15 | return _graph; 16 | } 17 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/private/QGVGvcPrivate.cpp: -------------------------------------------------------------------------------- 1 | #include "QGVGvcPrivate.h" 2 | 3 | QGVGvcPrivate::QGVGvcPrivate(GVC_t *context) 4 | { 5 | setContext(context); 6 | } 7 | 8 | void QGVGvcPrivate::setContext(GVC_t *context) 9 | { 10 | _context = context; 11 | } 12 | 13 | GVC_t* QGVGvcPrivate::context() const 14 | { 15 | return _context; 16 | } 17 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVCore-uninstalled.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_BINARY_DIR@/lib 2 | includedir=@CMAKE_CURRENT_SOURCE_DIR@ 3 | 4 | Name: @TARGET_NAME@ 5 | Description: @PROJECT_DESCRIPTION@ 6 | Version: @PROJECT_VERSION@ 7 | Requires: @PKGCONFIG_REQUIRES@ 8 | Libs: -L${libdir} -l@TARGET_NAME@ @PKGCONFIG_LIBS@ 9 | Cflags: -I${includedir} @PKGCONFIG_CFLAGS@ 10 | 11 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/private/QGVEdgePrivate.h: -------------------------------------------------------------------------------- 1 | #ifndef QGVEDGEPRIVATE_H 2 | #define QGVEDGEPRIVATE_H 3 | 4 | #include 5 | 6 | class QGVEdgePrivate 7 | { 8 | public: 9 | QGVEdgePrivate(Agedge_t *edge = NULL); 10 | 11 | void setEdge(Agedge_t *edge); 12 | Agedge_t* edge() const; 13 | 14 | private: 15 | Agedge_t* _edge; 16 | }; 17 | 18 | #endif // QGVEDGEPRIVATE_H 19 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/private/QGVGraphPrivate.h: -------------------------------------------------------------------------------- 1 | #ifndef QGVGRAPHPRIVATE_H 2 | #define QGVGRAPHPRIVATE_H 3 | 4 | #include 5 | 6 | class QGVGraphPrivate 7 | { 8 | public: 9 | QGVGraphPrivate(Agraph_t *graph); 10 | 11 | void setGraph(Agraph_t *graph); 12 | Agraph_t* graph() const; 13 | 14 | private: 15 | Agraph_t* _graph; 16 | }; 17 | 18 | #endif // QGVGRAPHPRIVATE_H 19 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVCore.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=${prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: @TARGET_NAME@ 7 | Description: @PROJECT_DESCRIPTION@ 8 | Version: @PROJECT_VERSION@ 9 | Requires: @PKGCONFIG_REQUIRES@ 10 | Libs: -L${libdir} -l@TARGET_NAME@ @PKGCONFIG_LIBS@ 11 | Cflags: -I${includedir} @PKGCONFIG_CFLAGS@ 12 | 13 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/private/QGVNodePrivate.cpp: -------------------------------------------------------------------------------- 1 | #include "QGVNodePrivate.h" 2 | 3 | QGVNodePrivate::QGVNodePrivate(Agnode_t *node, Agraph_t *parent) : 4 | _node(node), _parent(parent) 5 | { 6 | } 7 | 8 | void QGVNodePrivate::setNode(Agnode_t *node) 9 | { 10 | _node = node; 11 | } 12 | 13 | Agnode_t* QGVNodePrivate::node() const 14 | { 15 | return _node; 16 | } 17 | 18 | Agraph_t* QGVNodePrivate::graph() const 19 | { 20 | return _parent; 21 | } 22 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/private/QGVNodePrivate.h: -------------------------------------------------------------------------------- 1 | #ifndef QGVNODEPRIVATE_H 2 | #define QGVNODEPRIVATE_H 3 | 4 | #include 5 | 6 | class QGVNodePrivate 7 | { 8 | public: 9 | QGVNodePrivate(Agnode_t *node, Agraph_t *parent); 10 | 11 | void setNode(Agnode_t *node); 12 | Agnode_t* node() const; 13 | 14 | Agraph_t* graph() const; 15 | 16 | private: 17 | Agnode_t* _node; 18 | Agraph_t* _parent; 19 | }; 20 | 21 | #endif // QGVNODEPRIVATE_H 22 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/GraphViz.pri: -------------------------------------------------------------------------------- 1 | #GraphViz librairie 2 | DEFINES += WITH_CGRAPH 3 | INCLUDEPATH += private 4 | QMAKE_CXXFLAGS += -DQGVCORE_LIB 5 | 6 | unix { 7 | CONFIG += link_pkgconfig 8 | PKGCONFIG += libcdt libgvc libcgraph libgraph 9 | } 10 | win32 { 11 | #Configure Windows GraphViz path here : 12 | GRAPHVIZ_PATH = "C:/Program Files (x86)/Graphviz2.38/" 13 | DEFINES += WIN32_DLL 14 | DEFINES += GVDLL 15 | INCLUDEPATH += $$GRAPHVIZ_PATH/include/graphviz 16 | LIBS += -L$$GRAPHVIZ_PATH/lib/release/lib -lgvc -lcgraph -lgraph -lcdt 17 | } 18 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/private/QGVGvcPrivate.h: -------------------------------------------------------------------------------- 1 | #ifndef QGVGVCPRIVATE_H 2 | #define QGVGVCPRIVATE_H 3 | 4 | #include 5 | 6 | class QGVGvcPrivate 7 | { 8 | public: 9 | QGVGvcPrivate(GVC_t *context = NULL); 10 | 11 | void setContext(GVC_t *context); 12 | GVC_t* context() const; 13 | 14 | // operators to implicit cast from QGVGvcPrivate* into GVC_t* seems not to work, 15 | // because of typedef GVC_t 16 | // inline operator const GVC_t* () const 17 | // { 18 | // return const_cast(context()); 19 | // } 20 | 21 | // inline operator struct GVC_t* () 22 | // { 23 | // return context(); 24 | // } 25 | 26 | private: 27 | GVC_t* _context; 28 | }; 29 | 30 | #endif // QGVGVCPRIVATE_H 31 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/FAQ.txt: -------------------------------------------------------------------------------- 1 | 2 | For Windows user : 3 | - Download GraphViz librairie : http://www.graphviz.org/Download.php 4 | - Configure GRAPHVIZ_PATH in GraphViz.pro 5 | - Open with Qt Creator & compile 6 | - copy GraphViz dll to /bin : 7 | cdt.dll 8 | cgraph.dll 9 | gvc.dll 10 | gvplugin_core.dll 11 | gvplugin_dot_layout.dll (Sample use dot layout) 12 | libexpat.dll 13 | ltdl.dll 14 | Pathplan.dll 15 | vmalloc.dll 16 | zlib1.dll 17 | config6 (dont forget !) 18 | 19 | - copy Qt dll to /bin : 20 | QtCore4.dll 21 | QtGui4.dll 22 | mingwm10.dll and libgcc_s_dw2-1.dll (if using mingw32 compiler) 23 | 24 | 25 | COMPILATION BUG : 26 | - Graphviz2.36 Windows bundle forget to add "textspan.h" 27 | * Download missing file at : https://github.com/ellson/graphviz/blob/master/lib/common/textspan.h?source=cc -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/Sample.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2013-04-17T09:06:06 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = Sample 12 | TEMPLATE = app 13 | 14 | DESTDIR = ../bin 15 | 16 | #QGVCore librairie 17 | LIBS += -L$$OUT_PWD/../lib -lQGVCore 18 | INCLUDEPATH += $$PWD/../QGVCore 19 | DEPENDPATH += $$PWD/../QGVCore 20 | 21 | #GraphViz librairie 22 | !include(../QGVCore/GraphViz.pri) { 23 | error("fail open GraphViz.pri") 24 | } 25 | 26 | SOURCES += main.cpp\ 27 | MainWindow.cpp \ 28 | QGraphicsViewEc.cpp 29 | 30 | HEADERS += MainWindow.h \ 31 | QGraphicsViewEc.h \ 32 | graphvizwrapper.h 33 | 34 | FORMS += MainWindow.ui 35 | 36 | RESOURCES += \ 37 | ress.qrc 38 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVCore.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2013-04-17T09:06:06 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4){ 10 | QT += widgets 11 | } 12 | lessThan(QT_MAJOR_VERSION, 5) { 13 | QT += gui 14 | } 15 | 16 | TARGET = QGVCore 17 | TEMPLATE = lib 18 | CONFIG += shared 19 | 20 | DESTDIR = ../lib 21 | DLLDESTDIR = ../bin 22 | 23 | #GraphViz librairie 24 | !include(GraphViz.pri) { 25 | error("fail open GraphViz.pri") 26 | } 27 | 28 | SOURCES += QGVScene.cpp \ 29 | QGVNode.cpp \ 30 | QGVEdge.cpp \ 31 | QGVSubGraph.cpp \ 32 | private/QGVCore.cpp \ 33 | private/QGVGraphPrivate.cpp \ 34 | private/QGVGvcPrivate.cpp \ 35 | private/QGVEdgePrivate.cpp \ 36 | private/QGVNodePrivate.cpp 37 | 38 | HEADERS += QGVScene.h \ 39 | QGVNode.h \ 40 | QGVEdge.h \ 41 | QGVSubGraph.h \ 42 | private/QGVCore.h \ 43 | private/QGVGraphPrivate.h \ 44 | private/QGVGvcPrivate.h \ 45 | private/QGVEdgePrivate.h \ 46 | private/QGVNodePrivate.h \ 47 | qgv.h 48 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/graphvizwrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef GRAPHVIZWRAPPER_H 2 | #define GRAPHVIZWRAPPER_H 3 | 4 | #include "MainWindow.h" 5 | #include 6 | 7 | namespace Ui { 8 | class MainWindow; 9 | } 10 | 11 | class GraphvizWrapper 12 | { 13 | 14 | public: 15 | GraphvizWrapper() 16 | { 17 | mw.show(); 18 | } 19 | void addNode(QString lable , int frequency) 20 | { 21 | QGVNode* newNode = mw._scene->addNode(lable , frequency); 22 | nodeTable.insert(std::pair(lable,newNode)); 23 | } 24 | void addEdge(QString node1 , QString node2 , int weight) 25 | { 26 | mw._scene->addEdge(nodeTable[node1],nodeTable[node2],QString::number(weight)); 27 | } 28 | 29 | void addGraphAttribute(QString name , QString value) 30 | { 31 | mw._scene->setGraphAttribute(name, value); 32 | } 33 | void addNodeAttribute(QString name , QString value) 34 | { 35 | mw._scene->setNodeAttribute(name, value); 36 | } 37 | void draw() 38 | { 39 | mw._scene->applyLayout(); 40 | mw.FitAndChangeShapeToRect(); 41 | } 42 | 43 | private: 44 | MainWindow mw; 45 | std::map nodeTable; 46 | 47 | }; 48 | 49 | #endif // GRAPHVIZWRAPPER_H 50 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/QGraphicsViewEc.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore Sample 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #ifndef QGRAPHICSVIEWEC_H 19 | #define QGRAPHICSVIEWEC_H 20 | 21 | #include 22 | 23 | /** 24 | * @brief Graphics view with wheel zoom 25 | * 26 | */ 27 | class QGraphicsViewEc : public QGraphicsView 28 | { 29 | Q_OBJECT 30 | public: 31 | QGraphicsViewEc(QWidget *parent = 0); 32 | 33 | protected: 34 | virtual void wheelEvent(QWheelEvent* event); 35 | }; 36 | 37 | #endif // QGRAPHICSVIEWEC_H 38 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/MainWindow.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore Sample 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #ifndef MAINWINDOW_H 19 | #define MAINWINDOW_H 20 | 21 | #include 22 | #include "QGVScene.h" 23 | 24 | namespace Ui { 25 | class MainWindow; 26 | } 27 | 28 | class MainWindow : public QMainWindow 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit MainWindow(QWidget *parent = 0); 34 | ~MainWindow(); 35 | void drawGraph(); 36 | void FitAndChangeShapeToRect(); 37 | 38 | private slots: 39 | void nodeContextMenu(QGVNode* node); 40 | void nodeDoubleClick(QGVNode* node); 41 | 42 | public: 43 | Ui::MainWindow *ui; 44 | QGVScene *_scene; 45 | }; 46 | 47 | #endif // MAINWINDOW_H 48 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/QGraphicsViewEc.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore Sample 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #include "QGraphicsViewEc.h" 19 | #include "moc_QGraphicsViewEc.cpp" 20 | #include 21 | #include 22 | 23 | QGraphicsViewEc::QGraphicsViewEc(QWidget* parent) : QGraphicsView(parent) 24 | { 25 | setTransformationAnchor(QGraphicsView::AnchorUnderMouse); 26 | } 27 | 28 | 29 | void QGraphicsViewEc::wheelEvent(QWheelEvent* event) 30 | { 31 | qreal scaleFactor = qPow(2.0, event->delta() / 240.0); //How fast we zoom 32 | qreal factor = transform().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width(); 33 | if(0.05 < factor && factor < 10) //Zoom factor limitation 34 | scale(scaleFactor, scaleFactor); 35 | } 36 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # enable all QT-Stuff we need 2 | # see http://cmake.org/cmake/help/cmake2.6docs.html#module:FindQt4 for a complete list 3 | 4 | SET(qgv_TS 5 | ) 6 | 7 | SET(qgv_UI 8 | MainWindow.ui 9 | ) 10 | 11 | # all files which may be mocced 12 | SET(qgv_CPP 13 | main.cpp 14 | MainWindow.cpp 15 | QGraphicsViewEc.cpp 16 | ) 17 | 18 | # include with QT_USE selected library parts 19 | INCLUDE(${QT_USE_FILE}) 20 | 21 | INCLUDE_DIRECTORIES( 22 | ${libqgv_SOURCE_DIR} 23 | ${libqgv_BINARY_DIR} 24 | ${CMAKE_CURRENT_BINARY_DIR} 25 | ${CMAKE_CURRENT_SOURCE_DIR} 26 | ) 27 | 28 | # make *.h out of *.ui 29 | QT4_WRAP_UI(qgv_UI_H ${qgv_UI}) 30 | 31 | # moc classes 32 | QT4_AUTOMOC(${qgv_CPP}) 33 | 34 | # add translations 35 | QT4_ADD_TRANSLATION(qgv_TRANS ${qgv_TS}) 36 | 37 | SET(neededStuff 38 | ${qgv_CPP} 39 | ${qgv_UI_H} 40 | ${qgv_TRANS} 41 | ) 42 | 43 | IF(UNIX) 44 | ADD_EXECUTABLE(sample ${neededStuff}) 45 | ELSEIF(APPLE) 46 | # it's with gui, so MACOSX_BUNDLE is needed 47 | ADD_EXECUTABLE(sample MACOSX_BUNDLE ${neededStuff}) 48 | ELSEIF(WIN32) 49 | # it's with gui, so WIN32 is needed 50 | ADD_EXECUTABLE(sample WIN32 ${neededStuff}) 51 | ENDIF() 52 | SET_TARGET_PROPERTIES(sample PROPERTIES 53 | OUTPUT_NAME "Sample") 54 | 55 | TARGET_LINK_LIBRARIES(sample 56 | ${QT_LIBRARIES} 57 | qgvcore 58 | ) 59 | 60 | IF(BINDINGS_QT5) 61 | qt5_use_modules(sample Core Widgets) 62 | SET(CMAKE_AUTOMOC ON) 63 | ENDIF(BINDINGS_QT5) 64 | 65 | # The COMPONENT option only defines the internal belonging of the INSTALL'ed thing 66 | INSTALL( 67 | TARGETS sample 68 | RUNTIME DESTINATION ${bin_DIR} 69 | COMPONENT sample 70 | ) 71 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/MainWindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 817 10 | 567 11 | 12 | 13 | 14 | GraphViz Visualizer C++ Qt Widget 15 | 16 | 17 | 18 | 19 | 20 | 21 | QPainter::Antialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing 22 | 23 | 24 | QGraphicsView::ScrollHandDrag 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 0 34 | 0 35 | 817 36 | 21 37 | 38 | 39 | 40 | 41 | 42 | TopToolBarArea 43 | 44 | 45 | false 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | QGraphicsViewEc 54 | QGraphicsView 55 |
QGraphicsViewEc.h
56 |
57 |
58 | 59 | 60 |
61 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/README.md: -------------------------------------------------------------------------------- 1 | Interactive Qt graphViz display 2 | =============================== 3 | 4 | Features : 5 | ---------- 6 | 7 | * Use cgraph lib (C++ API wrapper) 8 | * Support edges : label on edge, simple arrow both direction 9 | * Support Nodes : box or ellipse shape, image on Node 10 | * Support subGraphs 11 | * Interactions with node and edge (context menu and double click) 12 | * Zoom/move on graph 13 | * Tested only on dot engine 14 | * Only 6 headers/sources files to add 15 | 16 | 17 | Screen capture : 18 | ---------------- 19 | 20 | ![Screen capture](http://i39.tinypic.com/2gy1z0h.png) 21 | 22 | * Windows binairies demo here : https://github.com/nbergont/qgv/releases 23 | 24 | Installation : 25 | -------------- 26 | 27 | * Download qgv sources from GIT : git clone https://github.com/nbergont/qgv.git 28 | * Download graphViz librairie : http://www.graphviz.org/Download.php 29 | * Configure GRAPHVIZ_PATH in QGraphViz.pro 30 | * Open with Qt Creator & compile 31 | 32 | TODO : 33 | ------ 34 | 35 | * Support more attributes of Graphviz 36 | * Add more comments 37 | * Support head/tail label on edge 38 | * Fully support layout from dot language (may be works...) 39 | * Dynamicaly move node and redraw layout ? (I dont know if it's possible) : not possible 40 | 41 | Good lecture on subject : 42 | ------------------------- 43 | 44 | * Steve Dodier-Lazaro : 45 | * Arvin Schnell : 46 | * 47 | 48 | Other similar projects (you must look before lose time with GraphViz) : 49 | ----------------------- 50 | * Constraint-based diagram editor : https://github.com/mjwybrow/dunnart (Probably best one ! Awesome work ...) 51 | * OGDF - Open Graph Drawing Framework : http://www.ogdf.net/doku.php (Very good library, better than GraphViz !) 52 | 53 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/cmake/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | ###################### 2 | # 3 | # Copyright (C) 2010 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved. 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | ###################### 19 | 20 | IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 21 | MESSAGE(FATAL_ERROR "Cannot find install manifest: "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt"") 22 | ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 23 | 24 | FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 25 | STRING(REGEX REPLACE "\n" ";" files "${files}") 26 | FOREACH(file ${files}) 27 | MESSAGE(STATUS "Uninstalling "$ENV{DESTDIR}${file}"") 28 | IF(EXISTS "$ENV{DESTDIR}${file}") 29 | EXEC_PROGRAM( 30 | "@CMAKE_COMMAND@" ARGS "-E remove "$ENV{DESTDIR}${file}"" 31 | OUTPUT_VARIABLE rm_out 32 | RETURN_VALUE rm_retval 33 | ) 34 | IF(NOT "${rm_retval}" STREQUAL 0) 35 | MESSAGE(FATAL_ERROR "Problem when removing "$ENV{DESTDIR}${file}"") 36 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 37 | ELSE(EXISTS "$ENV{DESTDIR}${file}") 38 | MESSAGE(STATUS "File "$ENV{DESTDIR}${file}" does not exist.") 39 | ENDIF(EXISTS "$ENV{DESTDIR}${file}") 40 | ENDFOREACH(file) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | GraphViz Dot Visualizer C++ Qt Widget 2 | ===================================== 3 | 4 | This is extended version of (https://github.com/nbergont/qgv).
5 | I have added a wrapper class to easily add edges , nodes , attributes.
6 | Just include the graphVizwrapper.h class in your main file and use the functions present in the class 7 | 8 | Demo : 9 | ------ 10 | 11 | ![Demo](https://i.imgur.com/fjLzahn.png) 12 | 13 | The Code : 14 | ---------- 15 | 16 | ![The Code](https://i.imgur.com/tQnhllJ.png) 17 | 18 | Functions inside the wrapper class : 19 | ------------------------------------ 20 | 21 | * void addNode(QString lable , int frequency) 22 | * void addEdge(QString node1 , QString node2 , int weight) 23 | * void addGraphAttribute(QString name , QString value) 24 | * void addNodeAttribute(QString name , QString value) 25 | * void draw() 26 | 27 | 28 | How to Download and use this : 29 | ------------------------------ 30 | 31 | * Download GraphViz 2.8 Stable from (https://graphviz.gitlab.io/_pages/Download/Download_windows.html) 32 | * Clone or Download this repository 33 | * Navigate to the following path and open (Qt GraphViz Visualizer/QGVCore/GraphViz.pri) file 34 | * Change the **GRAPHVIZ_PATH** to where you installed GraphViz in you computer as shown in the following image 35 | 36 | ![installation](https://i.imgur.com/ocJd7vL.png) 37 | 38 | * Open the (QGraphViz.pro) file located in folder (Qt GraphViz Visualizer) and build/run it. 39 | * [IMPORTANT] When you will build/run the project for the first time your build directory might have a differnt name than mine
40 | and will not contain the required dll files that are present in my provided build directories. If so, then just copy and
41 | paste the dll files from any of my build directoy to yours. 42 | ![Build Directory](https://i.imgur.com/BGOOD8p.png) 43 | 44 | * If something like following happens when opening the project file then just click "NO" 45 | ![Popup](https://i.imgur.com/QQTJzdM.png) 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVSubGraph.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #ifndef QGVSUBGRAPH_H 19 | #define QGVSUBGRAPH_H 20 | 21 | #include "qgv.h" 22 | #include 23 | #include 24 | 25 | class QGVNode; 26 | class QGVEdge; 27 | class QGVScene; 28 | class QGVGraphPrivate; 29 | 30 | /** 31 | * @brief SubGraph item 32 | * 33 | */ 34 | class QGVCORE_EXPORT QGVSubGraph : public QGraphicsItem 35 | { 36 | public: 37 | ~QGVSubGraph(); 38 | 39 | QString name() const; 40 | 41 | QGVNode* addNode(const QString& label); 42 | QGVSubGraph* addSubGraph(const QString& name, bool cluster=true); 43 | 44 | QRectF boundingRect() const; 45 | void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); 46 | void setAttribute(const QString &name, const QString &value); 47 | QString getAttribute(const QString &name) const; 48 | void updateLayout(); 49 | 50 | enum { Type = UserType + 4 }; 51 | int type() const 52 | { 53 | return Type; 54 | } 55 | 56 | 57 | private: 58 | friend class QGVScene; 59 | QGVSubGraph(QGVGraphPrivate* subGraph, QGVScene *scene); 60 | 61 | QGVScene *_scene; 62 | QGVGraphPrivate *_sgraph; 63 | double _height, _width; 64 | QPen _pen; 65 | QBrush _brush; 66 | 67 | QString _label; 68 | QRectF _label_rect; 69 | 70 | QList _nodes; 71 | }; 72 | 73 | #endif // QGVSUBGRAPH_H 74 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVEdge.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #ifndef QGVEDGE_H 19 | #define QGVEDGE_H 20 | 21 | #include "qgv.h" 22 | #include 23 | #include 24 | 25 | class QGVNode; 26 | class QGVScene; 27 | class QGVEdgePrivate; 28 | 29 | /** 30 | * @brief Edge item 31 | * 32 | */ 33 | class QGVCORE_EXPORT QGVEdge : public QGraphicsItem 34 | { 35 | public: 36 | ~QGVEdge(); 37 | 38 | QString label() const; 39 | QRectF boundingRect() const; 40 | QPainterPath shape() const; 41 | 42 | void setLabel(const QString &label); 43 | 44 | void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); 45 | 46 | void setAttribute(const QString &name, const QString &value); 47 | QString getAttribute(const QString &name) const; 48 | 49 | void updateLayout(); 50 | 51 | enum { Type = UserType + 3 }; 52 | int type() const 53 | { 54 | return Type; 55 | } 56 | 57 | private: 58 | QGVEdge(QGVEdgePrivate *edge, QGVScene *scene); 59 | 60 | QPolygonF toArrow(const QLineF &normal) const; 61 | 62 | friend class QGVScene; 63 | //friend class QGVSubGraph; 64 | 65 | QGVScene *_scene; 66 | QGVEdgePrivate* _edge; 67 | 68 | QPainterPath _path; 69 | QPen _pen; 70 | QPolygonF _head_arrow; 71 | QPolygonF _tail_arrow; 72 | 73 | QString _label; 74 | QRectF _label_rect; 75 | }; 76 | 77 | #endif // QGVEDGE_H 78 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/main.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore Sample 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #include "graphvizwrapper.h" 19 | #include 20 | #include 21 | 22 | int main(int argc, char *argv[]) 23 | { 24 | QApplication a(argc, argv); 25 | GraphvizWrapper graph; 26 | 27 | QString s1 = QString::fromUtf8("کیا کر رہے ہو ؟"); 28 | QString s2 = QString::fromUtf8("میرا نام احمد ہے"); 29 | QString s3 = QString::fromUtf8("آخر کار چل ہی گیا"); 30 | 31 | //Add Nodes Like This 32 | graph.addNode(s1,4); 33 | graph.addNode("QML" , 23); 34 | graph.addNode("C#" , 54); 35 | graph.addNode("C++" , 77); 36 | graph.addNode("Java" , 22); 37 | graph.addNode(s3 , 78); 38 | graph.addNode("Scala" , 78); 39 | graph.addNode(s2 , 78); 40 | 41 | //Add Edges Like This 42 | graph.addEdge(s1,"C#",222); 43 | graph.addEdge(s1,"QML",123); 44 | graph.addEdge("QML","C++",400); 45 | graph.addEdge("C#","Scala",29); 46 | graph.addEdge("C#",s3,567); 47 | graph.addEdge("C#","Java",567); 48 | graph.addEdge(s3,s2,567); 49 | graph.addEdge(s3,s3,400); 50 | graph.addEdge(s2,s1,400); 51 | 52 | //Add Attributes Like This 53 | graph.addGraphAttribute("rankdir", "LR"); 54 | graph.addNodeAttribute("style", "filled"); 55 | graph.addNodeAttribute("fillcolor", "yellow"); 56 | graph.addNodeAttribute("height", "0.6"); 57 | graph.addNodeAttribute("margin", "0.1"); 58 | 59 | graph.draw(); 60 | 61 | return a.exec(); 62 | } 63 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVNode.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #ifndef QGVNODE_H 19 | #define QGVNODE_H 20 | 21 | #include "qgv.h" 22 | #include 23 | #include 24 | 25 | class QGVEdge; 26 | class QGVScene; 27 | class QGVNodePrivate; 28 | 29 | /** 30 | * @brief Node item 31 | * 32 | */ 33 | class QGVCORE_EXPORT QGVNode : public QGraphicsItem 34 | { 35 | public: 36 | ~QGVNode(); 37 | 38 | QString label() const; 39 | QString alable; 40 | QString getfrequnecy() const; 41 | void setLabel(const QString &label); 42 | 43 | QRectF boundingRect() const; 44 | void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); 45 | void setAttribute(const QString &label, const QString &value); 46 | QString getAttribute(const QString &name) const; 47 | 48 | void setIcon(const QImage &icon); 49 | 50 | enum { Type = UserType + 2 }; 51 | int type() const 52 | { 53 | return Type; 54 | } 55 | 56 | private: 57 | friend class QGVScene; 58 | friend class QGVSubGraph; 59 | void updateLayout(); 60 | QGVNode(QGVNodePrivate* node, QGVScene *scene); 61 | 62 | // Not implemented in QGVNode.cpp 63 | // QPainterPath makeShape(Agnode_t* node) const; 64 | // QPolygonF makeShapeHelper(Agnode_t* node) const; 65 | 66 | QPainterPath _path; 67 | QPen _pen; 68 | QBrush _brush; 69 | QImage _icon; 70 | int frequency; 71 | QGVScene *_scene; 72 | QGVNodePrivate* _node; 73 | }; 74 | 75 | 76 | #endif // QGVNODE_H 77 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/cmake/modules/FindGraphviz.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find Graphviz cgraph library 2 | # Once done this will define 3 | # 4 | # GRAPHVIZ_FOUND - system has Graphviz installed 5 | # GRAPHVIZ_INCLUDE_DIR 6 | # GRAPHVIZ_GVC_LIBRARY 7 | # GRAPHVIZ_CGRAPH_LIBRARY 8 | # GRAPHVIZ_CDT_LIBRARY 9 | # 10 | # 11 | 12 | if ( GRAPHVIZ_CGRAPH_LIBRARY ) 13 | # in cache already 14 | SET(Graphviz_FIND_QUIETLY TRUE) 15 | endif ( GRAPHVIZ_CGRAPH_LIBRARY ) 16 | 17 | # use pkg-config to get the directories and then use these values 18 | # in the FIND_PATH() and FIND_LIBRARY() calls 19 | if( NOT WIN32 ) 20 | find_package(PkgConfig) 21 | 22 | pkg_check_modules(GRAPHVIZ_GVC_PKG libgvc) 23 | pkg_check_modules(GRAPHVIZ_CGRAPH_PKG libcgraph) 24 | pkg_check_modules(GRAPHVIZ_CDT_PKG libcdt) 25 | 26 | SET(GRAPHVIZ_INCLUDE_DIR ${GRAPHVIZ_CGRAPH_PKG_INCLUDE_DIRS}) 27 | 28 | endif( NOT WIN32 ) 29 | 30 | FIND_LIBRARY(GRAPHVIZ_GVC_LIBRARY NAMES gvc libgvc 31 | PATHS 32 | /usr/lib 33 | /usr/local/lib 34 | HINTS 35 | ${GRAPHVIZ_GVC_PKG_LIBRARY_DIRS} # Generated by pkg-config 36 | ) 37 | IF ( NOT(GRAPHVIZ_GVC_LIBRARY) ) 38 | MESSAGE(STATUS "Could not find libgvc." ) 39 | SET(GRAPHVIZ_GVC_FOUND FALSE) 40 | ELSE () 41 | SET(GRAPHVIZ_GVC_FOUND TRUE) 42 | ENDIF () 43 | 44 | FIND_LIBRARY(GRAPHVIZ_CGRAPH_LIBRARY NAMES cgraph libcgraph 45 | PATHS 46 | /usr/lib 47 | /usr/local/lib 48 | HINTS 49 | ${GRAPHVIZ_CGRAPH_PKG_LIBRARY_DIRS} # Generated by pkg-config 50 | ) 51 | IF ( NOT(GRAPHVIZ_CGRAPH_LIBRARY) ) 52 | MESSAGE(STATUS "Could not find libcgraph." ) 53 | SET(GRAPHVIZ_CGRAPH_FOUND FALSE) 54 | ELSE () 55 | SET(GRAPHVIZ_CGRAPH_FOUND TRUE) 56 | ENDIF () 57 | 58 | FIND_LIBRARY(GRAPHVIZ_CDT_LIBRARY NAMES cdt libcdt 59 | PATHS 60 | /usr/lib 61 | /usr/local/lib 62 | HINTS 63 | ${GRAPHVIZ_CDT_PKG_LIBRARY_DIRS} # Generated by pkg-config 64 | ) 65 | IF ( NOT(GRAPHVIZ_CDT_LIBRARY) ) 66 | MESSAGE(STATUS "Could not find libcdt." ) 67 | SET(GRAPHVIZ_CDT_FOUND FALSE) 68 | ELSE () 69 | SET(GRAPHVIZ_CDT_FOUND TRUE) 70 | ENDIF () 71 | 72 | FIND_LIBRARY(GRAPHVIZ_INCLUDE_DIR NAMES cgraph.h 73 | PATHS 74 | /usr/include 75 | /usr/include/graphviz 76 | /usr/local/include 77 | HINTS 78 | ${GRAPHVIZ_CGRAPH_PKG_INCLUDE_DIRS} # Generated by pkg-config 79 | ) 80 | IF ( NOT(GRAPHVIZ_INCLUDE_DIR) ) 81 | MESSAGE(STATUS "Could not find graphviz headers." ) 82 | ENDIF () 83 | 84 | include(FindPackageHandleStandardArgs) 85 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz_Gvc DEFAULT_MSG GRAPHVIZ_GVC_LIBRARY ) 86 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz_Cgraph DEFAULT_MSG GRAPHVIZ_CGRAPH_LIBRARY ) 87 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz_Cdt DEFAULT_MSG GRAPHVIZ_CDT_LIBRARY ) 88 | FIND_PACKAGE_HANDLE_STANDARD_ARGS("Graphviz Headers" DEFAULT_MSG GRAPHVIZ_INCLUDE_DIR ) 89 | 90 | 91 | # show the POPPLER_(XPDF/QT4)_INCLUDE_DIR and POPPLER_LIBRARIES variables only in the advanced view 92 | MARK_AS_ADVANCED(GRAPHVIZ_INCLUDE_DIR GRAPHVIZ_GVC_LIBRARY GRAPHVIZ_CGRAPH_LIBRARY GRAPHVIZ_CDT_LIBRARY) 93 | 94 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVScene.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #ifndef QGVSCENE_H 19 | #define QGVSCENE_H 20 | 21 | #include "qgv.h" 22 | #include 23 | 24 | class QGVNode; 25 | class QGVEdge; 26 | class QGVSubGraph; 27 | 28 | class QGVGraphPrivate; 29 | class QGVGvcPrivate; 30 | 31 | /** 32 | * @brief GraphViz interactive scene 33 | * 34 | */ 35 | class QGVCORE_EXPORT QGVScene : public QGraphicsScene 36 | { 37 | Q_OBJECT 38 | public: 39 | 40 | explicit QGVScene(const QString &name, QObject *parent = 0); 41 | ~QGVScene(); 42 | 43 | void setGraphAttribute(const QString &name, const QString &value); 44 | void setNodeAttribute(const QString &name, const QString &value); 45 | void setEdgeAttribute(const QString &name, const QString &value); 46 | 47 | QGVNode* addNode(const QString& label , int frequency); 48 | QGVEdge* addEdge(QGVNode* source, QGVNode* target, const QString& label=QString()); 49 | QGVSubGraph* addSubGraph(const QString& name, bool cluster=true); 50 | 51 | void deleteNode(QGVNode *node); 52 | void deleteEdge(QGVEdge *edge); 53 | void deleteSubGraph(QGVSubGraph *subgraph); 54 | 55 | void setRootNode(QGVNode *node); 56 | 57 | void loadLayout(const QString &text); 58 | void applyLayout(); 59 | void clear(); 60 | 61 | 62 | signals: 63 | void nodeContextMenu(QGVNode* node); 64 | void nodeDoubleClick(QGVNode* node); 65 | 66 | void edgeContextMenu(QGVEdge* edge); 67 | void edgeDoubleClick(QGVEdge* edge); 68 | 69 | void subGraphContextMenu(QGVSubGraph* graph); 70 | void subGraphDoubleClick(QGVSubGraph* graph); 71 | 72 | void graphContextMenuEvent(); 73 | 74 | public slots: 75 | 76 | protected: 77 | // virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent * contextMenuEvent); 78 | virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * mouseEvent); 79 | virtual void drawBackground(QPainter * painter, const QRectF & rect); 80 | private: 81 | friend class QGVNode; 82 | friend class QGVEdge; 83 | friend class QGVSubGraph; 84 | 85 | QGVGvcPrivate *_context; 86 | QGVGraphPrivate *_graph; 87 | //QFont _font; 88 | 89 | QList _nodes; 90 | QList _edges; 91 | QList _subGraphs; 92 | }; 93 | 94 | #endif // QGVSCENE_H 95 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/private/QGVCore.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | 19 | #ifndef QGVCORE_H 20 | #define QGVCORE_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | //GraphViz headers 28 | #include 29 | #include 30 | 31 | const qreal DotDefaultDPI = 72.0; 32 | 33 | /** 34 | * @brief GraphViz to GraphicsScene conversions 35 | * 36 | */ 37 | class QGVCore 38 | { 39 | public: 40 | static qreal graphHeight(Agraph_t *graph); 41 | static QPointF toPoint(pointf p, qreal gheight); 42 | static QPointF toPoint(point p, qreal gheight); 43 | static QPointF centerToOrigin(const QPointF &p, qreal width, qreal height); 44 | static QPolygonF toPolygon(const polygon_t* poly, qreal width, qreal height); 45 | 46 | static QPainterPath toPath(const char *type, const polygon_t *poly, qreal width, qreal height); 47 | static QPainterPath toPath(const splines* spl, qreal gheight); 48 | 49 | static Qt::BrushStyle toBrushStyle(const QString &style); 50 | static Qt::PenStyle toPenStyle(const QString &style); 51 | static QColor toColor(const QString &color); 52 | 53 | typedef struct { 54 | const char *data; 55 | int len; 56 | int cur; 57 | } rdr_t; 58 | 59 | static int memiofread(void *chan, char *buf, int bufsize) 60 | { 61 | const char *ptr; 62 | char *optr; 63 | char c; 64 | int l; 65 | rdr_t *s; 66 | 67 | if (bufsize == 0) return 0; 68 | s = (rdr_t *) chan; 69 | if (s->cur >= s->len) 70 | return 0; 71 | l = 0; 72 | ptr = s->data + s->cur; 73 | optr = buf; 74 | do { 75 | *optr++ = c = *ptr++; 76 | l++; 77 | } while (c && (c != '\n') && (l < bufsize)); 78 | s->cur += l; 79 | return l; 80 | } 81 | 82 | static Agraph_t *agmemread2(const char *cp) 83 | { 84 | Agraph_t* g; 85 | rdr_t rdr; 86 | Agdisc_t disc; 87 | Agiodisc_t memIoDisc; 88 | 89 | memIoDisc.afread = memiofread; 90 | memIoDisc.putstr = AgIoDisc.putstr; 91 | memIoDisc.flush = AgIoDisc.flush; 92 | rdr.data = cp; 93 | rdr.len = strlen(cp); 94 | rdr.cur = 0; 95 | 96 | disc.mem = &AgMemDisc; 97 | disc.id = &AgIdDisc; 98 | disc.io = &memIoDisc; 99 | g = agread (&rdr, &disc); 100 | return g; 101 | } 102 | }; 103 | 104 | #endif // QGVCORE_H 105 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVNode.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | QGVNode::QGVNode(QGVNodePrivate *node, QGVScene *scene): _scene(scene), _node(node) 27 | { 28 | setFlag(QGraphicsItem::ItemIsSelectable, true); 29 | } 30 | 31 | QGVNode::~QGVNode() 32 | { 33 | _scene->removeItem(this); 34 | delete _node; 35 | } 36 | 37 | QString QGVNode::label() const 38 | { 39 | return getAttribute("label"); 40 | } 41 | 42 | QString QGVNode::getfrequnecy() const 43 | { 44 | return QString::number(frequency); 45 | } 46 | 47 | void QGVNode::setLabel(const QString &label) 48 | { 49 | setAttribute("label", label); 50 | } 51 | 52 | QRectF QGVNode::boundingRect() const 53 | { 54 | return _path.boundingRect(); 55 | } 56 | 57 | void QGVNode::paint(QPainter * painter, const QStyleOptionGraphicsItem *, QWidget *) 58 | { 59 | painter->save(); 60 | 61 | painter->setPen(_pen); 62 | 63 | if(isSelected()) 64 | { 65 | QBrush tbrush(_brush); 66 | tbrush.setColor(tbrush.color().darker(120)); 67 | painter->setBrush(tbrush); 68 | } 69 | else 70 | painter->setBrush(_brush); 71 | 72 | painter->drawPath(_path); 73 | 74 | painter->setPen(QGVCore::toColor(getAttribute("labelfontcolor"))); 75 | 76 | const QRectF rect = boundingRect().adjusted(2,2,-2,-2); //Margin 77 | 78 | painter->drawText(rect, Qt::AlignCenter , alable); 79 | painter->drawText(rect, Qt::AlignTop | Qt::AlignHCenter, QGVNode::getfrequnecy()); 80 | painter->restore(); 81 | } 82 | 83 | void QGVNode::setAttribute(const QString &name, const QString &value) 84 | { 85 | char empty[] = ""; 86 | agsafeset(_node->node(), name.toLocal8Bit().data(), value.toLocal8Bit().data(), empty); 87 | } 88 | 89 | QString QGVNode::getAttribute(const QString &name) const 90 | { 91 | char* value = agget(_node->node(), name.toLocal8Bit().data()); 92 | if(value) 93 | return value; 94 | return QString(); 95 | } 96 | 97 | void QGVNode::setIcon(const QImage &icon) 98 | { 99 | _icon = icon; 100 | } 101 | 102 | void QGVNode::updateLayout() 103 | { 104 | prepareGeometryChange(); 105 | qreal width = ND_width(_node->node())*DotDefaultDPI; 106 | qreal height = ND_height(_node->node())*DotDefaultDPI; 107 | 108 | //Node Position (center) 109 | qreal gheight = QGVCore::graphHeight(_scene->_graph->graph()); 110 | setPos(QGVCore::centerToOrigin(QGVCore::toPoint(ND_coord(_node->node()), gheight), width, height)); 111 | 112 | //Node on top 113 | setZValue(1); 114 | 115 | //Node path 116 | _path = QGVCore::toPath(ND_shape(_node->node())->name, (polygon_t*)ND_shape_info(_node->node()), width, height); 117 | _pen.setWidth(1); 118 | 119 | _brush.setStyle(QGVCore::toBrushStyle(getAttribute("style"))); 120 | _brush.setColor(QGVCore::toColor(getAttribute("fillcolor"))); 121 | _pen.setColor(QGVCore::toColor(getAttribute("color"))); 122 | 123 | setToolTip(getAttribute("tooltip")); 124 | } 125 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVSubGraph.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #include "QGVSubGraph.h" 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | QGVSubGraph::QGVSubGraph(QGVGraphPrivate *subGraph, QGVScene *scene): _scene(scene), _sgraph(subGraph) 28 | { 29 | //setFlag(QGraphicsItem::ItemIsSelectable, true); 30 | } 31 | 32 | QGVSubGraph::~QGVSubGraph() 33 | { 34 | _scene->removeItem(this); 35 | delete _sgraph; 36 | } 37 | 38 | QString QGVSubGraph::name() const 39 | { 40 | return QString::fromLocal8Bit(GD_label(_sgraph->graph())->text); 41 | } 42 | 43 | QGVNode *QGVSubGraph::addNode(const QString &label) 44 | { 45 | Agnode_t *node = agnode(_sgraph->graph(), NULL, TRUE); 46 | if(node == NULL) 47 | { 48 | qWarning()<<"Invalid sub node :"<graph(), node, TRUE); 52 | 53 | QGVNode *item = new QGVNode(new QGVNodePrivate(node, _sgraph->graph()), _scene); 54 | item->setLabel(label); 55 | _scene->addItem(item); 56 | _scene->_nodes.append(item); 57 | _nodes.append(item); 58 | return item; 59 | } 60 | 61 | QGVSubGraph *QGVSubGraph::addSubGraph(const QString &name, bool cluster) 62 | { 63 | Agraph_t* sgraph; 64 | if(cluster) 65 | sgraph = agsubg(_sgraph->graph(), ("cluster_" + name).toLocal8Bit().data(), TRUE); 66 | else 67 | sgraph = agsubg(_sgraph->graph(), name.toLocal8Bit().data(), TRUE); 68 | 69 | if(sgraph == NULL) 70 | { 71 | qWarning()<<"Invalid subGraph :"<_subGraphs.append(item); 77 | _scene->addItem(item); 78 | return item; 79 | } 80 | 81 | QRectF QGVSubGraph::boundingRect() const 82 | { 83 | return QRectF(0,0, _width, _height); 84 | } 85 | 86 | void QGVSubGraph::paint(QPainter * painter, const QStyleOptionGraphicsItem *, QWidget *) 87 | { 88 | painter->save(); 89 | 90 | painter->setPen(_pen); 91 | painter->setBrush(_brush); 92 | 93 | painter->drawRect(boundingRect()); 94 | painter->drawText(_label_rect, Qt::AlignCenter, _label); 95 | painter->restore(); 96 | } 97 | 98 | void QGVSubGraph::setAttribute(const QString &name, const QString &value) 99 | { 100 | char empty[] = ""; 101 | agsafeset(_sgraph->graph(), name.toLocal8Bit().data(), value.toLocal8Bit().data(), empty); 102 | } 103 | 104 | QString QGVSubGraph::getAttribute(const QString &name) const 105 | { 106 | char* value = agget(_sgraph->graph(), name.toLocal8Bit().data()); 107 | if(value) 108 | return value; 109 | return QString(); 110 | } 111 | 112 | void QGVSubGraph::updateLayout() 113 | { 114 | prepareGeometryChange(); 115 | 116 | //SubGraph box 117 | boxf box = GD_bb(_sgraph->graph()); 118 | pointf p1 = box.UR; 119 | pointf p2 = box.LL; 120 | _width = p1.x - p2.x; 121 | _height = p1.y - p2.y; 122 | 123 | qreal gheight = QGVCore::graphHeight(_scene->_graph->graph()); 124 | setPos(p2.x, gheight - p1.y); 125 | 126 | _pen.setWidth(1); 127 | _brush.setStyle(QGVCore::toBrushStyle(getAttribute("style"))); 128 | _brush.setColor(QGVCore::toColor(getAttribute("fillcolor"))); 129 | _pen.setColor(QGVCore::toColor(getAttribute("color"))); 130 | 131 | //SubGraph label 132 | textlabel_t *xlabel = GD_label(_sgraph->graph()); 133 | if(xlabel) 134 | { 135 | _label = xlabel->text; 136 | _label_rect.setSize(QSize(xlabel->dimen.x, xlabel->dimen.y)); 137 | _label_rect.moveCenter(QGVCore::toPoint(xlabel->pos, QGVCore::graphHeight(_scene->_graph->graph())) - pos()); 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # enable all QT-Stuff we need 2 | # see http://cmake.org/cmake/help/cmake2.6docs.html#module:FindQt4 for a complete list 3 | 4 | SET(qgvlib_TS 5 | ) 6 | 7 | SET(qgvlib_UI 8 | 9 | ) 10 | 11 | # all files which may be mocced 12 | SET(qgvlib_CPP 13 | private/QGVCore.cpp 14 | private/QGVGraphPrivate.cpp 15 | private/QGVEdgePrivate.cpp 16 | private/QGVGvcPrivate.cpp 17 | private/QGVNodePrivate.cpp 18 | QGVEdge.cpp 19 | QGVNode.cpp 20 | QGVScene.cpp 21 | QGVSubGraph.cpp 22 | ) 23 | 24 | SET(TARGET_NAME "QGVCore") 25 | 26 | # include with QT_USE selected library parts 27 | INCLUDE(${QT_USE_FILE}) 28 | 29 | INCLUDE_DIRECTORIES( 30 | ${GRAPHVIZ_INCLUDE_DIR} 31 | ${CMAKE_CURRENT_BINARY_DIR} 32 | ${CMAKE_CURRENT_SOURCE_DIR} 33 | ${CMAKE_CURRENT_SOURCE_DIR}/private 34 | ${CMAKE_CURRENT_BINARY_DIR}/private 35 | 36 | ) 37 | # Activate Export macro for building the library itself 38 | # if QGVCORE_LIB is not set or equal 0 (null), import macro is used 39 | ADD_DEFINITIONS(-DQGVCORE_LIB -D_PACKAGE_ast -D_dll_import -D_BLD_cdt -D_DLL_BLD) 40 | 41 | IF(BINDINGS_QT4) 42 | # QT5 does not declare and does not need QT_INCLUDES 43 | SET(INCLUDE_DIRECTORIES ${INCLUDES_DIRECTORIES} ${QT_INCLUDES}) 44 | INCLUDE(${QT_USE_FILE}) 45 | ENDIF(BINDINGS_QT4) 46 | ADD_DEFINITIONS(-DQVGCORE_LIB) 47 | 48 | IF(BINDINGS_QT4) 49 | QT4_AUTOMOC(${qgvlib_CPP}) 50 | QT4_WRAP_UI(qgvlib_UI_H ${qgvlib_UI}) 51 | QT4_ADD_TRANSLATION(qgvlib_TRANS ${qgvlib_TS}) 52 | # -binary is not working 53 | # QT4_ADD_RESOURCES(RCCS "${QRCS}" OPTIONS "-binary") 54 | # QT4_ADD_RESOURCES(qgvlib_RCCS ${qgvlib_QRC}) 55 | ENDIF(BINDINGS_QT4) 56 | IF(BINDINGS_QT5) 57 | QT5_WRAP_UI(qgvlib_UI_H ${qgvlib_UI}) 58 | QT5_ADD_TRANSLATION(qgvlib_TRANS ${qgvlib_TS}) 59 | QT5_ADD_RESOURCES(qgvlib_RCCS ${qgvlib_QRC}) 60 | ENDIF(BINDINGS_QT5) 61 | 62 | ADD_LIBRARY(qgvcore SHARED 63 | ${qgvlib_CPP} 64 | ${qgvlib_UI_H} 65 | ${qgvlib_TRANS} 66 | ) 67 | 68 | TARGET_LINK_LIBRARIES(qgvcore 69 | ${QT_LIBRARIES} 70 | ${GRAPHVIZ_GVC_LIBRARY} 71 | ${GRAPHVIZ_CGRAPH_LIBRARY} 72 | ${GRAPHVIZ_CDT_LIBRARY} 73 | ) 74 | 75 | IF(BINDINGS_QT5) 76 | qt5_use_modules(QVGCore Core Widgets) 77 | ENDIF(BINDINGS_QT5) 78 | 79 | SET_TARGET_PROPERTIES(qgvcore PROPERTIES 80 | OUTPUT_NAME "QGVCore" 81 | VERSION ${TARGET_VERSION_MAJOR}.${TARGET_VERSION_MINOR}.${${PROJECT_NAME}_PATCH_LEVEL} 82 | SOVERSION ${TARGET_VERSION_MAJOR}) 83 | IF(WIN32) 84 | # this extra install command is needed by the nsis installer 85 | INSTALL(TARGETS qgvcore 86 | RUNTIME DESTINATION ${LIB_INSTALL_DIR} 87 | COMPONENT library 88 | ) 89 | ELSE(WIN32) 90 | INSTALL(TARGETS qgvcore 91 | ARCHIVE DESTINATION ${LIB_INSTALL_DIR} 92 | LIBRARY DESTINATION ${LIB_INSTALL_DIR} 93 | COMPONENT library 94 | ) 95 | ENDIF(WIN32) 96 | 97 | # The COMPONENT option only defines the internal belonging of the INSTALL'ed thing 98 | # INSTALL( 99 | # FILES ${qgvlib_TRANS} 100 | # DESTINATION ${qm_DIR} 101 | # COMPONENT library 102 | # ) 103 | 104 | configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_NAME}.pc.in 105 | ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.pc @ONLY) 106 | configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_NAME}-uninstalled.pc.in 107 | ${CMAKE_BINARY_DIR}/${TARGET_NAME}-uninstalled.pc @ONLY) 108 | 109 | INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.pc 110 | DESTINATION lib/pkgconfig) 111 | 112 | IF(WIN32) 113 | # QuaZip 114 | # FIND_FILE(PACK_zlib zlib.dll PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH) 115 | # INSTALL(FILES ${QUAZIP_LIBRARIES} ${PACK_zlib} DESTINATION ${bin_DIR} COMPONENT library) 116 | 117 | # Qt itself 118 | FIND_FILE(PACK_qtcore QtCore4.dll PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH) 119 | FIND_FILE(PACK_qtgui QtGui4.dll PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH) 120 | 121 | FIND_FILE(PACK_mingwm10 mingwm10.dll PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH) 122 | FIND_FILE(PACK_libgcc_s_dw libgcc_s_dw2-1.dll PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH) 123 | 124 | INSTALL( 125 | FILES 126 | ${PACK_qtcore} 127 | ${PACK_qtgui} 128 | # ${PACK_qtnetwork} 129 | # ${PACK_qtsql} 130 | # ${PACK_libmysql} 131 | # ${PACK_qtxml} 132 | # ${PACK_qtxml_patterns} 133 | ${PACK_mingwm10} 134 | ${PACK_libgcc_s_dw} 135 | DESTINATION ${bin_DIR} 136 | COMPONENT qtlibs 137 | ) 138 | 139 | INSTALL( 140 | FILES 141 | ${GRAPHVIZ_GVC_LIBRARY} 142 | ${GRAPHVIZ_CGRAPH_LIBRARY} 143 | ${GRAPHVIZ_CDT_LIBRARY} 144 | DESTINATION ${bin_DIR} 145 | COMPONENT graphvizlibs 146 | ) 147 | ENDIF(WIN32) 148 | 149 | IF(BUILD_DEV) 150 | FILE(GLOB header "${CMAKE_CURRENT_SOURCE_DIR}/*.h") 151 | INSTALL( 152 | FILES ${header} 153 | DESTINATION ${include_DIR} 154 | COMPONENT headerfiles 155 | ) 156 | ENDIF(BUILD_DEV) 157 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVEdge.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | QGVEdge::QGVEdge(QGVEdgePrivate *edge, QGVScene *scene) : _scene(scene), _edge(edge) 27 | { 28 | setFlag(QGraphicsItem::ItemIsSelectable, true); 29 | } 30 | 31 | QGVEdge::~QGVEdge() 32 | { 33 | _scene->removeItem(this); 34 | delete _edge; 35 | } 36 | 37 | QString QGVEdge::label() const 38 | { 39 | return getAttribute("xlabel"); 40 | } 41 | 42 | QRectF QGVEdge::boundingRect() const 43 | { 44 | return _path.boundingRect() | _head_arrow.boundingRect() | _tail_arrow.boundingRect() | _label_rect; 45 | } 46 | 47 | QPainterPath QGVEdge::shape() const 48 | { 49 | QPainterPathStroker ps; 50 | ps.setCapStyle(_pen.capStyle()); 51 | ps.setWidth(_pen.widthF() + 10); 52 | ps.setJoinStyle(_pen.joinStyle()); 53 | ps.setMiterLimit(_pen.miterLimit()); 54 | return ps.createStroke(_path); 55 | } 56 | 57 | void QGVEdge::setLabel(const QString &label) 58 | { 59 | setAttribute("xlabel", label); 60 | } 61 | 62 | void QGVEdge::paint(QPainter * painter, const QStyleOptionGraphicsItem *, QWidget *) 63 | { 64 | painter->save(); 65 | 66 | if(isSelected()) 67 | { 68 | QPen tpen(_pen); 69 | tpen.setColor(_pen.color().darker(120)); 70 | tpen.setStyle(Qt::DotLine); 71 | painter->setPen(tpen); 72 | } 73 | else 74 | painter->setPen(_pen); 75 | 76 | 77 | painter->drawPath(_path); 78 | 79 | /* 80 | QRectF pp = _path.controlPointRect(); 81 | if(pp.width() < pp.height()) 82 | { 83 | painter->save(); 84 | painter->translate(_label_rect.topLeft()); 85 | painter->rotate(90); 86 | painter->drawText(QRectF(QPointF(0, -_label_rect.width()), _label_rect.size()), Qt::AlignCenter, _label); 87 | painter->restore(); 88 | } 89 | else 90 | */ 91 | painter->drawText(_label_rect, Qt::AlignHCenter, _label); 92 | 93 | painter->setBrush(QBrush(_pen.color(), Qt::SolidPattern)); 94 | painter->drawPolygon(_head_arrow); 95 | painter->drawPolygon(_tail_arrow); 96 | painter->restore(); 97 | } 98 | 99 | void QGVEdge::setAttribute(const QString &name, const QString &value) 100 | { 101 | char empty[] = ""; 102 | agsafeset(_edge->edge(), name.toLocal8Bit().data(), value.toLocal8Bit().data(), empty); 103 | } 104 | 105 | QString QGVEdge::getAttribute(const QString &name) const 106 | { 107 | char* value = agget(_edge->edge(), name.toLocal8Bit().data()); 108 | if(value) 109 | return value; 110 | return QString(); 111 | } 112 | 113 | void QGVEdge::updateLayout() 114 | { 115 | prepareGeometryChange(); 116 | 117 | qreal gheight = QGVCore::graphHeight(_scene->_graph->graph()); 118 | 119 | const splines* spl = ED_spl(_edge->edge()); 120 | _path = QGVCore::toPath(spl, gheight); 121 | 122 | 123 | //Edge arrows 124 | if((spl->list != 0) && (spl->list->size%3 == 1)) 125 | { 126 | if(spl->list->sflag) 127 | { 128 | _tail_arrow = toArrow(QLineF(QGVCore::toPoint(spl->list->list[0], gheight), QGVCore::toPoint(spl->list->sp, gheight))); 129 | } 130 | 131 | if(spl->list->eflag) 132 | { 133 | _head_arrow = toArrow(QLineF(QGVCore::toPoint(spl->list->list[spl->list->size-1], gheight), QGVCore::toPoint(spl->list->ep, gheight))); 134 | } 135 | } 136 | 137 | _pen.setWidth(1); 138 | _pen.setColor(QGVCore::toColor(getAttribute("color"))); 139 | _pen.setStyle(QGVCore::toPenStyle(getAttribute("style"))); 140 | 141 | //Edge label 142 | textlabel_t *xlabel = ED_xlabel(_edge->edge()); 143 | if(xlabel) 144 | { 145 | _label = xlabel->text; 146 | _label_rect.setSize(QSize(xlabel->dimen.x, xlabel->dimen.y)); 147 | _label_rect.moveCenter(QGVCore::toPoint(xlabel->pos, QGVCore::graphHeight(_scene->_graph->graph()))); 148 | } 149 | 150 | setToolTip(getAttribute("tooltip")); 151 | } 152 | 153 | QPolygonF QGVEdge::toArrow(const QLineF &line) const 154 | { 155 | QLineF n = line.normalVector(); 156 | QPointF o(n.dx() / 3.0, n.dy() / 3.0); 157 | 158 | //Only support normal arrow type 159 | QPolygonF polygon; 160 | polygon.append(line.p1() + o); 161 | polygon.append(line.p2()); 162 | polygon.append(line.p1() - o); 163 | 164 | return polygon; 165 | } 166 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/Sample/MainWindow.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore Sample 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #include "MainWindow.h" 19 | #include "moc_MainWindow.cpp" 20 | #include "ui_MainWindow.h" 21 | #include "QGVScene.h" 22 | #include "QGVNode.h" 23 | #include "QGVEdge.h" 24 | #include "QGVSubGraph.h" 25 | #include 26 | 27 | MainWindow::MainWindow(QWidget *parent) : 28 | QMainWindow(parent), 29 | ui(new Ui::MainWindow) 30 | { 31 | ui->setupUi(this); 32 | 33 | _scene = new QGVScene("DEMO", this); 34 | ui->graphicsView->setScene(_scene); 35 | 36 | connect(_scene, SIGNAL(nodeContextMenu(QGVNode*)), SLOT(nodeContextMenu(QGVNode*))); 37 | connect(_scene, SIGNAL(nodeDoubleClick(QGVNode*)), SLOT(nodeDoubleClick(QGVNode*))); 38 | } 39 | 40 | MainWindow::~MainWindow() 41 | { 42 | delete ui; 43 | } 44 | 45 | void MainWindow::drawGraph() 46 | { 47 | /* 48 | _scene->loadLayout("digraph test{node [style=filled,fillcolor=white];N1 -> N2;N2 -> N3;N3 -> N4;N4 -> N1;}"); 49 | connect(_scene, SIGNAL(nodeContextMenu(QGVNode*)), SLOT(nodeContextMenu(QGVNode*))); 50 | connect(_scene, SIGNAL(nodeDoubleClick(QGVNode*)), SLOT(nodeDoubleClick(QGVNode*))); 51 | ui->graphicsView->setScene(_scene); 52 | return; 53 | */ 54 | 55 | //Configure scene attributes 56 | _scene->setGraphAttribute("label", "DEMO"); 57 | 58 | _scene->setGraphAttribute("splines", "ortho"); 59 | _scene->setGraphAttribute("rankdir", "LR"); 60 | //_scene->setGraphAttribute("concentrate", "true"); //Error ! 61 | _scene->setGraphAttribute("nodesep", "0.4"); 62 | 63 | _scene->setNodeAttribute("shape", "box"); 64 | _scene->setNodeAttribute("style", "filled"); 65 | _scene->setNodeAttribute("fillcolor", "white"); 66 | _scene->setNodeAttribute("height", "1.2"); 67 | _scene->setEdgeAttribute("minlen", "3"); 68 | //_scene->setEdgeAttribute("dir", "both"); 69 | 70 | //Add some nodes 71 | QGVNode *node1 = _scene->addNode("B",45); 72 | //node1->setIcon(QImage(":/icons/Gnome-System-Run-64.png")); 73 | QGVNode *node2 = _scene->addNode("SERVER0" , 34); 74 | //node2->setIcon(QImage(":/icons/Gnome-Network-Transmit-64.png")); 75 | /* QGVNode *node3 = _scene->addNode("SERVER1"); 76 | node3->setIcon(QImage(":/icons/Gnome-Network-Transmit-64.png")); 77 | QGVNode *node4 = _scene->addNode("USER"); 78 | node4->setIcon(QImage(":/icons/Gnome-Stock-Person-64.png")); 79 | QGVNode *node5 = _scene->addNode("SWITCH"); 80 | node5->setIcon(QImage(":/icons/Gnome-Network-Server-64.png")); 81 | */ 82 | //Add some edges 83 | _scene->addEdge(node1, node2, "TTL")->setAttribute("color", "red"); 84 | _scene->addEdge(node1, node2, "SERIAL"); 85 | /*_scene->addEdge(node1, node3, "RAZ")->setAttribute("color", "blue"); 86 | _scene->addEdge(node2, node3, "SECU"); 87 | 88 | _scene->addEdge(node2, node4, "STATUS")->setAttribute("color", "red"); 89 | 90 | _scene->addEdge(node4, node3, "ACK")->setAttribute("color", "red"); 91 | 92 | _scene->addEdge(node4, node2, "TBIT"); 93 | _scene->addEdge(node4, node2, "ETH"); 94 | _scene->addEdge(node4, node2, "RS232"); 95 | 96 | _scene->addEdge(node4, node5, "ETH1"); 97 | _scene->addEdge(node2, node5, "ETH2"); 98 | 99 | QGVSubGraph *sgraph = _scene->addSubGraph("SUB1"); 100 | sgraph->setAttribute("label", "OFFICE"); 101 | 102 | QGVNode *snode1 = sgraph->addNode("PC0152"); 103 | QGVNode *snode2 = sgraph->addNode("PC0153"); 104 | 105 | _scene->addEdge(snode1, snode2, "RT7"); 106 | 107 | _scene->addEdge(node3, snode1, "GB8"); 108 | _scene->addEdge(node3, snode2, "TS9"); 109 | 110 | 111 | QGVSubGraph *ssgraph = sgraph->addSubGraph("SUB2"); 112 | ssgraph->setAttribute("label", "DESK"); 113 | _scene->addEdge(snode1, ssgraph->addNode("PC0155"), "S10"); 114 | */ 115 | //Layout scene 116 | _scene->applyLayout(); 117 | 118 | //Fit in view 119 | ui->graphicsView->fitInView(_scene->sceneRect(), Qt::KeepAspectRatio); 120 | 121 | } 122 | 123 | void MainWindow::FitAndChangeShapeToRect() 124 | { 125 | ui->graphicsView->fitInView(_scene->sceneRect(), Qt::KeepAspectRatio); 126 | } 127 | 128 | void MainWindow::nodeContextMenu(QGVNode *node) 129 | { 130 | //Context menu exemple 131 | QMenu menu(node->label()); 132 | 133 | menu.addSeparator(); 134 | menu.addAction(tr("Informations")); 135 | menu.addAction(tr("Options")); 136 | 137 | QAction *action = menu.exec(QCursor::pos()); 138 | if(action == 0) 139 | return; 140 | } 141 | 142 | void MainWindow::nodeDoubleClick(QGVNode *node) 143 | { 144 | QMessageBox::information(this, tr("Node double clicked"), tr("Node %1").arg(node->label())); 145 | } 146 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGVCore/QGVScene.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | QGVCore 3 | Copyright (c) 2014, Bergont Nicolas, All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 3.0 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library. 17 | ***************************************************************/ 18 | #include "QGVScene.h" 19 | // The following include allows the automoc to detect, that it must moc this class 20 | #include "moc_QGVScene.cpp" 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | QGVScene::QGVScene(const QString &name, QObject *parent) : QGraphicsScene(parent) 35 | { 36 | _context = new QGVGvcPrivate(gvContext()); 37 | _graph = new QGVGraphPrivate(agopen(name.toLocal8Bit().data(), Agdirected, NULL)); 38 | //setGraphAttribute("fontname", QFont().family()); 39 | } 40 | 41 | QGVScene::~QGVScene() 42 | { 43 | gvFreeLayout(_context->context(), _graph->graph()); 44 | agclose(_graph->graph()); 45 | gvFreeContext(_context->context()); 46 | delete _graph; 47 | delete _context; 48 | } 49 | 50 | void QGVScene::setGraphAttribute(const QString &name, const QString &value) 51 | { 52 | agattr(_graph->graph(), AGRAPH, name.toLocal8Bit().data(), value.toLocal8Bit().data()); 53 | } 54 | 55 | void QGVScene::setNodeAttribute(const QString &name, const QString &value) 56 | { 57 | agattr(_graph->graph(), AGNODE, name.toLocal8Bit().data(), value.toLocal8Bit().data()); 58 | } 59 | 60 | void QGVScene::setEdgeAttribute(const QString &name, const QString &value) 61 | { 62 | agattr(_graph->graph(), AGEDGE, name.toLocal8Bit().data(), value.toLocal8Bit().data()); 63 | } 64 | 65 | QGVNode *QGVScene::addNode(const QString &label , int frequency) 66 | { 67 | Agnode_t *node = agnode(_graph->graph(), NULL, TRUE); 68 | if(node == NULL) 69 | { 70 | qWarning()<<"Invalid node :"<graph()), this); 74 | item->setLabel(label); 75 | item->alable = label; 76 | item->frequency = frequency; 77 | addItem(item); 78 | _nodes.append(item); 79 | return item; 80 | } 81 | 82 | QGVEdge *QGVScene::addEdge(QGVNode *source, QGVNode *target, const QString &label) 83 | { 84 | Agedge_t* edge = agedge(_graph->graph(), source->_node->node(), target->_node->node(), NULL, TRUE); 85 | if(edge == NULL) 86 | { 87 | qWarning()<<"Invalid egde :"<setLabel(label); 93 | addItem(item); 94 | _edges.append(item); 95 | return item; 96 | } 97 | 98 | QGVSubGraph *QGVScene::addSubGraph(const QString &name, bool cluster) 99 | { 100 | Agraph_t* sgraph; 101 | if(cluster) 102 | sgraph = agsubg(_graph->graph(), ("cluster_" + name).toLocal8Bit().data(), TRUE); 103 | else 104 | sgraph = agsubg(_graph->graph(), name.toLocal8Bit().data(), TRUE); 105 | 106 | if(sgraph == NULL) 107 | { 108 | qWarning()<<"Invalid subGraph :"<::iterator it = std::find(_nodes.begin(), _nodes.end(), node); 121 | if(it == _nodes.end()) 122 | { 123 | std::cout << "Error, node not part of Scene" << std::endl; 124 | return; 125 | } 126 | std::cout << "delNode ret " << agdelnode(node->_node->graph(), node->_node->node()) << std::endl;; 127 | _nodes.erase(it); 128 | delete node; 129 | } 130 | 131 | void QGVScene::deleteEdge(QGVEdge* edge) 132 | { 133 | std::cout << "delEdge ret " << agdeledge(_graph->graph(), edge->_edge->edge()) << std::endl; 134 | QList::iterator it = std::find(_edges.begin(), _edges.end(), edge); 135 | if(it == _edges.end()) 136 | { 137 | std::cout << "Error, QGVEdge not part of Scene" << std::endl; 138 | return; 139 | } 140 | _edges.erase(it); 141 | delete edge; 142 | } 143 | 144 | void QGVScene::deleteSubGraph(QGVSubGraph *subgraph) 145 | { 146 | std::cout << "Removing sug " << subgraph->_sgraph->graph() << std::endl; 147 | std::cout << "delSubg ret " << agclose(subgraph->_sgraph->graph()) << std::endl; 148 | QList::iterator it = std::find(_subGraphs.begin(), _subGraphs.end(), subgraph); 149 | if(it == _subGraphs.end()) 150 | { 151 | std::cout << "Error, QGVSubGraph not part of Scene" << std::endl; 152 | return; 153 | } 154 | _subGraphs.erase(it); 155 | 156 | delete subgraph; 157 | } 158 | 159 | void QGVScene::setRootNode(QGVNode *node) 160 | { 161 | Q_ASSERT(_nodes.contains(node)); 162 | char root[] = "root"; 163 | agset(_graph->graph(), root, node->label().toLocal8Bit().data()); 164 | } 165 | 166 | void QGVScene::loadLayout(const QString &text) 167 | { 168 | _graph->setGraph(QGVCore::agmemread2(text.toLocal8Bit().constData())); 169 | 170 | if(gvLayout(_context->context(), _graph->graph(), "dot") != 0) 171 | { 172 | qCritical()<<"Layout render error"<context(), _graph->graph(), "png", "debug.png"); 178 | 179 | //Read nodes and edges 180 | for (Agnode_t* node = agfstnode(_graph->graph()); node != NULL; node = agnxtnode(_graph->graph(), node)) 181 | { 182 | QGVNode *inode = new QGVNode(new QGVNodePrivate(node, _graph->graph()), this); 183 | inode->updateLayout(); 184 | addItem(inode); 185 | for (Agedge_t* edge = agfstout(_graph->graph(), node); edge != NULL; edge = agnxtout(_graph->graph(), edge)) 186 | { 187 | QGVEdge *iedge = new QGVEdge(new QGVEdgePrivate(edge), this); 188 | iedge->updateLayout(); 189 | addItem(iedge); 190 | } 191 | 192 | } 193 | update(); 194 | } 195 | 196 | void QGVScene::applyLayout() 197 | { 198 | if(gvLayout(_context->context(), _graph->graph(), "dot") != 0) 199 | { 200 | /* 201 | * Si plantage ici : 202 | * - Verifier que les dll sont dans le repertoire d'execution 203 | * - Verifie que le fichier "configN" est dans le repertoire d'execution ! 204 | */ 205 | qCritical()<<"Layout render error"<context(), _graph->graph(), "canon", "debug.dot"); 211 | //gvRenderFilename(_context->context(), _graph->graph(), "png", "debug.png"); 212 | 213 | //Update items layout 214 | foreach(QGVNode* node, _nodes) 215 | node->updateLayout(); 216 | 217 | foreach(QGVEdge* edge, _edges) 218 | edge->updateLayout(); 219 | 220 | foreach(QGVSubGraph* sgraph, _subGraphs) 221 | sgraph->updateLayout(); 222 | 223 | //Graph label 224 | textlabel_t *xlabel = GD_label(_graph->graph()); 225 | if(xlabel) 226 | { 227 | QGraphicsTextItem *item = addText(xlabel->text); 228 | item->setPos(QGVCore::centerToOrigin(QGVCore::toPoint(xlabel->pos, QGVCore::graphHeight(_graph->graph())), xlabel->dimen.x, -4)); 229 | } 230 | 231 | gvFreeLayout(_context->context(), _graph->graph()); 232 | 233 | update(); 234 | } 235 | 236 | void QGVScene::clear() 237 | { 238 | gvFreeLayout(_context->context(), _graph->graph()); 239 | _nodes.clear(); 240 | _edges.clear(); 241 | _subGraphs.clear(); 242 | QGraphicsScene::clear(); 243 | } 244 | 245 | #include 246 | /*void QGVScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *contextMenuEvent) 247 | { 248 | QGraphicsItem *item = itemAt(contextMenuEvent->scenePos(), QTransform()); 249 | if(item) 250 | { 251 | item->setSelected(true); 252 | if(item->type() == QGVNode::Type) 253 | emit nodeContextMenu(qgraphicsitem_cast(item)); 254 | else if(item->type() == QGVEdge::Type) 255 | emit edgeContextMenu(qgraphicsitem_cast(item)); 256 | else if(item->type() == QGVSubGraph::Type) 257 | emit subGraphContextMenu(qgraphicsitem_cast(item)); 258 | else 259 | emit graphContextMenuEvent(); 260 | } 261 | QGraphicsScene::contextMenuEvent(contextMenuEvent); 262 | } 263 | */ 264 | void QGVScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *mouseEvent) 265 | { 266 | QGraphicsItem *item = itemAt(mouseEvent->scenePos(), QTransform()); 267 | if(item) 268 | { 269 | if(item->type() == QGVNode::Type) 270 | emit nodeDoubleClick(qgraphicsitem_cast(item)); 271 | else if(item->type() == QGVEdge::Type) 272 | emit edgeDoubleClick(qgraphicsitem_cast(item)); 273 | else if(item->type() == QGVSubGraph::Type) 274 | emit subGraphDoubleClick(qgraphicsitem_cast(item)); 275 | } 276 | QGraphicsScene::mouseDoubleClickEvent(mouseEvent); 277 | } 278 | 279 | #include 280 | #include 281 | void QGVScene::drawBackground(QPainter * painter, const QRectF & rect) 282 | { 283 | const int gridSize = 25; 284 | 285 | const qreal left = int(rect.left()) - (int(rect.left()) % gridSize); 286 | const qreal top = int(rect.top()) - (int(rect.top()) % gridSize); 287 | 288 | QVarLengthArray lines; 289 | 290 | for (qreal x = left; x < rect.right(); x += gridSize) 291 | lines.append(QLineF(x, rect.top(), x, rect.bottom())); 292 | for (qreal y = top; y < rect.bottom(); y += gridSize) 293 | lines.append(QLineF(rect.left(), y, rect.right(), y)); 294 | 295 | painter->setRenderHint(QPainter::Antialiasing, false); 296 | 297 | painter->setPen(QColor(Qt::lightGray).lighter(110)); 298 | painter->drawLines(lines.data(), lines.size()); 299 | painter->setPen(Qt::black); 300 | //painter->drawRect(sceneRect()); 301 | } 302 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ###################### 2 | # 3 | # Copyright (C) 2014 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved. 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | ###################### 19 | 20 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 21 | PROJECT(qgv) 22 | 23 | SET(TARGET_VERSION_MAJOR 0 ) 24 | SET(TARGET_VERSION_MINOR 1 ) 25 | SET(${PROJECT_NAME}_PATCH_LEVEL 0 ) 26 | SET(${PROJECT_NAME}_SOVERSION ${TARGET_VERSION_MAJOR}) 27 | SET(${PROJECT_NAME}_VERSION 28 | "${TARGET_VERSION_MAJOR}.${TARGET_VERSION_MINOR}.${${PROJECT_NAME}_PATCH_LEVEL}" ) 29 | 30 | # INCLUDE(CTest) 31 | 32 | # Extending the Module path with the local module path of desuto 33 | SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ) 34 | 35 | OPTION(BUILD_DEV "Build development version of qgv" ON) 36 | OPTION(BUILD_DEBUG "Build in debug mode" ON) 37 | OPTION(BINDINGS_QT4 "Build with Qt4" OFF) 38 | OPTION(BINDINGS_QT5 "Build with Qt5" OFF) 39 | 40 | SET(BUILD_DEBUG_WANTED ${BUILD_DEBUG}) 41 | SET(BUILD_DEV_WANTED ${BUILD_DEV}) 42 | SET(BINDINGS_QT4_WANTED ${BINDINGS_QT4}) 43 | SET(BINDINGS_QT5_WANTED ${BINDINGS_QT5}) 44 | 45 | IF(BUILD_DEBUG) 46 | SET(CMAKE_BUILD_TYPE Debug) 47 | ELSE() 48 | SET(CMAKE_BUILD_TYPE Release) 49 | ENDIF() 50 | 51 | IF(NOT BINDINGS_QT4 AND NOT BINDINGS_QT5) 52 | MESSAGE("Trying to autodetect Qt version") 53 | FIND_PACKAGE(Qt4 QUIET) 54 | IF(Qt4_FOUND OR QT4_FOUND) 55 | SET(BINDINGS_QT4 ON) 56 | MESSAGE("Found Qt4 --> Prefer Qt4 over Qt5") 57 | ELSE(Qt4_FOUND OR QT4_FOUND) 58 | SET(BINDINGS_QT5 ON) 59 | MESSAGE("Qt4 not found --> Try to build with Qt5") 60 | ENDIF(Qt4_FOUND OR QT4_FOUND) 61 | ENDIF(NOT BINDINGS_QT4 AND NOT BINDINGS_QT5) 62 | IF(BINDINGS_QT4) 63 | # Qt4 must be included after setting the build type 64 | FIND_PACKAGE(Qt4 REQUIRED) 65 | ENDIF(BINDINGS_QT4) 66 | IF(BINDINGS_QT5) 67 | IF(BINDINGS_QT4) 68 | MESSAGE("Qt4 and Qt5 enabled --> Preferring Qt4 and therefore disabling Qt5") 69 | SET(BINDINGS_QT5 OFF) 70 | ELSE(BINDINGS_QT4) 71 | FIND_PACKAGE(Qt5Core REQUIRED) 72 | FIND_PACKAGE(Qt5Widgets REQUIRED) 73 | FIND_PACKAGE(Qt5Xml REQUIRED) 74 | FIND_PACKAGE(Qt5XmlPatterns REQUIRED) 75 | FIND_PACKAGE(Qt5Sql REQUIRED) 76 | FIND_PACKAGE(Qt5Network REQUIRED) 77 | FIND_PACKAGE(Qt5LinguistTools REQUIRED) 78 | # Do not automatically link against qtmain 79 | CMAKE_POLICY(SET CMP0020 OLD) 80 | ENDIF(BINDINGS_QT4) 81 | ENDIF(BINDINGS_QT5) 82 | # enable automatic moc by CMAKE 83 | SET(CMAKE_AUTOMOC ON) 84 | 85 | IF(NOT KDE) 86 | IF(NOT APPLE) 87 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") 88 | ENDIF(NOT APPLE) 89 | IF(MSVC) 90 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_EXCEPTIONS -Zc:wchar_t-") 91 | ELSE(MSVC) 92 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common") 93 | ENDIF(MSVC) 94 | IF(NOT WIN32 AND NOT APPLE) 95 | # SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--fatal-warnings -lc -Wl,--disable-auto-import") 96 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--fatal-warnings -lc") 97 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi") 98 | ENDIF(NOT WIN32 AND NOT APPLE) 99 | ENDIF(NOT KDE) 100 | IF(BUILD_DEBUG AND NOT MSVC) 101 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") 102 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") 103 | ENDIF(BUILD_DEBUG AND NOT MSVC) 104 | ADD_DEFINITIONS(${QT_DEFINITIONS}) 105 | 106 | # directory to install binaries 107 | SET(bin_DIR ${CMAKE_INSTALL_PREFIX}/bin) 108 | IF(WIN32) 109 | SET(bin_DIR .) 110 | ENDIF(WIN32) 111 | 112 | IF(NOT WIN32) 113 | SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/" CACHE STRING "Where to install the library files to") 114 | ENDIF(NOT WIN32) 115 | SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) 116 | IF(UNIX) 117 | # SET(designer_DIR "/usr/lib/qt4/plugins/designer") 118 | SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) 119 | SET(include_DIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}) 120 | SET(find_cmake_DIR ${CMAKE_ROOT}/Modules/) 121 | ELSE(UNIX) 122 | SET(LIB_INSTALL_DIR ${bin_DIR}) 123 | SET(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH}) 124 | SET(include_DIR ${bin_DIR}/include/${PROJECT_NAME}) 125 | SET(find_cmake_DIR ${CMAKE_ROOT}/Modules/) 126 | ENDIF(UNIX) 127 | 128 | IF(WIN32) 129 | IF(BUILD_DEBUG) 130 | SET(qt_LIBS ${qt_LIBS}/Debug) 131 | ELSE(BUILD_DEBUG) 132 | SET(qt_LIBS ${qt_LIBS}/Release) 133 | ENDIF(BUILD_DEBUG) 134 | ENDIF() 135 | 136 | FIND_PACKAGE(Qt4 REQUIRED) 137 | ADD_DEFINITIONS(${QT_DEFINITIONS}) 138 | FIND_PACKAGE(Graphviz REQUIRED) 139 | 140 | ###################### 141 | # 142 | # include source tree 143 | # 144 | ###################### 145 | SET(libqgv_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/QGVCore) 146 | SET(libqgv_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/QGVCore) 147 | ADD_SUBDIRECTORY(QGVCore) 148 | ADD_SUBDIRECTORY(Sample) 149 | 150 | ###################### 151 | # 152 | # printing choosen configuration 153 | # 154 | ###################### 155 | MESSAGE("######################################################") 156 | MESSAGE("") 157 | MESSAGE("CONFIGURATION") 158 | MESSAGE("") 159 | MESSAGE("CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}") 160 | MESSAGE("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") 161 | MESSAGE("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") 162 | MESSAGE("") 163 | MESSAGE("OPTIONS:") 164 | MESSAGE(" Name Wanted Used") 165 | # MESSAGE(" BUILD_PACKAGE: ${BUILD_PACKAGE_WANTED} ${BUILD_PACKAGE}") 166 | MESSAGE(" BUILD_DEBUG: ${BUILD_DEBUG_WANTED} ${BUILD_DEBUG}") 167 | # MESSAGE(" BUILD_TESTING: ${BUILD_TESTING_WANTED} ${BUILD_TESTING}") 168 | MESSAGE(" BUILD_DEV: ${BUILD_DEV} ${BUILD_DEV}") 169 | MESSAGE(" BINDINGS_QT4: ${BINDINGS_QT4_WANTED} ${BINDINGS_QT4}") 170 | MESSAGE(" BINDINGS_QT5: ${BINDINGS_QT5_WANTED} ${BINDINGS_QT5}") 171 | # MESSAGE(" L10N_ALL: ${L10N_ALL_WANTED} ${L10N_ALL}") 172 | # MESSAGE(" L10N_DE: ${L10N_DE_WANTED} ${L10N_DE}") 173 | # MESSAGE(" L10N_EN: ${L10N_EN_WANTED} ${L10N_EN}") 174 | # MESSAGE(" L10N_FR: ${L10N_FR_WANTED} ${L10N_FR}") 175 | MESSAGE("") 176 | MESSAGE("######################################################") 177 | 178 | ###################### 179 | # 180 | # Add uninstall target 181 | # 182 | ###################### 183 | CONFIGURE_FILE( 184 | "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" 185 | "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake" 186 | IMMEDIATE @ONLY) 187 | ADD_CUSTOM_TARGET(uninstall 188 | "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake") 189 | 190 | 191 | ###################### 192 | # 193 | # CPACK 194 | # 195 | ###################### 196 | SET(CPACK_GENERATOR "NSIS") 197 | SET(CPACK_PACKAGE_NAME "QGV") 198 | SET(CPACK_PACKAGE_VENDOR "") 199 | SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Qt interface for Graphviz") 200 | SET(CPACK_PACKAGE_VERSION ${${PROJECT_NAME}_VERSION}) 201 | SET(CPACK_PACKAGE_VERSION_MAJOR ${TARGET_MAJOR_VERSION}) 202 | SET(CPACK_PACKAGE_VERSION_MINOR ${TARGET_MINOR_VERSION}) 203 | SET(CPACK_PACKAGE_VERSION_PATCH ${${PROJECT_NAME}_PATCH_LEVEL}) 204 | SET(CPACK_PACKAGE_INSTALL_DIRECTORY "qgv") 205 | 206 | # add all components which should be installable via the package 207 | IF(WIN32) 208 | SET(external_DLL 209 | qtlibs 210 | graphvizlibs 211 | ) 212 | ENDIF(WIN32) 213 | 214 | SET(CPACK_COMPONENTS_ALL 215 | library 216 | ${external_DLL} 217 | headerfiles 218 | sample 219 | ) 220 | 221 | # License file 222 | SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt) 223 | 224 | # Pre selected installation profiles 225 | SET(CPACK_ALL_INSTALL_TYPES Full Minimal) 226 | 227 | # groups for components 228 | SET(CPACK_COMPONENT_GROUP_3RDPARTYLIBS_DISPLAY_NAME "3rd Party Libraries") 229 | SET(CPACK_COMPONENT_GROUP_3RDPARTYLIBS_DESCRIPTION "Libraries which are needed, but not belonging to this project. They must not be installed, if they are already installed at path") 230 | 231 | # the scheme of the variable names are: CPACK_COMPNONENT_%COMPONENTNAMEINUPPERCASE%_DISPLAY_NAME 232 | # where %COMPONENTNAMEINUPPERCASE% must be replaced by the upper cased name of the component 233 | # see below for example 234 | SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "QGV") 235 | SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION 236 | "The qgv library") 237 | # SET(CPACK_COMPONENT_LIBRARY_GROUP "Base") 238 | SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Full Minimal) 239 | 240 | IF(BUILD_DEV) 241 | SET(CPACK_COMPONENT_HEADERFILES_DISPLAY_NAME "Header files") 242 | SET(CPACK_COMPONENT_HEADERFILES_DESCRIPTION 243 | "Header files of qgv library") 244 | SET(CPACK_COMPONENT_HEADERFILES_DEPENDS library) 245 | SET(CPACK_COMPONENT_HEADERFILES_INSTALL_TYPES Full) 246 | ENDIF(BUILD_DEV) 247 | 248 | SET(CPACK_COMPONENT_QTLIBS_DISPLAY_NAME "QT") 249 | SET(CPACK_COMPONENT_QTLIBS_DESCRIPTION 250 | "Qt libraries") 251 | SET(CPACK_COMPONENT_QTLIBS_GROUP "3rdPartyLibs") 252 | SET(CPACK_COMPONENT_QTLIBS_INSTALL_TYPES Full) 253 | 254 | SET(CPACK_COMPONENT_GRAPHVIZLIBS_DISPLAY_NAME "Graphviz") 255 | SET(CPACK_COMPONENT_GRAPHVIZLIBS_DESCRIPTION 256 | "Graphviz libraries") 257 | SET(CPACK_COMPONENT_GRAPHVIZLIBS_GROUP "3rdPartyLibs") 258 | SET(CPACK_COMPONENT_GRAPHVIZLIBS_INSTALL_TYPES Full) 259 | 260 | SET(CPACK_COMPONENT_SAMPLE_DISPLAY_NAME "Sample") 261 | SET(CPACK_COMPONENT_SAMPLE_DESCRIPTION 262 | "Example application") 263 | SET(CPACK_COMPONENT_SAMPLE_DEPENDS library) 264 | SET(CPACK_COMPONENT_SAMPLE_INSTALL_TYPES Full) 265 | 266 | # used by NSIS to create startmenu links to the executables 267 | # this entrys are only useful if a bin folder is used, otherwise use the empty EXECUTABLES 268 | # and fill out the NSIS_MENU_LINKS 269 | SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "Sample" "Sample") 270 | 271 | # This must always be last! 272 | INCLUDE(CPack) 273 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGraphViz.pro.user.98d90d7: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {98d90d70-42c3-4d1e-972d-09549f359073} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | 60 | ProjectExplorer.Project.Target.0 61 | 62 | Desktop Qt 5.10.0 MinGW 32bit 63 | Desktop Qt 5.10.0 MinGW 32bit 64 | qt.qt5.5100.win32_mingw53_kit 65 | 0 66 | 0 67 | 0 68 | 69 | E:/build-QGraphViz-Desktop_Qt_5_10_0_MinGW_32bit-Debug 70 | 71 | 72 | true 73 | qmake 74 | 75 | QtProjectManager.QMakeBuildStep 76 | true 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | false 89 | 90 | 91 | 92 | 2 93 | Build 94 | 95 | ProjectExplorer.BuildSteps.Build 96 | 97 | 98 | 99 | true 100 | Make 101 | 102 | Qt4ProjectManager.MakeStep 103 | 104 | true 105 | clean 106 | 107 | 108 | 1 109 | Clean 110 | 111 | ProjectExplorer.BuildSteps.Clean 112 | 113 | 2 114 | false 115 | 116 | Debug 117 | 118 | Qt4ProjectManager.Qt4BuildConfiguration 119 | 2 120 | true 121 | 122 | 123 | E:/build-QGraphViz-Desktop_Qt_5_10_0_MinGW_32bit-Release 124 | 125 | 126 | true 127 | qmake 128 | 129 | QtProjectManager.QMakeBuildStep 130 | false 131 | 132 | false 133 | false 134 | false 135 | 136 | 137 | true 138 | Make 139 | 140 | Qt4ProjectManager.MakeStep 141 | 142 | false 143 | 144 | 145 | 146 | 2 147 | Build 148 | 149 | ProjectExplorer.BuildSteps.Build 150 | 151 | 152 | 153 | true 154 | Make 155 | 156 | Qt4ProjectManager.MakeStep 157 | 158 | true 159 | clean 160 | 161 | 162 | 1 163 | Clean 164 | 165 | ProjectExplorer.BuildSteps.Clean 166 | 167 | 2 168 | false 169 | 170 | Release 171 | 172 | Qt4ProjectManager.Qt4BuildConfiguration 173 | 0 174 | true 175 | 176 | 177 | E:/build-QGraphViz-Desktop_Qt_5_10_0_MinGW_32bit-Profile 178 | 179 | 180 | true 181 | qmake 182 | 183 | QtProjectManager.QMakeBuildStep 184 | true 185 | 186 | false 187 | true 188 | false 189 | 190 | 191 | true 192 | Make 193 | 194 | Qt4ProjectManager.MakeStep 195 | 196 | false 197 | 198 | 199 | 200 | 2 201 | Build 202 | 203 | ProjectExplorer.BuildSteps.Build 204 | 205 | 206 | 207 | true 208 | Make 209 | 210 | Qt4ProjectManager.MakeStep 211 | 212 | true 213 | clean 214 | 215 | 216 | 1 217 | Clean 218 | 219 | ProjectExplorer.BuildSteps.Clean 220 | 221 | 2 222 | false 223 | 224 | Profile 225 | 226 | Qt4ProjectManager.Qt4BuildConfiguration 227 | 0 228 | true 229 | 230 | 3 231 | 232 | 233 | 0 234 | Deploy 235 | 236 | ProjectExplorer.BuildSteps.Deploy 237 | 238 | 1 239 | Deploy locally 240 | 241 | ProjectExplorer.DefaultDeployConfiguration 242 | 243 | 1 244 | 245 | 246 | false 247 | false 248 | 1000 249 | 250 | true 251 | 252 | false 253 | false 254 | false 255 | false 256 | true 257 | 0.01 258 | 10 259 | true 260 | 1 261 | 25 262 | 263 | 1 264 | true 265 | false 266 | true 267 | valgrind 268 | 269 | 0 270 | 1 271 | 2 272 | 3 273 | 4 274 | 5 275 | 6 276 | 7 277 | 8 278 | 9 279 | 10 280 | 11 281 | 12 282 | 13 283 | 14 284 | 285 | 2 286 | 287 | Sample 288 | 289 | Qt4ProjectManager.Qt4RunConfiguration:E:/qgv-master/Sample/Sample.pro 290 | true 291 | 292 | Sample/Sample.pro 293 | false 294 | 295 | /../bin 296 | 3768 297 | false 298 | true 299 | false 300 | false 301 | true 302 | 303 | 1 304 | 305 | 306 | 307 | ProjectExplorer.Project.TargetCount 308 | 1 309 | 310 | 311 | ProjectExplorer.Project.Updater.FileVersion 312 | 18 313 | 314 | 315 | Version 316 | 18 317 | 318 | 319 | -------------------------------------------------------------------------------- /Qt Graphiz Visualizer/QGraphViz.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {3e19712b-c4f5-42b0-a3c5-ead0ccfc57fb} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | 60 | ProjectExplorer.Project.Target.0 61 | 62 | Desktop Qt 5.10.0 MinGW 32bit 63 | Desktop Qt 5.10.0 MinGW 32bit 64 | qt.qt5.5100.win32_mingw53_kit 65 | 0 66 | 0 67 | 0 68 | 69 | C:/Users/Probook/Downloads/GraphViz Visualization C++/GraphViz Visualization C++/build-QGraphViz-Desktop_Qt_5_10_0_MinGW_32bit-Debug 70 | 71 | 72 | true 73 | qmake 74 | 75 | QtProjectManager.QMakeBuildStep 76 | true 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | false 89 | 90 | 91 | 92 | 2 93 | Build 94 | 95 | ProjectExplorer.BuildSteps.Build 96 | 97 | 98 | 99 | true 100 | Make 101 | 102 | Qt4ProjectManager.MakeStep 103 | 104 | true 105 | clean 106 | 107 | 108 | 1 109 | Clean 110 | 111 | ProjectExplorer.BuildSteps.Clean 112 | 113 | 2 114 | false 115 | 116 | Debug 117 | 118 | Qt4ProjectManager.Qt4BuildConfiguration 119 | 2 120 | true 121 | 122 | 123 | C:/Users/Probook/Downloads/GraphViz Visualization C++/GraphViz Visualization C++/build-QGraphViz-Desktop_Qt_5_10_0_MinGW_32bit-Release 124 | 125 | 126 | true 127 | qmake 128 | 129 | QtProjectManager.QMakeBuildStep 130 | false 131 | 132 | false 133 | false 134 | false 135 | 136 | 137 | true 138 | Make 139 | 140 | Qt4ProjectManager.MakeStep 141 | 142 | false 143 | 144 | 145 | 146 | 2 147 | Build 148 | 149 | ProjectExplorer.BuildSteps.Build 150 | 151 | 152 | 153 | true 154 | Make 155 | 156 | Qt4ProjectManager.MakeStep 157 | 158 | true 159 | clean 160 | 161 | 162 | 1 163 | Clean 164 | 165 | ProjectExplorer.BuildSteps.Clean 166 | 167 | 2 168 | false 169 | 170 | Release 171 | 172 | Qt4ProjectManager.Qt4BuildConfiguration 173 | 0 174 | true 175 | 176 | 177 | C:/Users/Probook/Downloads/GraphViz Visualization C++/GraphViz Visualization C++/build-QGraphViz-Desktop_Qt_5_10_0_MinGW_32bit-Profile 178 | 179 | 180 | true 181 | qmake 182 | 183 | QtProjectManager.QMakeBuildStep 184 | true 185 | 186 | false 187 | true 188 | false 189 | 190 | 191 | true 192 | Make 193 | 194 | Qt4ProjectManager.MakeStep 195 | 196 | false 197 | 198 | 199 | 200 | 2 201 | Build 202 | 203 | ProjectExplorer.BuildSteps.Build 204 | 205 | 206 | 207 | true 208 | Make 209 | 210 | Qt4ProjectManager.MakeStep 211 | 212 | true 213 | clean 214 | 215 | 216 | 1 217 | Clean 218 | 219 | ProjectExplorer.BuildSteps.Clean 220 | 221 | 2 222 | false 223 | 224 | Profile 225 | 226 | Qt4ProjectManager.Qt4BuildConfiguration 227 | 0 228 | true 229 | 230 | 3 231 | 232 | 233 | 0 234 | Deploy 235 | 236 | ProjectExplorer.BuildSteps.Deploy 237 | 238 | 1 239 | Deploy locally 240 | 241 | ProjectExplorer.DefaultDeployConfiguration 242 | 243 | 1 244 | 245 | 246 | false 247 | false 248 | 1000 249 | 250 | true 251 | 252 | false 253 | false 254 | false 255 | false 256 | true 257 | 0.01 258 | 10 259 | true 260 | 1 261 | 25 262 | 263 | 1 264 | true 265 | false 266 | true 267 | valgrind 268 | 269 | 0 270 | 1 271 | 2 272 | 3 273 | 4 274 | 5 275 | 6 276 | 7 277 | 8 278 | 9 279 | 10 280 | 11 281 | 12 282 | 13 283 | 14 284 | 285 | 2 286 | 287 | Sample 288 | 289 | Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Probook/Downloads/GraphViz Visualization C++/GraphViz Visualization C++/qgv-master/Sample/Sample.pro 290 | true 291 | 292 | Sample/Sample.pro 293 | false 294 | 295 | C:/Users/Probook/Downloads/GraphViz Visualization C++/GraphViz Visualization C++/build-QGraphViz-Desktop_Qt_5_10_0_MinGW_32bit-Debug/bin 296 | 3768 297 | false 298 | true 299 | false 300 | false 301 | true 302 | 303 | 1 304 | 305 | 306 | 307 | ProjectExplorer.Project.TargetCount 308 | 1 309 | 310 | 311 | ProjectExplorer.Project.Updater.FileVersion 312 | 18 313 | 314 | 315 | Version 316 | 18 317 | 318 | 319 | --------------------------------------------------------------------------------