X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=alg%2Fglsequence.cpp;h=5362b21b1ce96824865d734a6ae39fd7eb116c4a;hp=2e5bb756b03979448291da6c56982439a3281549;hb=16ee7264600da01db691667bfb684d88b869ee37;hpb=3c5e9d09704b35421555398fe79bb50b4218d615 diff --git a/alg/glsequence.cpp b/alg/glsequence.cpp index 2e5bb75..5362b21 100644 --- a/alg/glsequence.cpp +++ b/alg/glsequence.cpp @@ -264,6 +264,24 @@ const ColorRef GlSequence::color() const return seq->drawable()->color(); } +ColorRef GlSequence::default_gene_color() +{ + static ColorRef default_color; + if (not default_color) { + default_color.reset(new Color(0.0, 0.8, 0.0)); + } + return default_color; +} + +ColorRef GlSequence::default_track_color() +{ + static ColorRef default_color; + if (not default_color) { + default_color.reset(new Color(0.0, 0.0, 0.0)); + } + return default_color; +} + int GlSequence::get_viewport_width_in_pixels() { GLint viewport[4]; @@ -355,7 +373,7 @@ void GlSequence::draw_annotations(GLfloat left, GLfloat right) const assert((*annot_itor)->parent() == seq); drawable->drawFunction()((*annot_itor), left, right); } else { - glColor3f(0.0, 0.8, 0.0); + glColor3fv(default_gene_color()->get()); draw_box(left, right, x()+(*annot_itor)->start(), x()+(*annot_itor)->stop(), height(), y(), annotation_z); } @@ -498,7 +516,7 @@ void draw_narrow_track(SeqSpanRef s, float left, float right) float y( (parent_draw) ? parent_draw->y() : 0); float z( (parent_draw) ? parent_draw->z() : 10 ); float height( (parent_draw) ? parent_draw->height() : default_height ); - Color c( (s->drawable()) ? s->drawable()->color() : Color(0.0, 0.0, 0.0) ); + Color c( (s->drawable()) ? s->drawable()->color() : *GlSequence::default_track_color() ); glColor3fv(c.get()); float hsmall = height * 0.25; @@ -514,7 +532,7 @@ void draw_track(SeqSpanRef s, float left, float right) float y( (parent_draw) ? parent_draw->y() : 0); float z( (parent_draw) ? parent_draw->z() : 10 ); float height( (parent_draw) ? parent_draw->height() : default_height ); - Color c( (s->drawable()) ? s->drawable()->color() : Color(0.0, 0.0, 0.0) ); + Color c( (s->drawable()) ? s->drawable()->color() : *GlSequence::default_track_color() ); glColor3fv( c.get() ); GlSequence::draw_box(left, right, x+s->start(), x+s->stop(),