[project @ 13]
[mussa.git] / mussa_gui_seq_view.hh
1 //  This file is part of the Mussa source distribution.
2 //  http://mussa.caltech.edu/
3 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
4
5 // This program and all associated source code files are Copyright (C) 2005
6 // the California Institute of Technology, Pasadena, CA, 91125 USA.  It is
7 // under the GNU Public License; please see the included LICENSE.txt
8 // file for more information, or contact Tristan directly.
9
10
11 #include "mussa_gui_load_window.hh"
12
13 #include <math.h>
14 #include <FL/Fl_Box.H>
15 #include <FL/fl_draw.H>
16
17 class SeqView : public Fl_Box
18 {
19   public:
20     SeqView(int x_top,int y_top,int x_bot,int y_bot) :
21       Fl_Box(x_top,y_top,x_bot,y_bot)
22     {
23       x_max = x_bot;
24       y_max = y_bot;
25       x_min = x_top;
26       y_min = y_top;
27       show_bars = true;
28       show_motifs = true;
29     }
30              
31     void setup(string name, int sq_num, vector<Sequence> *some_seqs, 
32                list<vector<int> > some_paths, vector<int> some_lens,
33                vector<motif> *some_motifs);
34     void align_offsets(int align_num);
35     void toggle_align(int align_num);
36     void toggle_bars();
37     void toggle_motifs();
38
39   private:
40     string ana_name;
41     int seq_num;
42     int base_window_len;
43
44   //this data is passed as pointers to the instantiated classes
45     vector<Sequence> *S;
46   //list of paths in selection box
47     list<vector<int> > P;
48     vector<int> seq_lens;
49   //pointer to passed motif data
50     vector<motif> *the_motifs;
51
52     int x_max, y_max, x_min, y_min;
53     int y_seq_incre;
54     int index_pad;
55     vector<int> seq_align_offsets;
56     vector<string> raw_sequence;
57     bool dragging;
58     int drag_change, scroll_offset;
59     bool show_bars, show_motifs;
60     vector<bool> show_aligns;
61
62     void resize(int new_x, int new_y, int new_w, int new_h);
63     void draw();
64     void draw_motifs(double ch_width);
65     void draw_sequence(double ch_width);
66     void draw_match_lines(double ch_width);
67     void draw_indices(double ch_width);
68     int handle(int e);
69     void reporter(string id, int value);
70 };