Cleanup: use BKE_mesh_ prefix for the remesh API
authorCampbell Barton <ideasman42@gmail.com>
Wed, 14 Aug 2019 18:46:10 +0000 (04:46 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 14 Aug 2019 18:46:51 +0000 (04:46 +1000)
These functions deal with voxel remeshing of Mesh data,
and aren't related to MOD_remesh.c for e.g.

Name so other kinds of remeshing wont cause confusion.

source/blender/blenkernel/BKE_mesh_remesh_voxel.h [moved from source/blender/blenkernel/BKE_remesh.h with 70% similarity]
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/mesh_remesh_voxel.c [moved from source/blender/blenkernel/intern/remesh.c with 89% similarity]
source/blender/editors/object/object_remesh.c

similarity index 70%
rename from source/blender/blenkernel/BKE_remesh.h
rename to source/blender/blenkernel/BKE_mesh_remesh_voxel.h
index 996e88e0ea0e27b4f59db52e99e80c9d242e7714..089e4de4709c00f6114666957a89d855c3907aaf 100644 (file)
@@ -31,14 +31,14 @@ struct Mesh;
 
 /* OpenVDB Voxel Remesher */
 #ifdef WITH_OPENVDB
-struct OpenVDBLevelSet *BKE_remesh_voxel_ovdb_mesh_to_level_set_create(
+struct OpenVDBLevelSet *BKE_mesh_remesh_voxel_ovdb_mesh_to_level_set_create(
     struct Mesh *mesh, struct OpenVDBTransform *transform);
-struct Mesh *BKE_remesh_voxel_ovdb_volume_to_mesh_nomain(struct OpenVDBLevelSet *level_set,
-                                                         double isovalue,
-                                                         double adaptivity,
-                                                         bool relax_disoriented_triangles);
+struct Mesh *BKE_mesh_remesh_voxel_ovdb_volume_to_mesh_nomain(struct OpenVDBLevelSet *level_set,
+                                                              double isovalue,
+                                                              double adaptivity,
+                                                              bool relax_disoriented_triangles);
 #endif
-struct Mesh *BKE_remesh_voxel_to_mesh_nomain(struct Mesh *mesh, float voxel_size);
+struct Mesh *BKE_mesh_remesh_voxel_to_mesh_nomain(struct Mesh *mesh, float voxel_size);
 
 /* Data reprojection functions */
 void BKE_remesh_reproject_paint_mask(struct Mesh *target, struct Mesh *source);
index 1f125b93b3f016d88100da17da0093154afe279e..669abff6599b5075854a7a77e16f4bb1d99718e5 100644 (file)
@@ -151,6 +151,7 @@ set(SRC
   intern/mesh_mapping.c
   intern/mesh_merge.c
   intern/mesh_remap.c
+  intern/mesh_remesh_voxel.c
   intern/mesh_runtime.c
   intern/mesh_tangent.c
   intern/mesh_validate.c
@@ -178,7 +179,6 @@ set(SRC
   intern/pbvh.c
   intern/pbvh_bmesh.c
   intern/pointcache.c
-  intern/remesh.c
   intern/report.c
   intern/rigidbody.c
   intern/scene.c
@@ -301,6 +301,7 @@ set(SRC
   BKE_mesh_iterators.h
   BKE_mesh_mapping.h
   BKE_mesh_remap.h
+  BKE_mesh_remesh_voxel.h
   BKE_mesh_runtime.h
   BKE_mesh_tangent.h
   BKE_modifier.h
@@ -318,7 +319,6 @@ set(SRC
   BKE_particle.h
   BKE_pbvh.h
   BKE_pointcache.h
-  BKE_remesh.h
   BKE_report.h
   BKE_rigidbody.h
   BKE_scene.h
similarity index 89%
rename from source/blender/blenkernel/intern/remesh.c
rename to source/blender/blenkernel/intern/mesh_remesh_voxel.c
index 36e92689f1a2014db7ea3f192f38160fc5fbdde6..173478422160303141f134b9c7cc2e3d59b312ce 100644 (file)
 #include "BKE_library.h"
 #include "BKE_customdata.h"
 #include "BKE_bvhutils.h"
-#include "BKE_remesh.h"
+#include "BKE_mesh_remesh_voxel.h" /* own include */
 
 #ifdef WITH_OPENVDB
 #  include "openvdb_capi.h"
 #endif
 
 #ifdef WITH_OPENVDB
-struct OpenVDBLevelSet *BKE_remesh_voxel_ovdb_mesh_to_level_set_create(
+struct OpenVDBLevelSet *BKE_mesh_remesh_voxel_ovdb_mesh_to_level_set_create(
     Mesh *mesh, struct OpenVDBTransform *transform)
 {
   BKE_mesh_runtime_looptri_recalc(mesh);
@@ -90,10 +90,10 @@ struct OpenVDBLevelSet *BKE_remesh_voxel_ovdb_mesh_to_level_set_create(
   return level_set;
 }
 
-Mesh *BKE_remesh_voxel_ovdb_volume_to_mesh_nomain(struct OpenVDBLevelSet *level_set,
-                                                  double isovalue,
-                                                  double adaptivity,
-                                                  bool relax_disoriented_triangles)
+Mesh *BKE_mesh_remesh_voxel_ovdb_volume_to_mesh_nomain(struct OpenVDBLevelSet *level_set,
+                                                       double isovalue,
+                                                       double adaptivity,
+                                                       bool relax_disoriented_triangles)
 {
 #  ifdef WITH_OPENVDB
   struct OpenVDBVolumeToMeshData output_mesh;
@@ -142,15 +142,15 @@ Mesh *BKE_remesh_voxel_ovdb_volume_to_mesh_nomain(struct OpenVDBLevelSet *level_
 }
 #endif
 
-Mesh *BKE_remesh_voxel_to_mesh_nomain(Mesh *mesh, float voxel_size)
+Mesh *BKE_mesh_remesh_voxel_to_mesh_nomain(Mesh *mesh, float voxel_size)
 {
   Mesh *new_mesh = NULL;
 #ifdef WITH_OPENVDB
   struct OpenVDBLevelSet *level_set;
   struct OpenVDBTransform *xform = OpenVDBTransform_create();
   OpenVDBTransform_create_linear_transform(xform, (double)voxel_size);
-  level_set = BKE_remesh_voxel_ovdb_mesh_to_level_set_create(mesh, xform);
-  new_mesh = BKE_remesh_voxel_ovdb_volume_to_mesh_nomain(level_set, 0.0, 0.0, false);
+  level_set = BKE_mesh_remesh_voxel_ovdb_mesh_to_level_set_create(mesh, xform);
+  new_mesh = BKE_mesh_remesh_voxel_ovdb_volume_to_mesh_nomain(level_set, 0.0, 0.0, false);
   OpenVDBLevelSet_free(level_set);
   OpenVDBTransform_free(xform);
 #else
index 2234b3875b774d22fdc0b026f42bc6567c20a992..1bcac9b4739d10bc569ec445db519e5a1b12a3cb 100644 (file)
@@ -47,7 +47,7 @@
 #include "BKE_report.h"
 #include "BKE_scene.h"
 #include "BKE_customdata.h"
-#include "BKE_remesh.h"
+#include "BKE_mesh_remesh_voxel.h"
 
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_build.h"
@@ -102,7 +102,7 @@ static int voxel_remesh_exec(bContext *C, wmOperator *op)
     ED_sculpt_undo_geometry_begin(ob);
   }
 
-  new_mesh = BKE_remesh_voxel_to_mesh_nomain(mesh, mesh->remesh_voxel_size);
+  new_mesh = BKE_mesh_remesh_voxel_to_mesh_nomain(mesh, mesh->remesh_voxel_size);
 
   if (!new_mesh) {
     return OPERATOR_CANCELLED;