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 fasta copy action (reference stored internally)
26 QAction *getCopySelectedSequenceAsFastaAction();
27 //! return our string copy action (reference stored internally)
28 QAction *getCopySelectedSequenceAsStringAction();
30 //! copy selected track regions into a list of SequenceLocations
31 void copySelectedTracksAsSeqLocation(std::list<SequenceLocation>& );
33 //! return current zoom size
36 //! reset all of our stored data back to the empty state
39 /* Attach sequences to our browser, its best to attach them all
40 * at once, as otherwise the Sidebar has some rendering trouble
41 * as it draw and redraws the SequenceDescriptions in the various
44 //void push_sequences(std::vector<Sequence>& sequences);
46 const std::vector< boost::shared_ptr<Sequence> >& sequences,
47 boost::shared_ptr<AnnotationColors> cm);
48 void setSequences(std::vector<boost::shared_ptr<GlSequence> >& sequences);
49 const std::vector<boost::shared_ptr<GlSequence> >& sequences() const;
51 //! reset just the links we're displaying
53 //! set per species links
54 void link(const std::vector<int> &path, const std::vector<bool>& isRC, int length);
55 // return set of pathids defined by order of link calls
56 const std::set<int> selectedPaths() const;
57 void centerOnPath(const std::vector<int>& paths);
60 //! copy selected sequence
61 void copySelectedSequenceAsFasta();
63 //! set the zoom level of our browser
65 //! zoom to fit the whole scene on the screen
68 double zoomToSequence();
70 void updatePosition();
71 //! ask the user where to save an image of the current browser view
72 void promptSaveBrowserPixmap();
77 //! emit when someone copies basepairs
78 void basepairsCopied(size_t);
81 boost::shared_ptr<QDir> default_dir;
82 ScrollableSequenceBrowser scrollable_browser;
83 SequenceBrowserSidebar left_sidebar;
84 SequenceBrowserSidebar right_sidebar;
86 //! sequences created by a setSequences(vector<Sequences>) call
87 /*! I need to save them so i can free them to avoid a memory leak
89 std::vector<boost::shared_ptr<GlSequence> > converted_sequences;