QElectroTech
0.70
|
The QetGraphicsHandlerUtility class This class provide some methods to create and use handler for modify graphics shape like line rectangle etc... They also provide some conveniance static method. More...
#include <qetgraphicshandlerutility.h>
Static Public Member Functions | |
static QVector< QPointF > | pointsForRect (const QRectF &rect) |
QetGraphicsHandlerUtility::pointsForRect Return the keys points of the rectangle, stored in a vector. The points in the vector are stored like this : 0—1—2 | | 3 4 | | 5—6—7 More... | |
static QVector< QPointF > | pointsForLine (const QLineF &line) |
QetGraphicsHandlerUtility::pointsForLine The point that define a line in a QVector. there is two points. More... | |
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 vector is the start point, the second the end point. More... | |
static QRectF | rectForPosAtIndex (const QRectF &old_rect, const QPointF &pos, int index) |
QetGraphicsHandlerUtility::rectForPosAtIndex Return a rectangle after modification of the point '' at index '' of original rectangle ''. More... | |
static QRectF | mirrorRectForPosAtIndex (const QRectF &old_rect, const QPointF &pos, int index) |
QetGraphicsHandlerUtility::mirrorRectForPosAtIndex Return a rectangle after modification of the point '' at index '' of original rectangle ''. the opposite edge is modified inversely (like a mirror) More... | |
static QLineF | lineForPosAtIndex (const QLineF &old_line, const QPointF &pos, int index) |
QetGraphicsHandlerUtility::lineForPosAtIndex Return a line after modification of at index of . More... | |
static QPolygonF | polygonForInsertPoint (const QPolygonF &old_polygon, bool closed, const QPointF &pos) |
QetGraphicsHandlerUtility::polygonForInsertPoint. More... | |
static QVector< QPointF > | pointForRadiusRect (const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize) |
QetGraphicsHandlerUtility::pointForRadiusRect. More... | |
static qreal | radiusForPosAtIndex (const QRectF &rect, const QPointF &pos, int index, Qt::SizeMode mode=Qt::AbsoluteSize) |
QetGraphicsHandlerUtility::radiusForPosAtIndex. More... | |
static qreal | percentageInRange (qreal min, qreal max, qreal value) |
The QetGraphicsHandlerUtility class This class provide some methods to create and use handler for modify graphics shape like line rectangle etc... They also provide some conveniance static method.
Definition at line 34 of file qetgraphicshandlerutility.h.
|
static |
QetGraphicsHandlerUtility::lineForPosAtIndex Return a line after modification of at index of .
old_line | |
pos | |
index |
Definition at line 182 of file qetgraphicshandlerutility.cpp.
|
static |
QetGraphicsHandlerUtility::mirrorRectForPosAtIndex Return a rectangle after modification of the point '' at index '' of original rectangle ''. the opposite edge is modified inversely (like a mirror)
old_rect | : the rectangle befor modification |
pos | : the new position of a key point |
index | : the index of the key point to modifie see QetGraphicsHandlerUtility::pointsForRect to know the index of each keys points of a rectangle) |
Definition at line 126 of file qetgraphicshandlerutility.cpp.
Referenced by PartEllipse::handlerMouseMoveEvent(), PartArc::handlerMouseMoveEvent(), PartRectangle::handlerMouseMoveEvent(), and QetShapeItem::handlerMouseMoveEvent().
|
static |
Definition at line 359 of file qetgraphicshandlerutility.cpp.
Referenced by radiusForPosAtIndex().
|
static |
QetGraphicsHandlerUtility::pointForRadiusRect.
rect | the rectangle. |
xRadius | : x radius |
yRadius | : y radius |
mode | : absolute or relative size: NOTE this argument is not used, this function always compute with relative size. |
Definition at line 253 of file qetgraphicshandlerutility.cpp.
Referenced by PartRectangle::addHandler(), QetShapeItem::addHandler(), PartRectangle::adjusteHandlerPos(), and QetShapeItem::adjusteHandlerPos().
|
static |
QetGraphicsHandlerUtility::pointsForArc Return the points for the given arc. The first value in the vector is the start point, the second the end point.
rect | |
start_angle | : start angle in degree |
span_angle | : span angle in degree; |
Definition at line 78 of file qetgraphicshandlerutility.cpp.
Referenced by PartArc::addHandler(), PartArc::adjusteHandlerPos(), PartArc::handlerMouseMoveEvent(), and PartArc::handlerMousePressEvent().
|
static |
QetGraphicsHandlerUtility::pointsForLine The point that define a line in a QVector. there is two points.
line |
Definition at line 65 of file qetgraphicshandlerutility.cpp.
|
static |
QetGraphicsHandlerUtility::pointsForRect Return the keys points of the rectangle, stored in a vector. The points in the vector are stored like this :
0—1—2 | | 3 4 | | 5—6—7
rect |
Definition at line 36 of file qetgraphicshandlerutility.cpp.
Referenced by PartEllipse::addHandler(), PartArc::addHandler(), PartRectangle::addHandler(), QetShapeItem::addHandler(), PartEllipse::adjusteHandlerPos(), PartArc::adjusteHandlerPos(), PartRectangle::adjusteHandlerPos(), and QetShapeItem::adjusteHandlerPos().
|
static |
QetGraphicsHandlerUtility::polygonForInsertPoint.
old_polygon | : the polygon which we insert a new point. |
closed | : polygon is closed or not |
pos | : the pos where the new point must be added |
Definition at line 195 of file qetgraphicshandlerutility.cpp.
Referenced by PartPolygon::insertPoint(), and QetShapeItem::insertPoint().
|
static |
QetGraphicsHandlerUtility::radiusForPosAtIndex.
rect | the rectangle |
pos | : the pos of the new radius |
index | : index of radius 0=X 1=Y |
mode |
Definition at line 293 of file qetgraphicshandlerutility.cpp.
References percentageInRange(), and QET::Icons::tr.
Referenced by PartRectangle::handlerMouseMoveEvent(), and QetShapeItem::handlerMouseMoveEvent().
|
static |
QetGraphicsHandlerUtility::rectForPosAtIndex Return a rectangle after modification of the point '' at index '' of original rectangle ''.
old_rect | - the rectangle befor modification |
pos | - the new position of a key point |
index | - the index of the key point to modifie see QetGraphicsHandlerUtility::pointsForRect to know the index of each keys points of a rectangle) |
Definition at line 99 of file qetgraphicshandlerutility.cpp.
Referenced by PartEllipse::handlerMouseMoveEvent(), PartArc::handlerMouseMoveEvent(), PartRectangle::handlerMouseMoveEvent(), and QetShapeItem::handlerMouseMoveEvent().