X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=alg%2Fglsequence.cpp;h=c77c29b5369a4acf5ab72d2981c16e3f2d403d08;hp=6c8b12b80410418e2e8bc2c0ec537a574724283a;hb=55f0a3e9612b3e1df2c588682d7f605203eab421;hpb=fd0de7877ef325b4922bfe9968d85607a681751d diff --git a/alg/glsequence.cpp b/alg/glsequence.cpp index 6c8b12b..c77c29b 100644 --- a/alg/glsequence.cpp +++ b/alg/glsequence.cpp @@ -85,7 +85,7 @@ SeqSpanRef GlSequence::make_undefined_sequence_annotation( return empty_seq; } -void GlSequence::add_annotations_for_undefined_sequence(Drawable::draw_func_ptr draw) +void GlSequence::add_annotations_for_defined_sequence(Drawable::draw_func_ptr draw) { Sequence::const_iterator start_i = begin(); Sequence::const_iterator seq_i = begin(); @@ -95,7 +95,7 @@ void GlSequence::add_annotations_for_undefined_sequence(Drawable::draw_func_ptr for(; seq_i != end_i; ++seq_i) { // need a better set of characters to serch for - if (*seq_i == 'N' or *seq_i == 'n') { + if (not (*seq_i == 'N' or *seq_i == 'n')) { if (start_block_i == end_i) { start_block_i = seq_i; } @@ -280,7 +280,8 @@ void GlSequence::draw(GLfloat left, GLfloat right) const void GlSequence::draw_box(GLfloat world_left, GLfloat world_right, GLfloat left, GLfloat right, - GLfloat height, GLfloat y, GLfloat z) + GLfloat height, GLfloat y, GLfloat z, + GLint primitive) { GLfloat pixel_width = pixelWidth(world_left, world_right); GLfloat offset = height/2.0; @@ -291,7 +292,7 @@ void GlSequence::draw_box(GLfloat world_left, GLfloat world_right, if ((right-left) < pixel_width) { right = left + pixel_width; } - glBegin(GL_QUADS); + glBegin(primitive); glVertex3f(left, top, z); glVertex3f(left, bottom, z); glVertex3f(right, bottom, z); @@ -303,7 +304,7 @@ void GlSequence::draw_track(GLfloat left, GLfloat right) const { glColor3fv(color()->get()); // draw main sequence track - draw_box(left, right, x(), x()+Sequence::size(), height(), y(), 0.0); + draw_box(left, right, x(), x()+Sequence::size(), height(), y(), 0.0, GL_LINE_LOOP); } void GlSequence::draw_annotations(GLfloat left, GLfloat right) const @@ -465,8 +466,22 @@ void draw_narrow_track(SeqSpanRef s, float left, float right) float z( (parent_draw) ? parent_draw->z() : 10 ); float height( (parent_draw) ? parent_draw->height() : default_height ); - glColor3f(1.0, 1.0, 1.0); - float hsmall = height * 3.0/4.0; + glColor3f(0.0, 0.0, 0.0); + float hsmall = height * 0.5; GlSequence::draw_box(left, right, x+s->start(), x+s->stop(), hsmall, y, z+10); +} + +void draw_track(SeqSpanRef s, float left, float right) +{ + SeqSpanRef parent(s->parent()); + DrawableRef parent_draw(parent->drawable()); + float x( (parent_draw) ? parent_draw->x() : 0); + 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 ); + + glColor3f(0.0, 0.0, 0.0); + GlSequence::draw_box(left, right, x+s->start(), x+s->stop(), + height, y, z+10); } \ No newline at end of file