QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
QetGraphicsHandlerUtility Class Reference

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 convenience static method. More...

#include <qetgraphicshandlerutility.h>

Collaboration diagram for QetGraphicsHandlerUtility:
Collaboration graph

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 :
 
static QVector< QPointF > pointsForLine (const QLineF &line)
 QetGraphicsHandlerUtility::pointsForLine The point that define a line in a QVector. there is two points.
 
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.
 
static QRectF rectForPosAtIndex (const QRectF &old_rect, const QPointF &pos, int index)
 QetGraphicsHandlerUtility::rectForPosAtIndex Return a rectangle after modification of the point 'pos' at index 'index' of original rectangle 'old_rect'.
 
static QRectF mirrorRectForPosAtIndex (const QRectF &old_rect, const QPointF &pos, int index)
 QetGraphicsHandlerUtility::mirrorRectForPosAtIndex Return a rectangle after modification of the point 'pos' at index 'index' of original rectangle 'old_rect'. the opposite edge is modified inversely (like a mirror)
 
static QRectF rectForArc (const QRectF &rect, qreal start_angle, qreal span_angle)
 QetGraphicsHandlerUtility::rectForArc.
 
static QLineF lineForPosAtIndex (const QLineF &old_line, const QPointF &pos, int index)
 QetGraphicsHandlerUtility::lineForPosAtIndex Return a line after modification of pos at index index of old_line.
 
static QPolygonF polygonForInsertPoint (const QPolygonF &old_polygon, bool closed, const QPointF &pos)
 QetGraphicsHandlerUtility::polygonForInsertPoint.
 
static QVector< QPointF > pointForRadiusRect (const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
 QetGraphicsHandlerUtility::pointForRadiusRect.
 
static qreal radiusForPosAtIndex (const QRectF &rect, const QPointF &pos, int index, Qt::SizeMode mode=Qt::AbsoluteSize)
 QetGraphicsHandlerUtility::radiusForPosAtIndex.
 
static qreal percentageInRange (qreal min, qreal max, qreal value)
 

Detailed Description

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 convenience static method.

Member Function Documentation

◆ lineForPosAtIndex()

QLineF QetGraphicsHandlerUtility::lineForPosAtIndex ( const QLineF &  old_line,
const QPointF &  pos,
int  index 
)
static

QetGraphicsHandlerUtility::lineForPosAtIndex Return a line after modification of pos at index index of old_line.

Parameters
old_line
pos
index
Returns

◆ mirrorRectForPosAtIndex()

QRectF QetGraphicsHandlerUtility::mirrorRectForPosAtIndex ( const QRectF &  old_rect,
const QPointF &  pos,
int  index 
)
static

QetGraphicsHandlerUtility::mirrorRectForPosAtIndex Return a rectangle after modification of the point 'pos' at index 'index' of original rectangle 'old_rect'. the opposite edge is modified inversely (like a mirror)

Parameters
old_rect: the rectangle before modification
pos: the new position of a key point
index: the index of the key point to modifie
See also
QetGraphicsHandlerUtility::pointsForRect to know the index of each keys points of a rectangle)
Returns
: the rectangle with modification. If index is lower than 0 or higher than 7, this method return old_rect.
Here is the caller graph for this function:

◆ percentageInRange()

qreal QetGraphicsHandlerUtility::percentageInRange ( qreal  min,
qreal  max,
qreal  value 
)
static
Here is the caller graph for this function:

◆ pointForRadiusRect()

QVector< QPointF > QetGraphicsHandlerUtility::pointForRadiusRect ( const QRectF &  rect,
qreal  xRadius,
qreal  yRadius,
Qt::SizeMode  mode = Qt::AbsoluteSize 
)
static

QetGraphicsHandlerUtility::pointForRadiusRect.

Parameters
rectthe 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.
Returns
the points of x and y radius of a rounded rect. The points are always based on the top right corner of the rect. the first point of vector is X the second Y
Here is the caller graph for this function:

◆ pointsForArc()

QVector< QPointF > QetGraphicsHandlerUtility::pointsForArc ( const QRectF &  rect,
qreal  start_angle,
qreal  span_angle 
)
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.

Parameters
rect
start_angle: start angle in degree
span_angle: span angle in degree;
Returns
Here is the caller graph for this function:

◆ pointsForLine()

QVector< QPointF > QetGraphicsHandlerUtility::pointsForLine ( const QLineF &  line)
static

QetGraphicsHandlerUtility::pointsForLine The point that define a line in a QVector. there is two points.

Parameters
line
Returns

◆ pointsForRect()

QVector< QPointF > QetGraphicsHandlerUtility::pointsForRect ( const QRectF &  rect)
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

Parameters
rect
Returns
Here is the caller graph for this function:

◆ polygonForInsertPoint()

QPolygonF QetGraphicsHandlerUtility::polygonForInsertPoint ( const QPolygonF &  old_polygon,
bool  closed,
const QPointF &  pos 
)
static

QetGraphicsHandlerUtility::polygonForInsertPoint.

Parameters
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
Returns
the new polygon
Here is the caller graph for this function:

◆ radiusForPosAtIndex()

qreal QetGraphicsHandlerUtility::radiusForPosAtIndex ( const QRectF &  rect,
const QPointF &  pos,
int  index,
Qt::SizeMode  mode = Qt::AbsoluteSize 
)
static

QetGraphicsHandlerUtility::radiusForPosAtIndex.

Parameters
rectthe rectangle
pos: the pos of the new radius
index: index of radius 0=X 1=Y
mode
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rectForArc()

QRectF QetGraphicsHandlerUtility::rectForArc ( const QRectF &  rect,
qreal  start_angle,
qreal  span_angle 
)
static

QetGraphicsHandlerUtility::rectForArc.

Parameters
rect: the rect where the arc is defined
start_angle: start angle in degree
span_angle: span angle in degree
Returns
Return the rect that bound the arc.
Here is the caller graph for this function:

◆ rectForPosAtIndex()

QRectF QetGraphicsHandlerUtility::rectForPosAtIndex ( const QRectF &  old_rect,
const QPointF &  pos,
int  index 
)
static

QetGraphicsHandlerUtility::rectForPosAtIndex Return a rectangle after modification of the point 'pos' at index 'index' of original rectangle 'old_rect'.

Parameters
old_rect- the rectangle before modification
pos- the new position of a key point
index- the index of the key point to modifie
See also
QetGraphicsHandlerUtility::pointsForRect to know the index of each keys points of a rectangle)
Returns
: the rectangle with modification. If index is lower than 0 or higher than 7, this method return old_rect.
Here is the caller graph for this function:

The documentation for this class was generated from the following files: