2018-06-20 10:03:50 +02:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup bke
|
2018-06-20 10:03:50 +02:00
|
|
|
*/
|
|
|
|
|
2020-03-02 15:07:49 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-01-28 11:08:24 +01:00
|
|
|
struct Mesh;
|
2018-06-20 10:03:50 +02:00
|
|
|
|
|
|
|
typedef enum MeshForeachFlag {
|
|
|
|
MESH_FOREACH_NOP = 0,
|
2019-06-26 04:40:22 +02:00
|
|
|
/* foreachMappedVert, foreachMappedLoop, foreachMappedFaceCenter */
|
|
|
|
MESH_FOREACH_USE_NORMAL = (1 << 0),
|
2018-06-20 10:03:50 +02:00
|
|
|
} MeshForeachFlag;
|
|
|
|
|
|
|
|
void BKE_mesh_foreach_mapped_vert(struct Mesh *mesh,
|
|
|
|
void (*func)(void *userData,
|
|
|
|
int index,
|
|
|
|
const float co[3],
|
|
|
|
const float no_f[3],
|
|
|
|
const short no_s[3]),
|
|
|
|
void *userData,
|
|
|
|
MeshForeachFlag flag);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Copied from #cdDM_foreachMappedEdge.
|
|
|
|
* \param tot_edges: Number of original edges. Used to avoid calling the callback with invalid
|
|
|
|
* edge indices.
|
|
|
|
*/
|
2018-06-20 10:03:50 +02:00
|
|
|
void BKE_mesh_foreach_mapped_edge(
|
|
|
|
struct Mesh *mesh,
|
2021-07-23 16:15:18 +02:00
|
|
|
int tot_edges,
|
2018-06-20 10:03:50 +02:00
|
|
|
void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]),
|
|
|
|
void *userData);
|
|
|
|
void BKE_mesh_foreach_mapped_loop(struct Mesh *mesh,
|
|
|
|
void (*func)(void *userData,
|
|
|
|
int vertex_index,
|
|
|
|
int face_index,
|
|
|
|
const float co[3],
|
|
|
|
const float no[3]),
|
|
|
|
void *userData,
|
|
|
|
MeshForeachFlag flag);
|
|
|
|
void BKE_mesh_foreach_mapped_face_center(
|
|
|
|
struct Mesh *mesh,
|
|
|
|
void (*func)(void *userData, int index, const float cent[3], const float no[3]),
|
|
|
|
void *userData,
|
|
|
|
MeshForeachFlag flag);
|
2019-07-07 18:58:11 +02:00
|
|
|
void BKE_mesh_foreach_mapped_subdiv_face_center(
|
|
|
|
struct Mesh *mesh,
|
|
|
|
void (*func)(void *userData, int index, const float cent[3], const float no[3]),
|
|
|
|
void *userData,
|
|
|
|
MeshForeachFlag flag);
|
2018-06-20 10:03:50 +02:00
|
|
|
|
2022-01-07 01:38:08 +01:00
|
|
|
void BKE_mesh_foreach_mapped_vert_coords_get(struct Mesh *me_eval, float (*r_cos)[3], int totcos);
|
2018-06-28 15:42:00 +02:00
|
|
|
|
2020-03-02 15:07:49 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|