-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
45 lines (39 loc) · 1.03 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <QtGui/QApplication>
#include "linplot.h"
#include "genome.h"
#include "utils.h"
#include <string>
#include <QGraphicsView>
#include <QPrinter>
#include <QPainter>
#include <QSize>
int main(int argc, char** argv)
{
Genome* g(new Genome());
std::string fileName;
if (argc > 1) {
fileName = argv[1];
}
else {
fileName = "out.sam";
}
g->read(fileName);
QApplication app(argc, argv);
LinearPlot lp();
auto seed = g->getReadAt(1, 1);
assume(seed != nullptr, "Error, no read found!");
lp.setSceneRect(0, 0, 1200, 300);
lp.fromRead(seed, g);
QGraphicsView view(&lp);
view.setWindowTitle("Chipboard demo v0.0.1");
view.show();
QPrinter printer;
printer.setPaperSize(QSize(view.width(), view.height()), QPrinter::Point);
printer.setFullPage(true);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName("plot.pdf");
QPainter pdfPainter;
pdfPainter.begin(&printer);
view.render(&pdfPainter);
return app.exec();
}