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/bmesh/intern')
-rw-r--r--source/blender/bmesh/intern/bmesh_error.h23
-rw-r--r--source/blender/bmesh/intern/bmesh_iterators.h4
-rw-r--r--source/blender/bmesh/intern/bmesh_marking.h4
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.c38
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh_normals.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_operator_api.h16
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.h2
-rw-r--r--source/blender/bmesh/intern/bmesh_query.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers.h2
10 files changed, 51 insertions, 44 deletions
diff --git a/source/blender/bmesh/intern/bmesh_error.h b/source/blender/bmesh/intern/bmesh_error.h
index 41d02e334fb..587e33e7dfd 100644
--- a/source/blender/bmesh/intern/bmesh_error.h
+++ b/source/blender/bmesh/intern/bmesh_error.h
@@ -24,12 +24,12 @@
/*----------- bmop error system ----------*/
-/* pushes an error onto the bmesh error stack.
+/* Pushes an error onto the bmesh error stack.
* if msg is null, then the default message for the `errcode` is used. */
void BMO_error_raise(BMesh *bm, BMOperator *owner, int errcode, const char *msg);
-/* gets the topmost error from the stack.
- * returns error code or 0 if no error.*/
+/* Gets the topmost error from the stack.
+ * returns error code or 0 if no error. */
int BMO_error_get(BMesh *bm, const char **msg, BMOperator **op);
bool BMO_error_occurred(BMesh *bm);
@@ -37,23 +37,22 @@ bool BMO_error_occurred(BMesh *bm);
int BMO_error_pop(BMesh *bm, const char **msg, BMOperator **op);
void BMO_error_clear(BMesh *bm);
-/* this is meant for handling errors, like self-intersection test failures.
+/* This is meant for handling errors, like self-intersection test failures.
* it's dangerous to handle errors in general though, so disabled for now. */
-/* catches an error raised by the op pointed to by catchop.
+/* Catches an error raised by the op pointed to by catchop.
* errorcode is either the errorcode, or BMERR_ALL for any
- * error.*/
+ * error. */
-/* not yet implemented.
- * int BMO_error_catch_op(BMesh *bm, BMOperator *catchop, int errorcode, char **msg);
- */
+/* Not yet implemented. */
+// int BMO_error_catch_op(BMesh *bm, BMOperator *catchop, int errorcode, char **msg);
#define BM_ELEM_INDEX_VALIDATE(_bm, _msg_a, _msg_b) \
BM_mesh_elem_index_validate(_bm, __FILE__ ":" STRINGIFY(__LINE__), __func__, _msg_a, _msg_b)
/*------ error code defines -------*/
-/*error messages*/
+/** Error messages. */
enum {
BMERR_CONNECTVERT_FAILED = 1,
BMERR_DISSOLVEFACES_FAILED,
@@ -71,8 +70,8 @@ enum {
# define _BMESH_DUMMY_ABORT() (void)0
#endif
-/* this is meant to be higher level than BLI_assert(),
- * its enabled even when in Release mode*/
+/* This is meant to be higher level than BLI_assert(),
+ * its enabled even when in Release mode. */
#define BMESH_ASSERT(a) \
(void)((!(a)) ? ((fprintf(stderr, \
"BMESH_ASSERT failed: %s, %s(), %d at \'%s\'\n", \
diff --git a/source/blender/bmesh/intern/bmesh_iterators.h b/source/blender/bmesh/intern/bmesh_iterators.h
index f2e7a48a16c..470aceeb756 100644
--- a/source/blender/bmesh/intern/bmesh_iterators.h
+++ b/source/blender/bmesh/intern/bmesh_iterators.h
@@ -61,11 +61,11 @@ typedef enum BMIterType {
BM_LOOPS_OF_FACE = 11,
/* returns elements from all boundaries, and returns
* the first element at the end to flag that we're entering
- * a different face hole boundary*/
+ * a different face hole boundary. */
// BM_ALL_LOOPS_OF_FACE = 12,
/* iterate through loops around this loop, which are fetched
* from the other faces in the radial cycle surrounding the
- * input loop's edge.*/
+ * input loop's edge. */
BM_LOOPS_OF_LOOP = 12,
BM_LOOPS_OF_EDGE = 13,
} BMIterType;
diff --git a/source/blender/bmesh/intern/bmesh_marking.h b/source/blender/bmesh/intern/bmesh_marking.h
index ff6c359138a..99feae1d66c 100644
--- a/source/blender/bmesh/intern/bmesh_marking.h
+++ b/source/blender/bmesh/intern/bmesh_marking.h
@@ -68,8 +68,8 @@ void BM_mesh_elem_hflag_disable_all(BMesh *bm,
const char hflag,
const bool respecthide);
-/* individual element select functions, BM_elem_select_set is a shortcut for these
- * that automatically detects which one to use*/
+/* Individual element select functions, BM_elem_select_set is a shortcut for these
+ * that automatically detects which one to use. */
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select);
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select);
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select);
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index 80028564ff2..b2958a9e744 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -854,7 +854,7 @@ void BM_mesh_remap(BMesh *bm, const uint *vert_idx, const uint *edge_idx, const
for (i = totvert, ve = verts_copy + totvert - 1, vep = verts_pool + totvert - 1; i--;
ve--, vep--) {
*ve = **vep;
- /* printf("*vep: %p, verts_pool[%d]: %p\n", *vep, i, verts_pool[i]);*/
+ // printf("*vep: %p, verts_pool[%d]: %p\n", *vep, i, verts_pool[i]);
if (cd_vert_pyptr != -1) {
void **pyptr = BM_ELEM_CD_GET_VOID_P(((BMElem *)ve), cd_vert_pyptr);
pyptrs[i] = *pyptr;
@@ -990,7 +990,7 @@ void BM_mesh_remap(BMesh *bm, const uint *vert_idx, const uint *edge_idx, const
/* Verts' pointers, only edge pointers... */
if (eptr_map) {
BM_ITER_MESH (ve, &iter, bm, BM_VERTS_OF_MESH) {
- /* printf("Vert e: %p -> %p\n", ve->e, BLI_ghash_lookup(eptr_map, ve->e));*/
+ // printf("Vert e: %p -> %p\n", ve->e, BLI_ghash_lookup(eptr_map, ve->e));
if (ve->e) {
ve->e = BLI_ghash_lookup(eptr_map, ve->e);
BLI_assert(ve->e);
@@ -1004,22 +1004,30 @@ void BM_mesh_remap(BMesh *bm, const uint *vert_idx, const uint *edge_idx, const
if (vptr_map || eptr_map) {
BM_ITER_MESH (ed, &iter, bm, BM_EDGES_OF_MESH) {
if (vptr_map) {
- /* printf("Edge v1: %p -> %p\n", ed->v1, BLI_ghash_lookup(vptr_map, ed->v1));*/
- /* printf("Edge v2: %p -> %p\n", ed->v2, BLI_ghash_lookup(vptr_map, ed->v2));*/
+#if 0
+ printf("Edge v1: %p -> %p\n", ed->v1, BLI_ghash_lookup(vptr_map, ed->v1));
+ printf("Edge v2: %p -> %p\n", ed->v2, BLI_ghash_lookup(vptr_map, ed->v2));
+#endif
ed->v1 = BLI_ghash_lookup(vptr_map, ed->v1);
ed->v2 = BLI_ghash_lookup(vptr_map, ed->v2);
BLI_assert(ed->v1);
BLI_assert(ed->v2);
}
if (eptr_map) {
- /* printf("Edge v1_disk_link prev: %p -> %p\n", ed->v1_disk_link.prev,*/
- /* BLI_ghash_lookup(eptr_map, ed->v1_disk_link.prev));*/
- /* printf("Edge v1_disk_link next: %p -> %p\n", ed->v1_disk_link.next,*/
- /* BLI_ghash_lookup(eptr_map, ed->v1_disk_link.next));*/
- /* printf("Edge v2_disk_link prev: %p -> %p\n", ed->v2_disk_link.prev,*/
- /* BLI_ghash_lookup(eptr_map, ed->v2_disk_link.prev));*/
- /* printf("Edge v2_disk_link next: %p -> %p\n", ed->v2_disk_link.next,*/
- /* BLI_ghash_lookup(eptr_map, ed->v2_disk_link.next));*/
+#if 0
+ printf("Edge v1_disk_link prev: %p -> %p\n",
+ ed->v1_disk_link.prev,
+ BLI_ghash_lookup(eptr_map, ed->v1_disk_link.prev));
+ printf("Edge v1_disk_link next: %p -> %p\n",
+ ed->v1_disk_link.next,
+ BLI_ghash_lookup(eptr_map, ed->v1_disk_link.next));
+ printf("Edge v2_disk_link prev: %p -> %p\n",
+ ed->v2_disk_link.prev,
+ BLI_ghash_lookup(eptr_map, ed->v2_disk_link.prev));
+ printf("Edge v2_disk_link next: %p -> %p\n",
+ ed->v2_disk_link.next,
+ BLI_ghash_lookup(eptr_map, ed->v2_disk_link.next));
+#endif
ed->v1_disk_link.prev = BLI_ghash_lookup(eptr_map, ed->v1_disk_link.prev);
ed->v1_disk_link.next = BLI_ghash_lookup(eptr_map, ed->v1_disk_link.next);
ed->v2_disk_link.prev = BLI_ghash_lookup(eptr_map, ed->v2_disk_link.prev);
@@ -1036,17 +1044,17 @@ void BM_mesh_remap(BMesh *bm, const uint *vert_idx, const uint *edge_idx, const
BM_ITER_MESH (fa, &iter, bm, BM_FACES_OF_MESH) {
BM_ITER_ELEM (lo, &iterl, fa, BM_LOOPS_OF_FACE) {
if (vptr_map) {
- /* printf("Loop v: %p -> %p\n", lo->v, BLI_ghash_lookup(vptr_map, lo->v));*/
+ // printf("Loop v: %p -> %p\n", lo->v, BLI_ghash_lookup(vptr_map, lo->v));
lo->v = BLI_ghash_lookup(vptr_map, lo->v);
BLI_assert(lo->v);
}
if (eptr_map) {
- /* printf("Loop e: %p -> %p\n", lo->e, BLI_ghash_lookup(eptr_map, lo->e));*/
+ // printf("Loop e: %p -> %p\n", lo->e, BLI_ghash_lookup(eptr_map, lo->e));
lo->e = BLI_ghash_lookup(eptr_map, lo->e);
BLI_assert(lo->e);
}
if (fptr_map) {
- /* printf("Loop f: %p -> %p\n", lo->f, BLI_ghash_lookup(fptr_map, lo->f));*/
+ // printf("Loop f: %p -> %p\n", lo->f, BLI_ghash_lookup(fptr_map, lo->f));
lo->f = BLI_ghash_lookup(fptr_map, lo->f);
BLI_assert(lo->f);
}
diff --git a/source/blender/bmesh/intern/bmesh_mesh_normals.c b/source/blender/bmesh/intern/bmesh_mesh_normals.c
index 3e3fa2a2d9d..db09bbff97c 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_normals.c
+++ b/source/blender/bmesh/intern/bmesh_mesh_normals.c
@@ -1546,7 +1546,7 @@ static int bm_loop_normal_mark_indiv(BMesh *bm, BLI_bitmap *loops, const bool do
/* Using face history allows to select a single loop from a single face...
* Note that this is O(n^2) piece of code,
* but it is not designed to be used with huge selection sets,
- * rather with only a few items selected at most.*/
+ * rather with only a few items selected at most. */
/* Goes from last selected to the first selected element. */
for (ese = bm->selected.last; ese; ese = ese->prev) {
if (ese->htype == BM_FACE) {
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c
index c2c5dc24fa9..b61ef47351a 100644
--- a/source/blender/bmesh/intern/bmesh_mods.c
+++ b/source/blender/bmesh/intern/bmesh_mods.c
@@ -962,7 +962,7 @@ bool BM_edge_rotate_check_beauty(BMEdge *e, BMLoop *l1, BMLoop *l2)
{
/* Stupid check for now:
* Could compare angles of surrounding edges
- * before & after, but this is OK.*/
+ * before & after, but this is OK. */
return (len_squared_v3v3(e->v1->co, e->v2->co) > len_squared_v3v3(l1->v->co, l2->v->co));
}
diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h
index 706979abeba..d09c0ee428d 100644
--- a/source/blender/bmesh/intern/bmesh_operator_api.h
+++ b/source/blender/bmesh/intern/bmesh_operator_api.h
@@ -256,7 +256,7 @@ typedef struct BMO_FlagSet {
} BMO_FlagSet;
/* please ignore all these structures, don't touch them in tool code, except
- * for when your defining an operator with BMOpDefine.*/
+ * for when your defining an operator with BMOpDefine. */
typedef struct BMOpSlot {
const char *slot_name; /* pointer to BMOpDefine.slot_args */
@@ -345,16 +345,16 @@ typedef struct BMOpDefine {
/* data types that use pointers (arrays, etc) should never
* have it set directly. and never use BMO_slot_ptr_set to
- * pass in a list of edges or any arrays, really.*/
+ * pass in a list of edges or any arrays, really. */
void BMO_op_init(BMesh *bm, BMOperator *op, const int flag, const char *opname);
/* executes an operator, pushing and popping a new tool flag
- * layer as appropriate.*/
+ * layer as appropriate. */
void BMO_op_exec(BMesh *bm, BMOperator *op);
/* finishes an operator (though note the operator's tool flag is removed
- * after it finishes executing in BMO_op_exec).*/
+ * after it finishes executing in BMO_op_exec). */
void BMO_op_finish(BMesh *bm, BMOperator *op);
/* count the number of elements with the specified flag enabled.
@@ -369,7 +369,7 @@ int BMO_mesh_disabled_flag_count(BMesh *bm, const char htype, const short oflag)
void BMO_push(BMesh *bm, BMOperator *op);
void BMO_pop(BMesh *bm);
-/*executes an operator*/
+/* Executes an operator. */
bool BMO_op_callf(BMesh *bm, const int flag, const char *fmt, ...);
/* initializes, but doesn't execute an operator. this is so you can
@@ -538,7 +538,7 @@ void BMO_slot_buffer_hflag_disable(BMesh *bm,
/* puts every element of type 'type' (which is a bitmask) with header
* flag 'flag', into a slot. note: ignores hidden elements
- * (e.g. elements with header flag BM_ELEM_HIDDEN set).*/
+ * (e.g. elements with header flag BM_ELEM_HIDDEN set). */
void BMO_slot_buffer_from_enabled_hflag(BMesh *bm,
BMOperator *op,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
@@ -548,7 +548,7 @@ void BMO_slot_buffer_from_enabled_hflag(BMesh *bm,
/* puts every element of type 'type' (which is a bitmask) without
* header flag 'flag', into a slot. note: ignores hidden elements
- * (e.g. elements with header flag BM_ELEM_HIDDEN set).*/
+ * (e.g. elements with header flag BM_ELEM_HIDDEN set). */
void BMO_slot_buffer_from_disabled_hflag(BMesh *bm,
BMOperator *op,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
@@ -571,7 +571,7 @@ int BMO_slot_map_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_na
void BMO_slot_map_insert(BMOperator *op, BMOpSlot *slot, const void *element, const void *data);
/* flags all elements in a mapping. note that the mapping must only have
- * bmesh elements in it.*/
+ * bmesh elements in it. */
void BMO_slot_map_to_flag(BMesh *bm,
BMOpSlot slot_args[BMO_OP_MAX_SLOTS],
const char *slot_name,
diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h
index 2d9e244e54d..a701fe3eb85 100644
--- a/source/blender/bmesh/intern/bmesh_operators.h
+++ b/source/blender/bmesh/intern/bmesh_operators.h
@@ -20,7 +20,7 @@
* \ingroup bmesh
*/
-/*see comments in intern/bmesh_opdefines.c for documentation of specific operators*/
+/* See comments in `intern/bmesh_opdefines.c` for documentation of specific operators. */
/*--------defines/enumerations for specific operators-------*/
diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c
index da407abfb21..1449df9925f 100644
--- a/source/blender/bmesh/intern/bmesh_query.c
+++ b/source/blender/bmesh/intern/bmesh_query.c
@@ -2365,7 +2365,7 @@ bool BM_face_exists_overlap_subset(BMVert **varr, const int len)
for (int i = 0; i < len; i++) {
BM_ITER_ELEM (f, &viter, varr[i], BM_FACES_OF_VERT) {
if ((f->len <= len) && (BM_ELEM_API_FLAG_TEST(f, _FLAG_OVERLAP) == 0)) {
- /* check if all vers in this face are flagged*/
+ /* Check if all vers in this face are flagged. */
BMLoop *l_iter, *l_first;
if (is_init == false) {
diff --git a/source/blender/bmesh/intern/bmesh_walkers.h b/source/blender/bmesh/intern/bmesh_walkers.h
index ce0f8ae8324..d0348aa11dc 100644
--- a/source/blender/bmesh/intern/bmesh_walkers.h
+++ b/source/blender/bmesh/intern/bmesh_walkers.h
@@ -80,7 +80,7 @@ void *BMW_step(struct BMWalker *walker);
void BMW_end(struct BMWalker *walker);
int BMW_current_depth(BMWalker *walker);
-/*these are used by custom walkers*/
+/* These are used by custom walkers. */
void *BMW_current_state(BMWalker *walker);
void *BMW_state_add(BMWalker *walker);
void BMW_state_remove(BMWalker *walker);