-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotLayer.h
90 lines (67 loc) · 2.17 KB
/
plotLayer.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef PLOTLAYER_H
#define PLOTLAYER_H
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsRectItem>
#include <QtCore>
//#include "layer.h"
#include "contigData.h"
#include "layerArcs.h"
class SRegion : public QGraphicsPathItem
{
public:
SRegion(unsigned radius, unsigned width, qreal initialAngle,
qreal terminalAngle, qreal upstreamNeighborTerminalAngle,
qreal donwstreamNeighborInitialAngle, QColor color);
private:
void arc(QPainterPath &path, unsigned radius, qreal initialAngle,
qreal terminalAngle);
qreal max(qreal a, qreal b);
qreal min(qreal a, qreal b);
};
class ContigOutline : public QGraphicsPathItem
{
public:
ContigOutline(unsigned radius, unsigned width, qreal initialAngle,
qreal terminalAngle, QColor color);
private:
void arc(QPainterPath &path, unsigned radius, qreal initialAngle,
qreal terminalAngle);
};
class Contig
{
public:
Contig(qreal start, qreal end, QVector<qreal> newInitialAngles, QVector<qreal> newTerminalAngles,
QVector<QColor> newColors);
void plotRegions(QGraphicsScene &scene, unsigned radius);
void plotContigOutline(QGraphicsScene &scene, unsigned radius);
void plotContig(QGraphicsScene &scene, unsigned radius);
void print();
private:
QVector<qreal> initialAngles, terminalAngles;
QVector<QColor> colors;
qreal start, end;
};
class Layer
{
public:
//order in which contigs appear in the array is their display order
Layer(QVector<unsigned> contigSizes, QVector<QString> contigNames);
//default constructor to ensure that Layer works with Qt containers
Layer();
void plotLayer(QGraphicsScene &scene, unsigned radius);
void plotArcs(QGraphicsScene &scene, unsigned radius);
bool addMatch(QString precName, QString prodName, unsigned precU,
unsigned precD, unsigned prodU, unsigned prodD);
void print();
QMap<QString, ContigData> contigs;
LayerArcs layerArcs;
//QMap<QString, QVector<unsigned> > ArcsFrom;
//QMap<QString, QVector<unsigned> > ArcsTo;
QMap<QString, unsigned> size;
private:
int checkInsertable(QVector<unsigned> &Us, QVector<unsigned> &Ds, unsigned U, unsigned D);
QMap<QString, unsigned> contigStartAngles;
qreal totalLen;
};
#endif