guide.h
Go to the documentation of this file.
1 /***************************************************************************
2  SocNetV: Social Network Visualizer
3  version: 2.2
4  Written in Qt
5 
6  Guide.h - description
7  -------------------
8  copyright : (C) 2005-2017 by Dimitris B. Kalamaras
9  project site : http://socnetv.org
10 
11  ***************************************************************************/
12 
13 /*******************************************************************************
14 * This program is free software: you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation, either version 3 of the License, or *
17 * (at your option) any later version. *
18 * *
19 * This program is distributed in the hope that it will be useful, *
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22 * GNU General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU General Public License *
25 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
26 ********************************************************************************/
27 
28 #ifndef Guide_H
29 #define Guide_H
30 
31 
32 
33 #include <QGraphicsItem>
34 #include <QObject>
35 
36 
37 class GraphicsWidget;
38 
39 static const int TypeGuide = QGraphicsItem::UserType+7;
40 static const int ZValueGuide = 10;
41 
42 class Guide : public QObject, public QGraphicsItem {
43  Q_OBJECT
44  Q_INTERFACES (QGraphicsItem)
45 
46 public:
48  const double &x0, const double &y0, const double &radius );
50  const double &y0, const int &width);
51  bool isCircle();
52  void setCircle(const QPointF &center, const double &radius) ;
53  void setHorizontalLine(const QPointF &origin, const int &width) ;
54  double radius();
55  int width();
56  enum { Type = UserType + 7 };
57  int type() const { return Type; }
58  void die();
59 
60 
61 protected:
62  QRectF boundingRect() const;
63  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
64 
65 private:
67  double m_radius;
68  int m_width;
69  bool circle;
70 
71 };
72 
73 #endif
74 
75 
76 
int width()
Definition: guide.cpp:79
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition: guide.cpp:94
Definition: guide.h:42
static const int TypeGuide
Definition: guide.h:39
Definition: guide.h:56
bool circle
Definition: guide.h:69
int type() const
Definition: guide.h:57
QRectF boundingRect() const
Definition: guide.cpp:84
GraphicsWidget * graphicsWidget
Definition: guide.h:66
static const int ZValueGuide
Definition: guide.h:40
double m_radius
Definition: guide.h:67
void die()
Definition: guide.cpp:107
Definition: graphicswidget.h:53
void setCircle(const QPointF &center, const double &radius)
Definition: guide.cpp:64
void setHorizontalLine(const QPointF &origin, const int &width)
Definition: guide.cpp:72
Guide(GraphicsWidget *, const double &x0, const double &y0, const double &radius)
Definition: guide.cpp:31
int m_width
Definition: guide.h:68
double radius()
Definition: guide.cpp:56
bool isCircle()
Definition: guide.cpp:60