QElectroTech  0.70
abstractpartellipse.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef ABSTRACTPARTELLIPSE_H
19 #define ABSTRACTPARTELLIPSE_H
20 
22 
24 
36 {
37  Q_OBJECT
38  Q_PROPERTY(int startAngle READ startAngle WRITE setStartAngle)
39  Q_PROPERTY(int spanAngle READ spanAngle WRITE setSpanAngle)
40  Q_PROPERTY(QRectF rect READ rect WRITE setRect)
41 
42  // constructors, destructor
43  public:
44  AbstractPartEllipse(QETElementEditor *editor, QGraphicsItem * parent = nullptr);
45  ~AbstractPartEllipse() override;
46 
47  private:
49 
50  signals:
51  void rectChanged();
52  void startAngleChanged();
53  void spanAngleChanged();
54 
55  // methods
56  public:
57  void startUserTransformation (const QRectF &) override;
58  void handleUserTransformation (const QRectF &, const QRectF &) override;
59 
60  //Coordinates
61  QRectF boundingRect() const override;
62  QRectF sceneGeometricRect() const override;
63  virtual QPointF sceneTopLeft() const;
64 
65  QRectF rect() const;
66  virtual void setRect (const QRectF &rect);
67  bool isUseless() const override;
68 
69  int startAngle() const {return m_start_angle;}
70  virtual void setStartAngle (const int &start_angle);
71 
72  int spanAngle () const {return m_span_angle;}
73  virtual void setSpanAngle (const int &span_angle);
74 
75  protected:
76  QList<QPointF> saved_points_;
77  QRectF m_rect;
79  qreal m_span_angle;
80  QVector<QetGraphicsHandlerItem *> m_handler_vector;
81 };
82 
83 #endif // ABSTRACTPARTELLIPSE_H
QRectF sceneGeometricRect() const override
AbstractPartEllipse::sceneGeometricRect.
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
void handleUserTransformation(const QRectF &, const QRectF &) override
AbstractPartEllipse::handleUserTransformation Handle the user-induced transformation from initial_sel...
QRectF rect() const
QVector< QetGraphicsHandlerItem * > m_handler_vector
virtual void setStartAngle(const int &start_angle)
AbstractPartEllipse::setStartAngle Sets the start angle for an ellipse segment to angle...
The CustomElementGraphicPart class This class is the base for all home-made primitive like line...
The AbstractPartEllipse class This is the base class for all ellipse based item like ellipse...
bool isUseless() const override
AbstractPartEllipse::isUseless.
virtual QPointF sceneTopLeft() const
AbstractPartEllipse::sceneTopLeft.
virtual void setSpanAngle(const int &span_angle)
AbstractPartEllipse::setSpanAngle Returns the span angle of an ellipse segment in 16ths of a degree...
virtual void setRect(const QRectF &rect)
AbstractPartEllipse::setRect Sets the item&#39;s ellipse geometry to rect. The rectangle&#39;s left edge defi...
QRectF boundingRect() const override
AbstractPartEllipse::boundingRect Bounding rectangle this part can fit into.
QList< QPointF > saved_points_
void startUserTransformation(const QRectF &) override
AbstractPartEllipse::startUserTransformation Start the user-induced transformation, provided this primitive is contained within the initial_selection_rect bounding rectangle.