From 123434f806f33780f9a5c01563517c7597274216 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 19 May 2016 15:23:37 +0300 Subject: [PATCH] Mark with different color base objects and rotated objects. --HG-- branch : feature --- .../visualization/line/vistoolrotation.cpp | 20 +++++++++---------- .../visualization/line/vistoolrotation.h | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libs/vtools/visualization/line/vistoolrotation.cpp b/src/libs/vtools/visualization/line/vistoolrotation.cpp index 70173feb3..4d3736ec8 100644 --- a/src/libs/vtools/visualization/line/vistoolrotation.cpp +++ b/src/libs/vtools/visualization/line/vistoolrotation.cpp @@ -126,11 +126,11 @@ void VisToolRotation::RefreshGeometry() const QSharedPointer p = Visualization::data->GeometricObject(id); ++iPoint; - QGraphicsEllipseItem *point = GetPoint(iPoint); - DrawPoint(point, *p, supportColor); + QGraphicsEllipseItem *point = GetPoint(iPoint, supportColor2); + DrawPoint(point, *p, supportColor2); ++iPoint; - point = GetPoint(iPoint); + point = GetPoint(iPoint, supportColor); if (object1Id != NULL_ID) { @@ -216,7 +216,7 @@ void VisToolRotation::VisualMode(const quint32 &pointId) } //--------------------------------------------------------------------------------------------------------------------- -QGraphicsEllipseItem *VisToolRotation::GetPoint(quint32 i) +QGraphicsEllipseItem *VisToolRotation::GetPoint(quint32 i, const QColor &color) { if (not points.isEmpty() && static_cast(points.size() - 1) >= i) { @@ -224,7 +224,7 @@ QGraphicsEllipseItem *VisToolRotation::GetPoint(quint32 i) } else { - auto point = InitPoint(supportColor, this); + auto point = InitPoint(color, this); points.append(point); return point; } @@ -232,7 +232,7 @@ QGraphicsEllipseItem *VisToolRotation::GetPoint(quint32 i) } //--------------------------------------------------------------------------------------------------------------------- -QGraphicsPathItem *VisToolRotation::GetCurve(quint32 i) +QGraphicsPathItem *VisToolRotation::GetCurve(quint32 i, const QColor &color) { if (not curves.isEmpty() && static_cast(curves.size() - 1) >= i) { @@ -254,15 +254,15 @@ int VisToolRotation::AddCurve(const QPointF &origin, quint32 id, int i) const QSharedPointer curve = Visualization::data->GeometricObject(id); ++i; - QGraphicsPathItem *path = GetCurve(i); - DrawPath(path, curve->GetPath(PathDirection::Hide), mainColor, Qt::SolidLine, Qt::RoundCap); + QGraphicsPathItem *path = GetCurve(i, supportColor2); + DrawPath(path, curve->GetPath(PathDirection::Hide), supportColor2, Qt::SolidLine, Qt::RoundCap); ++i; - path = GetCurve(i); + path = GetCurve(i, supportColor); if (object1Id != NULL_ID) { const Item rotated = curve->Rotate(origin, angle); - DrawPath(path, rotated.GetPath(PathDirection::Hide), mainColor, Qt::SolidLine, Qt::RoundCap); + DrawPath(path, rotated.GetPath(PathDirection::Hide), supportColor, Qt::SolidLine, Qt::RoundCap); } return i; diff --git a/src/libs/vtools/visualization/line/vistoolrotation.h b/src/libs/vtools/visualization/line/vistoolrotation.h index e7a660e8e..42005ea5d 100644 --- a/src/libs/vtools/visualization/line/vistoolrotation.h +++ b/src/libs/vtools/visualization/line/vistoolrotation.h @@ -62,8 +62,8 @@ private: QVector points; QVector curves; - QGraphicsEllipseItem * GetPoint(quint32 i); - QGraphicsPathItem * GetCurve(quint32 i); + QGraphicsEllipseItem * GetPoint(quint32 i, const QColor &color); + QGraphicsPathItem * GetCurve(quint32 i, const QColor &color); template int AddCurve(const QPointF &origin, quint32 id, int i);