libkpl  4.1
A Library for Graphical Presentation of Data Sets and Functions
decoitem.h
1 /***************************************************************************
2  decoitem.h - description
3  -------------------
4 
5  This file is a part of kpl - a program for graphical presentation of
6  data sets and functions.
7 
8  begin : Wed Aug 25 1999
9  copyright : (C) 2015 by Werner Stille
10  email : stille@uni-freiburg.de
11  ***************************************************************************/
12 
13 /***************************************************************************
14  * *
15  * This program is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU General Public License as published by *
17  * the Free Software Foundation; either version 2 of the License, or *
18  * (at your option) any later version. *
19  * *
20  ***************************************************************************/
21 
22 #ifndef DECOITEM_H
23 #define DECOITEM_H
24 
25 #include <kdemacros.h>
26 #include <QTransform>
27 #include "kplitem.h"
28 
29 class QPointF;
30 class KConfigGroup;
31 
36 class KDE_EXPORT DecoItem : public KplItem
37 {
38 public:
46  DecoItem(unsigned color = 0, double x0 = 0, double y0 = 0,
47  double relSize = 1);
53  DecoItem(const KConfigGroup* plo, unsigned color = 0);
55  virtual ~DecoItem();
57  inline unsigned color() const { return m_color; };
62  inline void setColor(unsigned color) { m_color = color; };
67  inline void setX0(double x0) { m_x0 = x0; };
72  inline void setY0(double y0) { m_y0 = y0; };
78  void updatePos(const QPointF& p, bool absolute = true);
84  void writePlo(KConfigGroup* plo, bool visible) const;
86  inline double x0() const { return m_x0; };
88  inline double y0() const { return m_y0; };
89 
90 protected:
91  unsigned m_color;
92  double m_x0, m_y0;
93  QTransform m_matrix;
94 };
95 
96 #endif
Kpl item class.
Definition: kplitem.h:43
double x0() const
Returns x position in cm.
Definition: decoitem.h:86
double y0() const
Returns y position in cm.
Definition: decoitem.h:88
void writePlo(KConfigGroup *plo, bool visible=true) const
Writes into plot file.
Decoration item class.
Definition: decoitem.h:36
unsigned color() const
Returns color.
Definition: decoitem.h:57
void setColor(unsigned color)
Sets color.
Definition: decoitem.h:62
void setX0(double x0)
Sets x position.
Definition: decoitem.h:67
void setY0(double y0)
Sets y position.
Definition: decoitem.h:72