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