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