QElectroTech  0.8-dev
abstractpartellipse.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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 
40 {
41  Q_OBJECT
42  Q_PROPERTY(int startAngle READ startAngle WRITE setStartAngle)
43  Q_PROPERTY(int spanAngle READ spanAngle WRITE setSpanAngle)
44  Q_PROPERTY(QRectF rect READ rect WRITE setRect)
45 
46  // constructors, destructor
47  public:
48  AbstractPartEllipse(QETElementEditor *editor, QGraphicsItem * parent = nullptr);
49  ~AbstractPartEllipse() override;
50 
51  private:
53 
54  signals:
55  void rectChanged();
58 
59  // methods
60  public:
61  void startUserTransformation (const QRectF &) override;
62  void handleUserTransformation (const QRectF &, const QRectF &) override;
63 
64  //Coordinates
65  QRectF boundingRect() const override;
66  QRectF sceneGeometricRect() const override;
67  virtual QPointF sceneTopLeft() const;
68 
69  QRectF rect() const;
70  virtual void setRect (const QRectF &rect);
71  bool isUseless() const override;
72 
73  int startAngle() const {return m_start_angle;}
74  virtual void setStartAngle (const int &start_angle);
75 
76  int spanAngle () const {return m_span_angle;}
77  virtual void setSpanAngle (const int &span_angle);
78 
79  protected:
80  QList<QPointF> saved_points_;
81  QRectF m_rect;
83  qreal m_span_angle;
84  QVector<QetGraphicsHandlerItem *> m_handler_vector;
85 };
86 
87 #endif // ABSTRACTPARTELLIPSE_H
AbstractPartEllipse::AbstractPartEllipse
AbstractPartEllipse(QETElementEditor *editor, QGraphicsItem *parent=nullptr)
AbstractPartEllipse::AbstractPartEllipse Constructor.
Definition: abstractpartellipse.cpp:26
AbstractPartEllipse::AbstractPartEllipse
AbstractPartEllipse(const AbstractPartEllipse &)
AbstractPartEllipse::setSpanAngle
virtual void setSpanAngle(const int &span_angle)
AbstractPartEllipse::setSpanAngle Returns the span angle of an ellipse segment in 16ths of a degree....
Definition: abstractpartellipse.cpp:163
abstractpartellipse.h
CustomElementGraphicPart
The CustomElementGraphicPart class This class is the base for all home-made primitive like line,...
Definition: customelementgraphicpart.h:36
AbstractPartEllipse::m_start_angle
qreal m_start_angle
Definition: abstractpartellipse.h:82
AbstractPartEllipse::~AbstractPartEllipse
~AbstractPartEllipse() override
AbstractPartEllipse::~AbstractPartEllipse Destructor.
Definition: abstractpartellipse.cpp:37
AbstractPartEllipse::saved_points_
QList< QPointF > saved_points_
Definition: abstractpartellipse.h:80
AbstractPartEllipse::boundingRect
QRectF boundingRect() const override
AbstractPartEllipse::boundingRect Bounding rectangle this part can fit into.
Definition: abstractpartellipse.cpp:70
AbstractPartEllipse::setRect
virtual void setRect(const QRectF &rect)
AbstractPartEllipse::setRect Sets the item's ellipse geometry to rect. The rectangle's left edge defi...
Definition: abstractpartellipse.cpp:119
AbstractPartEllipse::m_span_angle
qreal m_span_angle
Definition: abstractpartellipse.h:83
AbstractPartEllipse::isUseless
bool isUseless() const override
AbstractPartEllipse::isUseless.
Definition: abstractpartellipse.cpp:134
AbstractPartEllipse::startAngleChanged
void startAngleChanged()
AbstractPartEllipse::sceneTopLeft
virtual QPointF sceneTopLeft() const
AbstractPartEllipse::sceneTopLeft.
Definition: abstractpartellipse.cpp:98
AbstractPartEllipse::startAngle
int startAngle
Definition: abstractpartellipse.h:42
AbstractPartEllipse::handleUserTransformation
void handleUserTransformation(const QRectF &, const QRectF &) override
AbstractPartEllipse::handleUserTransformation Handle the user-induced transformation from initial_sel...
Definition: abstractpartellipse.cpp:59
AbstractPartEllipse
The AbstractPartEllipse class This is the base class for all ellipse based item like ellipse,...
Definition: abstractpartellipse.h:40
AbstractPartEllipse::m_handler_vector
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition: abstractpartellipse.h:84
AbstractPartEllipse::spanAngle
int spanAngle() const
Definition: abstractpartellipse.h:76
QetGraphicsHandlerItem
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition: qetgraphicshandleritem.h:37
AbstractPartEllipse::startUserTransformation
void startUserTransformation(const QRectF &) override
AbstractPartEllipse::startUserTransformation Start the user-induced transformation,...
Definition: abstractpartellipse.cpp:45
AbstractPartEllipse::rect
QRectF rect
Definition: abstractpartellipse.h:44
customelementgraphicpart.h
SHADOWS_HEIGHT
#define SHADOWS_HEIGHT
Definition: customelementgraphicpart.h:37
AbstractPartEllipse::rectChanged
void rectChanged()
CustomElementPart::mapPoints
QList< QPointF > mapPoints(const QRectF &, const QRectF &, const QList< QPointF > &)
Definition: customelementpart.cpp:69
AbstractPartEllipse::sceneGeometricRect
QRectF sceneGeometricRect() const override
AbstractPartEllipse::sceneGeometricRect.
Definition: abstractpartellipse.cpp:90
AbstractPartEllipse::spanAngle
int spanAngle
Definition: abstractpartellipse.h:43
CustomElementGraphicPart::penWeight
qreal penWeight() const
CustomElementGraphicPart::penWeight.
Definition: customelementgraphicpart.cpp:109
AbstractPartEllipse::startAngle
int startAngle() const
Definition: abstractpartellipse.h:73
AbstractPartEllipse::m_rect
QRectF m_rect
Definition: abstractpartellipse.h:81
AbstractPartEllipse::spanAngleChanged
void spanAngleChanged()
AbstractPartEllipse::setStartAngle
virtual void setStartAngle(const int &start_angle)
AbstractPartEllipse::setStartAngle Sets the start angle for an ellipse segment to angle,...
Definition: abstractpartellipse.cpp:147
QETElementEditor
Definition: qetelementeditor.h:33