[Bf-blender-cvs] [8a9ab3d0e9e] temp-modifiers-instancing: initial C api for geometry sets

Jacques Lucke noreply at git.blender.org
Tue Nov 10 16:38:56 CET 2020


Commit: 8a9ab3d0e9ea0149d284991c0204e5441decd719
Author: Jacques Lucke
Date:   Mon Nov 9 16:16:03 2020 +0100
Branches: temp-modifiers-instancing
https://developer.blender.org/rB8a9ab3d0e9ea0149d284991c0204e5441decd719

initial C api for geometry sets

===================================================================

A	source/blender/blenkernel/BKE_geometry_set.h
M	source/blender/blenkernel/BKE_geometry_set.hh
M	source/blender/blenkernel/intern/geometry_set.cc

===================================================================

diff --git a/source/blender/blenkernel/BKE_geometry_set.h b/source/blender/blenkernel/BKE_geometry_set.h
new file mode 100644
index 00000000000..e192bacbbad
--- /dev/null
+++ b/source/blender/blenkernel/BKE_geometry_set.h
@@ -0,0 +1,34 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+/** \file
+ * \ingroup bke
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct GeometrySetC GeometrySetC;
+
+void BKE_geometry_set_user_add(GeometrySetC *geometry_set);
+void BKE_geometry_set_user_remove(GeometrySetC *geometry_set);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh
index 36c77619139..9a19054cb7c 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -27,6 +27,8 @@
 #include "BLI_map.hh"
 #include "BLI_user_counter.hh"
 
+#include "BKE_geometry_set.h"
+
 struct Mesh;
 struct PointCloud;
 
diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc
index 568e581fd85..e8d09dfd042 100644
--- a/source/blender/blenkernel/intern/geometry_set.cc
+++ b/source/blender/blenkernel/intern/geometry_set.cc
@@ -369,3 +369,24 @@ PointCloud *PointCloudComponent::get_for_write()
 /** \} */
 
 }  // namespace blender::bke
+
+/* -------------------------------------------------------------------- */
+/** \name C API
+ * \{ */
+
+static blender::bke::GeometrySet *unwrap(GeometrySetC *geometry_set)
+{
+  return reinterpret_cast<blender::bke::GeometrySet *>(geometry_set);
+}
+
+void BKE_geometry_set_user_add(GeometrySetC *geometry_set)
+{
+  unwrap(geometry_set)->user_add();
+}
+
+void BKE_geometry_set_user_remove(GeometrySetC *geometry_set)
+{
+  unwrap(geometry_set)->user_remove();
+}
+
+/** \} */



More information about the Bf-blender-cvs mailing list