libkpl  5.0
A Library for Graphical Presentation of Data Sets and Functions
vectoritem.h
1 /***************************************************************************
2  vectoritem.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 VECTORITEM_H
23 #define VECTORITEM_H
24 
25 #include "decoitem.h"
26 
27 class KConfigGroup;
28 
33 class Q_DECL_EXPORT VectorItem : public DecoItem
34 {
35 public:
45  VectorItem(unsigned color = 0, double x0 = 0, double y0 = 0,
46  double length = 1, double dir = 0, double relSize = 1);
52  VectorItem(const KConfigGroup* plo, unsigned color = 0);
54  virtual ~VectorItem();
56  inline double dir() const { return m_dir; };
58  inline double length() const { return m_length; };
63  inline void setDir(double dir) { m_dir = dir; };
68  inline void setLength(double length) { m_length = length; };
74  void writePlo(KConfigGroup* plo, bool visible) const;
75 
76 protected:
77  double m_length, m_dir;
78 };
79 
80 #endif
void setDir(double dir)
Sets rotation angle.
Definition: vectoritem.h:63
double dir() const
Returns rotation angle in deg.
Definition: vectoritem.h:56
void writePlo(KConfigGroup *plo, bool visible) const
Writes into plot file.
double length() const
Returns length in cm.
Definition: vectoritem.h:58
Decoration item class.
Definition: decoitem.h:35
Vector item class.
Definition: vectoritem.h:33
void setLength(double length)
Sets length.
Definition: vectoritem.h:68