bmesh: re-arrange headers
authorCampbell Barton <ideasman42@gmail.com>
Tue, 28 Feb 2012 16:47:12 +0000 (16:47 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 28 Feb 2012 16:47:12 +0000 (16:47 +0000)
12 files changed:
source/blender/bmesh/CMakeLists.txt
source/blender/bmesh/bmesh.h
source/blender/bmesh/bmesh_operator_api.h
source/blender/bmesh/intern/bmesh_interp.h [new file with mode: 0644]
source/blender/bmesh/intern/bmesh_iterators.h [moved from source/blender/bmesh/bmesh_iterators.h with 99% similarity]
source/blender/bmesh/intern/bmesh_marking.h [moved from source/blender/bmesh/bmesh_marking.h with 98% similarity]
source/blender/bmesh/intern/bmesh_operators.h [moved from source/blender/bmesh/bmesh_operators.h with 98% similarity]
source/blender/bmesh/intern/bmesh_queries.h [moved from source/blender/bmesh/bmesh_queries.h with 100% similarity]
source/blender/bmesh/intern/bmesh_walkers.h [moved from source/blender/bmesh/bmesh_walkers.h with 98% similarity]
source/blender/bmesh/intern/bmesh_walkers_private.h
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/bmesh_tools.c

index 93850afd76883a9e232d4b6aaa418db7a647fa39..5f1016ef804bc4c20a7e50e9b73bfd94fafa3525 100644 (file)
@@ -81,24 +81,30 @@ set(SRC
        operators/bmo_utils.c
 
        intern/bmesh_construct.c
+       intern/bmesh_core.c
        intern/bmesh_inline.c
        intern/bmesh_interp.c
+       intern/bmesh_interp.h
        intern/bmesh_iterators.c
+       intern/bmesh_iterators.h
        intern/bmesh_iterators_inline.c
        intern/bmesh_marking.c
+       intern/bmesh_marking.h
        intern/bmesh_mesh.c
        intern/bmesh_mods.c
-       intern/bmesh_core.c
        intern/bmesh_opdefines.c
        intern/bmesh_operator_api_inline.c
        intern/bmesh_operators.c
+       intern/bmesh_operators.h
        intern/bmesh_operators_private.h
        intern/bmesh_polygon.c
        intern/bmesh_private.h
        intern/bmesh_queries.c
+       intern/bmesh_queries.h
        intern/bmesh_structure.c
        intern/bmesh_structure.h
        intern/bmesh_walkers.c
+       intern/bmesh_walkers.h
        intern/bmesh_walkers_impl.c
        intern/bmesh_walkers_private.h
 
@@ -107,13 +113,7 @@ set(SRC
        bmesh.h
        bmesh_class.h
        bmesh_error.h
-       bmesh_interp.h
-       bmesh_iterators.h
-       bmesh_marking.h
        bmesh_operator_api.h
-       bmesh_operators.h
-       bmesh_queries.h
-       bmesh_walkers.h
 )
 
 add_definitions(-DGLEW_STATIC)
index ce3d1315f9190999fb9b3c65ec1712626e6cafc8..9537cd7fe4fbb3a091e84b44c4a50062f06d6440 100644 (file)
@@ -460,14 +460,17 @@ void bmesh_edit_end(BMesh *bm, int flag);
 #define BM_NGON_MAX 100000
 
 /* include the rest of the API */
-#include "bmesh_marking.h"
 #include "bmesh_operator_api.h"
-#include "bmesh_operators.h"
 #include "bmesh_error.h"
-#include "bmesh_queries.h"
-#include "bmesh_interp.h"
-#include "bmesh_iterators.h"
-#include "bmesh_walkers.h"
+
+#include "intern/bmesh_interp.h"
+#include "intern/bmesh_iterators.h"
+#include "intern/bmesh_marking.h"
+#include "intern/bmesh_operators.h"
+#include "intern/bmesh_queries.h"
+#include "intern/bmesh_walkers.h"
+#include "intern/bmesh_walkers.h"
+
 #include "intern/bmesh_inline.c"
 #include "intern/bmesh_operator_api_inline.c"
 
index 04dd388f4c028c118d20331e73eb303c16c0c2c4..fd8de3623f109868c1c691d3703ed0052980ba2d 100644 (file)
@@ -113,7 +113,7 @@ enum {
 /* please ignore all these structures, don't touch them in tool code, except
  * for when your defining an operator with BMOpDefine.*/
 
-typedef struct BMOpSlot{
+typedef struct BMOpSlot {
        int slottype;
        int len;
        int flag;
diff --git a/source/blender/bmesh/intern/bmesh_interp.h b/source/blender/bmesh/intern/bmesh_interp.h
new file mode 100644 (file)
index 0000000..01c9870
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * ***** 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.
+ *
+ * Contributor(s): Geoffrey Bantle, Levi Schooley.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __BMESH_INTERP_H__
+#define __BMESH_INTERP_H__
+
+/** \file blender/bmesh/intern/bmesh_interp.h
+ *  \ingroup bmesh
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* project the multires grid in target onto source's set of multires grids */
+void  BM_loop_interp_multires(BMesh *bm, BMLoop *target, BMFace *source);
+void  BM_vert_interp_from_face(BMesh *bm, BMVert *v, BMFace *source);
+
+void  BM_data_interp_from_verts(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v, const float fac);
+void  BM_data_interp_face_vert_edge(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v, BMEdge *e1, const float fac);
+void  BM_data_layer_add(BMesh *em, CustomData *data, int type);
+void  BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const char *name);
+void  BM_data_layer_free(BMesh *em, CustomData *data, int type);
+void  BM_data_layer_free_n(BMesh *bm, CustomData *data, int type, int n);
+float BM_elem_float_data_get(CustomData *cd, void *element, int type);
+void  BM_elem_float_data_set(CustomData *cd, void *element, int type, const float val);
+
+
+/**
+ * projects target onto source for customdata interpolation.
+ * \note only does loop customdata.  multires is handled.  */
+void BM_face_interp_from_face(BMesh *bm, BMFace *target, BMFace *source);
+
+/* projects a single loop, target, onto source for customdata interpolation. multires is handled.
+ * if do_vertex is true, target's vert data will also get interpolated.*/
+void BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source,
+                              int do_vertex, int do_multires);
+
+/* smoothes boundaries between multires grids, including some borders in adjacent faces */
+void BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f);
+
+/* convert MLoop*** in a bmface to mtface and mcol in
+ * an MFace*/
+void BM_loops_to_corners(BMesh *bm, struct Mesh *me, int findex,
+                         BMFace *f, int numTex, int numCol);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BMESH_INTERP_H__ */
similarity index 99%
rename from source/blender/bmesh/bmesh_iterators.h
rename to source/blender/bmesh/intern/bmesh_iterators.h
index 4cce9ec2afa223a627123bef2481b4580876560f..107adb0567c78c238d95c928fa634358cde32900 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __BMESH_ITERATORS_H__
 #define __BMESH_ITERATORS_H__
 
-/** \file blender/bmesh/bmesh_iterators.h
+/** \file blender/bmesh/intern/bmesh_iterators.h
  *  \ingroup bmesh
  */
 
similarity index 98%
rename from source/blender/bmesh/bmesh_marking.h
rename to source/blender/bmesh/intern/bmesh_marking.h
index 03e0c911e7e39b458d3ed012ae3175adb8c071da..76131231a2c26eee76d14b91485d644620df5cec 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __BMESH_MARKING_H__
 #define __BMESH_MARKING_H__
 
-/** \file blender/bmesh/bmesh_marking.h
+/** \file blender/bmesh/intern/bmesh_marking.h
  *  \ingroup bmesh
  */
 
similarity index 98%
rename from source/blender/bmesh/bmesh_operators.h
rename to source/blender/bmesh/intern/bmesh_operators.h
index a4329f86614f85f2da50de274eaa63696a4b343c..fc24e1960abcc06bb945198b2b81c380bb2208fa 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __BMESH_OPERATORS_H__
 #define __BMESH_OPERATORS_H__
 
-/** \file blender/bmesh/bmesh_operators.h
+/** \file blender/bmesh/intern/bmesh_operators.h
  *  \ingroup bmesh
  */
 
similarity index 98%
rename from source/blender/bmesh/bmesh_walkers.h
rename to source/blender/bmesh/intern/bmesh_walkers.h
index de8da23aec7a3016eaa62123b660aceb8b93d58e..765576c9ab71643e75748f7c4887fbfca7231e54 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __BMESH_WALKERS_H__
 #define __BMESH_WALKERS_H__
 
-/** \file blender/bmesh/bmesh_walkers.h
+/** \file blender/bmesh/intern/bmesh_walkers.h
  *  \ingroup bmesh
  */
 
index 2d59a9404486ff58e6011d9e16194e6a809a0e78..963018856ad061824a38d39f3cee2093031e9247 100644 (file)
@@ -34,13 +34,13 @@ extern int bm_totwalkers;
 
 
 /* Pointer hiding*/
-typedef struct bmesh_walkerGeneric{
+typedef struct bmesh_walkerGeneric {
        Link link;
        int depth;
 } bmesh_walkerGeneric;
 
 
-typedef struct shellWalker{
+typedef struct shellWalker {
        bmesh_walkerGeneric header;
        BMEdge *curedge;
 } shellWalker;
index 2fe177b71f18476d3db4ec4f36c0ee349928a41d..ae62b9cbed63b532a4b6cda5963435903d088f50 100644 (file)
@@ -943,14 +943,14 @@ static int loop_multiselect(bContext *C, wmOperator *op)
        if (looptype) {
                for (edindex = 0; edindex < totedgesel; edindex += 1) {
                        eed = edarray[edindex];
-                       walker_select(em, BMW_EDGERING, eed, 1);
+                       walker_select(em, BMW_EDGERING, eed, TRUE);
                }
                EDBM_selectmode_flush(em);
        }
-       else{
+       else {
                for (edindex = 0; edindex < totedgesel; edindex += 1) {
                        eed = edarray[edindex];
-                       walker_select(em, BMW_LOOP, eed, 1);
+                       walker_select(em, BMW_LOOP, eed, TRUE);
                }
                EDBM_selectmode_flush(em);
        }
index 624a569b3e053d8207ad2b10c26afce221da26ac..b6abfe79b70a5f3634465d9992db79f13a1bc583 100644 (file)
@@ -2013,7 +2013,7 @@ static int merge_firstlast(BMEditMesh *em, int first, int uvmerge, wmOperator *w
                ese = em->bm->selected.last;
                mergevert = (BMVert *)ese->ele;
        }
-       else{
+       else {
                ese = em->bm->selected.first;
                mergevert = (BMVert *)ese->ele;
        }
@@ -2997,7 +2997,7 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
                                m1 = (y12 - y11) / xdiff1;
                                b1 = ((x12 * y11) - (x11 * y12)) / xdiff1;
                        }
-                       else{
+                       else {
                                m1 = MAXSLOPE;
                                b1 = x12;
                        }