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