graphicsguide.h
Go to the documentation of this file.
1 /***************************************************************************
2  SocNetV: Social Network Visualizer
3  version: 2.5
4  Written in Qt
5 
6  graphicsguide.h - description
7  -------------------
8  copyright : (C) 2005-2018 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 GRAPHICSGUIDE_H
29 #define GRAPHICSGUIDE_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 GraphicsGuide : 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 
bool isCircle()
Definition: graphicsguide.cpp:60
void setHorizontalLine(const QPointF &origin, const int &width)
Definition: graphicsguide.cpp:72
bool circle
Definition: graphicsguide.h:69
double m_radius
Definition: graphicsguide.h:67
Definition: graphicsguide.h:42
void setCircle(const QPointF &center, const double &radius)
Definition: graphicsguide.cpp:64
GraphicsWidget * graphicsWidget
Definition: graphicsguide.h:66
Definition: graphicsguide.h:56
int width()
Definition: graphicsguide.cpp:79
static const int ZValueGuide
Definition: graphicsguide.h:40
static const int TypeGuide
Definition: graphicsguide.h:39
int m_width
Definition: graphicsguide.h:68
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition: graphicsguide.cpp:94
int type() const
Definition: graphicsguide.h:57
Definition: graphicswidget.h:59
QRectF boundingRect() const
Definition: graphicsguide.cpp:84
void die()
Definition: graphicsguide.cpp:107
double radius()
Definition: graphicsguide.cpp:56
GraphicsGuide(GraphicsWidget *, const double &x0, const double &y0, const double &radius)
Definition: graphicsguide.cpp:31