src/geometry.h

changeset 206
654661eab7f3
parent 201
5d201ee4a9c3
child 223
ce81db996275
--- a/src/geometry.h	Wed Jun 08 20:41:21 2022 +0300
+++ b/src/geometry.h	Wed Jun 08 22:29:44 2022 +0300
@@ -1,6 +1,32 @@
 #pragma once
 #include <QPolygonF>
-#include "basics.h"
+#include <glm/glm.hpp>
+#include <optional>
+
+enum Winding
+{
+	NoWinding,
+	Anticlockwise,
+	Clockwise,
+};
+
+//! \brief XOR operator for winding
+constexpr Winding operator^(Winding one, Winding other)
+{
+	if (one == NoWinding or other == NoWinding) {
+		return NoWinding;
+	}
+	else {
+		const int xored = static_cast<int>(one) ^ static_cast<int>(other);
+		return static_cast<Winding>(xored);
+	}
+}
+
+constexpr Winding& operator^=(Winding& one, Winding other)
+{
+	one = one ^ other;
+	return one;
+}
 
 struct Plane
 {

mercurial