Thicker bars, better letters
[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 "alg/sequence.hh"
18 #include "alg/nway_paths.hh"
19 #include "SeqView.hh"
20 #include "SeqWindow.hh"
21 #include "MotifWindow.hh"
22 #include "AnnotWindow.hh" // aparently for annot_color
23
24 #include <FL/Fl_Box.H>
25
26 class NwayPaths;
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> *, NwayPaths *);
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 analysis_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     //! Store the nway paths our analysis did, we mostly need the refined paths
56     NwayPaths *P;
57
58     int name_pad, y_pad;
59     float x_scale_factor;
60     int y_seq_incre;
61     int drag_start, drag_end;
62     float y_drag_start;
63     int ref_seq_num, max_seq_len;
64     bool dragging, selected;
65     std::list<bool> highlight;
66
67   //path data scaled for current view size
68     std::list<ExtendedConservedPath > scaled_pathz;
69     std::vector<int> seq_lens;
70     std::vector<int> seq_scales;
71     int bar_interval, line_interval;
72     bool show_bars, show_lines;
73
74   //keeps track of all the motifs the user has inputed
75     std::vector<motif> some_motifs;
76     MotifWindow *motif_find_window;
77
78   //keeps track of the colors assigned to each motif type
79     std::vector<annot_color> some_annots;
80     AnnotWindow *annot_color_window;
81
82     SeqWindow *a_seq_win;
83
84     void draw();
85     void draw_paths();
86     void draw_sequence_stuff();
87
88     void resize(int x, int y, int w, int h); 
89     int handle(int e);
90     void check_new_motifs();
91
92   //for drawing function debugging
93     void reporter(std::string var, int value);
94     void report_float(std::string var, float value);
95 };
96 #endif