Changeset - 07facfed30c1
[Not reviewed]
Hasan Yavuz Ă–ZDERYA - 9 years ago 2016-09-07 16:06:26
hy@ozderya.net
enabled anti-aliasing
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/plotmanager.cpp
Show inline comments
 
@@ -198,49 +198,52 @@ Plot* PlotManager::addPlotWidget()
 

	
 
    return plot;
 
}
 

	
 
void PlotManager::addCurve(QString title, FrameBuffer* buffer)
 
{
 
    auto curve = new QwtPlotCurve(title);
 
    curve->setSamples(new FrameBufferSeries(buffer));
 
    _addCurve(curve);
 
}
 

	
 
void PlotManager::addCurve(QString title, QVector<QPointF> data)
 
{
 
    auto curve = new QwtPlotCurve(title);
 
    curve->setSamples(data);
 
    _addCurve(curve);
 
}
 

	
 
void PlotManager::_addCurve(QwtPlotCurve* curve)
 
{
 
    // store and init the curve
 
    curves.append(curve);
 

	
 
    unsigned index = curves.size()-1;
 
    curve->setPen(Plot::makeColor(index));
 
    auto pen = QPen(Plot::makeColor(index));
 
    pen.setWidth(2);
 
    curve->setPen(pen);
 
    curve->setRenderHint(QwtPlotItem::RenderAntialiased);
 

	
 
    // create the plot for the curve if we are on multi display
 
    Plot* plot;
 
    if (isMulti)
 
    {
 
        // create a new plot widget
 
        plot = addPlotWidget();
 
    }
 
    else
 
    {
 
        plot = plotWidgets[0];
 
    }
 

	
 
    // show the curve
 
    curve->attach(plot);
 
    plot->replot();
 
}
 

	
 
void PlotManager::removeCurves(unsigned number)
 
{
 
    for (unsigned i = 0; i < number; i++)
 
    {
 
        if (!curves.isEmpty())
 
        {
0 comments (0 inline, 0 general)