1 #ifndef _PATH_WIDGET_H_
2 #define _PATH_WIDGET_H_
5 #include <boost/shared_ptr.hpp>
10 #include "alg/sequence.hpp"
11 #include "alg/glsequence.hpp"
12 #include "qui/seqbrowser/ScrollableSequenceBrowser.hpp"
13 #include "qui/seqbrowser/SequenceBrowserSidebar.hpp"
15 //! the master widget that makes a useful Sequence Browser
16 class SequenceBrowserWidget : public QWidget
21 SequenceBrowserWidget(boost::shared_ptr<QDir>, QWidget *parent=0);
23 //! return the popup menu for the glcanvas (reference stored internally)
24 QMenu *getPopupMenu();
25 //! return our copy actioy (reference stored internally)
26 QAction *getCopySelectedSequenceAsFastaAction();
28 //! copy selected track regions into a list of SequenceLocations
29 void copySelectedTracksAsSeqLocation(std::list<SequenceLocation>& );
31 //! return current zoom size
34 //! reset all of our stored data back to the empty state
37 /* Attach sequences to our browser, its best to attach them all
38 * at once, as otherwise the Sidebar has some rendering trouble
39 * as it draw and redraws the SequenceDescriptions in the various
42 //void push_sequences(std::vector<Sequence>& sequences);
44 const std::vector< boost::shared_ptr<Sequence> >& sequences,
45 boost::shared_ptr<AnnotationColors> cm);
46 void setSequences(std::vector<boost::shared_ptr<GlSequence> >& sequences);
47 const std::vector<boost::shared_ptr<GlSequence> >& sequences() const;
49 //! reset just the links we're displaying
51 //! set per species links
52 void link(const std::vector<int> &path, const std::vector<bool>& isRC, int length);
53 // return set of pathids defined by order of link calls
54 const std::set<int> selectedPaths() const;
55 void centerOnPath(const std::vector<int>& paths);
58 //! copy selected sequence
59 void copySelectedSequenceAsFasta();
61 //! set the zoom level of our browser
63 //! zoom to fit the whole scene on the screen
66 double zoomToSequence();
68 void updatePosition();
69 //! ask the user where to save an image of the current browser view
70 void promptSaveBrowserPixmap();
75 boost::shared_ptr<QDir> default_dir;
76 ScrollableSequenceBrowser scrollable_browser;
77 SequenceBrowserSidebar left_sidebar;
78 SequenceBrowserSidebar right_sidebar;
80 //! sequences created by a setSequences(vector<Sequences>) call
81 /*! I need to save them so i can free them to avoid a memory leak
83 std::vector<boost::shared_ptr<GlSequence> > converted_sequences;