16 #include <QGraphicsScene>
18 #include "arrayitem.h"
19 #include "frameitem.h"
34 class Q_DECL_EXPORT
KplScene :
public QGraphicsScene
43 KplScene(
const QSizeF& size = QSizeF(21, 14.8), QObject* parent = 0);
52 bool exportImage(
const QUrl& url,
bool boundingBox =
true);
61 static bool framelike(
int type);
69 void insertItem(QGraphicsItem* item,
int z = -1);
75 QList<QGraphicsItem*> items(Qt::SortOrder order)
const;
81 QPointF map(
const QPointF& p)
const;
87 QPointF mapInv(
const QPointF& p)
const;
89 inline const QTransform&
matrix()
const {
return m_matrix; };
94 void print(QPrinter* printer);
123 bool readData(
const QUrl& url,
125 bool autoPathHeader =
false,
bool autoNorm =
true,
126 bool logX =
false,
bool logY =
false,
double x0 = 4,
127 double y0 = 3,
double width = 15,
double height = 10,
128 unsigned colorFrame = 0,
unsigned colorGrid = 0,
129 unsigned colorData = 0,
131 const QString& xText =
"x",
const QString& yText =
"y",
132 const QString& header =
"",
double relSize = 1,
int colX = 0,
133 int colY = 1,
int colErr = 2,
bool errorBars =
false,
141 bool readPlo(
const QUrl& url, QWidget* window = 0);
162 static bool readPlo(
const QUrl& url, QList<QGraphicsItem*>& list,
163 QWidget* window = 0,
unsigned colorFrame = 0,
164 unsigned colorGrid = 0,
unsigned colorData = 0,
166 double x0 = 4,
double y0 = 3,
double width = 15,
169 int colX = 0,
int colY = 0,
int colErr = 0,
170 bool errorBars =
false);
180 bool savePlo(
const QUrl& url,
bool absolute =
true,
char format =
'g',
181 int precision = 6)
const;
192 static bool savePlo(
const QUrl& url,
const QList<QGraphicsItem*>& list,
193 bool absolute =
true,
char format =
'g',
202 bool savePS(
const QUrl& url = QUrl(),
bool landscape =
false,
203 bool boundingBox =
true);
205 inline const QSizeF
size()
const {
return m_size; };
207 void setDashOffsets()
const;
212 void setProperties(QGraphicsItem* item)
const;
217 void setSize(
const QSizeF& size);
223 QPointF steps(
int z = -1)
const;
228 void updatePos(QGraphicsItem* item);
237 void mouseMoved(
const QPointF& pos,
const FrameItem* frame);
243 void mousePressed(
const QPointF& pos, Qt::MouseButtons buttons);
248 void positionChanged(QGraphicsItem* item);
253 void previewCreated(
const QString& filename);
267 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* e);
272 virtual void mousePressEvent(QGraphicsSceneMouseEvent* e);
274 QTransform m_matrix, m_inv;