replaced Origin with default-constructed Vertex

Thu, 04 Jan 2018 19:52:24 +0200

author
Santeri Piippo
date
Thu, 04 Jan 2018 19:52:24 +0200
changeset 1218
e0b59d183f96
parent 1217
314e12e23c3a
child 1219
8e39b5d7c562

replaced Origin with default-constructed Vertex

src/basics.cpp file | annotate | diff | comparison | revisions
src/basics.h file | annotate | diff | comparison | revisions
src/editmodes/circleMode.cpp file | annotate | diff | comparison | revisions
src/glRenderer.cpp file | annotate | diff | comparison | revisions
src/ldObject.cpp file | annotate | diff | comparison | revisions
src/ldObjectMath.cpp file | annotate | diff | comparison | revisions
src/main.cpp file | annotate | diff | comparison | revisions
src/miscallenous.cpp file | annotate | diff | comparison | revisions
src/toolsets/algorithmtoolset.cpp file | annotate | diff | comparison | revisions
--- a/src/basics.cpp	Thu Jan 04 19:44:26 2018 +0200
+++ b/src/basics.cpp	Thu Jan 04 19:52:24 2018 +0200
@@ -28,7 +28,7 @@
 #include "ldDocument.h"
 
 Vertex::Vertex() :
-	QVector3D() {}
+	QVector3D {0, 0, 0} {}
 
 Vertex::Vertex(const QVector3D& a) :
 	QVector3D(a) {}
--- a/src/basics.h	Thu Jan 04 19:44:26 2018 +0200
+++ b/src/basics.h	Thu Jan 04 19:52:24 2018 +0200
@@ -184,7 +184,6 @@
 	Vertex m_vertex1;
 };
 
-extern const Vertex Origin;
 extern const Matrix IdentityMatrix;
 
 static const double Pi = 3.14159265358979323846;
--- a/src/editmodes/circleMode.cpp	Thu Jan 04 19:44:26 2018 +0200
+++ b/src/editmodes/circleMode.cpp	Thu Jan 04 19:52:24 2018 +0200
@@ -227,7 +227,7 @@
 	{
 		const double sinangle(sin(angleoffset + i * angleUnit));
 		const double cosangle(cos(angleoffset + i * angleUnit));
-		Vertex v(Origin);
+		Vertex v;
 		v.setCoordinate(relX, m_drawedVerts[0][relX] +(cosangle * innerdistance));
 		v.setCoordinate(relY, m_drawedVerts[0][relY] +(sinangle * innerdistance));
 		innerverts << v;
--- a/src/glRenderer.cpp	Thu Jan 04 19:44:26 2018 +0200
+++ b/src/glRenderer.cpp	Thu Jan 04 19:52:24 2018 +0200
@@ -88,7 +88,7 @@
 	m_messageLog = new MessageManager(this);
 	m_messageLog->setRenderer(this);
 	m_width = m_height = -1;
-	m_position3D = Origin;
+	m_position3D = Vertex {};
 	m_toolTipTimer = new QTimer(this);
 	m_toolTipTimer->setSingleShot(true);
 	m_isCameraMoving = false;
@@ -537,7 +537,7 @@
 Vertex GLRenderer::convert2dTo3d(const QPoint& pos2d, bool snap) const
 {
 	if (camera() == EFreeCamera)
-		return Origin;
+		return {};
 
 	Vertex pos3d;
 	const LDFixedCamera* cam = &g_FixedCameras[camera()];
@@ -852,7 +852,7 @@
 #endif
 
 	// Calculate 3d position of the cursor
-	m_position3D = (camera() != EFreeCamera) ? convert2dTo3d(m_mousePosition, true) : Origin;
+	m_position3D = (camera() != EFreeCamera) ? convert2dTo3d(m_mousePosition, true) : Vertex {};
 
 	highlightCursorObject();
 	update();
@@ -1220,7 +1220,7 @@
 	const double negXFac = g_FixedCameras[cam].negatedX ? -1 : 1,
 		negYFac = g_FixedCameras[cam].negatedY ? -1 : 1;
 
-	info.v0 = info.v1 = Origin;
+	info.v0 = info.v1 = Vertex {};
 	info.v0.setCoordinate(x2d, -(info.ox * info.lw * negXFac) / img->width());
 	info.v0.setCoordinate(y2d,(info.oy * info.lh * negYFac) / img->height());
 	info.v1.setCoordinate(x2d, info.v0[x2d] + info.lw);
@@ -1594,7 +1594,7 @@
 		LDSubfileReference* ref = LDSpawn<LDSubfileReference>();
 		ref->setColor(MainColor);
 		ref->setFileInfo(m_documents->getDocumentByName(primitiveName));
-		ref->setPosition(Origin);
+		ref->setPosition(Vertex {});
 		ref->setTransform(IdentityMatrix);
 		currentDocument()->insertObj(m_window->suggestInsertPoint(), ref);
 		ref->select();
--- a/src/ldObject.cpp	Thu Jan 04 19:44:26 2018 +0200
+++ b/src/ldObject.cpp	Thu Jan 04 19:52:24 2018 +0200
@@ -885,7 +885,7 @@
 
 LDMatrixObject::LDMatrixObject(LDDocument* document) :
 	LDObject(document),
-	m_position(Origin) {}
+	m_position(Vertex {}) {}
 
 LDMatrixObject::LDMatrixObject(const Matrix& transform, const Vertex& pos, LDDocument* document) :
 	LDObject(document),
--- a/src/ldObjectMath.cpp	Thu Jan 04 19:44:26 2018 +0200
+++ b/src/ldObjectMath.cpp	Thu Jan 04 19:52:24 2018 +0200
@@ -25,7 +25,7 @@
 static void RotateVertex(Vertex& v, const Vertex& rotpoint, const Matrix& transformer)
 {
 	v -= rotpoint;
-	v.transform(transformer, Origin);
+	v.transform(transformer, Vertex {});
 	v += rotpoint;
 }
 
--- a/src/main.cpp	Thu Jan 04 19:44:26 2018 +0200
+++ b/src/main.cpp	Thu Jan 04 19:52:24 2018 +0200
@@ -36,7 +36,6 @@
 
 MainWindow* g_win = nullptr;
 ConfigurationValueBag config;
-const Vertex Origin(0.0f, 0.0f, 0.0f);
 const Matrix IdentityMatrix({1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f});
 
 ConfigOption(bool FirstStart = true)
--- a/src/miscallenous.cpp	Thu Jan 04 19:44:26 2018 +0200
+++ b/src/miscallenous.cpp	Thu Jan 04 19:52:24 2018 +0200
@@ -96,7 +96,7 @@
 ConfigOption(float GridFineAngleSnap = 7.5f)
 ConfigOption(float GridFineBezierCurveSegments = 32)
 ConfigOption(int RotationPointType = 0)
-ConfigOption(Vertex CustomRotationPoint = Origin)
+ConfigOption(Vertex CustomRotationPoint = Vertex {})
 
 float gridCoordinateSnap()
 {
@@ -203,7 +203,7 @@
 		}
 
 	case RotationPoint::WorldOrigin:
-		return Origin;
+		return {};
 
 	case RotationPoint::CustomPoint:
 		return config.customRotationPoint();
--- a/src/toolsets/algorithmtoolset.cpp	Thu Jan 04 19:44:26 2018 +0200
+++ b/src/toolsets/algorithmtoolset.cpp	Thu Jan 04 19:52:24 2018 +0200
@@ -609,7 +609,7 @@
 		LDSubfileReference* ref = LDSpawn<LDSubfileReference>();
 		ref->setColor(MainColor);
 		ref->setFileInfo(doc);
-		ref->setPosition(Origin);
+		ref->setPosition(Vertex {});
 		ref->setTransform(IdentityMatrix);
 		currentDocument()->insertObj(refidx, ref);
 

mercurial