[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10767] branches/bmesh/source/blender/src: Didn't realize that the editmesh*** files in src/ were still there.
Joseph Eagar
joeedh at gmail.com
Wed May 23 21:09:36 CEST 2007
Revision: 10767
https://svn.blender.org//revision/?rev=10767&view=rev
Author: joeedh
Date: 2007-05-23 21:09:36 +0200 (Wed, 23 May 2007)
Log Message:
-----------
Didn't realize that the editmesh*** files in src/ were still there.
Removed Paths:
-------------
branches/bmesh/source/blender/src/editmesh.c
branches/bmesh/source/blender/src/editmesh_add.c
branches/bmesh/source/blender/src/editmesh_lib.c
branches/bmesh/source/blender/src/editmesh_loop.c
branches/bmesh/source/blender/src/editmesh_mods.c
branches/bmesh/source/blender/src/editmesh_tools.c
Deleted: branches/bmesh/source/blender/src/editmesh.c
===================================================================
--- branches/bmesh/source/blender/src/editmesh.c 2007-05-23 15:27:34 UTC (rev 10766)
+++ branches/bmesh/source/blender/src/editmesh.c 2007-05-23 19:09:36 UTC (rev 10767)
@@ -1,2155 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL/BL DUAL 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. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
- */
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "DNA_customdata_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_screen_types.h"
-#include "DNA_key_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_material_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_dynstr.h"
-#include "BLI_rand.h"
-
-#include "BKE_DerivedMesh.h"
-#include "BKE_depsgraph.h"
-#include "BKE_customdata.h"
-#include "BKE_global.h"
-#include "BKE_key.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BIF_editkey.h"
-#include "BIF_editmesh.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_interface.h"
-#include "BIF_meshtools.h"
-#include "BIF_mywindow.h"
-#include "BIF_retopo.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BSE_view.h"
-#include "BSE_edit.h"
-#include "BSE_trans_types.h"
-
-#include "BDR_drawobject.h"
-#include "BDR_editobject.h"
-#include "BDR_editface.h"
-#include "BDR_vpaint.h"
-
-#include "LBM_fluidsim.h"
-
-#include "multires.h"
-#include "mydevice.h"
-#include "blendef.h"
-
-/* own include */
-#include "editmesh.h"
-
-/*
-
-editmesh.c:
-- add/alloc/free data
-- hashtables
-- enter/exit editmode
-
-*/
-
-
-/* ***************** HASH ********************* */
-
-
-#define EDHASHSIZE (512*512)
-#define EDHASH(a, b) (a % EDHASHSIZE)
-
-
-/* ************ ADD / REMOVE / FIND ****************** */
-
-/* used to bypass normal calloc with fast one */
-static void *(*callocvert)(size_t, size_t) = calloc;
-static void *(*callocedge)(size_t, size_t) = calloc;
-static void *(*callocface)(size_t, size_t) = calloc;
-
-EditVert *addvertlist(float *vec, EditVert *example)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- static int hashnr= 0;
-
- eve= callocvert(sizeof(EditVert), 1);
- BLI_addtail(&em->verts, eve);
-
- if(vec) VECCOPY(eve->co, vec);
-
- eve->hash= hashnr++;
- if( hashnr>=EDHASHSIZE) hashnr= 0;
-
- /* new verts get keyindex of -1 since they did not
- * have a pre-editmode vertex order
- */
- eve->keyindex = -1;
-#ifdef WITH_VERSE
- createVerseVert(eve);
-#endif
-
- if(example)
- CustomData_em_copy_data(&em->vdata, &em->vdata, example->data, &eve->data);
- else
- CustomData_em_set_default(&em->vdata, &eve->data);
-
- return eve;
-}
-
-void free_editvert (EditVert *eve)
-{
-#ifdef WITH_VERSE
- if(eve->vvert) {
- /* it prevents from removing all verse vertexes
- * during entering edit mode ... messy solution */
- if(G.editMesh->vnode)
- b_verse_send_vertex_delete(eve);
- else
- ((VerseVert*)eve->vvert)->vertex = NULL;
- }
-#endif
-
- EM_remove_selection(eve, EDITVERT);
- CustomData_em_free_block(&G.editMesh->vdata, &eve->data);
- if(eve->fast==0)
- free(eve);
-}
-
-
-EditEdge *findedgelist(EditVert *v1, EditVert *v2)
-{
- EditVert *v3;
- struct HashEdge *he;
-
- /* swap ? */
- if( v1 > v2) {
- v3= v2;
- v2= v1;
- v1= v3;
- }
-
- if(G.editMesh->hashedgetab==NULL)
- G.editMesh->hashedgetab= MEM_callocN(EDHASHSIZE*sizeof(struct HashEdge), "hashedgetab");
-
- he= G.editMesh->hashedgetab + EDHASH(v1->hash, v2->hash);
-
- while(he) {
-
- if(he->eed && he->eed->v1==v1 && he->eed->v2==v2) return he->eed;
-
- he= he->next;
- }
- return 0;
-}
-
-static void insert_hashedge(EditEdge *eed)
-{
- /* assuming that eed is not in the list yet, and that a find has been done before */
-
- struct HashEdge *first, *he;
-
- first= G.editMesh->hashedgetab + EDHASH(eed->v1->hash, eed->v2->hash);
-
- if( first->eed==0 ) {
- first->eed= eed;
- }
- else {
- he= &eed->hash;
- he->eed= eed;
- he->next= first->next;
- first->next= he;
- }
-}
-
-static void remove_hashedge(EditEdge *eed)
-{
- /* assuming eed is in the list */
-
- struct HashEdge *first, *he, *prev=NULL;
-
- he=first= G.editMesh->hashedgetab + EDHASH(eed->v1->hash, eed->v2->hash);
-
- while(he) {
- if(he->eed == eed) {
- /* remove from list */
- if(he==first) {
- if(first->next) {
- he= first->next;
- first->eed= he->eed;
- first->next= he->next;
- }
- else he->eed= 0;
- }
- else {
- prev->next= he->next;
- }
- return;
- }
- prev= he;
- he= he->next;
- }
-}
-
-EditEdge *addedgelist(EditVert *v1, EditVert *v2, EditEdge *example)
-{
- EditMesh *em = G.editMesh;
- EditVert *v3;
- EditEdge *eed;
- int swap= 0;
-
- if(v1==v2) return NULL;
- if(v1==NULL || v2==NULL) return NULL;
-
- /* swap ? */
- if(v1>v2) {
- v3= v2;
- v2= v1;
- v1= v3;
- swap= 1;
- }
-
- /* find in hashlist */
- eed= findedgelist(v1, v2);
-
- if(eed==NULL) {
-
- eed= (EditEdge *)callocedge(sizeof(EditEdge), 1);
- eed->v1= v1;
- eed->v2= v2;
- BLI_addtail(&em->edges, eed);
- eed->dir= swap;
- insert_hashedge(eed);
-
- /* copy edge data:
- rule is to do this with addedgelist call, before addfacelist */
- if(example) {
- eed->crease= example->crease;
- eed->sharp = example->sharp;
- eed->seam = example->seam;
- eed->h |= (example->h & EM_FGON);
- }
- }
-
- return eed;
-}
-
-void remedge(EditEdge *eed)
-{
- EditMesh *em = G.editMesh;
-
- BLI_remlink(&em->edges, eed);
- remove_hashedge(eed);
-}
-
-void free_editedge(EditEdge *eed)
-{
- EM_remove_selection(eed, EDITEDGE);
- if(eed->fast==0){
- free(eed);
- }
-}
-
-void free_editface(EditFace *efa)
-{
-#ifdef WITH_VERSE
- if(efa->vface) {
- /* it prevents from removing all verse faces
- * during entering edit mode ... messy solution */
- if(G.editMesh->vnode)
- b_verse_send_face_delete(efa);
- else
- ((VerseFace*)efa->vface)->face = NULL;
- }
-#endif
- EM_remove_selection(efa, EDITFACE);
- CustomData_em_free_block(&G.editMesh->fdata, &efa->data);
- if(efa->fast==0)
- free(efa);
-}
-
-void free_vertlist(ListBase *edve)
-{
- EditVert *eve, *next;
-
- if (!edve) return;
-
- eve= edve->first;
- while(eve) {
- next= eve->next;
- free_editvert(eve);
- eve= next;
- }
- edve->first= edve->last= NULL;
-}
-
-void free_edgelist(ListBase *lb)
-{
- EditEdge *eed, *next;
-
- eed= lb->first;
- while(eed) {
- next= eed->next;
- free_editedge(eed);
- eed= next;
- }
- lb->first= lb->last= NULL;
-}
-
-void free_facelist(ListBase *lb)
-{
- EditFace *efa, *next;
-
- efa= lb->first;
- while(efa) {
- next= efa->next;
- free_editface(efa);
- efa= next;
- }
- lb->first= lb->last= NULL;
-}
-
-EditFace *addfacelist(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4, EditFace *example, EditFace *exampleEdges)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- EditEdge *e1, *e2=0, *e3=0, *e4=0;
-
- /* added sanity check... seems to happen for some tools, or for enter editmode for corrupted meshes */
- if(v1==v4 || v2==v4 || v3==v4) v4= NULL;
-
- /* add face to list and do the edges */
- if(exampleEdges) {
- e1= addedgelist(v1, v2, exampleEdges->e1);
- e2= addedgelist(v2, v3, exampleEdges->e2);
- if(v4) e3= addedgelist(v3, v4, exampleEdges->e3);
- else e3= addedgelist(v3, v1, exampleEdges->e3);
- if(v4) e4= addedgelist(v4, v1, exampleEdges->e4);
- }
- else {
- e1= addedgelist(v1, v2, NULL);
- e2= addedgelist(v2, v3, NULL);
- if(v4) e3= addedgelist(v3, v4, NULL);
- else e3= addedgelist(v3, v1, NULL);
- if(v4) e4= addedgelist(v4, v1, NULL);
- }
-
- if(v1==v2 || v2==v3 || v1==v3) return NULL;
- if(e2==0) return NULL;
-
- efa= (EditFace *)callocface(sizeof(EditFace), 1);
- efa->v1= v1;
- efa->v2= v2;
- efa->v3= v3;
- efa->v4= v4;
-
- efa->e1= e1;
- efa->e2= e2;
- efa->e3= e3;
- efa->e4= e4;
-
- if(example) {
- efa->mat_nr= example->mat_nr;
- efa->flag= example->flag;
- CustomData_em_copy_data(&em->fdata, &em->fdata, example->data, &efa->data);
- }
- else {
- if (G.obedit && G.obedit->actcol)
- efa->mat_nr= G.obedit->actcol-1;
-
- CustomData_em_set_default(&em->fdata, &efa->data);
- }
-
- BLI_addtail(&em->faces, efa);
-
- if(efa->v4) {
- CalcNormFloat4(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, efa->n);
- CalcCent4f(efa->cent, efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co);
- }
- else {
- CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n);
- CalcCent3f(efa->cent, efa->v1->co, efa->v2->co, efa->v3->co);
- }
-
-#ifdef WITH_VERSE
- createVerseFace(efa);
-#endif
-
- return efa;
-}
-
-/* ************************ end add/new/find ************ */
-
-/* ************************ Edit{Vert,Edge,Face} utilss ***************************** */
-
-/* some nice utility functions */
-
-EditVert *editedge_getOtherVert(EditEdge *eed, EditVert *eve)
-{
- if (eve==eed->v1) {
- return eed->v2;
- } else if (eve==eed->v2) {
- return eed->v1;
- } else {
- return NULL;
- }
-}
-
-EditVert *editedge_getSharedVert(EditEdge *eed, EditEdge *eed2)
-{
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list