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 //! copy selected track regions into a list of SequenceLocations
28 void copySelectedTracksAsSeqLocation(std::list<SequenceLocation>& );
30 //! return current zoom size
33 //! reset all of our stored data back to the empty state
36 /* Attach sequences to our browser, its best to attach them all
37 * at once, as otherwise the Sidebar has some rendering trouble
38 * as it draw and redraws the SequenceDescriptions in the various
41 //void push_sequences(std::vector<Sequence>& sequences);
43 const std::vector< boost::shared_ptr<Sequence> >& sequences,
44 boost::shared_ptr<AnnotationColors> cm);
45 void setSequences(std::vector<boost::shared_ptr<GlSequence> >& sequences);
46 const std::vector<boost::shared_ptr<GlSequence> >& sequences() const;
48 //! reset just the links we're displaying
50 //! set per species links
51 void link(const std::vector<int> &path, const std::vector<bool>& isRC, int length);
52 // return set of pathids defined by order of link calls
53 const std::set<int> selectedPaths() const;
54 void centerOnPath(const std::vector<int>& paths);
57 //! copy selected sequence
58 void copySelectedSequenceAsFasta();
60 //! set the zoom level of our browser
62 //! zoom to fit the whole scene on the screen
65 double zoomToSequence();
67 void updatePosition();
68 //! ask the user where to save an image of the current browser view
69 void promptSaveBrowserPixmap();
74 ScrollableSequenceBrowser scrollable_browser;
75 SequenceBrowserSidebar left_sidebar;
76 SequenceBrowserSidebar right_sidebar;
78 //! sequences created by a setSequences(vector<Sequences>) call
79 /*! I need to save them so i can free them to avoid a memory leak
81 std::vector<boost::shared_ptr<GlSequence> > converted_sequences;