libkpl  5.0
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) 2017 by Werner Stille
10  email : kpl@werner-stille.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 <QTransform>
26 #include "kplitem.h"
27 
28 class QPointF;
29 class KConfigGroup;
30 
35 class Q_DECL_EXPORT DecoItem : public KplItem
36 {
37 public:
45  DecoItem(unsigned color = 0, double x0 = 0, double y0 = 0,
46  double relSize = 1);
52  DecoItem(const KConfigGroup* plo, unsigned color = 0);
54  virtual ~DecoItem();
56  inline unsigned color() const { return m_color; };
61  inline void setColor(unsigned color) { m_color = color; };
66  inline void setX0(double x0) { m_x0 = x0; };
71  inline void setY0(double y0) { m_y0 = y0; };
77  void updatePos(const QPointF& p, bool absolute = true);
83  void writePlo(KConfigGroup* plo, bool visible) const;
85  inline double x0() const { return m_x0; };
87  inline double y0() const { return m_y0; };
88 
89 protected:
90  unsigned m_color;
91  double m_x0, m_y0;
92  QTransform m_matrix;
93 };
94 
95 #endif
Kpl item class.
Definition: kplitem.h:41
double x0() const
Returns x position in cm.
Definition: decoitem.h:85
double y0() const
Returns y position in cm.
Definition: decoitem.h:87
void writePlo(KConfigGroup *plo, bool visible=true) const
Writes into plot file.
Decoration item class.
Definition: decoitem.h:35
unsigned color() const
Returns color.
Definition: decoitem.h:56
void setColor(unsigned color)
Sets color.
Definition: decoitem.h:61
void setX0(double x0)
Sets x position.
Definition: decoitem.h:66
void setY0(double y0)
Sets y position.
Definition: decoitem.h:71