2012-02-19 18:31:04 +00:00
|
|
|
/*
|
|
|
|
|
* ***** 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): Joseph Eagar.
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __BMESH_QUERIES_H__
|
|
|
|
|
#define __BMESH_QUERIES_H__
|
|
|
|
|
|
2012-02-28 18:28:30 +00:00
|
|
|
/** \file blender/bmesh/intern/bmesh_queries.h
|
2012-02-19 18:31:04 +00:00
|
|
|
* \ingroup bmesh
|
|
|
|
|
*/
|
|
|
|
|
|
2013-01-14 16:42:43 +00:00
|
|
|
bool BM_vert_in_face(BMFace *f, BMVert *v);
|
|
|
|
|
int BM_verts_in_face_count(BMFace *f, BMVert **varr, int len);
|
2013-01-14 18:37:58 +00:00
|
|
|
bool BM_verts_in_face(BMFace *f, BMVert **varr, int len);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-08-03 15:30:57 +00:00
|
|
|
bool BM_edge_in_face(BMEdge *e, BMFace *f);
|
2013-12-23 16:03:07 +11:00
|
|
|
BLI_INLINE bool BM_edge_in_loop(const BMEdge *e, const BMLoop *l);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-12-23 16:03:07 +11:00
|
|
|
BLI_INLINE bool BM_vert_in_edge(const BMEdge *e, const BMVert *v);
|
|
|
|
|
BLI_INLINE bool BM_verts_in_edge(const BMVert *v1, const BMVert *v2, const BMEdge *e);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2012-04-23 01:19:50 +00:00
|
|
|
float BM_edge_calc_length(BMEdge *e);
|
2012-12-31 02:40:15 +00:00
|
|
|
float BM_edge_calc_length_squared(BMEdge *e);
|
2013-01-14 16:42:43 +00:00
|
|
|
bool BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb);
|
|
|
|
|
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb);
|
2013-12-23 16:03:07 +11:00
|
|
|
BLI_INLINE BMVert *BM_edge_other_vert(BMEdge *e, const BMVert *v);
|
2012-10-14 04:42:11 +00:00
|
|
|
BMLoop *BM_edge_other_loop(BMEdge *e, BMLoop *l);
|
2012-03-04 16:36:31 +00:00
|
|
|
BMLoop *BM_face_other_edge_loop(BMFace *f, BMEdge *e, BMVert *v);
|
2013-04-19 01:02:58 +00:00
|
|
|
BMLoop *BM_loop_other_edge_loop(BMLoop *l, BMVert *v);
|
2012-03-04 16:01:02 +00:00
|
|
|
BMLoop *BM_face_other_vert_loop(BMFace *f, BMVert *v_prev, BMVert *v);
|
2012-03-25 14:44:48 +00:00
|
|
|
BMLoop *BM_loop_other_vert_loop(BMLoop *l, BMVert *v);
|
2012-10-20 16:48:04 +00:00
|
|
|
BMLoop *BM_vert_step_fan_loop(BMLoop *l, BMEdge **e_step);
|
2012-06-27 15:39:14 +00:00
|
|
|
BMLoop *BM_vert_find_first_loop(BMVert *v);
|
2013-12-24 11:04:03 +11:00
|
|
|
BMFace *BM_vert_pair_share_face(BMVert *v_a, BMVert *v_b,
|
|
|
|
|
BMLoop **r_l_a, BMLoop **r_l_b);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2012-03-11 21:47:14 +00:00
|
|
|
int BM_vert_edge_count_nonwire(BMVert *v);
|
2012-02-28 18:28:30 +00:00
|
|
|
int BM_vert_edge_count(BMVert *v);
|
|
|
|
|
int BM_edge_face_count(BMEdge *e);
|
|
|
|
|
int BM_vert_face_count(BMVert *v);
|
2012-04-19 21:47:32 +00:00
|
|
|
BMEdge *BM_vert_other_disk_edge(BMVert *v, BMEdge *e);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-08-03 16:37:23 +00:00
|
|
|
bool BM_vert_is_wire(const BMVert *v);
|
2013-12-23 16:03:07 +11:00
|
|
|
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-08-03 16:37:23 +00:00
|
|
|
bool BM_vert_is_manifold(const BMVert *v);
|
2013-12-23 16:03:07 +11:00
|
|
|
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e);
|
2013-08-03 16:37:23 +00:00
|
|
|
bool BM_vert_is_boundary(const BMVert *v);
|
2013-12-23 16:03:07 +11:00
|
|
|
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e);
|
|
|
|
|
BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e);
|
2013-08-03 16:37:23 +00:00
|
|
|
bool BM_edge_is_convex(const BMEdge *e);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-08-03 16:37:23 +00:00
|
|
|
bool BM_loop_is_convex(const BMLoop *l);
|
2013-12-24 11:04:03 +11:00
|
|
|
BLI_INLINE bool BM_loop_is_adjacent(const BMLoop *l_a, const BMLoop *l_b);
|
2013-01-29 03:25:47 +00:00
|
|
|
|
2012-04-23 01:19:50 +00:00
|
|
|
float BM_loop_calc_face_angle(BMLoop *l);
|
|
|
|
|
void BM_loop_calc_face_normal(BMLoop *l, float r_normal[3]);
|
2013-02-03 06:09:29 +00:00
|
|
|
void BM_loop_calc_face_direction(BMLoop *l, float r_normal[3]);
|
2012-04-23 01:19:50 +00:00
|
|
|
void BM_loop_calc_face_tangent(BMLoop *l, float r_tangent[3]);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-12-14 23:18:23 +11:00
|
|
|
float BM_edge_calc_face_angle_ex(const BMEdge *e, const float fallback);
|
2013-08-03 16:37:23 +00:00
|
|
|
float BM_edge_calc_face_angle(const BMEdge *e);
|
2013-12-14 23:18:23 +11:00
|
|
|
float BM_edge_calc_face_angle_signed_ex(const BMEdge *e, const float fallback);
|
2013-08-03 16:37:23 +00:00
|
|
|
float BM_edge_calc_face_angle_signed(const BMEdge *e);
|
|
|
|
|
void BM_edge_calc_face_tangent(const BMEdge *e, const BMLoop *e_loop, float r_tangent[3]);
|
2012-04-19 11:25:05 +00:00
|
|
|
|
2012-04-23 01:19:50 +00:00
|
|
|
float BM_vert_calc_edge_angle(BMVert *v);
|
|
|
|
|
float BM_vert_calc_shell_factor(BMVert *v);
|
2012-12-14 16:10:46 +00:00
|
|
|
float BM_vert_calc_shell_factor_ex(BMVert *v, const char hflag);
|
2012-04-29 10:44:00 +00:00
|
|
|
float BM_vert_calc_mean_tagged_edge_length(BMVert *v);
|
2012-05-22 15:19:33 +00:00
|
|
|
|
2012-05-22 15:49:41 +00:00
|
|
|
BMLoop *BM_face_find_shortest_loop(BMFace *f);
|
|
|
|
|
BMLoop *BM_face_find_longest_loop(BMFace *f);
|
|
|
|
|
|
2012-02-28 18:28:30 +00:00
|
|
|
BMEdge *BM_edge_exists(BMVert *v1, BMVert *v2);
|
2012-10-20 09:48:41 +00:00
|
|
|
BMEdge *BM_edge_find_double(BMEdge *e);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-01-14 16:42:43 +00:00
|
|
|
bool BM_face_exists(BMVert **varr, int len, BMFace **r_existface);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-01-14 16:42:43 +00:00
|
|
|
bool BM_face_exists_multi(BMVert **varr, BMEdge **earr, int len);
|
|
|
|
|
bool BM_face_exists_multi_edge(BMEdge **earr, int len);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-08-16 13:02:34 +00:00
|
|
|
bool BM_face_exists_overlap(BMVert **varr, const int len, BMFace **r_f_overlap);
|
|
|
|
|
bool BM_face_exists_overlap_subset(BMVert **varr, const int len);
|
|
|
|
|
|
2013-08-03 15:30:57 +00:00
|
|
|
int BM_face_share_face_count(BMFace *f_a, BMFace *f_b);
|
2012-02-28 18:28:30 +00:00
|
|
|
int BM_face_share_edge_count(BMFace *f1, BMFace *f2);
|
2012-11-09 14:52:05 +00:00
|
|
|
|
2013-01-14 16:42:43 +00:00
|
|
|
bool BM_face_share_face_check(BMFace *f1, BMFace *f2);
|
|
|
|
|
bool BM_face_share_edge_check(BMFace *f1, BMFace *f2);
|
|
|
|
|
bool BM_edge_share_face_check(BMEdge *e1, BMEdge *e2);
|
|
|
|
|
bool BM_edge_share_quad_check(BMEdge *e1, BMEdge *e2);
|
|
|
|
|
bool BM_edge_share_vert_check(BMEdge *e1, BMEdge *e2);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2012-02-28 07:42:48 +00:00
|
|
|
BMVert *BM_edge_share_vert(BMEdge *e1, BMEdge *e2);
|
2013-08-19 10:00:17 +00:00
|
|
|
BMLoop *BM_edge_vert_share_loop(BMLoop *l, BMVert *v);
|
2012-03-08 20:00:37 +00:00
|
|
|
BMLoop *BM_face_vert_share_loop(BMFace *f, BMVert *v);
|
2012-04-18 04:32:55 +00:00
|
|
|
BMLoop *BM_face_edge_share_loop(BMFace *f, BMEdge *e);
|
2012-02-26 21:32:20 +00:00
|
|
|
|
2013-08-03 16:37:23 +00:00
|
|
|
void BM_edge_ordered_verts(const BMEdge *edge, BMVert **r_v1, BMVert **r_v2);
|
|
|
|
|
void BM_edge_ordered_verts_ex(const BMEdge *edge, BMVert **r_v1, BMVert **r_v2,
|
|
|
|
|
const BMLoop *edge_loop);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-08-03 16:37:23 +00:00
|
|
|
bool BM_edge_is_any_vert_flag_test(const BMEdge *e, const char hflag);
|
|
|
|
|
bool BM_face_is_any_vert_flag_test(const BMFace *f, const char hflag);
|
|
|
|
|
bool BM_face_is_any_edge_flag_test(const BMFace *f, const char hflag);
|
2012-11-11 23:33:59 +00:00
|
|
|
|
2013-08-03 16:37:23 +00:00
|
|
|
bool BM_face_is_normal_valid(const BMFace *f);
|
2013-07-29 06:04:09 +00:00
|
|
|
|
2013-05-07 00:00:32 +00:00
|
|
|
float BM_mesh_calc_volume(BMesh *bm, bool is_signed);
|
2013-07-22 14:50:38 +00:00
|
|
|
|
2013-07-08 13:30:11 +00:00
|
|
|
int BM_mesh_calc_face_groups(BMesh *bm, int *r_groups_array, int (**r_group_index)[2],
|
2013-07-22 14:50:38 +00:00
|
|
|
BMElemFilterFunc filter_fn, void *user_data,
|
|
|
|
|
const char hflag_test, const char htype_step);
|
|
|
|
|
int BM_mesh_calc_edge_groups(BMesh *bm, int *r_groups_array, int (**r_group_index)[2],
|
|
|
|
|
BMElemFilterFunc filter_fn, void *user_data,
|
|
|
|
|
const char hflag_test);
|
2013-03-13 06:32:08 +00:00
|
|
|
|
2013-05-23 06:19:04 +00:00
|
|
|
/* not really any good place to put this */
|
|
|
|
|
float bmesh_subd_falloff_calc(const int falloff, float val);
|
|
|
|
|
|
2013-12-23 16:03:07 +11:00
|
|
|
#include "bmesh_queries_inline.h"
|
|
|
|
|
|
2012-02-19 18:31:04 +00:00
|
|
|
#endif /* __BMESH_QUERIES_H__ */
|