| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
#ifndef HORIZONTAL_SEQUENCE_VIEW_HH |
|---|
| 20 |
#define HORIZONTAL_SEQUENCE_VIEW_HH |
|---|
| 21 |
|
|---|
| 22 |
#include <FL/Fl.H> |
|---|
| 23 |
#include <FL/Fl_Window.H> |
|---|
| 24 |
#include <FL/Fl_Box.H> |
|---|
| 25 |
#include <FL/fl_draw.H> |
|---|
| 26 |
|
|---|
| 27 |
#include "SequenceView.hh" |
|---|
| 28 |
|
|---|
| 29 |
namespace gui { |
|---|
| 30 |
class HorizontalSequenceView : public SequenceView { |
|---|
| 31 |
protected: |
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
const static unsigned int border = 60; |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
const static unsigned int line_thickness = 6; |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
const static unsigned int half_tick_height = 5; |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
const static unsigned int tick_thickness = 2; |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
const static unsigned int half_label_height = 6; |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
const static unsigned int label_width = border - 2; |
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
void draw(); |
|---|
| 56 |
void draw_ticks(); |
|---|
| 57 |
void draw_ticks_at_spacing(int); |
|---|
| 58 |
void draw_labels(); |
|---|
| 59 |
void draw_selection_box(); |
|---|
| 60 |
void draw_features(); |
|---|
| 61 |
bool _show_sequence_line; |
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
virtual int handle(int e); |
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
unsigned int get_left(), get_width(), get_mid(); |
|---|
| 68 |
public: |
|---|
| 69 |
|
|---|
| 70 |
HorizontalSequenceView(int x, int y, |
|---|
| 71 |
unsigned int width, unsigned int seq_len) : |
|---|
| 72 |
SequenceView(x, y, width, height, seq_len) { |
|---|
| 73 |
_show_sequence_line = true; |
|---|
| 74 |
}; |
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
HorizontalSequenceView(int x, int y, unsigned int width, |
|---|
| 78 |
std::string seq_name, std::string seq) : |
|---|
| 79 |
SequenceView(x, y, width, height, seq.length()) { |
|---|
| 80 |
_sequence_name = seq_name; |
|---|
| 81 |
_sequence_text = seq; |
|---|
| 82 |
_show_sequence_line = true; |
|---|
| 83 |
}; |
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
const static unsigned int height = 20; |
|---|
| 89 |
virtual void h(unsigned int _h) { SequenceView::h(_h); } |
|---|
| 90 |
virtual unsigned int h() { return SequenceView::h(); } |
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
unsigned int base_to_pos(int base); |
|---|
| 94 |
unsigned int pos_to_base(int pos); |
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 |
void show_sequence_line(bool s) { _show_sequence_line = s; } |
|---|
| 98 |
bool show_sequence_line() { return _show_sequence_line; } |
|---|
| 99 |
}; |
|---|
| 100 |
} |
|---|
| 101 |
|
|---|
| 102 |
#endif |
|---|
| 103 |
|
|---|