Spectrogram::Spectrogram(Graph *graph, Matrix *m): QwtPlotSpectrogram(QString(m->objectName())), d_graph(graph), d_matrix(m), color_axis(QwtPlot::yRight), color_map_policy(Default), color_map(QwtLinearColorMap()), d_show_labels(true), d_labels_color(Qt::black), d_labels_font(QFont()), d_white_out_labels(false), d_labels_angle(0.0), d_labels_x_offset(0), d_labels_y_offset(0), d_selected_label(NULL), d_use_matrix_formula(false), d_color_map_pen(false), d_impose_range(false) { setData(MatrixData(m)); double step = fabs(data().range().maxValue() - data().range().minValue())/5.0; QwtValueList contourLevels; for ( double level = data().range().minValue() + step; level < data().range().maxValue(); level += step ) contourLevels += level; setContourLevels(contourLevels); }
void Spectrogram::setLevelsNumber(int levels) { double step = fabs(data().range().maxValue() - data().range().minValue())/(double)levels; QwtValueList contourLevels; for ( double level = data().range().minValue() + 0.5*step; level < data().range().maxValue(); level += step ) contourLevels += level; setContourLevels(contourLevels); }
PlotSpectr::PlotSpectr() { setRenderThreadCount(0); // use system specific thread count QList<double> contourLevels; contourLevels += 0.99; setContourLevels( contourLevels ); setAlpha(0); setDisplayMode( QwtPlotSpectrogram::ContourMode, true ); setCachePolicy( QwtPlotRasterItem::PaintCache ); setRenderHint(QwtPlotItem::RenderAntialiased); }
void Spectrogram::setLevelsNumber(int levels) { if (levels <= 0) return; double step = fabs(range().maxValue() - range().minValue())/(double)levels; QwtValueList contourLevels; for ( double level = range().minValue() + 0.5*step; level < range().maxValue(); level += step ) contourLevels += level; setContourLevels(contourLevels); }
Spectrogram::Spectrogram(Matrix *m): QwtPlotSpectrogram(QString(m->objectName())), d_matrix(m), color_axis(QwtPlot::yRight), color_map_policy(Default), color_map(QwtLinearColorMap()) { setData(MatrixData(m)); double step = fabs(data().range().maxValue() - data().range().minValue())/5.0; QwtValueList contourLevels; for ( double level = data().range().minValue() + step; level < data().range().maxValue(); level += step ) contourLevels += level; setContourLevels(contourLevels); }