[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43316] trunk/blender/source/blender/ editors/mesh/editmesh_tools.c: remove commented editmesh code which is now moved to transform.c

Campbell Barton ideasman42 at gmail.com
Thu Jan 12 07:32:21 CET 2012


Revision: 43316
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43316
Author:   campbellbarton
Date:     2012-01-12 06:32:07 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
remove commented editmesh code which is now moved to transform.c

Modified Paths:
--------------
    trunk/blender/source/blender/editors/mesh/editmesh_tools.c

Modified: trunk/blender/source/blender/editors/mesh/editmesh_tools.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_tools.c	2012-01-12 06:11:08 UTC (rev 43315)
+++ trunk/blender/source/blender/editors/mesh/editmesh_tools.c	2012-01-12 06:32:07 UTC (rev 43316)
@@ -3943,808 +3943,6 @@
 	return 0;
 }
 
-#if 0
-
-typedef struct SlideUv {
-	float origuv[2];
-	float *uv_up, *uv_down;
-	//float *fuv[4];
-	LinkNode *fuv_list;
-} SlideUv;
-
-typedef struct SlideVert {
-	EditEdge *up,*down;
-	EditVert origvert;
-} SlideVert;
-
-int EdgeSlide(EditMesh *em, wmOperator *op, short immediate, float imperc)
-{
-	return 0;
-/* XXX REFACTOR - #if 0'd for now, otherwise can't make 64bit windows builds on 64bit machine */
-useless:
-	goto useless // because it doesn't do anything right now
-
-//	NumInput num; XXX
-	Mesh *me= NULL; // XXX
-	EditFace *efa;
-	EditEdge *eed,*first=NULL,*last=NULL, *temp = NULL;
-	EditVert *ev, *nearest;
-	LinkNode *edgelist = NULL, *vertlist=NULL, *look;
-	GHash *vertgh;
-
-	SlideVert *tempsv;
-	float perc = 0, percp = 0,vertdist; // XXX, projectMat[4][4];
-	float shiftlabda= 0.0f,len = 0.0f;
-	int i = 0,j, numsel, numadded=0, timesthrough = 0, vertsel=0, prop=1, cancel = 0,flip=0;
-	int wasshift = 0;
-
-	/* UV correction vars */
-	GHash **uvarray= NULL;
-	int  uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
-	int uvlay_idx;
-	SlideUv *slideuvs=NULL, *suv=NULL, *suv_last=NULL;
-	float uv_tmp[2];
-	LinkNode *fuv_link;
-
-	short event, draw=1;
-	int mval[2], mvalo[2];
-	char str[128];
-	float labda = 0.0f;
-
-//	initNumInput(&num);
-
-//	view3d_get_object_project_mat(curarea, obedit, projectMat);
-
-	mvalo[0] = -1; mvalo[1] = -1;
-	numsel =0;
-
-	// Get number of selected edges and clear some flags
-	for(eed=em->edges.first;eed;eed=eed->next) {
-		eed->f1 = 0;
-		eed->f2 = 0;
-		if(eed->f & SELECT) numsel++;
-	}
-
-	for(ev=em->verts.first;ev;ev=ev->next) {
-		ev->f1 = 0;
-	}
-
-	//Make sure each edge only has 2 faces
-	// make sure loop doesn't cross face
-	for(efa=em->faces.first;efa;efa=efa->next) {
-		int ct = 0;
-		if(efa->e1->f & SELECT) {
-			ct++;
-			efa->e1->f1++;
-			if(efa->e1->f1 > 2) {
-				BKE_report(op->reports, RPT_ERROR, "3+ face edge");
-				return 0;
-			}
-		}
-		if(efa->e2->f & SELECT) {
-			ct++;
-			efa->e2->f1++;
-			if(efa->e2->f1 > 2) {
-				BKE_report(op->reports, RPT_ERROR, "3+ face edge");
-				return 0;
-			}
-		}
-		if(efa->e3->f & SELECT) {
-			ct++;
-			efa->e3->f1++;
-			if(efa->e3->f1 > 2) {
-				BKE_report(op->reports, RPT_ERROR, "3+ face edge");
-				return 0;
-			}
-		}
-		if(efa->e4 && efa->e4->f & SELECT) {
-			ct++;
-			efa->e4->f1++;
-			if(efa->e4->f1 > 2) {
-				BKE_report(op->reports, RPT_ERROR, "3+ face edge");
-				return 0;
-			}
-		}
-		// Make sure loop is not 2 edges of same face
-		if(ct > 1) {
-			BKE_report(op->reports, RPT_ERROR, "Loop crosses itself");
-			return 0;
-		}
-	}
-	// Get # of selected verts
-	for(ev=em->verts.first;ev;ev=ev->next) {
-		if(ev->f & SELECT) vertsel++;
-	}
-
-	// Test for multiple segments
-	if(vertsel > numsel+1) {
-		BKE_report(op->reports, RPT_ERROR, "Please choose a single edge loop");
-		return 0;
-	}
-
-	// Get the edgeloop in order - mark f1 with SELECT once added
-	for(eed=em->edges.first;eed;eed=eed->next) {
-		if((eed->f & SELECT) && !(eed->f1 & SELECT)) {
-			// If this is the first edge added, just put it in
-			if(!edgelist) {
-				BLI_linklist_prepend(&edgelist,eed);
-				numadded++;
-				first = eed;
-				last  = eed;
-				eed->f1 = SELECT;
-			} else {
-				if(editedge_getSharedVert(eed, last)) {
-					BLI_linklist_append(&edgelist,eed);
-					eed->f1 = SELECT;
-					numadded++;
-					last = eed;
-				}  else if(editedge_getSharedVert(eed, first)) {
-					BLI_linklist_prepend(&edgelist,eed);
-					eed->f1 = SELECT;
-					numadded++;
-					first = eed;
-				}
-			}
-		}
-		if(eed->next == NULL && numadded != numsel) {
-			eed=em->edges.first;
-			timesthrough++;
-		}
-
-		// It looks like there was an unexpected case - Hopefully should not happen
-		if(timesthrough >= numsel*2) {
-			BLI_linklist_free(edgelist,NULL);
-			BKE_report(op->reports, RPT_ERROR, "Could not order loop");
-			return 0;
-		}
-	}
-
-	// Put the verts in order in a linklist
-	look = edgelist;
-	while(look) {
-		eed = look->link;
-		if(!vertlist) {
-			if(look->next) {
-				temp = look->next->link;
-
-				//This is the first entry takes care of extra vert
-				if(eed->v1 != temp->v1 && eed->v1 != temp->v2) {
-					BLI_linklist_append(&vertlist,eed->v1);
-					eed->v1->f1 = 1;
-				} else {
-					BLI_linklist_append(&vertlist,eed->v2);
-					eed->v2->f1 = 1;
-				}
-			} else {
-				//This is the case that we only have 1 edge
-				BLI_linklist_append(&vertlist,eed->v1);
-				eed->v1->f1 = 1;
-			}
-		}
-		// for all the entries
-		if(eed->v1->f1 != 1) {
-			BLI_linklist_append(&vertlist,eed->v1);
-			eed->v1->f1 = 1;
-		} else  if(eed->v2->f1 != 1) {
-			BLI_linklist_append(&vertlist,eed->v2);
-			eed->v2->f1 = 1;
-		}
-		look = look->next;
-	}
-
-	// populate the SlideVerts
-
-	vertgh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "EdgeSlide gh");
-	look = vertlist;
-	while(look) {
-		i=0;
-		j=0;
-		ev = look->link;
-		tempsv = (struct SlideVert*)MEM_mallocN(sizeof(struct SlideVert),"SlideVert");
-		tempsv->up = NULL;
-		tempsv->down = NULL;
-		tempsv->origvert.co[0] = ev->co[0];
-		tempsv->origvert.co[1] = ev->co[1];
-		tempsv->origvert.co[2] = ev->co[2];
-		tempsv->origvert.no[0] = ev->no[0];
-		tempsv->origvert.no[1] = ev->no[1];
-		tempsv->origvert.no[2] = ev->no[2];
-		// i is total edges that vert is on
-		// j is total selected edges that vert is on
-
-		for(eed=em->edges.first;eed;eed=eed->next) {
-			if(eed->v1 == ev || eed->v2 == ev) {
-				i++;
-				if(eed->f & SELECT) {
-					 j++;
-				}
-			}
-		}
-		// If the vert is in the middle of an edge loop, it touches 2 selected edges and 2 unselected edges
-		if(i == 4 && j == 2) {
-			for(eed=em->edges.first;eed;eed=eed->next) {
-				if(editedge_containsVert(eed, ev)) {
-					if(!(eed->f & SELECT)) {
-						if(!tempsv->up) {
-							tempsv->up = eed;
-						} else if (!(tempsv->down)) {
-							tempsv->down = eed;
-						}
-					}
-				}
-			}
-		}
-		// If it is on the end of the loop, it touches 1 selected and as least 2 more unselected
-		if(i >= 3 && j == 1) {
-			for(eed=em->edges.first;eed;eed=eed->next) {
-				if(editedge_containsVert(eed, ev) && eed->f & SELECT) {
-					for(efa = em->faces.first;efa;efa=efa->next) {
-						if(editface_containsEdge(efa, eed)) {
-							if(editedge_containsVert(efa->e1, ev) && efa->e1 != eed) {
-								if(!tempsv->up) {
-									tempsv->up = efa->e1;
-								} else if (!(tempsv->down)) {
-									tempsv->down = efa->e1;
-								}
-							}
-							if(editedge_containsVert(efa->e2, ev) && efa->e2 != eed) {
-								if(!tempsv->up) {
-									tempsv->up = efa->e2;
-								} else if (!(tempsv->down)) {
-									tempsv->down = efa->e2;
-								}
-							}
-							if(editedge_containsVert(efa->e3, ev) && efa->e3 != eed) {
-								if(!tempsv->up) {
-									tempsv->up = efa->e3;
-								} else if (!(tempsv->down)) {
-									tempsv->down = efa->e3;
-								}
-							}
-							if(efa->e4) {
-								if(editedge_containsVert(efa->e4, ev) && efa->e4 != eed) {
-									if(!tempsv->up) {
-										tempsv->up = efa->e4;
-									} else if (!(tempsv->down)) {
-										tempsv->down = efa->e4;
-									}
-								}
-							}
-
-						}
-					}
-				}
-			}
-		}
-		if(i > 4 && j == 2) {
-			BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN);
-			BLI_linklist_free(vertlist,NULL);
-			BLI_linklist_free(edgelist,NULL);
-			return 0;
-		}
-		BLI_ghash_insert(vertgh,ev,tempsv);
-
-		look = look->next;
-	}
-
-	// make sure the UPs nad DOWNs are 'faceloops'
-	// Also find the nearest slidevert to the cursor
-// XXX	getmouseco_areawin(mval);
-	look = vertlist;
-	nearest = NULL;
-	vertdist = -1;
-	while(look) {
-		tempsv  = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
-
-		if(!tempsv->up || !tempsv->down) {
-			BKE_report(op->reports, RPT_ERROR, "Missing rails");
-			BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN);
-			BLI_linklist_free(vertlist,NULL);
-			BLI_linklist_free(edgelist,NULL);
-			return 0;
-		}
-
-		if(me->drawflag & ME_DRAWEXTRA_EDGELEN) {
-			if(!(tempsv->up->f & SELECT)) {
-				tempsv->up->f |= SELECT;
-				tempsv->up->f2 |= 16;
-			} else {
-				tempsv->up->f2 |= ~16;
-			}
-			if(!(tempsv->down->f & SELECT)) {
-				tempsv->down->f |= SELECT;
-				tempsv->down->f2 |= 16;
-			} else {
-				tempsv->down->f2 |= ~16;
-			}
-		}
-
-		if(look->next != NULL) {
-			SlideVert *sv;
-
-			sv = BLI_ghash_lookup(vertgh,(EditVert*)look->next->link);
-
-			if(sv) {
-				float tempdist, co[2];
-
-				if(!sharesFace(em, tempsv->up,sv->up)) {
-					EditEdge *swap;
-					swap = sv->up;
-					sv->up = sv->down;
-					sv->down = swap;
-				}
-
-//				view3d_project_float(curarea, tempsv->origvert.co, co, projectMat);
-
-				tempdist = sqrt(pow(co[0] - mval[0],2)+pow(co[1]  - mval[1],2));
-
-				if(vertdist < 0) {
-					vertdist = tempdist;
-					nearest  = (EditVert*)look->link;
-				} else if ( tempdist < vertdist ) {
-					vertdist = tempdist;
-					nearest  = (EditVert*)look->link;
-				}
-			}
-		}
-
-
-
-		look = look->next;
-	}
-
-
-	if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) {
-		int maxnum = 0;
-		uvarray = MEM_callocN( uvlay_tot * sizeof(GHash *), "SlideUVs Array");
-		suv_last = slideuvs = MEM_callocN( uvlay_tot * (numadded+1) * sizeof(SlideUv), "SlideUVs"); /* uvLayers * verts */
-		suv = NULL;
-
-		for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
-
-			uvarray[uvlay_idx] = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "EdgeSlideUV gh");
-
-			for(ev=em->verts.first;ev;ev=ev->next) {
-				ev->tmp.l = 0;
-			}
-			look = vertlist;
-			while(look) {
-				float *uv_new;
-				tempsv  = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
-
-				ev = look->link;
-				suv = NULL;
-				for(efa = em->faces.first;efa;efa=efa->next) {
-					if (ev->tmp.l != -1) { /* test for self, in this case its invalid */
-						int k=-1; /* face corner */
-
-						/* Is this vert in the faces corner? */
-						if		(efa->v1==ev)				k=0;
-						else if	(efa->v2==ev)				k=1;
-						else if	(efa->v3==ev)				k=2;
-						else if	(efa->v4 && efa->v4==ev)	k=3;
-
-						if (k != -1) {
-							MTFace *tf = CustomData_em_get_n(&em->fdata, efa->data, CD_MTFACE, uvlay_idx);
-							EditVert *ev_up, *ev_down;
-

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list