src/editmodes/linePathMode.cpp

changeset 1217
314e12e23c3a
parent 1008
74cb432812d3
child 1222
34def2630300
--- a/src/editmodes/linePathMode.cpp	Thu Jan 04 19:40:52 2018 +0200
+++ b/src/editmodes/linePathMode.cpp	Thu Jan 04 19:44:26 2018 +0200
@@ -21,52 +21,52 @@
 #include "../glRenderer.h"
 #include "../mainwindow.h"
 
-LinePathMode::LinePathMode (GLRenderer *renderer) :
-	Super (renderer) {}
+LinePathMode::LinePathMode(GLRenderer *renderer) :
+	Super(renderer) {}
 
-void LinePathMode::render (QPainter& painter) const
+void LinePathMode::render(QPainter& painter) const
 {
 	QVector<QPointF> points;
 	QList<Vertex> points3d = m_drawedVerts;
 	points3d << renderer()->position3D();
 
 	for (Vertex const& vrt : points3d)
-		points << renderer()->convert3dTo2d (vrt);
+		points << renderer()->convert3dTo2d(vrt);
 
-	painter.setPen (renderer()->textPen());
+	painter.setPen(renderer()->textPen());
 
 	if (points.size() == points3d.size())
 	{
 		for (int i = 0; i < points.size() - 1; ++i)
 		{
-			painter.drawLine (QLineF (points[i], points[i + 1]));
-			drawLength (painter, points3d[i], points3d[i + 1], points[i], points[i + 1]);
+			painter.drawLine(QLineF(points[i], points[i + 1]));
+			drawLength(painter, points3d[i], points3d[i + 1], points[i], points[i + 1]);
 		}
 	
 		for (int i = 0; i < points.size(); ++i)
 		{
 			const QPointF& point = points[i];
-			renderer()->drawBlip (painter, point);
-			renderer()->drawBlipCoordinates (painter, points3d[i], point);
+			renderer()->drawBlip(painter, point);
+			renderer()->drawBlipCoordinates(painter, points3d[i], point);
 		}
 	}
 }
 
-bool LinePathMode::mouseReleased (MouseEventData const& data)
+bool LinePathMode::mouseReleased(MouseEventData const& data)
 {
-	if (Super::mouseReleased (data))
+	if (Super::mouseReleased(data))
 		return true;
 
 	if (data.releasedButtons & Qt::LeftButton)
 	{
-		addDrawnVertex (renderer()->position3D());
+		addDrawnVertex(renderer()->position3D());
 		return true;
 	}
 
 	return false;
 }
 
-bool LinePathMode::preAddVertex (Vertex const& pos)
+bool LinePathMode::preAddVertex(Vertex const& pos)
 {
 	// If we picked the vertex we last drew, stop drawing
 	if (not m_drawedVerts.isEmpty() and pos == m_drawedVerts.last())
@@ -85,17 +85,17 @@
 	for (int i = 0; i < m_drawedVerts.size() - 1; ++i)
 	{
 		LDLine* line = LDSpawn<LDLine>();
-		line->setVertex (0, m_drawedVerts[i]);
-		line->setVertex (1, m_drawedVerts[i + 1]);
+		line->setVertex(0, m_drawedVerts[i]);
+		line->setVertex(1, m_drawedVerts[i + 1]);
 		objs << line;
 	}
 
-	finishDraw (objs);
+	finishDraw(objs);
 }
 
-bool LinePathMode::keyReleased (QKeyEvent* ev)
+bool LinePathMode::keyReleased(QKeyEvent* ev)
 {
-	if (Super::keyReleased (ev))
+	if (Super::keyReleased(ev))
 		return true;
 
 	if (ev->key() == Qt::Key_Enter or ev->key() == Qt::Key_Return)

mercurial