Logo Search packages:      
Sourcecode: pfstools version File versions  Download package

void Histogram::drawSlider (  )  [private]

Draws slider

Definition at line 186 of file histogram.cpp.

Referenced by processSliderSelection(), and redraw().

{
      float minValue = width * sliderPosMin;
      float maxValue = width * sliderPosMax;
      int sliderHeight = height;

      int offsetX = SIDE_BAR;
      int offsetY = height + height/4 ;

      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); 
      glColor4f(0.2f, 0.2f, 0.5f, 0.3f);
      
      glLoadName(WHOLE_SLIDER); 
      glBegin(GL_QUADS);
            glVertex3f(offsetX + minValue, offsetY, -0.5f);
            glVertex3f(offsetX + minValue, offsetY - sliderHeight, -0.5f);
            glVertex3f(offsetX + maxValue, offsetY - sliderHeight, -0.5f);
            glVertex3f(offsetX + maxValue, offsetY, -0.5f);
      glEnd();

      glColor4f(0.7f, 0.7f, 0.8f, 0.5f);
      glMatrixMode(GL_MODELVIEW);
      glPushMatrix();
            glLoadIdentity();
            glTranslatef(offsetX + minValue, offsetY - sliderHeight/2, 0.0f);
            glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);            
            glLoadName(LEFT_BAR); 
            glutSolidCone(sliderHeight/2, sliderHeight/3.0, 2, 2);
      glPopMatrix();
      glPushMatrix();
            glLoadIdentity();
            glTranslatef(offsetX + maxValue, offsetY - sliderHeight/2, 0.0f);
            glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
            glLoadName(RIGHT_BAR); 
            glutSolidCone(sliderHeight/2, sliderHeight/3.0, 2, 2);
      glPopMatrix();
      
      glDisable(GL_BLEND);
}


Generated by  Doxygen 1.6.0   Back to index