[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44364] trunk/blender/source/blender: bmesh api cleanup, remove unused header.

Campbell Barton ideasman42 at gmail.com
Thu Feb 23 11:24:23 CET 2012


Revision: 44364
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44364
Author:   campbellbarton
Date:     2012-02-23 10:24:20 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
bmesh api cleanup, remove unused header.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/CMakeLists.txt
    trunk/blender/source/blender/bmesh/intern/bmesh_queries.c
    trunk/blender/source/blender/bmesh/intern/bmesh_structure.c
    trunk/blender/source/blender/bmesh/intern/bmesh_structure.h

Removed Paths:
-------------
    trunk/blender/source/blender/blenkernel/intern/bmesh_private.h

Modified: trunk/blender/source/blender/blenkernel/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/blenkernel/CMakeLists.txt	2012-02-23 10:18:10 UTC (rev 44363)
+++ trunk/blender/source/blender/blenkernel/CMakeLists.txt	2012-02-23 10:24:20 UTC (rev 44364)
@@ -235,7 +235,6 @@
 	BKE_writeframeserver.h
 	depsgraph_private.h
 	intern/CCGSubSurf.h
-	intern/bmesh_private.h
 	nla_private.h
 )
 

Deleted: trunk/blender/source/blender/blenkernel/intern/bmesh_private.h
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/bmesh_private.h	2012-02-23 10:18:10 UTC (rev 44363)
+++ trunk/blender/source/blender/blenkernel/intern/bmesh_private.h	2012-02-23 10:24:20 UTC (rev 44364)
@@ -1,71 +0,0 @@
-/*
- * BME_private.h    jan 2007
- *
- *	low level, 'private' function prototypes for bmesh kernel.
- *
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2004 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Geoffrey Bantle.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/blenkernel/intern/bmesh_private.h
- *  \ingroup bke
- */
-
-
-#ifndef __BMESH_PRIVATE_H__
-#define __BMESH_PRIVATE_H__
-
-#include "BKE_bmesh.h"
-
-/*ALLOCATION/DEALLOCATION*/
-struct BME_Vert *BME_addvertlist(struct BME_Mesh *bm, struct BME_Vert *example);
-struct BME_Edge *BME_addedgelist(struct BME_Mesh *bm, struct BME_Vert *v1, struct BME_Vert *v2, struct BME_Edge *example);
-struct BME_Poly *BME_addpolylist(struct BME_Mesh *bm, struct BME_Poly *example); 
-struct BME_Loop *BME_create_loop(struct BME_Mesh *bm, struct BME_Vert *v, struct BME_Edge *e, struct BME_Poly *f, struct BME_Loop *example);
-
-void BME_free_vert(struct BME_Mesh *bm, struct BME_Vert *v);
-void BME_free_edge(struct BME_Mesh *bm, struct BME_Edge *e);
-void BME_free_poly(struct BME_Mesh *bm, struct BME_Poly *f);
-void BME_free_loop(struct BME_Mesh *bm, struct BME_Loop *l);
-
-/*DOUBLE CIRCULAR LINKED LIST FUNCTIONS*/
-void BME_cycle_append(void *h, void *nt);
-int BME_cycle_remove(void *h, void *remn);
-int BME_cycle_validate(int len, void *h);
-/*DISK CYCLE MANAGMENT*/
-int BME_disk_append_edge(struct BME_Edge *e, struct BME_Vert *v);
-void BME_disk_remove_edge(struct BME_Edge *e, struct BME_Vert *v);
-/*RADIAL CYCLE MANAGMENT*/
-void BME_radial_append(struct BME_Edge *e, struct BME_Loop *l);
-void BME_radial_remove_loop(struct BME_Loop *l, struct BME_Edge *e);
-
-/*MISC FUNCTIONS*/
-int BME_edge_swapverts(struct BME_Edge *e, struct BME_Vert *orig, struct BME_Vert *new); /*relink edge*/
-int BME_disk_hasedge(struct BME_Vert *v, struct BME_Edge *e);
-
-/*Error reporting. Shouldnt be called by tools ever.*/
-void BME_error(void);
-#endif

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_queries.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_queries.c	2012-02-23 10:18:10 UTC (rev 44363)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_queries.c	2012-02-23 10:24:20 UTC (rev 44364)
@@ -217,14 +217,13 @@
 int BM_edge_face_count(BMEdge *e)
 {
 	int count = 0;
-	BMLoop *curloop = NULL;
+	BMLoop *l_iter = NULL;
 
 	if (e->l) {
-		curloop = e->l;
+		l_iter = e->l;
 		do {
 			count++;
-			curloop = bmesh_radial_nextloop(curloop);
-		} while (curloop != e->l);
+		} while ((l_iter = bmesh_radial_nextloop(l_iter)) != e->l);
 	}
 
 	return count;

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_structure.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_structure.c	2012-02-23 10:18:10 UTC (rev 44363)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_structure.c	2012-02-23 10:24:20 UTC (rev 44364)
@@ -195,6 +195,15 @@
 	dl1->next = dl1->prev = NULL;
 }
 
+/*
+ *			bmesh_disk_nextedge
+ *
+ *	Find the next edge in a disk cycle
+ *
+ *  Returns -
+ *	Pointer to the next edge in the disk cycle for the vertex v.
+ */
+
 struct BMEdge *bmesh_disk_nextedge(struct BMEdge *e, struct BMVert *v)
 {
 	if (v == e->v1)
@@ -308,6 +317,15 @@
 	return count;
 }
 
+/*
+ * BME FIND FIRST FACE EDGE
+ *
+ * Finds the first edge in a vertices
+ * Disk cycle that has one of this
+ * vert's loops attached
+ * to it.
+ */
+
 struct BMEdge *bmesh_disk_find_first_faceedge(struct BMEdge *e, struct BMVert *v)
 {
 	BMEdge *searchedge = NULL;
@@ -444,26 +462,25 @@
 
 int bmesh_radial_length(BMLoop *l)
 {
-	BMLoop *l2 = l;
+	BMLoop *l_iter = l;
 	int i = 0;
 
 	if (!l)
 		return 0;
 
 	do {
-		if (!l2) {
+		if (!l_iter) {
 			/* radial cycle is broken (not a circulat loop) */
 			bmesh_error();
 			return 0;
 		}
 		
 		i++;
-		l2 = l2->radial_next;
 		if (i >= BM_LOOP_RADIAL_MAX) {
 			bmesh_error();
 			return -1;
 		}
-	} while (l2 != l);
+	} while ((l_iter = l_iter->radial_next) != l);
 
 	return i;
 }
@@ -494,12 +511,12 @@
 
 int bmesh_radial_find_face(BMEdge *e, BMFace *f)
 {
-	BMLoop *curloop;
+	BMLoop *l_iter;
 	int i, len;
 
 	len = bmesh_radial_length(e->l);
-	for (i = 0, curloop = e->l; i < len; i++, curloop = curloop->radial_next) {
-		if (curloop->f == f)
+	for (i = 0, l_iter = e->l; i < len; i++, l_iter = l_iter->radial_next) {
+		if (l_iter->f == f)
 			return TRUE;
 	}
 	return FALSE;
@@ -567,28 +584,6 @@
 
 
 #if 0
-void bmesh_cycle_append(void *h, void *nt)
-{
-	BMNode *oldtail, *head, *newtail;
-	
-	head = (BMNode *)h;
-	newtail = (BMNode *)nt;
-	
-	if (head->next == NULL) {
-		head->next = newtail;
-		head->prev = newtail;
-		newtail->next = head;
-		newtail->prev = head;
-	}
-	else {
-		oldtail = head->prev;
-		oldtail->next = newtail;
-		newtail->next = head;
-		newtail->prev = oldtail;
-		head->prev = newtail;
-		
-	}
-}
 
 /**
  *			bmesh_cycle_length
@@ -619,102 +614,9 @@
 	return len;
 }
 
-/**
- *			bmesh_cycle_remove
- *
- *	Removes a node from a cycle.
- *
- *  Returns -
- *	1 for success, 0 for failure.
- */
-
-int bmesh_cycle_remove(void *h, void *remn)
-{
-	int i, len;
-	BMNode *head, *remnode, *curnode;
-	
-	head = (BMNode *)h;
-	remnode = (BMNode *)remn;
-	len = bmesh_cycle_length(h);
-	
-	if (len == 1 && head == remnode) {
-		head->next = NULL;
-		head->prev = NULL;
-		return TRUE;
-	}
-	else {
-		for (i = 0, curnode = head; i < len; curnode = curnode->next) {
-			if (curnode == remnode) {
-				remnode->prev->next = remnode->next;
-				remnode->next->prev = remnode->prev;
-				/* zero out remnode pointers, important */
-				//remnode->next = NULL;
-				//remnode->prev = NULL;
-				return TRUE;
-
-			}
-		}
-	}
-	return FALSE;
-}
-
-/**
- *			bmesh_cycle_validate
- *
- *	Validates a cycle. Takes as an argument the expected length of the cycle and
- *	a pointer to the cycle head or base.
- *
- *
- *  Returns -
- *	1 for success, 0 for failure.
- */
-
-int bmesh_cycle_validate(int len, void *h)
-{
-	int i;
-	BMNode *curnode, *head;
-	head = (BMNode *)h;
-	
-	/* forward validatio */
-	for (i = 0, curnode = head; i < len; i++, curnode = curnode->next);
-	if (curnode != head) {
-		return FALSE;
-	}
-
-	/* reverse validatio */
-	for (i = 0, curnode = head; i < len; i++, curnode = curnode->prev);
-	if (curnode != head) {
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
 /* Begin Disk Cycle routine */
 
 /**
- *			bmesh_disk_nextedge
- *
- *	Find the next edge in a disk cycle
- *
- *  Returns -
- *	Pointer to the next edge in the disk cycle for the vertex v.
- */
-
-BMEdge *bmesh_disk_nextedge(BMEdge *e, BMVert *v)
-{
-	if (bmesh_vert_in_edge(e, v)) {
-		if (e->v1 == v) {
-			return e->d1.next->data;
-		}
-		else if (e->v2 == v) {
-			return e->d2.next->data;
-		}
-	}
-	return NULL;
-}
-
-/**
  *			bmesh_disk_getpointer
  *
  *	Given an edge and one of its vertices, find the apporpriate CycleNode
@@ -735,71 +637,6 @@
 }
 
 /**
- *			bmesh_disk_append_edge
- *
- *	Appends edge to the end of a vertex disk cycle.
- *
- *  Returns -
- *	1 for success, 0 for failure
- */
-
-int bmesh_disk_append_edge(BMEdge *e, BMVert *v)
-{
-	
-	BMNode *base, *tail;
-
-	/* check to make sure v is in */
-	if (bmesh_vert_in_edge(e, v) == 0) {
-		return FALSE;
-	}
-	
-	/* check for loose vert firs */
-	if (v->e == NULL) {
-		v->e = e;
-		base = tail = bmesh_disk_getpointer(e, v);
-		bmesh_cycle_append(base, tail); /* circular reference is ok */
-		return TRUE;
-	}
-	
-	/* insert e at the end of disk cycle and make it the new v-> */
-	base = bmesh_disk_getpointer(v->e, v);
-	tail = bmesh_disk_getpointer(e, v);
-	bmesh_cycle_append(base, tail);
-	return TRUE;
-}
-
-/**
- *			bmesh_disk_remove_edge
- *
- *	Removes an edge from a disk cycle. If the edge to be removed is
- *	at the base of the cycle, the next edge becomes the new base.
- *
- *
- *  Returns -
- *	Nothing
- */
-
-void bmesh_disk_remove_edge(BMEdge *e, BMVert *v)
-{
-	BMNode *base, *remnode;
-	BMEdge *newbase;
-	int len;
-	
-	base = bmesh_disk_getpointer(v->e, v);
-	remnode = bmesh_disk_getpointer(e, v);
-	
-	/* first deal with v->e pointer.. */
-	len = bmesh_cycle_length(base);
-	if (len == 1) newbase = NULL;
-	else if (v->e == e) newbase = base->next-> data;
-	else newbase = v->e;
-	
-	/* remove and rebas */
-	bmesh_cycle_remove(base, remnode);
-	v->e = newbase;
-}
-
-/**
  *			bmesh_disk_next_edgeflag
  *
  *	Searches the disk cycle of v, starting with e, for the
@@ -837,43 +674,6 @@
 	return NULL;
 }
 
-/**
- *			bmesh_disk_count_edgeflag
- *
- *	Counts number of edges in this verts disk cycle which have
- *	either eflag or tflag (but not both!)
- *
- *  Returns -
- *	Integer.
- */
-
-int bmesh_disk_count_edgeflag(BMVert *v, int eflag, int tflag)
-{
-	BMNode *diskbase;
-	BMEdge *curedge;
-	int i, len = 0, count = 0;
-	
-	if (v->e) {
-
-		/* tflag and eflag are reserved for different functions */
-		if (eflag && tflag) {
-			return 0;
-		}
-
-		diskbase = bmesh_disk_getpointer(v->e, v);

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list