QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
qetgraphicshandlerutility.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 QETGRAPHICSHANDLERUTILITY_H
19#define QETGRAPHICSHANDLERUTILITY_H
20
21#include <QRectF>
22#include <QLineF>
23#include <QPolygonF>
24
25class QPainter;
26
34{
35 public:
36 static QVector <QPointF> pointsForRect (const QRectF &rect);
37 static QVector <QPointF> pointsForLine (const QLineF &line);
38 static QVector <QPointF> pointsForArc (const QRectF &rect, qreal start_angle, qreal span_angle);
39 static QRectF rectForPosAtIndex (const QRectF &old_rect, const QPointF &pos, int index);
40 static QRectF mirrorRectForPosAtIndex (const QRectF &old_rect, const QPointF &pos, int index);
41 static QRectF rectForArc (const QRectF &rect, qreal start_angle, qreal span_angle);
42 static QLineF lineForPosAtIndex (const QLineF &old_line, const QPointF &pos, int index);
43 static QPolygonF polygonForInsertPoint(const QPolygonF &old_polygon, bool closed, const QPointF &pos);
44 static QVector <QPointF> pointForRadiusRect (const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
45 static qreal radiusForPosAtIndex (const QRectF &rect, const QPointF &pos, int index, Qt::SizeMode mode = Qt::AbsoluteSize);
46 static qreal percentageInRange(qreal min, qreal max, qreal value);
47};
48
49#endif // QETGRAPHICSHANDLERUTILITY_H
The QetGraphicsHandlerUtility class This class provide some methods to create and use handler for mod...
Definition qetgraphicshandlerutility.h:34
static QVector< QPointF > pointsForArc(const QRectF &rect, qreal start_angle, qreal span_angle)
QetGraphicsHandlerUtility::pointsForArc Return the points for the given arc. The first value in the v...
Definition qetgraphicshandlerutility.cpp:79
static QVector< QPointF > pointsForLine(const QLineF &line)
QetGraphicsHandlerUtility::pointsForLine The point that define a line in a QVector....
Definition qetgraphicshandlerutility.cpp:65
static QLineF lineForPosAtIndex(const QLineF &old_line, const QPointF &pos, int index)
QetGraphicsHandlerUtility::lineForPosAtIndex Return a line after modification of pos at index index o...
Definition qetgraphicshandlerutility.cpp:212
static QRectF mirrorRectForPosAtIndex(const QRectF &old_rect, const QPointF &pos, int index)
QetGraphicsHandlerUtility::mirrorRectForPosAtIndex Return a rectangle after modification of the point...
Definition qetgraphicshandlerutility.cpp:138
static qreal percentageInRange(qreal min, qreal max, qreal value)
Definition qetgraphicshandlerutility.cpp:396
static QRectF rectForPosAtIndex(const QRectF &old_rect, const QPointF &pos, int index)
QetGraphicsHandlerUtility::rectForPosAtIndex Return a rectangle after modification of the point 'pos'...
Definition qetgraphicshandlerutility.cpp:105
static QPolygonF polygonForInsertPoint(const QPolygonF &old_polygon, bool closed, const QPointF &pos)
QetGraphicsHandlerUtility::polygonForInsertPoint.
Definition qetgraphicshandlerutility.cpp:227
static QVector< QPointF > pointsForRect(const QRectF &rect)
QetGraphicsHandlerUtility::pointsForRect Return the keys points of the rectangle, stored in a vector....
Definition qetgraphicshandlerutility.cpp:36
static QVector< QPointF > pointForRadiusRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
QetGraphicsHandlerUtility::pointForRadiusRect.
Definition qetgraphicshandlerutility.cpp:290
static qreal radiusForPosAtIndex(const QRectF &rect, const QPointF &pos, int index, Qt::SizeMode mode=Qt::AbsoluteSize)
QetGraphicsHandlerUtility::radiusForPosAtIndex.
Definition qetgraphicshandlerutility.cpp:330
static QRectF rectForArc(const QRectF &rect, qreal start_angle, qreal span_angle)
QetGraphicsHandlerUtility::rectForArc.
Definition qetgraphicshandlerutility.cpp:196