Changes from Version 1 of AddingPaircompControl

Show
Ignore:
Author:
titus (IP: 131.215.240.165)
Timestamp:
11/13/06 22:47:36 (11 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AddingPaircompControl

    v v1  
     1There are a couple of different stages to adding a new widget into the control box for an analysis. 
     2(The control box is the box containing the color/threshold widgets on the right side of a pairwise 
     3display.) 
     4 
     5The steps are pretty similar for all of the types of analyses; the details below are for seqcomp analyses. 
     6 
     7First, add the widget control (checkbox, pull-down menu, whatever) in the !ParsedSeqcompPairwiseAnalysis::add_control_panel 
     8function.  (!ParsedSeqcompPairwiseAnalysis.cc is in cartwheel-interface/).  The !Parsed*Analysis stuff is the way that 
     9individual Cartwheel analyses are wrapped in a semi-generic way that lets FRII load/display them without worrying about 
     10what they are; the Parsed*Analysis files are responsible for adding maps or feature lists into the view, and adding controls 
     11to manipulate them. 
     12 
     13After adding a control, also add a callback function to that control.  This is the function that's going to be called 
     14by the widget control when the value is changed (e.g. for a threshold slider, the position of the slider; for a 
     15checkbox, the on/off state of the checkbox). 
     16 
     17Now, whenever a seqcomp analysis is loaded, you'll get the widget in the control panel for that analysis.  Great.  Let's 
     18make the control *do* something now! 
     19 
     20If you want to modify the way that a seqcomp is drawn, you will want to look in gui/!SeqcompMappingContainer.cc.  Ultimately, 
     21the function 'draw_on_canvas' is called for each seqcomp, with a canvas that does coordinate conversion so that the drawing 
     22function is identical for a dotplot and an alignment view.  So this is the actual function that iterates over each feature 
     23and draws it.  If you wanted to select based on orientation, for example, look for the line 'const int o = m->get_orientation()' 
     24and put an if...continue somewhere below that. 
     25 
     26So, first build a function that tells !MappingContainer to do whatever it is you need it to do (toggles forward/reverse orientation, 
     27for example).  Then connect that function to the _map_cont variable that is part of the !ParsedSeqcompPairwiseAnalysis class in the 
     28callback for the control widget you added.  Voila! 
     29 
     30Now, for the feature that Carolina needs, where it should be an option to display forward or reverse orientations only, or both, 
     31I would suggest making an enum that can be set via a getter/setter function, and then connecting that to a drop-down menu or a 
     32toggle button.  That's up to you. 
     33 
     34Hope this helps!