Blender  V2.93
bmesh_edgeloop.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2013 by Campbell Barton.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
26 struct BMEdgeLoopStore;
27 struct GSet;
28 struct ListBase;
29 
30 /* multiple edgeloops (ListBase) */
32  struct ListBase *r_eloops,
33  bool (*test_fn)(BMEdge *, void *user_data),
34  void *user_data);
36  ListBase *r_eloops,
37  bool (*test_fn)(BMEdge *, void *user_data),
38  void *user_data,
39  BMVert *v_src,
40  BMVert *v_dst);
41 
42 void BM_mesh_edgeloops_free(struct ListBase *eloops);
43 void BM_mesh_edgeloops_calc_center(BMesh *bm, struct ListBase *eloops);
44 void BM_mesh_edgeloops_calc_normal(BMesh *bm, struct ListBase *eloops);
46  struct ListBase *eloops,
47  const float no_align[3]);
48 void BM_mesh_edgeloops_calc_order(BMesh *bm, ListBase *eloops, const bool use_normals);
49 
50 /* single edgeloop */
51 struct BMEdgeLoopStore *BM_edgeloop_copy(struct BMEdgeLoopStore *el_store);
53  const int v_arr_tot,
54  bool is_closed);
55 
56 void BM_edgeloop_free(struct BMEdgeLoopStore *el_store);
57 bool BM_edgeloop_is_closed(struct BMEdgeLoopStore *el_store);
58 int BM_edgeloop_length_get(struct BMEdgeLoopStore *el_store);
59 struct ListBase *BM_edgeloop_verts_get(struct BMEdgeLoopStore *el_store);
60 const float *BM_edgeloop_normal_get(struct BMEdgeLoopStore *el_store);
61 const float *BM_edgeloop_center_get(struct BMEdgeLoopStore *el_store);
62 void BM_edgeloop_edges_get(struct BMEdgeLoopStore *el_store, BMEdge **e_arr);
66  struct BMEdgeLoopStore *el_store,
67  const float no_align[3]);
68 void BM_edgeloop_flip(BMesh *bm, struct BMEdgeLoopStore *el_store);
70  struct BMEdgeLoopStore *el_store,
71  int el_store_len,
72  bool split,
73  struct GSet *split_edges);
74 
75 bool BM_edgeloop_overlap_check(struct BMEdgeLoopStore *el_store_a,
76  struct BMEdgeLoopStore *el_store_b);
77 
78 #define BM_EDGELINK_NEXT(el_store, elink) \
79  (elink)->next ? \
80  (elink)->next : \
81  (BM_edgeloop_is_closed(el_store) ? BM_edgeloop_verts_get(el_store)->first : NULL)
82 
83 #define BM_EDGELOOP_NEXT(el_store) \
84  (CHECK_TYPE_INLINE(el_store, struct BMEdgeLoopStore *), \
85  (struct BMEdgeLoopStore *)((LinkData *)el_store)->next)
struct GSet GSet
Definition: BLI_ghash.h:189
void BM_mesh_edgeloops_calc_normal(BMesh *bm, struct ListBase *eloops)
const float * BM_edgeloop_center_get(struct BMEdgeLoopStore *el_store)
bool BM_edgeloop_calc_normal(BMesh *bm, struct BMEdgeLoopStore *el_store)
int BM_edgeloop_length_get(struct BMEdgeLoopStore *el_store)
int BM_mesh_edgeloops_find(BMesh *bm, struct ListBase *r_eloops, bool(*test_fn)(BMEdge *, void *user_data), void *user_data)
void BM_edgeloop_free(struct BMEdgeLoopStore *el_store)
void BM_mesh_edgeloops_calc_normal_aligned(BMesh *bm, struct ListBase *eloops, const float no_align[3])
void BM_mesh_edgeloops_free(struct ListBase *eloops)
struct BMEdgeLoopStore * BM_edgeloop_copy(struct BMEdgeLoopStore *el_store)
void BM_edgeloop_flip(BMesh *bm, struct BMEdgeLoopStore *el_store)
struct ListBase * BM_edgeloop_verts_get(struct BMEdgeLoopStore *el_store)
bool BM_mesh_edgeloops_find_path(BMesh *bm, ListBase *r_eloops, bool(*test_fn)(BMEdge *, void *user_data), void *user_data, BMVert *v_src, BMVert *v_dst)
void BM_mesh_edgeloops_calc_center(BMesh *bm, struct ListBase *eloops)
struct BMEdgeLoopStore * BM_edgeloop_from_verts(BMVert **v_arr, const int v_arr_tot, bool is_closed)
void BM_edgeloop_edges_get(struct BMEdgeLoopStore *el_store, BMEdge **e_arr)
void BM_mesh_edgeloops_calc_order(BMesh *bm, ListBase *eloops, const bool use_normals)
void BM_edgeloop_calc_center(BMesh *bm, struct BMEdgeLoopStore *el_store)
bool BM_edgeloop_overlap_check(struct BMEdgeLoopStore *el_store_a, struct BMEdgeLoopStore *el_store_b)
bool BM_edgeloop_is_closed(struct BMEdgeLoopStore *el_store)
const float * BM_edgeloop_normal_get(struct BMEdgeLoopStore *el_store)
void BM_edgeloop_expand(BMesh *bm, struct BMEdgeLoopStore *el_store, int el_store_len, bool split, struct GSet *split_edges)
bool BM_edgeloop_calc_normal_aligned(BMesh *bm, struct BMEdgeLoopStore *el_store, const float no_align[3])
ATTR_WARN_UNUSED_RESULT BMesh * bm
void * user_data
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
Definition: abc_util.cc:115