Update mussa to build on ubuntu 10.04 with qt 4.6.2 +boost 1.40.0.1
[mussa.git] / qui / MussaAlignedWindow.hpp
index 1e7139053776deeb493c6483a3037426c6d6f623..28d43d6e8e2fe82d03c244fb1eef1efc50d8a358 100644 (file)
@@ -3,13 +3,18 @@
 
 #include <set>
 
+#include <boost/shared_ptr.hpp>
+
+#include <QDir>
 #include <QMainWindow>
 #include <QMenu>
 #include <QToolBar>
 #include "alg/mussa.hpp"
 #include "qui/IntAction.hpp"
 #include "qui/ZoomWidget.hpp"
+#include "qui/ThresholdWidget.hpp"
 #include "qui/seqbrowser/SequenceBrowserWidget.hpp"
+#include "qui/subanalysis/SubanalysisWindow.hpp"
 
 //! Show sequence alignments
 class MussaAlignedWindow : public QMainWindow
@@ -18,9 +23,20 @@ class MussaAlignedWindow : public QMainWindow
 
 public:
   //! construct an aligned window for an analysis and selected paths
-  MussaAlignedWindow(Mussa&, const std::set<int>&, QWidget *parent=0);
+  /*! \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, 
+                     boost::shared_ptr<QDir> default_dir,
+                     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
@@ -28,10 +44,15 @@ public slots:
 
   //! just force updating the window
   void update();
+  
+  //! set the title based on the analysis
+  void updateTitle();
+  //! display how many base pairs were copied on the status bar
+  void showBasePairsCopied(size_t);
 
 protected:
   // figure out what Alignments we have (needed for setupAlignmentMenus)
-  void setSelectedPaths(Mussa &m, const std::set<int>& sel_paths);
+  void setSelectedPaths(MussaRef m, const std::set<int>& sel_paths);
   // create our cations
   void setupActions();
   // create our menus
@@ -40,20 +61,27 @@ protected:
   void setupAlignmentMenus();
   void computeMatchLines();
   
-  Mussa& analysis;
+  MussaRef analysis;
+  boost::shared_ptr<QDir> default_dir;
   //std::vector<Sequence> sequences;
   //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;
   std::vector <IntAction *> view_actions;
   ZoomWidget *zoom;
+  ThresholdWidget *threshold_widget;
   QToolBar *alignTB;
 };
+
+//! reference to a MussaAlignedWindow
+typedef boost::shared_ptr<MussaAlignedWindow> MussaAlignedWindowRef;
 #endif