/** Paints an integral and an outline of that integral for each data set (rsdht * and/or alldht) that is to be displayed. The integrals will be drawn first, * followed by the outlines, since we want the area of overlapping integrals * to blend, but not the outlines of those integrals. */ void RSGraphWidget::paintData() { /* Convert the bandwidth data points to graph points */ if(_source == NULL) return ; const RSGraphSource& source(*_source) ; _maxValue = 0.0f ; for(int i=0;i<source.n_values();++i) if( _masked_entries.find(source.displayName(i).toStdString()) == _masked_entries.end() ) { std::vector<QPointF> values ; source.getDataPoints(i,values) ; QVector<QPointF> points ; pointsFromData(values,points) ; /* Plot the bandwidth data as area graphs */ if (_flags & RSGRAPH_FLAGS_PAINT_STYLE_PLAIN) paintIntegral(points, getColor(i), _opacity); /* Plot the bandwidth as solid lines. If the graph style is currently an * area graph, we end up outlining the integrals. */ paintLine(points, getColor(i)); } if(_maxValue > 0.0f) if(_flags & RSGRAPH_FLAGS_LOG_SCALE_Y) _y_scale = _rec.height()*0.8 / log(_maxValue) ; else _y_scale = _rec.height()*0.8/_maxValue ; }
/** Paints an integral and an outline of that integral for each data set (send * and/or receive) that is to be displayed. The integrals will be drawn first, * followed by the outlines, since we want the area of overlapping integrals * to blend, but not the outlines of those integrals. */ void GraphFrame::paintData() { QVector<QPointF> recvPoints, sendPoints; /* Convert the bandwidth data points to graph points */ recvPoints = pointsFromData(_recvData); sendPoints = pointsFromData(_sendData); if (_graphStyle == AreaGraph) { /* Plot the bandwidth data as area graphs */ if (_showRecv) paintIntegral(recvPoints, RECV_COLOR, 0.6); if (_showSend) paintIntegral(sendPoints, SEND_COLOR, 0.4); } /* Plot the bandwidth as solid lines. If the graph style is currently an * area graph, we end up outlining the integrals. */ if (_showRecv) paintLine(recvPoints, RECV_COLOR); if (_showSend) paintLine(sendPoints, SEND_COLOR); }