[Bf-blender-cvs] [c4e041da23b] master: Cleanup: move public doc-strings into headers for 'bmesh'

Campbell Barton noreply at git.blender.org
Fri Dec 3 10:18:31 CET 2021


Commit: c4e041da23b9c45273fcd4874308c536b6a315d1
Author: Campbell Barton
Date:   Fri Dec 3 19:29:35 2021 +1100
Branches: master
https://developer.blender.org/rBc4e041da23b9c45273fcd4874308c536b6a315d1

Cleanup: move public doc-strings into headers for 'bmesh'

Some minor improvements to doc-strings too.

Ref T92709

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

M	source/blender/bmesh/intern/bmesh_construct.c
M	source/blender/bmesh/intern/bmesh_construct.h
M	source/blender/bmesh/intern/bmesh_core.c
M	source/blender/bmesh/intern/bmesh_core.h
M	source/blender/bmesh/intern/bmesh_delete.c
M	source/blender/bmesh/intern/bmesh_delete.h
M	source/blender/bmesh/intern/bmesh_edgeloop.c
M	source/blender/bmesh/intern/bmesh_edgeloop.h
M	source/blender/bmesh/intern/bmesh_error.h
M	source/blender/bmesh/intern/bmesh_interp.c
M	source/blender/bmesh/intern/bmesh_interp.h
M	source/blender/bmesh/intern/bmesh_iterators.c
M	source/blender/bmesh/intern/bmesh_iterators.h
M	source/blender/bmesh/intern/bmesh_log.c
M	source/blender/bmesh/intern/bmesh_log.h
M	source/blender/bmesh/intern/bmesh_marking.c
M	source/blender/bmesh/intern/bmesh_marking.h
M	source/blender/bmesh/intern/bmesh_mesh.c
M	source/blender/bmesh/intern/bmesh_mesh.h
M	source/blender/bmesh/intern/bmesh_mesh_convert.c
M	source/blender/bmesh/intern/bmesh_mesh_convert.h
M	source/blender/bmesh/intern/bmesh_mesh_duplicate.c
M	source/blender/bmesh/intern/bmesh_mesh_duplicate.h
M	source/blender/bmesh/intern/bmesh_mesh_normals.c
M	source/blender/bmesh/intern/bmesh_mesh_normals.h
M	source/blender/bmesh/intern/bmesh_mesh_partial_update.c
M	source/blender/bmesh/intern/bmesh_mesh_partial_update.h
M	source/blender/bmesh/intern/bmesh_mesh_tessellate.c
M	source/blender/bmesh/intern/bmesh_mesh_tessellate.h
M	source/blender/bmesh/intern/bmesh_mesh_validate.c
M	source/blender/bmesh/intern/bmesh_mesh_validate.h
M	source/blender/bmesh/intern/bmesh_mods.c
M	source/blender/bmesh/intern/bmesh_mods.h
M	source/blender/bmesh/intern/bmesh_operator_api.h
M	source/blender/bmesh/intern/bmesh_operators.c
M	source/blender/bmesh/intern/bmesh_operators.h
M	source/blender/bmesh/intern/bmesh_polygon.c
M	source/blender/bmesh/intern/bmesh_polygon.h
M	source/blender/bmesh/intern/bmesh_polygon_edgenet.c
M	source/blender/bmesh/intern/bmesh_polygon_edgenet.h
M	source/blender/bmesh/intern/bmesh_private.h
M	source/blender/bmesh/intern/bmesh_query.c
M	source/blender/bmesh/intern/bmesh_query.h
M	source/blender/bmesh/intern/bmesh_query_uv.c
M	source/blender/bmesh/intern/bmesh_query_uv.h
M	source/blender/bmesh/intern/bmesh_structure.c
M	source/blender/bmesh/intern/bmesh_structure.h
M	source/blender/bmesh/intern/bmesh_walkers.c
M	source/blender/bmesh/intern/bmesh_walkers.h
M	source/blender/bmesh/operators/bmo_create.c
M	source/blender/bmesh/operators/bmo_dissolve.c
M	source/blender/bmesh/operators/bmo_primitive.c
M	source/blender/bmesh/operators/bmo_split_edges.c
M	source/blender/bmesh/operators/bmo_subdivide_edgering.c
M	source/blender/bmesh/operators/bmo_unsubdivide.c
M	source/blender/bmesh/tools/bmesh_beautify.c
M	source/blender/bmesh/tools/bmesh_beautify.h
M	source/blender/bmesh/tools/bmesh_bevel.c
M	source/blender/bmesh/tools/bmesh_bevel.h
M	source/blender/bmesh/tools/bmesh_bisect_plane.c
M	source/blender/bmesh/tools/bmesh_bisect_plane.h
M	source/blender/bmesh/tools/bmesh_boolean.cc
M	source/blender/bmesh/tools/bmesh_boolean.h
M	source/blender/bmesh/tools/bmesh_decimate.h
M	source/blender/bmesh/tools/bmesh_decimate_collapse.c
M	source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c
M	source/blender/bmesh/tools/bmesh_edgenet.c
M	source/blender/bmesh/tools/bmesh_edgenet.h
M	source/blender/bmesh/tools/bmesh_edgesplit.c
M	source/blender/bmesh/tools/bmesh_edgesplit.h
M	source/blender/bmesh/tools/bmesh_intersect.c
M	source/blender/bmesh/tools/bmesh_intersect.h
M	source/blender/bmesh/tools/bmesh_region_match.c
M	source/blender/bmesh/tools/bmesh_region_match.h
M	source/blender/bmesh/tools/bmesh_separate.c
M	source/blender/bmesh/tools/bmesh_separate.h
M	source/blender/bmesh/tools/bmesh_wireframe.c
M	source/blender/bmesh/tools/bmesh_wireframe.h

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

diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c
index a10a911b06c..789165f2e40 100644
--- a/source/blender/bmesh/intern/bmesh_construct.c
+++ b/source/blender/bmesh/intern/bmesh_construct.c
@@ -39,11 +39,6 @@
 
 #define SELECT 1
 
-/**
- * Fill in a vertex array from an edge array.
- *
- * \returns false if any verts aren't found.
- */
 bool BM_verts_from_edges(BMVert **vert_arr, BMEdge **edge_arr, const int len)
 {
   int i, i_prev = len - 1;
@@ -57,11 +52,6 @@ bool BM_verts_from_edges(BMVert **vert_arr, BMEdge **edge_arr, const int len)
   return true;
 }
 
-/**
- * Fill in an edge array from a vertex array (connected polygon loop).
- *
- * \returns false if any edges aren't found.
- */
 bool BM_edges_from_verts(BMEdge **edge_arr, BMVert **vert_arr, const int len)
 {
   int i, i_prev = len - 1;
@@ -75,10 +65,6 @@ bool BM_edges_from_verts(BMEdge **edge_arr, BMVert **vert_arr, const int len)
   return true;
 }
 
-/**
- * Fill in an edge array from a vertex array (connected polygon loop).
- * Creating edges as-needed.
- */
 void BM_edges_from_verts_ensure(BMesh *bm, BMEdge **edge_arr, BMVert **vert_arr, const int len)
 {
   int i, i_prev = len - 1;
@@ -93,20 +79,6 @@ void BM_edges_from_verts_ensure(BMesh *bm, BMEdge **edge_arr, BMVert **vert_arr,
 static void bm_loop_attrs_copy(
     BMesh *bm_src, BMesh *bm_dst, const BMLoop *l_src, BMLoop *l_dst, CustomDataMask mask_exclude);
 
-/**
- * \brief Make Quad/Triangle
- *
- * Creates a new quad or triangle from a list of 3 or 4 vertices.
- * If \a no_double is true, then a check is done to see if a face
- * with these vertices already exists and returns it instead.
- *
- * If a pointer to an example face is provided, its custom data
- * and properties will be copied to the new face.
- *
- * \note The winding of the face is determined by the order
- * of the vertices in the vertex array.
- */
-
 BMFace *BM_face_create_quad_tri(BMesh *bm,
                                 BMVert *v1,
                                 BMVert *v2,
@@ -119,16 +91,6 @@ BMFace *BM_face_create_quad_tri(BMesh *bm,
   return BM_face_create_verts(bm, vtar, v4 ? 4 : 3, f_example, create_flag, true);
 }
 
-/**
- * \brief copies face loop data from shared adjacent faces.
- *
- * \param filter_fn: A function that filters the source loops before copying
- * (don't always want to copy all).
- *
- * \note when a matching edge is found, both loops of that edge are copied
- * this is done since the face may not be completely surrounded by faces,
- * this way: a quad with 2 connected quads on either side will still get all 4 loops updated
- */
 void BM_face_copy_shared(BMesh *bm, BMFace *f, BMLoopFilterFunc filter_fn, void *user_data)
 {
   BMLoop *l_first;
@@ -260,20 +222,6 @@ error:
   return false;
 }
 
-/**
- * \brief Make NGon
- *
- * Makes an ngon from an unordered list of edges.
- * Verts \a v1 and \a v2 define the winding of the new face.
- *
- * \a edges are not required to be ordered, simply to form
- * a single closed loop as a whole.
- *
- * \note While this function will work fine when the edges
- * are already sorted, if the edges are always going to be sorted,
- * #BM_face_create should be considered over this function as it
- * avoids some unnecessary work.
- */
 BMFace *BM_face_create_ngon(BMesh *bm,
                             BMVert *v1,
                             BMVert *v2,
@@ -294,14 +242,6 @@ BMFace *BM_face_create_ngon(BMesh *bm,
   return NULL;
 }
 
-/**
- * Create an ngon from an array of sorted verts
- *
- * Special features this has over other functions.
- * - Optionally calculate winding based on surrounding edges.
- * - Optionally create edges between vertices.
- * - Uses verts so no need to find edges (handy when you only have verts)
- */
 BMFace *BM_face_create_ngon_verts(BMesh *bm,
                                   BMVert **vert_arr,
                                   const int len,
@@ -367,22 +307,6 @@ BMFace *BM_face_create_ngon_verts(BMesh *bm,
       bm, v_winding[winding[0]], v_winding[winding[1]], edge_arr, len, f_example, create_flag);
 }
 
-/**
- * Makes an NGon from an un-ordered set of verts
- *
- * assumes...
- * - that verts are only once in the list.
- * - that the verts have roughly planer bounds
- * - that the verts are roughly circular
- * there can be concave areas but overlapping folds from the center point will fail.
- *
- * a brief explanation of the method used
- * - find the center point
- * - find the normal of the vcloud
- * - order the verts around the face based on their angle to the normal vector at the center point.
- *
- * \note Since this is a vcloud there is no direction.
- */
 void BM_verts_sort_radial_plane(BMVert **vert_arr, int len)
 {
   struct SortIntByFloat *vang = BLI_array_alloca(vang, len);
@@ -470,10 +394,6 @@ static void bm_face_attrs_copy(
 /* BMESH_TODO: Special handling for hide flags? */
 /* BMESH_TODO: swap src/dst args, everywhere else in bmesh does other way round */
 
-/**
- * Copies attributes, e.g. customdata, header flags, etc, from one element
- * to another of the same type.
- */
 void BM_elem_attrs_copy_ex(BMesh *bm_src,
                            BMesh *bm_dst,
                            const void *ele_src_v,
@@ -626,15 +546,6 @@ void BM_mesh_copy_init_customdata(BMesh *bm_dst, BMesh *bm_src, const BMAllocTem
   CustomData_bmesh_init_pool(&bm_dst->pdata, allocsize->totface, BM_FACE);
 }
 
-/**
- * Similar to #BM_mesh_copy_init_customdata but copies all layers ignoring
- * flags like #CD_FLAG_NOCOPY.
- *
- * \param bm_dst: BMesh whose custom-data layers will be added.
- * \param bm_src: BMesh whose custom-data layers will be copied.
- * \param htype: Specifies which custom-data layers will be initiated.
- * \param allocsize: Initialize the memory-pool before use (may be an estimate).
- */
 void BM_mesh_copy_init_customdata_all_layers(BMesh *bm_dst,
                                              BMesh *bm_src,
                                              const char htype,
@@ -786,7 +697,6 @@ BMesh *BM_mesh_copy(BMesh *bm_old)
   return bm_new;
 }
 
-/* ME -> BM */
 char BM_vert_flag_from_mflag(const char mflag)
 {
   return (((mflag & SELECT) ? BM_ELEM_SELECT : 0) | ((mflag & ME_HIDE) ? BM_ELEM_HIDDEN : 0));
@@ -804,7 +714,6 @@ char BM_face_flag_from_mflag(const char mflag)
           ((mflag & ME_SMOOTH) ? BM_ELEM_SMOOTH : 0) | ((mflag & ME_HIDE) ? BM_ELEM_HIDDEN : 0));
 }
 
-/* BM -> ME */
 char BM_vert_flag_to_mflag(BMVert *v)
 {
   const char hflag = v->head.hflag;
diff --git a/source/blender/bmesh/intern/bmesh_construct.h b/source/blender/bmesh/intern/bmesh_construct.h
index f2b5e2b4daa..692f3b403b5 100644
--- a/source/blender/bmesh/intern/bmesh_construct.h
+++ b/source/blender/bmesh/intern/bmesh_construct.h
@@ -25,14 +25,57 @@
 struct BMAllocTemplate;
 struct Mesh;
 
+/**
+ * Fill in a vertex array from an edge array.
+ *
+ * \returns false if any verts aren't found.
+ */
 bool BM_verts_from_edges(BMVert **vert_arr, BMEdge **edge_arr, const int len);
 
+/**
+ * Fill in an edge array from a vertex array (connected polygon loop).
+ *
+ * \returns false if any edges aren't found.
+ */
 bool BM_edges_from_verts(BMEdge **edge_arr, BMVert **vert_arr, const int len);
+/**
+ * Fill in an edge array from a vertex array (connected polygon loop).
+ * Creating edges as-needed.
+ */
 void BM_edges_from_verts_ensure(BMesh *bm, BMEdge **edge_arr, BMVert **vert_arr, const int len);
 
-/* sort before creation */
+/**
+ * Makes an NGon from an un-ordered set of verts.
+ *
+ * Assumes:
+ * - that verts are only once in the list.
+ * - that the verts have roughly planer bounds
+ * - that the verts are roughly circular
+ *
+ * There can be concave areas but overlapping folds from the center point will fail.
+ *
+ * A brief explanation of the method used
+ * - find the center point
+ * - find the normal of the vertex-cloud
+ * - order the verts around the face based on their angle to the normal vector at the center point.
+ *
+ * \note Since this is a vertex-cloud there is no direction.
+ */
 void BM_verts_sort_radial_plane(BMVert **vert_arr, int len);
 
+/**
+ * \brief Make Quad/Triangle
+ *
+ * Creates a new quad or triangle from a list of 3 or 4 vertices.
+ * If \a no_double is true, then a check is done to see if a face
+ * with these vertices already exists and returns it instead.
+ *
+ * If a pointer to an example face is provided, its custom data
+ * and properties will be copied to the new face.
+ *
+ * \note The winding of the face is determined by the order
+ * of the vertices in the vertex array.
+ */
 BMFace *BM_face_create_quad_tri(BMesh *bm,
                                 BMVert *v1,
                                 BMVert *v2,
@@ -41,8 +84,32 @@ BMFace *BM_face_create_quad_tri(BMesh *bm,
                                 const BMFace *f_example,
                                 const eBMCreateFlag create_flag);
 
+/**
+ * \brief copies face loop data from shared adjacent faces.
+ *
+ * \param filter_fn: A function that filters the source loops before copying
+ * (don't always want to copy all).
+ *
+ * \note when a matching edge is found, both loops of that edge are copied
+ * this is done since the face may not be completely surrounded by faces,
+ * this way: a quad with 2 connected quads on either side will still get all 4 loops updated
+ */
 void BM_face_copy_shared(BMesh *bm, BMFace *f, BMLoopFilterFunc filter_fn, void *user_data);
 
+/**
+ * \brief Make NGon
+ *
+ * Makes an ngon from an unordered list of edges.
+ * Verts \a v1 and \a v2 define the winding of the new face.
+ *
+ * \a edges are not required to be ordered, simply to form
+ * a single closed loop as a whole.
+ *
+ * \note While this function will work fine when the edges
+ * are already sorted, if the edges are always going to be sorted,
+ * #BM_face_create should be considered over this function as it
+ * avoids some unnecessary work.
+ */
 BMFace *BM_face_create_ngon(BMesh *bm,
                             BMVert *v1,
                             BMVert *v2,
@@ -50,6 +117,14 @@ BMFace *BM_face_create_ngon(BMesh *bm,
                             const int len,
                             const BMFace *f_example,
   

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list