조성현

print_graph --> make_graph

......@@ -25,16 +25,11 @@ MainWindow::~MainWindow()
}
void MainWindow::print_graph(const char * filename)
void MainWindow::make_graph(const char* filename)
{
graphWidget->print_graph(filename);
graphWidget->make_graph(filename);
}
//void MainWindow::print_graph(std::ifstream *pFin)
//{
// graphWidget->print_graph(pFin);
//}
//////////////////////////////////////////////////////////////////
// private methods
//////////////////////////////////////////////////////////////////
......
......@@ -12,8 +12,7 @@ public:
MainWindow(QWidget *parent = 0);
~MainWindow();
//void print_graph(std::ifstream *pFin);
void print_graph(const char* filename);
void make_graph(const char* filename);
private:
......
......@@ -25,22 +25,10 @@ PaperGraphWidget::PaperGraphWidget(QWidget *parent)
setWindowTitle(tr("dblp paper graph visualization"));
}
//void PaperGraphWidget::print_graph(ifstream* pFin)
//{
// qDebug("* PaperGraphWidget::print_graph");
// //QGraphicsItem *graph_item = new GraphItem(fin);
// if (graphItem)
// throw std::exception("already have graph item");
//
// graphItem = new GraphItem(pFin);
// graphItem->setPos(0, 0);
// scene->addItem(graphItem);
//}
void PaperGraphWidget::print_graph(const char * filename)
void PaperGraphWidget::make_graph(const char* filename)
{
if (graphItem)
throw std::exception("already have graph item");
throw std::exception("graph is already exist");
graphItem = new GraphItem(filename);
graphItem->setPos(0, 0);
......
......@@ -11,8 +11,7 @@ class PaperGraphWidget : public QWidget
public:
PaperGraphWidget(QWidget *parent = 0);
//void print_graph(ifstream* pFin);
void print_graph(const char* filename);
void make_graph(const char* filename);
//main window slots
void read_more();
......
......@@ -9,9 +9,7 @@ int main(int argc, char *argv[])
MainWindow m;
try {
//ifstream fin(PAPER_FILENAME);
m.print_graph(PAPER_FILENAME);
//fin.close();
m.make_graph(PAPER_FILENAME);
} catch (const std::exception& e) {
qDebug() << "Error: " << e.what();
return EXIT_FAILURE;
......