[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44072] branches/bmesh/blender/source/ blender: api name conventions, more minor changes: flag set/clear --> enable/disable
Campbell Barton
ideasman42 at gmail.com
Sun Feb 12 20:18:31 CET 2012
Revision: 44072
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44072
Author: campbellbarton
Date: 2012-02-12 19:18:30 +0000 (Sun, 12 Feb 2012)
Log Message:
-----------
api name conventions, more minor changes: flag set/clear --> enable/disable
Modified Paths:
--------------
branches/bmesh/blender/source/blender/bmesh/bmesh_operator_api.h
branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_connect.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_create.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_dissolve.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_dupe.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_edgesplit.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_extrude.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_mirror.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_primitive.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_removedoubles.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_subdivide.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_triangulate.c
branches/bmesh/blender/source/blender/bmesh/operators/bmo_utils.c
branches/bmesh/blender/source/blender/bmesh/tools/BME_dupe_ops.c
branches/bmesh/blender/source/blender/editors/mesh/knifetool.c
Modified: branches/bmesh/blender/source/blender/bmesh/bmesh_operator_api.h
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/bmesh_operator_api.h 2012-02-12 19:11:09 UTC (rev 44071)
+++ branches/bmesh/blender/source/blender/bmesh/bmesh_operator_api.h 2012-02-12 19:18:30 UTC (rev 44072)
@@ -310,10 +310,10 @@
const short oflag, const char htype);
/* tool-flags all elements inside an element slot array with flag flag. */
-void BMO_slot_buffer_flag(struct BMesh *bm, struct BMOperator *op, const char *slotname,
+void BMO_slot_buffer_flag_enable(struct BMesh *bm, struct BMOperator *op, const char *slotname,
const short oflag, const char htype);
/* clears tool-flag flag from all elements inside a slot array. */
-void BMO_slot_buffer_flag_clear(struct BMesh *bm, struct BMOperator *op, const char *slotname,
+void BMO_slot_buffer_flag_disable(struct BMesh *bm, struct BMOperator *op, const char *slotname,
const short oflag, const char htype);
/* tool-flags all elements inside an element slot array with flag flag. */
@@ -449,7 +449,7 @@
int len;
} BMOElemMapping;
-extern const int BMOP_OPSLOT_TYPEINFO[];
+extern const int BMO_OPSLOT_TYPEINFO[];
BM_INLINE void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname,
void *element, void *data, int len)
Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c 2012-02-12 19:11:09 UTC (rev 44071)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c 2012-02-12 19:18:30 UTC (rev 44072)
@@ -40,14 +40,14 @@
#include "bmesh_private.h"
/* forward declarations */
-static void alloc_flag_layer(BMesh *bm);
-static void free_flag_layer(BMesh *bm);
-static void clear_flag_layer(BMesh *bm);
+static void bmo_flag_layer_alloc(BMesh *bm);
+static void bmo_flag_layer_free(BMesh *bm);
+static void bmo_flag_layer_clear(BMesh *bm);
static int bmesh_name_to_slotcode(BMOpDefine *def, const char *name);
static int bmesh_name_to_slotcode_check(BMOpDefine *def, const char *name);
static int bmesh_opname_to_opcode(const char *opname);
-static const char *bmop_error_messages[] = {
+static const char *bmo_error_messages[] = {
NULL,
"Self intersection error",
"Could not dissolve vert",
@@ -63,7 +63,7 @@
/* operator slot type information - size of one element of the type given. */
-const int BMOP_OPSLOT_TYPEINFO[] = {
+const int BMO_OPSLOT_TYPEINFO[] = {
0,
sizeof(int),
sizeof(float),
@@ -101,9 +101,9 @@
/* add flag layer, if appropriate */
if (bm->stackdepth > 1)
- alloc_flag_layer(bm);
+ bmo_flag_layer_alloc(bm);
else
- clear_flag_layer(bm);
+ bmo_flag_layer_clear(bm);
}
/*
@@ -117,7 +117,7 @@
void BMO_pop(BMesh *bm)
{
if (bm->stackdepth > 1)
- free_flag_layer(bm);
+ bmo_flag_layer_free(bm);
bm->stackdepth--;
}
@@ -263,7 +263,7 @@
dest_slot->data.buf = NULL;
dest_slot->len = source_slot->len;
if (dest_slot->len) {
- const int slot_alloc_size = BMOP_OPSLOT_TYPEINFO[dest_slot->slottype] * dest_slot->len;
+ const int slot_alloc_size = BMO_OPSLOT_TYPEINFO[dest_slot->slottype] * dest_slot->len;
dest_slot->data.buf = BLI_memarena_alloc(dest_op->arena, slot_alloc_size);
memcpy(dest_slot->data.buf, source_slot->data.buf, slot_alloc_size);
}
@@ -516,8 +516,8 @@
slot->size = (slot->size + 1 + totadd) * 2;
tmp = slot->data.buf;
- slot->data.buf = MEM_callocN(BMOP_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->size, "opslot dynamic array");
- memcpy(slot->data.buf, tmp, BMOP_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->size);
+ slot->data.buf = MEM_callocN(BMO_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->size, "opslot dynamic array");
+ memcpy(slot->data.buf, tmp, BMO_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->size);
MEM_freeN(tmp);
}
@@ -528,8 +528,8 @@
slot->len += totadd;
slot->size = slot->len + 2;
tmp = slot->data.buf;
- slot->data.buf = MEM_callocN(BMOP_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->len, "opslot dynamic array");
- memcpy(slot->data.buf, tmp, BMOP_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->len);
+ slot->data.buf = MEM_callocN(BMO_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->len, "opslot dynamic array");
+ memcpy(slot->data.buf, tmp, BMO_OPSLOT_TYPEINFO[opdefines[op->type]->slottypes[slotcode].type] * slot->len);
}
return slot->data.buf;
@@ -553,7 +553,7 @@
}
}
-static void *alloc_slot_buffer(BMOperator *op, const char *slotname, int len)
+static void *bmo_slot_buffer_alloc(BMOperator *op, const char *slotname, int len)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
@@ -563,7 +563,7 @@
slot->len = len;
if (len)
- slot->data.buf = BLI_memarena_alloc(op->arena, BMOP_OPSLOT_TYPEINFO[slot->slottype] * len);
+ slot->data.buf = BLI_memarena_alloc(op->arena, BMO_OPSLOT_TYPEINFO[slot->slottype] * len);
return slot->data.buf;
}
@@ -586,7 +586,7 @@
if (htype & BM_FACE) totelement += bm->totface;
if (totelement) {
- alloc_slot_buffer(op, slotname, totelement);
+ bmo_slot_buffer_alloc(op, slotname, totelement);
if (htype & BM_VERT) {
for (e = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
@@ -629,7 +629,7 @@
totelement = BM_mesh_count_flag(bm, htype, hflag, 1);
if (totelement) {
- alloc_slot_buffer(op, slotname, totelement);
+ bmo_slot_buffer_alloc(op, slotname, totelement);
if (htype & BM_VERT) {
for (e = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
@@ -678,7 +678,7 @@
int totelement = BMO_mesh_flag_count(bm, oflag, htype), i = 0;
if (totelement) {
- alloc_slot_buffer(op, slotname, totelement);
+ bmo_slot_buffer_alloc(op, slotname, totelement);
if (htype & BM_VERT) {
for (e = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
@@ -787,7 +787,7 @@
*
* Flags elements in a slots buffer
*/
-void BMO_slot_buffer_flag(BMesh *bm, BMOperator *op, const char *slotname,
+void BMO_slot_buffer_flag_enable(BMesh *bm, BMOperator *op, const char *slotname,
const short oflag, const char htype)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
@@ -808,7 +808,7 @@
*
* Removes flags from elements in a slots buffer
*/
-void BMO_slot_buffer_flag_clear(BMesh *bm, BMOperator *op, const char *slotname,
+void BMO_slot_buffer_flag_disable(BMesh *bm, BMOperator *op, const char *slotname,
const short oflag, const char htype)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
@@ -838,7 +838,7 @@
* all operators have been executed. This would
* save a lot of realloc potentially.
*/
-static void alloc_flag_layer(BMesh *bm)
+static void bmo_flag_layer_alloc(BMesh *bm)
{
BMHeader *ele;
/* set the index values since we are looping over all data anyway,
@@ -883,7 +883,7 @@
BLI_mempool_destroy(oldpool);
}
-static void free_flag_layer(BMesh *bm)
+static void bmo_flag_layer_free(BMesh *bm)
{
BMHeader *ele;
/* set the index values since we are looping over all data anyway,
@@ -928,7 +928,7 @@
BLI_mempool_destroy(oldpool);
}
-static void clear_flag_layer(BMesh *bm)
+static void bmo_flag_layer_clear(BMesh *bm)
{
BMHeader *ele;
/* set the index values since we are looping over all data anyway,
@@ -1057,7 +1057,7 @@
BMOpError *err = MEM_callocN(sizeof(BMOpError), "bmop_error");
err->errorcode = errcode;
- if (!msg) msg = bmop_error_messages[errcode];
+ if (!msg) msg = bmo_error_messages[errcode];
err->msg = msg;
err->op = owner;
Modified: branches/bmesh/blender/source/blender/bmesh/operators/bmo_connect.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/operators/bmo_connect.c 2012-02-12 19:11:09 UTC (rev 44071)
+++ branches/bmesh/blender/source/blender/bmesh/operators/bmo_connect.c 2012-02-12 19:18:30 UTC (rev 44072)
@@ -45,7 +45,7 @@
BLI_array_declare(verts);
int i;
- BMO_slot_buffer_flag(bm, op, "verts", VERT_INPUT, BM_VERT);
+ BMO_slot_buffer_flag_enable(bm, op, "verts", VERT_INPUT, BM_VERT);
for (f = BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL); f; f = BM_iter_step(&iter)) {
BLI_array_empty(loops);
@@ -172,7 +172,7 @@
BMEdge *e, *nexte;
int c = 0, cl1 = 0, cl2 = 0;
- BMO_slot_buffer_flag(bm, op, "edges", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_MARK, BM_EDGE);
BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
if (!BMO_elem_flag_test(bm, e, EDGE_DONE)) {
Modified: branches/bmesh/blender/source/blender/bmesh/operators/bmo_create.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/operators/bmo_create.c 2012-02-12 19:11:09 UTC (rev 44071)
+++ branches/bmesh/blender/source/blender/bmesh/operators/bmo_create.c 2012-02-12 19:18:30 UTC (rev 44072)
@@ -887,8 +887,8 @@
edata = MEM_callocN(sizeof(EdgeData)*bm->totedge, "EdgeData");
vdata = MEM_callocN(sizeof(VertData)*bm->totvert, "VertData");
- BMO_slot_buffer_flag(bm, op, "edges", EDGE_MARK, BM_EDGE);
- BMO_slot_buffer_flag(bm, op, "excludefaces", FACE_IGNORE, BM_FACE);
+ BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, op, "excludefaces", FACE_IGNORE, BM_FACE);
BM_mesh_elem_index_ensure(bm, BM_VERT);
@@ -1071,7 +1071,7 @@
int ok = 1;
int i, count;
- BMO_slot_buffer_flag(bm, op, "edges", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, op, "edges", EDGE_MARK, BM_EDGE);
/* validate that each edge has at most one other tagged edge in the
* disk cycle around each of it's vertices */
@@ -1330,7 +1330,7 @@
/* call edgenet prepare op so additional face creation cases wor */
BMO_op_initf(bm, &op2, "edgenet_prepare edges=%fe", ELE_NEW);
BMO_op_exec(bm, &op2);
- BMO_slot_buffer_flag(bm, &op2, "edgeout", ELE_NEW, BM_EDGE);
+ BMO_slot_buffer_flag_enable(bm, &op2, "edgeout", ELE_NEW, BM_EDGE);
BMO_op_finish(bm, &op2);
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list