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

void QEWaveForm::repaint_current_position ( void   )  [slot]

Repaint the current pointer

Definition at line 95 of file qewaveform.cpp.

References set_wave_color().

Referenced by current_position(), and current_position_relative().

                                              { 
  // --------
  DBC_REQUIRE(waveblock != 0);
  // --------

  int waveheight = height() / 2 - 5;
  int half_height = height() / 2;

  QPainter p (this);
  if (xpos != prev_xpos) {

    p.setPen(background_color);
    p.drawLine(prev_xpos, 0, prev_xpos, height());
 
    if (prev_inside_marked == true &&
      marked_rep == true) {
      p.setPen(marked_position_color);
      p.drawLine(xpos, 0, xpos, height());

      p.setPen(marked_background_color);
      p.drawLine(prev_xpos, 0,
             prev_xpos, height());
      p.setPen(marked_color);
    }
    else {
      p.setPen(position_color);
      p.drawLine(xpos, 0, xpos, height());
      p.setPen(wave_color);
    }

    p.drawLine(prev_xpos, half_height - prev_xpos_minimum,
              prev_xpos, half_height - prev_xpos_maximum);

    p.setPen(minmax_color);
    p.drawLine(0, half_height - waveheight,
             width(), half_height - waveheight);
    p.drawLine(0, half_height + waveheight,
             width(), half_height + waveheight);
    
    p.setPen(zeroline_color);
    p.drawLine(0, half_height, width(), half_height);
  }
  p.end();

  if (current_position_rep >= marked_area_begin_rep &&
      current_position_rep <= marked_area_end_rep)
    prev_inside_marked = true;
  else
    prev_inside_marked = false;

  prev_xpos = xpos;
  int min = waveblock_minimum(current_position_rep, step);
  int max = waveblock_maximum(current_position_rep, step);
  if (max > -min)
    set_wave_color(calculate_wave_color_value(max));
  else
    set_wave_color(calculate_wave_color_value(-min));
  prev_xpos_minimum = static_cast<int>(waveblock_minimum(current_position_rep, step) / 32767.0 * waveheight);
  prev_xpos_maximum = static_cast<int>(waveblock_maximum(current_position_rep, step) / 32767.0 * waveheight);
}


Generated by  Doxygen 1.6.0   Back to index