fix too long lines

Tue, 27 Jul 2021 11:11:32 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Tue, 27 Jul 2021 11:11:32 +0300
changeset 115
ed884a2fb009
parent 114
4e03b0e2a29f
child 116
aad3e897bc32

fix too long lines

src/geometry.cpp file | annotate | diff | comparison | revisions
src/geometry.h file | annotate | diff | comparison | revisions
src/gl/common.h file | annotate | diff | comparison | revisions
src/gl/compiler.cpp file | annotate | diff | comparison | revisions
src/parser.cpp file | annotate | diff | comparison | revisions
src/ring.h file | annotate | diff | comparison | revisions
src/ui/canvas.cpp file | annotate | diff | comparison | revisions
src/ui/multiplyfactordialog.cpp file | annotate | diff | comparison | revisions
src/widgets/colorselectdialog.cpp file | annotate | diff | comparison | revisions
--- a/src/geometry.cpp	Tue Jul 27 09:56:06 2021 +0300
+++ b/src/geometry.cpp	Tue Jul 27 11:11:32 2021 +0300
@@ -103,7 +103,9 @@
 
 std::optional<glm::vec2> geom::rayLineSegmentIntersection(const Ray<2>& ray, const LineSegment2D& line)
 {
-	std::optional<glm::vec2> result = lineLineIntersection(rayToLine(ray), lineFromPoints(line.points[0], line.points[1]));
+	std::optional<glm::vec2> result = lineLineIntersection(
+		rayToLine(ray),
+		lineFromPoints(line.points[0], line.points[1]));
 	if (result.has_value())
 	{
 		const float d1 = glm::dot(*result - ray.anchor, ray.direction);
--- a/src/geometry.h	Tue Jul 27 09:56:06 2021 +0300
+++ b/src/geometry.h	Tue Jul 27 11:11:32 2021 +0300
@@ -85,7 +85,9 @@
 	std::optional<PointOnRectagle> rayRectangleIntersection(const Ray<2>& ray, const QRectF& rectangle);
 	Plane planeFromTriangle(const Triangle& triangle);
 	glm::vec3 normalVector(const Triangle& triangle);
-	std::optional<glm::vec3> linePlaneIntersection(const Line<3>& line, const Plane& plane, const float epsilon = 1e-6f);
+	std::optional<glm::vec3> linePlaneIntersection(
+		const Line<3>& line,
+		const Plane& plane, const float epsilon = 1e-6f);
 	glm::vec3 scalingVector(const glm::mat4 matrix);
 	LineSegment2D top(const QRectF& rectangle);
 	LineSegment2D bottom(const QRectF& rectangle);
--- a/src/gl/common.h	Tue Jul 27 09:56:06 2021 +0300
+++ b/src/gl/common.h	Tue Jul 27 11:11:32 2021 +0300
@@ -169,7 +169,12 @@
 		ConditionalLines
 	};
 
-	constexpr ArrayClass ARRAY_CLASSES[] = {ArrayClass::Lines, ArrayClass::Triangles, ArrayClass::Quads, ArrayClass::ConditionalLines};
+	constexpr ArrayClass ARRAY_CLASSES[] = {
+		ArrayClass::Lines,
+		ArrayClass::Triangles,
+		ArrayClass::Quads,
+		ArrayClass::ConditionalLines,
+	};
 	constexpr int NUM_ARRAY_CLASSES = countof(ARRAY_CLASSES);
 
 	// Different ways to render the scene
--- a/src/gl/compiler.cpp	Tue Jul 27 09:56:06 2021 +0300
+++ b/src/gl/compiler.cpp	Tue Jul 27 11:11:32 2021 +0300
@@ -142,7 +142,9 @@
 	{
 		log += "\n" + QObject::tr("Vertex shader:") + "\n" + shaderProgram->log();
 	}
-	const bool fragmentShaderCompiled = shaderProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, fragmentShaderSource);
+	const bool fragmentShaderCompiled = shaderProgram->addShaderFromSourceCode(
+		QOpenGLShader::Fragment,
+		fragmentShaderSource);
 	if (not fragmentShaderCompiled)
 	{
 		log += "\n" + QObject::tr("Fragment shader:") + "\n" + shaderProgram->log();
--- a/src/parser.cpp	Tue Jul 27 09:56:06 2021 +0300
+++ b/src/parser.cpp	Tue Jul 27 11:11:32 2021 +0300
@@ -311,7 +311,10 @@
 	return {x, y, z};
 }
 
-static glm::mat4 matrixFromStrings(const QStringList& tokens, const int startingPosition, const int positionStartingIndex)
+static glm::mat4 matrixFromStrings(
+	const QStringList& tokens,
+	const int startingPosition,
+	const int positionStartingIndex)
 {
 	glm::mat4 result = glm::mat4{1};
 	for (int i = 0; i < 9; i += 1)
--- a/src/ring.h	Tue Jul 27 09:56:06 2021 +0300
+++ b/src/ring.h	Tue Jul 27 11:11:32 2021 +0300
@@ -34,8 +34,8 @@
 }
 
 /*
- * Implements a ring adapter over T. This class corrects indices given to the element-operator so that they're within bounds.
- * The maximum amount can be specified manually.
+ * Implements a ring adapter over T. This class corrects indices given to the element-operator so that they're within
+ * bounds. The maximum amount can be specified manually.
  *
  * Example:
  *
@@ -83,8 +83,8 @@
 };
 
 /*
- * Convenience function for RingAdapter so that the template parameter does not have to be provided. The ring amount is assumed
- * to be the amount of elements in the collection.
+ * Convenience function for RingAdapter so that the template parameter does not have to be provided. The ring
+ * amount is assumed to be the amount of elements in the collection.
  */
 template<typename T>
 iter::_imp::RingAdapter<T, int> iter::ring(T&& collection)
--- a/src/ui/canvas.cpp	Tue Jul 27 09:56:06 2021 +0300
+++ b/src/ui/canvas.cpp	Tue Jul 27 11:11:32 2021 +0300
@@ -213,7 +213,9 @@
 			for (const auto& axis : directions)
 			{
 				const QPointF x_p = this->modelToScreenCoordinates(axis.direction);
-				const auto intersection = geom::rayRectangleIntersection(geom::rayFromPoints(toVec2(p1), toVec2(x_p)), box);
+				const auto intersection = geom::rayRectangleIntersection(
+					geom::rayFromPoints(toVec2(p1), toVec2(x_p)),
+					box);
 				if (intersection.has_value())
 				{
 					renderText(axis.text, *intersection);
--- a/src/ui/multiplyfactordialog.cpp	Tue Jul 27 09:56:06 2021 +0300
+++ b/src/ui/multiplyfactordialog.cpp	Tue Jul 27 11:11:32 2021 +0300
@@ -11,8 +11,16 @@
 	this->preview.setEnabled(false);
 	this->ui->previewGroupBox->setLayout(new QVBoxLayout{parent});
 	this->ui->previewGroupBox->layout()->addWidget(&this->preview);
-	connect(this->ui->invert, &QCheckBox::clicked, this, &MultiplyFactorDialog::updatePreview);
-	connect(this->ui->factor, qOverload<double>(&DoubleSpinBox::valueChanged), this, &MultiplyFactorDialog::updatePreview);
+	connect(
+		this->ui->invert,
+		&QCheckBox::clicked,
+		this,
+		&MultiplyFactorDialog::updatePreview);
+	connect(
+		this->ui->factor,
+		qOverload<double>(&DoubleSpinBox::valueChanged),
+		this,
+		&MultiplyFactorDialog::updatePreview);
 }
 
 /**
--- a/src/widgets/colorselectdialog.cpp	Tue Jul 27 09:56:06 2021 +0300
+++ b/src/widgets/colorselectdialog.cpp	Tue Jul 27 11:11:32 2021 +0300
@@ -104,7 +104,8 @@
 		const ldraw::ColorTable::ColorDefinition& colordef = this->colorTable[this->selectedColor];
 		this->ui.selectedColorName->setText(colordef.displayName);
 	}
-	this->ui.selectedColorName->setStyleSheet(styleSheetForColor(ldraw::colorFace(this->selectedColor, this->colorTable)));
+	const QColor colorFace = ldraw::colorFace(this->selectedColor, this->colorTable);
+	this->ui.selectedColorName->setStyleSheet(styleSheetForColor(colorFace));
 	this->ui.colorIndex->setValue(this->selectedColor.index);
 	for (QPushButton* button : this->buttons)
 	{

mercurial