Allow MussaAlignedWindows to create subanalyses
[mussa.git] / qui / MussaAlignedWindow.hpp
index c4715f9106732cd9afc17d46a50e6532d9142ef0..452ac0e5bea391e48ba588a0a69d391833e8cd08 100644 (file)
@@ -12,6 +12,7 @@
 #include "qui/IntAction.hpp"
 #include "qui/ZoomWidget.hpp"
 #include "qui/seqbrowser/SequenceBrowserWidget.hpp"
+#include "qui/SubanalysisWindow.hpp"
 
 //! Show sequence alignments
 class MussaAlignedWindow : public QMainWindow
@@ -22,11 +23,16 @@ public:
   //! construct an aligned window for an analysis and selected paths
   /*! \param analysis is a shared_ptr to a mussa analysis 
    *  \param paths is a set of "paths" AKA integer offsets into the sequences stored in mussa
+   *  \param window points to a SubanalysisWindowRef, so we can pick interesting
+   *         sequence portions from both the mussa window and the sequence view window
    *  \param parent is the typical Qt pointer to a parent widget
    */ 
-  MussaAlignedWindow(MussaRef analysis, const std::set<int>& paths, QWidget *parent=0);
+  MussaAlignedWindow(MussaRef analysis, const std::set<int>& paths, 
+                     SubanalysisWindowRef window, QWidget *parent=0);
 
 public slots:
+  //! launch a sub analysis
+  void createSubAnalysis();
   //! use selected_paths[pathid] to set the starting position of our sequence
   void setAlignment(int pathid);
   //! toggle whether or not to show the aligned basepairs of a window
@@ -51,10 +57,12 @@ protected:
   //const std::set<int>& selected_paths;
   std::vector<ConservedPath> selected_paths;
   std::vector<bool> view_paths;
+  SubanalysisWindowRef subanalysis_window;
   SequenceBrowserWidget browser;
   QMenu pick_align_menu;
   QMenu view_align_menu;
 
+  QAction *createSubAnalysisAction;
   QAction *saveBrowserPixmapAction;
 
   std::vector <IntAction *> pick_actions;
@@ -62,4 +70,7 @@ protected:
   ZoomWidget *zoom;
   QToolBar *alignTB;
 };
+
+//! reference to a MussaAlignedWindow
+typedef boost::shared_ptr<MussaAlignedWindow> MussaAlignedWindowRef;
 #endif