QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
abstractpartellipse.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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:
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;
84 QVector<QetGraphicsHandlerItem *> m_handler_vector;
85};
86
87#endif // ABSTRACTPARTELLIPSE_H
The AbstractPartEllipse class This is the base class for all ellipse based item like ellipse,...
Definition abstractpartellipse.h:40
int spanAngle() const
Definition abstractpartellipse.h:76
QRectF rect
Definition abstractpartellipse.h:44
QList< QPointF > saved_points_
Definition abstractpartellipse.h:80
int startAngle
Definition abstractpartellipse.h:42
QRectF m_rect
Definition abstractpartellipse.h:81
int spanAngle
Definition abstractpartellipse.h:43
void handleUserTransformation(const QRectF &, const QRectF &) override
AbstractPartEllipse::handleUserTransformation Handle the user-induced transformation from initial_sel...
Definition abstractpartellipse.cpp:59
virtual QPointF sceneTopLeft() const
AbstractPartEllipse::sceneTopLeft.
Definition abstractpartellipse.cpp:99
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:167
QRectF sceneGeometricRect() const override
AbstractPartEllipse::sceneGeometricRect.
Definition abstractpartellipse.cpp:90
void startUserTransformation(const QRectF &) override
AbstractPartEllipse::startUserTransformation Start the user-induced transformation,...
Definition abstractpartellipse.cpp:45
QRectF boundingRect() const override
AbstractPartEllipse::boundingRect Bounding rectangle this part can fit into.
Definition abstractpartellipse.cpp:70
qreal m_span_angle
Definition abstractpartellipse.h:83
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:122
qreal m_start_angle
Definition abstractpartellipse.h:82
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition abstractpartellipse.h:84
bool isUseless() const override
AbstractPartEllipse::isUseless.
Definition abstractpartellipse.cpp:137
virtual void setStartAngle(const int &start_angle)
AbstractPartEllipse::setStartAngle Sets the start angle for an ellipse segment to angle,...
Definition abstractpartellipse.cpp:151
The CustomElementGraphicPart class This class is the base for all home-made primitive like line,...
Definition customelementgraphicpart.h:36
Definition qetelementeditor.h:39
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition qetgraphicshandleritem.h:37