Load saved analysis can open new windows
[mussa.git] / qui / MussaAlignedWindow.hpp
1 #ifndef MUSSA_ALIGNED_WINDOW_H
2 #define MUSSA_ALIGNED_WINDOW_H
3
4 #include <set>
5
6 #include <QMainWindow>
7 #include <QMenu>
8 #include <QToolBar>
9 #include "alg/mussa.hpp"
10 #include "qui/IntAction.hpp"
11 #include "qui/ZoomWidget.hpp"
12 #include "qui/seqbrowser/SequenceBrowserWidget.hpp"
13
14 //! Show sequence alignments
15 class MussaAlignedWindow : public QMainWindow
16 {
17   Q_OBJECT 
18
19 public:
20   //! construct an aligned window for an analysis and selected paths
21   MussaAlignedWindow(Mussa&, const std::set<int>&, QWidget *parent=0);
22
23 public slots:
24   //! use selected_paths[pathid] to set the starting position of our sequence
25   void setAlignment(int pathid);
26   //! toggle whether or not to show the aligned basepairs of a window
27   void toggleViewAlignment(int alignment_index);
28
29   //! just force updating the window
30   void update();
31
32 protected:
33   // figure out what Alignments we have (needed for setupAlignmentMenus)
34   void setSelectedPaths(Mussa &m, const std::set<int>& sel_paths);
35   // create our cations
36   void setupActions();
37   // create our menus
38   void setupMenus();
39   //! set menus (must be called after setSelectedPaths)
40   void setupAlignmentMenus();
41   void computeMatchLines();
42   
43   Mussa& analysis;
44   //std::vector<Sequence> sequences;
45   //const std::set<int>& selected_paths;
46   std::vector<ConservedPath> selected_paths;
47   std::vector<bool> view_paths;
48   SequenceBrowserWidget browser;
49   QMenu pick_align_menu;
50   QMenu view_align_menu;
51
52   QAction *saveBrowserPixmapAction;
53
54   std::vector <IntAction *> pick_actions;
55   std::vector <IntAction *> view_actions;
56   ZoomWidget *zoom;
57   QToolBar *alignTB;
58 };
59 #endif