1 #include "mussa_gui_seq.hh"
5 SeqView::setup(string name, int sq_num, int win_len,
6 vector<Sequence> *some_seqs,
7 Nway_Paths *some_paths, vector<int> some_lens)
11 base_window_len = win_len;
16 y_seq_incre = (y_max-10) / (seq_num - 1);
18 fl_font(FL_COURIER, 14);
19 cout << fl_width('A') << endl;
30 list<vector<int> >::iterator pathz_i;
32 int x_start, y_start, x_end, y_end;
34 int window_length, win_i;
39 window_length = base_window_len;
40 fl_font(FL_COURIER, 14);
42 //blatantly stolen from FR2
43 ch_width = fl_width('A'); // monospaced: all characters are same width
46 for(seq_i = seq_num-1; seq_i >= 0; --seq_i)
49 fl_draw((*S)[seq_i].c_seq(), 0+x(), y_loc+y());
54 fl_line_style(FL_SOLID, 1, NULL);
55 //fl_line(x(),10+y(),20+x(),y_max/2 + y());
60 for(pathz_i = P->pathz.begin(); pathz_i != P->pathz.end(); ++pathz_i)
64 for(i2 = seq_num - 1; i2 > 0; i2--)
68 // ugh, and xor...only want black if one of the nodes is rc
69 if ( ((a_path[i2] < 0) || (a_path[i2-1] < 0)) &&
70 !((a_path[i2] < 0) && (a_path[i2-1] < 0)) )
73 // no matter the case, any RC node needs an offset
79 for(win_i = 0; win_i < window_length; win_i++)
80 fl_line(abs((int)((a_path[i2]-rc_1+win_i+x()+0.5)*ch_width)),
82 abs((int)((a_path[i2-1]-rc_2+win_i+x()+0.5)*ch_width)),
83 y_loc+y_seq_incre+y());
85 //if ((a_path[i2] < 0) || (a_path[i2-1] < 0))
99 x_start,y_start,x_end,y_end
104 if ((a_path[i2] >= 0) && (a_path[i2-1] >= 0))
107 else if ((a_path[i2] < 0) && (a_path[i2-1] < 0))
109 for(win_i = 0; win_i < window_length; win_i++)
110 fl_line(abs((int)((a_path[i2]+window_length+win_i+x())*ch_width)),
112 abs((int)((a_path[i2-1]+window_length+win_i+x())*ch_width)),
113 y_loc+y_seq_incre+y());
119 for(win_i = 0; win_i < window_length; win_i++)
120 fl_line(abs((int)((a_path[i2]+window_length+win_i+x())*ch_width)),
122 abs((int)((a_path[i2-1]+win_i+x())*ch_width)),
123 y_loc+y_seq_incre+y());
129 for(win_i = 0; win_i < window_length; win_i++)
130 fl_line(abs((int)((a_path[i2]+win_i+x())*ch_width)),
132 abs((int)((a_path[i2-1]+window_length+win_i+x())*ch_width)),
133 y_loc+y_seq_incre+y());