-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotitem.cpp
33 lines (28 loc) · 853 Bytes
/
plotitem.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
////////////////////////////////////////////////////////////////////////////////
// Name: plotitem.cpp
// Purpose: Implementation of class FractalPlotItem
// Author: Anton van Wezenbeek
// Copyright: (c) 2012 Anton van Wezenbeek
////////////////////////////////////////////////////////////////////////////////
#include <QtGui>
#include <qwt_painter.h>
#include "plotitem.h"
#include "fractalwidget.h"
FractalPlotItem::FractalPlotItem()
{
setItemAttribute(AutoScale);
setRenderHint(QwtPlotItem::RenderAntialiased, true);
setZ(1);
}
void FractalPlotItem::draw(QPainter *p,
const QwtScaleMap&,
const QwtScaleMap&,
const QRectF& r) const
{
const FractalWidget* fw = (FractalWidget *)plot();
QwtPainter::drawPixmap(p, r, fw->fractalPixmap());
}
int FractalPlotItem::rtti() const
{
return QwtPlotItem::Rtti_PlotUserItem;
}