조성현

add precompiled header

#include "stdafx.h"
#include "EdgeItem.h"
#include <QtWidgets>
void EdgeItem::mousePressEvent(QGraphicsSceneMouseEvent * event)
{
......
#ifndef EDGEITEM_H
#define EDGEITEM_H
#include <QColor>
#include <QGraphicsItem>
#include "stdafx.h"
class EdgeItem
......
#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)
{
......
#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:
......
#include "stdafx.h"
#include "GraphicsView.h"
#include <qmath.h>
#include <QKeyEvent>
//View
View::View(const QString& name, QWidget *parent)
......
#ifndef GRAPHICSVIEW_H
#define GRAPHICSVIEW_H
#include <QFrame>
#include <QGraphicsView>
#include <QGridLayout>
#include "stdafx.h"
//pre-declare
class View;
class GraphicsView
: public QGraphicsView
{
......
#include "stdafx.h"
#include "MainWindow.h"
MainWindow::MainWindow(QWidget *parent)
......
#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"
......
#include "stdafx.h"
#include "NodeItem.h"
#include <QtWidgets>
#include <QMessageBox>
void NodeItem::mousePressEvent(QGraphicsSceneMouseEvent * event)
{
......
#ifndef NODEITEM_H
#define NODEITEM_H
#include <QColor>
#include <QGraphicsItem>
#include "stdafx.h"
const int NODE_SIZE = 4;
......
This diff is collapsed. Click to expand it.
......@@ -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
......
#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)
{
......
#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
......
#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
*/
......
#include "stdafx.h"
#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