1 #ifndef _PATH_WIDGET_H_
2 #define _PATH_WIDGET_H_
5 #include <boost/shared_ptr.hpp>
9 #include "alg/sequence.hpp"
10 #include "alg/glsequence.hpp"
11 #include "qui/seqbrowser/ScrollableSequenceBrowser.hpp"
12 #include "qui/seqbrowser/SequenceBrowserSidebar.hpp"
14 //! the master widget that makes a useful Sequence Browser
15 class SequenceBrowserWidget : public QWidget
20 SequenceBrowserWidget(QWidget *parent=0);
22 //! return the popup menu for the glcanvas (reference stored internally)
23 QMenu &getPopupMenu();
24 //! return our copy actioy (reference stored internally)
25 QAction &getCopySelectedSequenceAsFastaAction();
27 //! return current zoom size
30 //! reset all of our stored data back to the empty state
33 /* Attach sequences to our browser, its best to attach them all
34 * at once, as otherwise the Sidebar has some rendering trouble
35 * as it draw and redraws the SequenceDescriptions in the various
38 //void push_sequences(std::vector<Sequence>& sequences);
40 const std::vector< boost::shared_ptr<Sequence> >& sequences,
41 boost::shared_ptr<AnnotationColors> cm);
42 void setSequences(std::vector<GlSequence>& sequences);
43 const std::vector<GlSequence>& sequences() const;
45 //! reset just the links we're displaying
47 //! set per species links
48 void link(const std::vector<int> &path, const std::vector<bool>& isRC, int length);
49 // return set of pathids defined by order of link calls
50 const std::set<int> selectedPaths() const;
51 void centerOnPath(const std::vector<int>& paths);
54 //! copy selected sequence
55 void copySelectedSequenceAsFasta();
57 //! set the zoom level of our browser
59 //! zoom to fit the whole scene on the screen
62 double zoomToSequence();
64 void updatePosition();
65 //! ask the user where to save an image of the current browser view
66 void promptSaveBrowserPixmap();
71 ScrollableSequenceBrowser scrollable_browser;
72 SequenceBrowserSidebar left_sidebar;
73 SequenceBrowserSidebar right_sidebar;
75 //! sequences created by a setSequences(vector<Sequences>) call
76 /*! I need to save them so i can free them to avoid a memory leak
78 std::vector<GlSequence> converted_sequences;