Toggle navigation
Toggle navigation
This project
Loading...
Sign in
조성현
/
graph-visualization
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
조성현
2017-04-13 09:33:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ac87f4589417092ff21fa18100185a59e9677988
ac87f458
1 parent
7df620cf
add precompiled header
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
72 additions
and
79 deletions
PaperGraph/EdgeItem.cpp
PaperGraph/EdgeItem.h
PaperGraph/GraphItem.cpp
PaperGraph/GraphItem.h
PaperGraph/GraphicsView.cpp
PaperGraph/GraphicsView.h
PaperGraph/MainWindow.cpp
PaperGraph/MainWindow.h
PaperGraph/NodeItem.cpp
PaperGraph/NodeItem.h
PaperGraph/PaperGraph.vcxproj
PaperGraph/PaperGraph.vcxproj.filters
PaperGraph/PaperGraphWidget.cpp
PaperGraph/PaperGraphWidget.h
PaperGraph/main.cpp
PaperGraph/stdafx.cpp
PaperGraph/stdafx.h
PaperGraph/EdgeItem.cpp
View file @
ac87f45
#include "stdafx.h"
#include "EdgeItem.h"
#include <QtWidgets>
void
EdgeItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
...
...
PaperGraph/EdgeItem.h
View file @
ac87f45
#ifndef EDGEITEM_H
#define EDGEITEM_H
#include <QColor>
#include <QGraphicsItem>
#include "stdafx.h"
class
EdgeItem
...
...
PaperGraph/GraphItem.cpp
View file @
ac87f45
#include "stdafx.h"
#include "GraphItem.h"
#include <boost/graph/fruchterman_reingold.hpp>
#include <boost/graph/random_layout.hpp>
#include <boost/graph/circle_layout.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/algorithm/string.hpp> //boost::split
#include <boost/bimap.hpp>
#include <boost/regex.hpp>
#include <exception>
#include <iterator>
#include <string>
#include <map>
#include <vector>
#include <QDebug>
#include <QtWidgets>
GraphItem
::
GraphItem
(
ifstream
&
fin
)
{
if
(
!
fin
)
...
...
@@ -270,6 +253,13 @@ void GraphItem::path_highlighting(std::string start, std::string end)
}
void
GraphItem
::
reset_color
()
{
for
(
auto
&
n
:
nodeList
)
{
n
->
setColor
(
QColor
());
}
}
//event handler
void
GraphItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
...
...
PaperGraph/GraphItem.h
View file @
ac87f45
#ifndef GRAPHITEM_H
#define GRAPHITEM_H
#include <QGraphicsItem>
#include <QList>
#include <QColor>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/topology.hpp>
#include <boost/graph/graph_traits.hpp>
#include <fstream>
#include "stdafx.h"
#include "NodeItem.h"
#include "EdgeItem.h"
...
...
@@ -68,6 +59,7 @@ public:
//methods
void
path_highlighting
(
std
::
string
start
,
std
::
string
end
);
void
reset_color
();
//
protected
:
...
...
PaperGraph/GraphicsView.cpp
View file @
ac87f45
#include "stdafx.h"
#include "GraphicsView.h"
#include <qmath.h>
#include <QKeyEvent>
//View
View
::
View
(
const
QString
&
name
,
QWidget
*
parent
)
...
...
PaperGraph/GraphicsView.h
View file @
ac87f45
#ifndef GRAPHICSVIEW_H
#define GRAPHICSVIEW_H
#include <QFrame>
#include <QGraphicsView>
#include <QGridLayout>
#include "stdafx.h"
//pre-declare
class
View
;
class
GraphicsView
:
public
QGraphicsView
{
...
...
PaperGraph/MainWindow.cpp
View file @
ac87f45
#include "stdafx.h"
#include "MainWindow.h"
MainWindow
::
MainWindow
(
QWidget
*
parent
)
...
...
PaperGraph/MainWindow.h
View file @
ac87f45
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtWidgets>
#include <QGridLayout>
#include <QtGui>
#include <iostream>
#include "stdafx.h"
//#include "ui_MainWindow.h"
#include "PaperGraphWidget.h"
...
...
PaperGraph/NodeItem.cpp
View file @
ac87f45
#include "stdafx.h"
#include "NodeItem.h"
#include <QtWidgets>
#include <QMessageBox>
void
NodeItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
...
...
PaperGraph/NodeItem.h
View file @
ac87f45
#ifndef NODEITEM_H
#define NODEITEM_H
#include <QColor>
#include <QGraphicsItem>
#include "stdafx.h"
const
int
NODE_SIZE
=
4
;
...
...
PaperGraph/PaperGraph.vcxproj
View file @
ac87f45
This diff is collapsed. Click to expand it.
PaperGraph/PaperGraph.vcxproj.filters
View file @
ac87f45
...
...
@@ -33,6 +33,9 @@
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="PCH">
<UniqueIdentifier>{23e088fd-f255-4f93-9c5e-f963b79d7a97}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
...
...
@@ -77,6 +80,9 @@
<ClCompile Include="GeneratedFiles\Release\moc_MainWindow.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp">
<Filter>PCH</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="PaperGraphWidget.h">
...
...
@@ -114,5 +120,8 @@
<ClInclude Include="GeneratedFiles\ui_MainWindow.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>PCH</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
...
...
PaperGraph/PaperGraphWidget.cpp
View file @
ac87f45
#include "stdafx.h"
#include "PaperGraphWidget.h"
#include "NodeItem.h"
#include "GraphicsView.h"
#include <string>
#include <QComboBox>
#include <QMessageBox>
#include <QtGui>
PaperGraphWidget
::
PaperGraphWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
...
...
PaperGraph/PaperGraphWidget.h
View file @
ac87f45
#ifndef PAPERGRAPHWIDGET_H
#define PAPERGRAPHWIDGET_H
#include <QtWidgets/QWidget>
#include <QGraphicsScene>
#include <fstream>
#include "stdafx.h"
#include "GraphItem.h"
//#include "ui_PaperGraphWidget.h"
class
PaperGraphWidget
:
public
QWidget
{
Q_OBJECT
...
...
PaperGraph/main.cpp
View file @
ac87f45
#include "stdafx.h"
#include "PaperGraphWidget.h"
#include "MainWindow.h"
#include <QtWidgets/QApplication>
#include <QDebug>
#include <algorithm>
#include <exception>
#include <fstream>
#include <iterator>
#include <string>
#include <map>
#include <vector>
#include <boost/graph/fruchterman_reingold.hpp>
//#include <boost/graph/kamada_kawai_spring_layout.hpp>
#include <boost/graph/random_layout.hpp>
#include <boost/graph/circle_layout.hpp>
#include <boost/algorithm/string.hpp> //boost::split
#include <boost/bimap.hpp>
using
namespace
std
;
/**
* Constants
*/
...
...
PaperGraph/stdafx.cpp
0 → 100644
View file @
ac87f45
#include "stdafx.h"
PaperGraph/stdafx.h
0 → 100644
View file @
ac87f45
#pragma once
#include <QColor>
#include <QComboBox>
#include <QDebug>
#include <QFrame>
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGridLayout>
#include <QKeyEvent>
#include <QList>
#include <QMainWindow>
#include <qmath.h>
#include <QMessageBox>
#include <QtGui>
#include <QtWidgets/QApplication>
#include <QtWidgets/QWidget>
#include <QtWidgets>
#include <boost/algorithm/string.hpp> //boost::split
#include <boost/bimap.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/circle_layout.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/fruchterman_reingold.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/random_layout.hpp>
#include <boost/graph/topology.hpp>
#include <boost/regex.hpp>
#include <algorithm>
#include <exception>
#include <fstream>
#include <iostream>
#include <iterator>
#include <map>
#include <string>
#include <vector>
using
namespace
boost
;
using
namespace
std
;
\ No newline at end of file
Please
register
or
login
to post a comment