Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_clipboard_graph_iso.hh')
-rw-r--r--source/blender/editors/uvedit/uvedit_clipboard_graph_iso.hh40
1 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.hh b/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.hh
new file mode 100644
index 00000000000..80d246f0ce3
--- /dev/null
+++ b/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.hh
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * Copyright (c) 2019 Stefano Quer.
+ * Additional code, copyright 2022 Blender Foundation. All rights reserved.
+ *
+ * Originally 6846114 from https://github.com/stefanoquer/graphISO/blob/master/v3
+ * graphISO: Tools to compute the Maximum Common Subgraph between two graphs.
+ */
+
+/** \file
+ * \ingroup eduv
+ */
+
+#pragma once
+
+#include "BLI_sys_types.h"
+
+/* A thin representation of a "Graph" in graph theory. */
+class GraphISO {
+ public:
+ GraphISO(int n);
+ ~GraphISO();
+ int n;
+ uint8_t **adjmat;
+ uint *label;
+ mutable uint *degree;
+
+ void add_edge(int v, int w);
+ GraphISO *sort_vertices_by_degree() const;
+
+ private:
+ void calculate_degrees() const;
+};
+
+/* Find the maximum common subgraph between two graphs.
+ * (Can be used to find graph ismorphism.)
+ */
+bool ED_uvedit_clipboard_maximum_common_subgraph(GraphISO *,
+ GraphISO *,
+ int solution[][2],
+ int *solution_length);