[Bf-blender-cvs] [d61ec52] mesh-transfer-data: cleanup: var names use mesh_remap_ prefix instead of mesh2mesh
Campbell Barton
noreply at git.blender.org
Mon Nov 17 17:20:25 CET 2014
Commit: d61ec522a6b1c26dbb2e5b9ca50c036ccfaed59c
Author: Campbell Barton
Date: Mon Nov 17 17:14:47 2014 +0100
Branches: mesh-transfer-data
https://developer.blender.org/rBd61ec522a6b1c26dbb2e5b9ca50c036ccfaed59c
cleanup: var names use mesh_remap_ prefix instead of mesh2mesh
===================================================================
M source/blender/blenkernel/BKE_customdata.h
M source/blender/blenkernel/BKE_mesh_remap.h
M source/blender/blenkernel/BKE_object_data_transfer.h
M source/blender/blenkernel/intern/customdata.c
M source/blender/blenkernel/intern/mesh_remap.c
M source/blender/blenkernel/intern/object_data_transfer.c
M source/blender/editors/object/object_data_transfer.c
M source/blender/makesdna/DNA_modifier_types.h
M source/blender/makesrna/intern/rna_modifier.c
M source/blender/modifiers/intern/MOD_datatransfer.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 71a7ce7..683709b 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -372,7 +372,7 @@ void CustomData_external_reload(struct CustomData *data,
/* Mesh-to-mesh transfer data. */
-struct Mesh2MeshMapping;
+struct MeshPairRemap;
typedef struct DataTransferLayerMapping DataTransferLayerMapping;
typedef void (*cd_datatransfer_interp)(const DataTransferLayerMapping *laymap, void *dest,
@@ -405,7 +405,8 @@ enum {
ME_LOOP = 1 << 3,
};
-/* How to filter out some elements (to leave untouched).
+/**
+ * How to filter out some elements (to leave untouched).
* Note those options are highly dependent on type of transferred data! */
enum {
CDT_MIX_NOMIX = -1, /* Special case, only used because we abuse 'copy' CD callback. */
@@ -441,7 +442,7 @@ typedef struct DataTransferLayerMapping {
} DataTransferLayerMapping;
/* Those functions assume src_n and dst_n layers of given type exist in resp. src and dst. */
-void CustomData_data_transfer(const struct Mesh2MeshMapping *m2mmap, const DataTransferLayerMapping *laymap);
+void CustomData_data_transfer(const struct MeshPairRemap *m2mmap, const DataTransferLayerMapping *laymap);
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/BKE_mesh_remap.h b/source/blender/blenkernel/BKE_mesh_remap.h
index 1b88d05..bf72e16 100644
--- a/source/blender/blenkernel/BKE_mesh_remap.h
+++ b/source/blender/blenkernel/BKE_mesh_remap.h
@@ -28,30 +28,31 @@ struct CustomData;
struct DerivedMesh;
struct MVert;
struct MeshElemMap;
+struct MemArena;
/* Generic ways to map some geometry elements from a source mesh to a dest one. */
-typedef struct Mesh2MeshMappingItem {
- int nbr_sources;
- int *indices_src; /* NULL if no source found. */
- float *weights_src; /* NULL if no source found, else, always normalized! */
- float hit_distance; /* FLT_MAX if irrelevant or no source found. */
- int island; /* For loops only. */
-} Mesh2MeshMappingItem;
+typedef struct MeshPairRemapItem {
+ int sources_num;
+ int *indices_src; /* NULL if no source found. */
+ float *weights_src; /* NULL if no source found, else, always normalized! */
+ float hit_distance; /* FLT_MAX if irrelevant or no source found. */
+ int island; /* For loops only. */
+} MeshPairRemapItem;
/* All mapping computing func return this. */
-typedef struct Mesh2MeshMapping {
- int nbr_items;
- Mesh2MeshMappingItem *items; /* Array, one item per dest element. */
+typedef struct MeshPairRemap {
+ int items_num;
+ MeshPairRemapItem *items; /* array, one item per dest element. */
- void *mem; /* Memory handler, internal use only. */
-} Mesh2MeshMapping;
+ struct MemArena *mem; /* memory arena, internal use only. */
+} MeshPairRemap;
/* Helpers! */
-void BKE_mesh2mesh_mapping_init(Mesh2MeshMapping *map, const int num_items);
-void BKE_mesh2mesh_mapping_free(Mesh2MeshMapping *map);
+void BKE_mesh_remap_init(MeshPairRemap *map, const int items_num);
+void BKE_mesh_remap_free(MeshPairRemap *map);
-void BKE_mesh2mesh_mapping_item_define_invalid(Mesh2MeshMapping *map, const int idx);
+void BKE_mesh_remap_item_define_invalid(MeshPairRemap *map, const int index);
/* TODO:
* Add other 'from/to' mapping sources, like e.g. using an UVMap, etc.
@@ -61,107 +62,107 @@ void BKE_mesh2mesh_mapping_item_define_invalid(Mesh2MeshMapping *map, const int
* Also, users will have to check, whether we can get rid of some modes here, not sure all will be useful!
*/
enum {
- M2MMAP_USE_VERT = 1 << 4,
- M2MMAP_USE_EDGE = 1 << 5,
- M2MMAP_USE_LOOP = 1 << 6,
- M2MMAP_USE_POLY = 1 << 7,
+ MREMAP_USE_VERT = 1 << 4,
+ MREMAP_USE_EDGE = 1 << 5,
+ MREMAP_USE_LOOP = 1 << 6,
+ MREMAP_USE_POLY = 1 << 7,
- M2MMAP_USE_NEAREST = 1 << 8,
- M2MMAP_USE_NORPROJ = 1 << 9,
- M2MMAP_USE_INTERP = 1 << 10,
- M2MMAP_USE_NORMAL = 1 << 11,
+ MREMAP_USE_NEAREST = 1 << 8,
+ MREMAP_USE_NORPROJ = 1 << 9,
+ MREMAP_USE_INTERP = 1 << 10,
+ MREMAP_USE_NORMAL = 1 << 11,
/* ***** Target's vertices ***** */
- M2MMAP_MODE_VERT = 1 << 24,
+ MREMAP_MODE_VERT = 1 << 24,
/* Nearest source vert. */
- M2MMAP_MODE_VERT_NEAREST = M2MMAP_MODE_VERT | M2MMAP_USE_VERT | M2MMAP_USE_NEAREST,
+ MREMAP_MODE_VERT_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_VERT | MREMAP_USE_NEAREST,
/* Nearest vertex of nearest edge. */
- M2MMAP_MODE_VERT_EDGE_NEAREST = M2MMAP_MODE_VERT | M2MMAP_USE_EDGE | M2MMAP_USE_NEAREST,
+ MREMAP_MODE_VERT_EDGE_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_EDGE | MREMAP_USE_NEAREST,
/* This one uses two verts of selected edge (weighted interpolation). */
/* Nearest point on nearest edge. */
- M2MMAP_MODE_VERT_EDGEINTERP_NEAREST = M2MMAP_MODE_VERT | M2MMAP_USE_EDGE | M2MMAP_USE_NEAREST | M2MMAP_USE_INTERP,
+ MREMAP_MODE_VERT_EDGEINTERP_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_EDGE | MREMAP_USE_NEAREST | MREMAP_USE_INTERP,
/* Nearest vertex of nearest poly. */
- M2MMAP_MODE_VERT_POLY_NEAREST = M2MMAP_MODE_VERT | M2MMAP_USE_POLY | M2MMAP_USE_NEAREST,
+ MREMAP_MODE_VERT_POLY_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_POLY | MREMAP_USE_NEAREST,
/* Those two use all verts of selected poly (weighted interpolation). */
/* Nearest point on nearest poly. */
- M2MMAP_MODE_VERT_POLYINTERP_NEAREST = M2MMAP_MODE_VERT | M2MMAP_USE_POLY | M2MMAP_USE_NEAREST | M2MMAP_USE_INTERP,
+ MREMAP_MODE_VERT_POLYINTERP_NEAREST = MREMAP_MODE_VERT | MREMAP_USE_POLY | MREMAP_USE_NEAREST | MREMAP_USE_INTERP,
/* Point on nearest face hit by ray from target vertex's normal. */
- M2MMAP_MODE_VERT_POLYINTERP_VNORPROJ = M2MMAP_MODE_VERT | M2MMAP_USE_POLY | M2MMAP_USE_NORPROJ | M2MMAP_USE_INTERP,
+ MREMAP_MODE_VERT_POLYINTERP_VNORPROJ = MREMAP_MODE_VERT | MREMAP_USE_POLY | MREMAP_USE_NORPROJ | MREMAP_USE_INTERP,
/* ***** Target's edges ***** */
- M2MMAP_MODE_EDGE = 1 << 25,
+ MREMAP_MODE_EDGE = 1 << 25,
/* Source edge which both vertices are nearest of dest ones. */
- M2MMAP_MODE_EDGE_VERT_NEAREST = M2MMAP_MODE_EDGE | M2MMAP_USE_VERT | M2MMAP_USE_NEAREST,
+ MREMAP_MODE_EDGE_VERT_NEAREST = MREMAP_MODE_EDGE | MREMAP_USE_VERT | MREMAP_USE_NEAREST,
/* Nearest source edge (using mid-point). */
- M2MMAP_MODE_EDGE_NEAREST = M2MMAP_MODE_EDGE | M2MMAP_USE_EDGE | M2MMAP_USE_NEAREST,
+ MREMAP_MODE_EDGE_NEAREST = MREMAP_MODE_EDGE | MREMAP_USE_EDGE | MREMAP_USE_NEAREST,
/* Nearest edge of nearest poly (using mid-point). */
- M2MMAP_MODE_EDGE_POLY_NEAREST = M2MMAP_MODE_EDGE | M2MMAP_USE_POLY | M2MMAP_USE_NEAREST,
+ MREMAP_MODE_EDGE_POLY_NEAREST = MREMAP_MODE_EDGE | MREMAP_USE_POLY | MREMAP_USE_NEAREST,
/* Cast a set of rays from along dest edge, interpolating its vertices' normals, and use hit source edges. */
- M2MMAP_MODE_EDGE_EDGEINTERP_VNORPROJ = M2MMAP_MODE_EDGE | M2MMAP_USE_VERT | M2MMAP_USE_NORPROJ | M2MMAP_USE_INTERP,
+ MREMAP_MODE_EDGE_EDGEINTERP_VNORPROJ = MREMAP_MODE_EDGE | MREMAP_USE_VERT | MREMAP_USE_NORPROJ | MREMAP_USE_INTERP,
/* ***** Target's loops ***** */
/* Note: when islands are given to loop mapping func, all loops from the same destination face will always be mapped
* to loops of source faces within a same island, regardless of mapping mode. */
- M2MMAP_MODE_LOOP = 1 << 26,
+ MREMAP_MODE_LOOP = 1 << 26,
/* Best normal-matching loop from nearest vert. */
- M2MMAP_MODE_LOOP_NEAREST_LOOPNOR = M2MMAP_MODE_LOOP | M2MMAP_USE_LOOP | M2MMAP_USE_VERT | M2MMAP_USE_NEAREST | M2MMAP_USE_NORMAL,
+ MREMAP_MODE_LOOP_NEAREST_LOOPNOR = MREMAP_MODE_LOOP | MREMAP_USE_LOOP | MREMAP_USE_VERT | MREMAP_USE_NEAREST | MREMAP_USE_NORMAL,
/* Loop from best normal-matching poly from nearest vert. */
- M2MMAP_MODE_LOOP_NEAREST_POLYNOR = M2MMAP_MODE_LOOP | M2MMAP_USE_POLY | M2MMAP_USE_VERT | M2MMAP_USE_NEAREST | M2MMAP_USE_NORMAL,
+ MREMAP_MODE_LOOP_NEAREST_POLYNOR = MREMAP_MODE_LOOP | MREMAP_USE_POLY | MREMAP_USE_VERT | MREMAP_USE_NEAREST | MREMAP_USE_NORMAL,
/* Loop from nearest vertex of nearest poly. */
- M2MMAP_MODE_LOOP_POLY_NEAREST = M2MMAP_MODE_LOOP | M2MMAP_USE_POLY | M2MMAP_USE_NEAREST,
+ MREMAP_MODE_LOOP_POLY_NEAREST = MREMAP_MODE_LOOP | MREMAP_USE_POLY | MREMAP_USE_NEAREST,
/* Those two use all verts of selected poly (weighted interpolation). */
/* Nearest point on nearest poly. */
- M2MMAP_MODE_LOOP_POLYINTERP_NEAREST = M2MMAP_MODE_LOOP | M2MMAP_USE_POLY | M2MMAP_USE_NEAREST | M2MMAP_USE_INTERP,
+ MREMAP_MODE_LOOP_POLYINTERP_NEAREST = MREMAP_MODE_LOOP | MREMAP_USE_POLY | MREMAP_USE_NEAREST | MREMAP_USE_INTERP,
/* Point on nearest face hit by ray from target loop's normal. */
- M2MMAP_MODE_LOOP_POLYINTERP_LNORPROJ = M2MMAP_MODE_LOOP | M2MMAP_USE_POLY | M2MMAP_USE_NORPROJ | M2MMAP_USE_INTERP,
+ MREMAP_MODE_LOOP_POLYINTERP_LNORPROJ = MREMAP_MODE_LOOP | MREMAP_USE_POLY | MREMAP_USE_NORPROJ | MREMAP_USE_INTERP,
/* ***** Target's polygons ***** */
- M2MMAP_MODE_POLY = 1 << 27,
+ MREMAP_MODE_POLY = 1 << 27,
/* Nearest source poly. */
- M2MMAP_MODE_POLY_NEAREST = M2MMAP_MODE_POLY | M2MMAP_USE_POLY | M2MMAP_USE_NEAREST,
+ MREMAP_MODE_POLY_NEAREST = MREMAP_MODE_POLY | MREMAP_USE_POLY | MREMAP_USE_NEAREST,
/* Source poly from best normal-matching dest poly. */
- M2MMAP_MODE_POLY_NOR = M2MMAP_MODE_POLY | M2MMAP_USE_POLY | M2MMAP_USE_NORMAL,
+ MREMAP_MODE_POLY_NOR = MREMAP_MODE_POLY | MREMAP_USE_POLY | MREMAP_USE_NORMAL,
/* Project dest poly onto source mesh using its normal, and use interpolation of all intersecting source polys. */
- M2MMAP_MODE_POLY_POLYINTERP_PNORPROJ = M2MMAP_MOD
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list