mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Remove unused code
This commit is contained in:
parent
24d4885093
commit
89f9f47174
@ -20,7 +20,6 @@
|
||||
|
||||
#include <QRectF>
|
||||
#include <QLineF>
|
||||
#include <QColor>
|
||||
#include <QPolygonF>
|
||||
|
||||
class QPainter;
|
||||
|
@ -407,54 +407,6 @@ QPainterPath PartLine::shadowShape() const
|
||||
return (pps.createStroke(shape));
|
||||
}
|
||||
|
||||
/**
|
||||
@brief PartLine::fourShapePoints
|
||||
@return a list with the two points that delimite the line
|
||||
+ the four points surrounding these two points
|
||||
*/
|
||||
QList<QPointF> PartLine::fourShapePoints() const
|
||||
{
|
||||
const qreal marge = 2.0;
|
||||
|
||||
QPointF a = m_line.p1();
|
||||
QPointF b = m_line.p2();
|
||||
|
||||
QList<QPointF> result;
|
||||
|
||||
//Special case, the line is defined by one point
|
||||
if (a == b)
|
||||
{
|
||||
result << QPointF(a.x() - marge, a.y() - marge);
|
||||
result << QPointF(a.x() - marge, a.y() + marge);
|
||||
result << QPointF(a.x() + marge, a.y() + marge);
|
||||
result << QPointF(a.x() + marge, a.y() - marge);
|
||||
}
|
||||
else
|
||||
{
|
||||
//We calcule the vector AB : (xb-xa, yb-ya)
|
||||
QPointF v_ab = b - a;
|
||||
|
||||
//And the distance AB: root of the coordinates of the vector squared
|
||||
qreal ab = sqrt(pow(v_ab.x(), 2) + pow(v_ab.y(), 2));
|
||||
|
||||
//Next, we define the vector u(a, b) wich is equal to the vector AB divided
|
||||
//by is length and multiplied by the length of marge.
|
||||
QPointF u = v_ab / ab * marge;
|
||||
|
||||
//We define the vector v(-b, a) wich is perpendicular to AB
|
||||
QPointF v(-u.y(), u.x());
|
||||
QPointF m = -u + v; // we have vector M = -u + v
|
||||
QPointF n = -u - v; // and vector N=-u-v
|
||||
QPointF h = a + m; // H = A + M
|
||||
QPointF k = a + n; // K = A + N
|
||||
QPointF i = b - n; // I = B - N
|
||||
QPointF j = b - m; // J = B - M
|
||||
|
||||
result << h << i << j << k;
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief PartLine::firstEndCircleRect
|
||||
@return the rectangle bordering the entirety of the first extremity
|
||||
@ -491,35 +443,6 @@ QRectF PartLine::secondEndCircleRect() const
|
||||
return(end_rect);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief PartLine::debugPaint
|
||||
Display several composante of the drawing
|
||||
-the bounding rect
|
||||
-special points at each extremity
|
||||
-the quadrature of the circle at each extremity, even if itself is an other type
|
||||
@param painter
|
||||
*/
|
||||
void PartLine::debugPaint(QPainter *painter)
|
||||
{
|
||||
painter -> save();
|
||||
painter -> setPen(Qt::gray);
|
||||
painter -> drawRect(boundingRect());
|
||||
|
||||
painter -> setPen(Qt::green);
|
||||
painter -> drawRect(firstEndCircleRect());
|
||||
painter -> drawRect(secondEndCircleRect());
|
||||
|
||||
painter -> setPen(Qt::red);
|
||||
|
||||
foreach(QPointF pointy, fourEndPoints(m_line.p1(), m_line.p2(), first_length))
|
||||
painter -> drawEllipse(pointy, 0.1, 0.1);
|
||||
|
||||
foreach(QPointF pointy, fourEndPoints(m_line.p2(), m_line.p1(), second_length))
|
||||
painter -> drawEllipse(pointy, 0.1, 0.1);
|
||||
|
||||
painter -> restore();
|
||||
}
|
||||
|
||||
/**
|
||||
@brief PartLine::boundingRect
|
||||
@return the bounding rect of this part
|
||||
|
@ -110,10 +110,8 @@ class PartLine : public CustomElementGraphicPart
|
||||
void removeHandler();
|
||||
|
||||
QPainterPath path() const;
|
||||
QList<QPointF> fourShapePoints() const;
|
||||
QRectF firstEndCircleRect() const;
|
||||
QRectF secondEndCircleRect() const;
|
||||
void debugPaint(QPainter *);
|
||||
|
||||
/*****************/
|
||||
Qet::EndType first_end;
|
||||
|
Loading…
x
Reference in New Issue
Block a user