dont draw sequence box when we can see sequence text
[mussa.git] / alg / glseqbrowser.cpp
index 03afaf56c4fac3707735f9afa90752d96fea19ab..afcf6a97fc72d86df432e88978bb20a86c4f64cf 100644 (file)
@@ -185,6 +185,13 @@ void GlSeqBrowser::selectRegion(int top, int left, int bottom, int right)
   processSelection(hits, selectBuf, select_buf_size, selectedRegion);
 }
 
+void GlSeqBrowser::clearSelection()
+{
+  selected_paths.clear();
+  selected_tracks.clear();
+  selectedMode = false;  
+}
+
 float GlSeqBrowser::border() const
 {
   return border_width;
@@ -308,14 +315,14 @@ double GlSeqBrowser::zoom() const
   return zoom_level;
 }
 
-void GlSeqBrowser::setColorMapper(boost::shared_ptr<AnnotationColors> cm)
+void GlSeqBrowser::setColorMapper(AnnotationColorsRef cm)
 {
   color_mapper = cm;
 }
 
-const AnnotationColors& GlSeqBrowser::colorMapper()
+const AnnotationColorsRef GlSeqBrowser::colorMapper()
 {
-  return *color_mapper;
+  return color_mapper;
 }
 
 void GlSeqBrowser::clear()
@@ -354,7 +361,12 @@ void GlSeqBrowser::push_sequence(GlSequence gs)
 
 void GlSeqBrowser::push_sequence(GlSequenceRef gs)
 {
+  ColorRef default_color(GlSequence::default_gene_color());
   GlSequenceRef new_gs(new GlSequence(gs));
+  new_gs->update_annotation_draw_function("gene", draw_narrow_track, default_color);
+  // mark where the sequence is
+  new_gs->add_annotations_for_defined_sequence(draw_summarized_track);
+  
   clear_links();
   track_container.push_back(new_gs);
   update_layout();
@@ -362,7 +374,7 @@ void GlSeqBrowser::push_sequence(GlSequenceRef gs)
     path_segments.push_back(pair_segment_map());
 }
 
-const std::vector<boost::shared_ptr<GlSequence> >& GlSeqBrowser::sequences() const
+const std::vector<GlSequenceRef >& GlSeqBrowser::sequences() const
 {
   return track_container;
 }