173 |
173 |
174 const Vertex& Canvas::position3D() const |
174 const Vertex& Canvas::position3D() const |
175 { |
175 { |
176 return m_position3D; |
176 return m_position3D; |
177 } |
177 } |
|
178 |
|
179 void Canvas::drawPoint(QPainter& painter, QPointF pos, QColor color) const |
|
180 { |
|
181 int pointSize = 8; |
|
182 QPen pen = thinBorderPen; |
|
183 pen.setWidth(1); |
|
184 painter.setPen(pen); |
|
185 painter.setBrush(color); |
|
186 painter.drawEllipse(pos.x() - pointSize / 2, pos.y() - pointSize / 2, pointSize, pointSize); |
|
187 } |
|
188 |
|
189 void Canvas::drawBlipCoordinates(QPainter& painter, const Vertex& pos3d) const |
|
190 { |
|
191 drawBlipCoordinates (painter, pos3d, convert3dTo2d (pos3d)); |
|
192 } |
|
193 |
|
194 void Canvas::drawBlipCoordinates(QPainter& painter, const Vertex& pos3d, QPointF pos) const |
|
195 { |
|
196 painter.setPen (textPen()); |
|
197 painter.drawText (pos.x(), pos.y() - 8, pos3d.toString (true)); |
|
198 } |
|
199 |
|
200 QPen Canvas::linePen() const |
|
201 { |
|
202 QPen linepen = thinBorderPen; |
|
203 linepen.setWidth(2); |
|
204 linepen.setColor(luma(backgroundColor()) < 40 ? Qt::white : Qt::black); |
|
205 return linepen; |
|
206 } |