-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAbstractGraph.h
103 lines (88 loc) · 2.82 KB
/
AbstractGraph.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
91
92
93
94
95
96
97
98
99
100
101
102
103
#ifndef ABSTRACT_GRAPH
#define ABSTRACT_GRAPH
#include <QGLWidget>
#include <string>
#include <vector>
#include "BasicTypes.h"
#include "TextureCanvas.h"
#include <utility> //includes std::pair
#include "SkittleUtil.h"
/**
* This is the base class for all Grapher objects.
*/
class GLWidget;
class QScrollArea;
class QAction;
class UiVariables;
using namespace std;
class AbstractGraph : public QGLWidget
{
Q_OBJECT
protected:
int frameCount;
const string* sequence;
QScrollArea* settingsTab;
GLuint display_object;
public:
vector<color> outputPixels;
GLWidget* glWidget;
UiVariables* ui;
TextureCanvas* textureBuffer;
bool hidden;
bool upToDate;
bool usingTextures;
QAction* toggleButton;
string actionLabel;
string actionTooltip;
string actionData;
AbstractGraph();
AbstractGraph(UiVariables* gui, GLWidget* gl);
~AbstractGraph();
virtual int width();
virtual int height();
virtual void paint_square(point position, color c);
virtual void paint_image(point position, string filePath);
virtual void paint_line(point startPoint, point endPoint, color c);
virtual void loadTextureCanvas(bool raggedEdge = false);
virtual void storeDisplay(vector<color>& pixels, int width, bool raggedEdge = false);
virtual bool updateInt(int& subject, int& value);
virtual bool updateDouble(double& subject, double& value);
virtual void display();
virtual GLuint render();
virtual void calculateOutputPixels() = 0;
virtual void displayLegend(float canvasWidth, float canvasHeight);
virtual void checkVariables();
virtual void ensureVisible();
virtual void setButtonFont();
virtual void setSequence(const string* seq);
virtual string getFileName();
virtual QScrollArea* settingsUi();
string reverseComplement(string original);
virtual int current_display_size();
virtual string mouseClick(point2D pt, bool);
virtual string SELECT_MouseClick(point2D pt);
virtual string FIND_MouseClick(point2D pt);
virtual int getRelativeIndexFromMouseClick(point2D pt);
virtual pair<int,int> getIndicesFromPoints(point2D startPoint, point2D endPoint);
virtual int getBeginningOfLineFromMouseClick(point2D pt);
virtual int adjustForSampleLengthBounds(int index, int sample_length);
virtual string SELECT_StringFromMouseClick(int index);
virtual string FIND_StringFromMouseClick(int index);
inline char complement(char a)
{
if(a == 'A') return 'T';
if(a == 'C') return 'G';
if(a == 'G') return 'C';
if(a == 'T') return 'A';
return a;
}
public slots:
void invalidate();
void toggleVisibility();
signals:
void displayChanged();
void hideSettings(QScrollArea*);
void showSettings(QScrollArea*);
void deleteButton(QAction*);
};
#endif