Thicker bars, better letters
[mussa.git] / gui / SubAnalysisWindow.hh
1 #ifndef _MUSSA_GUI_SUBANA_H_
2 #define _MUSSA_GUI_SUBANA_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 <string>
13 #include <vector>
14
15 #include <FL/Fl_Button.H>
16 #include <FL/Fl_Window.H>
17 #include <FL/Fl_Input.H>
18 #include <FL/Fl_File_Chooser.H>
19 #include <FL/Fl_Scroll.H>
20
21 #include "alg/mussa_class.hh"
22 #include "SeqTextWindow.hh"
23
24 class SubAnalysisWindow : public Fl_Window
25
26   public:
27     SubAnalysisWindow(int w, int h, const char* title, Mussa *an_analysis,
28                  std::vector<Sequence> some_Seqs);
29     ~SubAnalysisWindow();
30     bool done();
31
32
33     Fl_Button* test;
34
35     Fl_Input *name_input;
36     Fl_Input *win_input;
37     Fl_Input *thres_input;
38     Fl_Input *seq_num_input;
39     Fl_Scroll *seq_scroll;
40     // need to keep track of these so a browsed file search can set the input
41     // fields to the selected file
42     std::vector<Fl_Input*> seq_inputs, annot_inputs;
43
44
45     // callback receiver functions
46
47     void real_do_subana();
48
49     void real_set_ana_name_cb(Fl_Input* o);
50     void real_set_win_size_cb(Fl_Input* o);
51     void real_set_threshold_cb(Fl_Input* o);
52
53     void real_sub_start_in_cb(Fl_Input* o, int i);
54     void real_sub_end_in_cb(Fl_Input* o, int i);
55
56   private:
57     // sequence data
58     std::vector<Sequence> the_seqs;
59     Mussa *an_analysis;
60     std::string analysis_name;
61     int window, threshold, seq_num;
62     std::vector<int> sub_seq_starts, sub_seq_ends;
63     bool win_append, thres_append;
64     bool all_done;
65
66     static void print_cb(Fl_Button*, void*);
67     inline void print_cb_real(Fl_Button*, void*);
68
69     void add_seq_input(int index, std::string a_name);
70 };
71
72 // crazy whacked shite Titus taught me to do to get an index value associated
73 // with each instance of an input associated with the callback... 
74
75
76 struct sub_seq_data_instance
77 {
78   SubAnalysisWindow * sw_ptr;
79   int index;
80 };
81 #endif