187 } |
187 } |
188 |
188 |
189 void AbstractDrawMode::drawLength (QPainter &painter, const Vertex &v0, const Vertex &v1, |
189 void AbstractDrawMode::drawLength (QPainter &painter, const Vertex &v0, const Vertex &v1, |
190 const QPointF& v0p, const QPointF& v1p) const |
190 const QPointF& v0p, const QPointF& v1p) const |
191 { |
191 { |
192 if (not m_config->drawLineLengths()) |
192 if (not Config->drawLineLengths()) |
193 return; |
193 return; |
194 |
194 |
195 const QString label = QString::number ((v1 - v0).length()); |
195 const QString label = QString::number ((v1 - v0).length()); |
196 QPoint origin = QLineF (v0p, v1p).pointAt (0.5).toPoint(); |
196 QPoint origin = QLineF (v0p, v1p).pointAt (0.5).toPoint(); |
197 painter.drawText (origin, label); |
197 painter.drawText (origin, label); |
229 const int h = (i - 1 >= 0) ? (i - 1) : (poly3d.size() - 1); |
229 const int h = (i - 1 >= 0) ? (i - 1) : (poly3d.size() - 1); |
230 |
230 |
231 if (withlengths) |
231 if (withlengths) |
232 drawLength (painter, poly3d[i], poly3d[j], poly[i], poly[j]); |
232 drawLength (painter, poly3d[i], poly3d[j], poly[i], poly[j]); |
233 |
233 |
234 if (withangles and m_config->drawAngles()) |
234 if (withangles and Config->drawAngles()) |
235 { |
235 { |
236 QLineF l0 (poly[h], poly[i]), |
236 QLineF l0 (poly[h], poly[i]), |
237 l1 (poly[i], poly[j]); |
237 l1 (poly[i], poly[j]); |
238 |
238 |
239 double angle = 180 - l0.angleTo (l1); |
239 double angle = 180 - l0.angleTo (l1); |