[project @ 13]
[mussa.git] / mussa_gui_conn_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_subana.hh"
12
13 #include <sstream>
14
15 class ConnView : public Fl_Box
16 {
17   public:
18     ConnView(int x_top,int y_top,int x_bot,int y_bot) :
19       Fl_Box(x_top,y_top,x_bot,y_bot)
20     {}
21
22     void setup(string name, int sq_num, int win_len,
23                vector<Sequence> *, Nway_Paths *);
24     void scale_paths();
25
26     void spawnSeq();
27     void find_motifs();
28     void annot_win();
29
30     void toggle_bars();
31     void set_bar_interval(int new_bar_len);
32     void toggle_lines();
33     void set_line_interval(int new_line_len);
34
35
36   private:
37     string ana_name;
38     int seq_num, window, threshold;
39     bool win_append, thres_append;
40
41   //this data is passed as pointers to the instantiated classes
42     vector<Sequence> *S;
43     Nway_Paths *P;
44
45     int name_pad, y_pad;
46     float x_scale_factor;
47     int y_seq_incre;
48     int drag_start, drag_end;
49     float y_drag_start;
50     int ref_seq_num, max_seq_len;
51     bool dragging, selected;
52     list<bool> highlight;
53
54   //path data scaled for current view size
55     list<vector<int> > scaled_pathz;
56     vector<int> seq_lens;
57     vector<int> seq_scales;
58     int bar_interval, line_interval;
59     bool show_bars, show_lines;
60
61   //keeps track of all the motifs the user has inputed
62     vector<motif> some_motifs;
63     MotifWindow *motif_find_window;
64
65   //keeps track of the colors assigned to each motif type
66     vector<annot_color> some_annots;
67     AnnotWindow *annot_color_window;
68
69     SeqWindow *a_seq_win;
70
71     void draw();
72     void draw_paths();
73     void draw_sequence_stuff();
74
75     void resize(int x, int y, int w, int h); 
76     int handle(int e);
77     void check_new_motifs();
78
79   //for drawing function debugging
80     void reporter(string var, int value);
81     void report_float(string var, float value);
82 };