61 #define SCULPT_GEODESIC_VERTEX_NONE -1
65 MVert *mvert,
const int v0,
const int v1,
const int v2,
float *dists,
GSet *initial_vertices)
72 if (dists[v0] <= dists[
v1]) {
79 if (dists[v0] <= dists[
v2]) {
83 mvert[v0].co, mvert[
v1].co, mvert[
v2].co, dists[
v1], dists[
v2]);
91 if (dist0 < dists[v0]) {
100 GSet *initial_vertices,
139 for (
int i = 0; i < totvert; i++) {
164 float *v_co =
verts[
v].co;
165 for (
int i = 0; i < totvert; i++) {
174 for (
int i = 0; i < totedge; i++) {
175 const int v1 = edges[i].
v1;
176 const int v2 = edges[i].
v2;
180 if (dists[
v1] != FLT_MAX || dists[
v2] != FLT_MAX) {
188 int v1 = edges[
e].
v1;
189 int v2 = edges[
e].
v2;
191 if (dists[
v1] == FLT_MAX || dists[
v2] == FLT_MAX) {
192 if (dists[
v1] > dists[
v2]) {
200 for (
int poly_map_index = 0; poly_map_index < ss->
epmap[
e].
count; poly_map_index++) {
207 for (
int loop_index = 0; loop_index < mpoly->
totloop; loop_index++) {
209 const int v_other = mloop->
v;
214 verts, v_other,
v1,
v2, dists, initial_vertices)) {
215 for (
int edge_map_index = 0; edge_map_index < ss->
vemap[v_other].
count;
217 const int e_other = ss->
vemap[v_other].
indices[edge_map_index];
219 if (edges[e_other].
v1 == (
uint)v_other) {
220 ev_other = edges[e_other].
v2;
223 ev_other = edges[e_other].
v1;
227 (ss->
epmap[e_other].
count == 0 || dists[ev_other] != FLT_MAX)) {
241 for (
LinkNode *lnk = queue_next; lnk; lnk = lnk->
next) {
276 for (
int i = 0; i < totvert; i++) {
283 for (
int i = 0; i < totvert; i++) {
291 GSet *initial_vertices,
315 for (
char i = 0; i <= symm; ++i) {
void BKE_mesh_vert_edge_map_create(MeshElemMap **r_map, int **r_mem, const struct MEdge *medge, int totvert, int totedge)
void BKE_mesh_edge_poly_map_create(MeshElemMap **r_map, int **r_mem, const struct MEdge *medge, int totedge, const struct MPoly *mpoly, int totpoly, const struct MLoop *mloop, int totloop)
General operations, lookup, etc. for blender objects.
struct Mesh * BKE_object_get_original_mesh(const struct Object *object)
A BVH for high poly meshes.
PBVHType BKE_pbvh_type(const PBVH *pbvh)
#define BLI_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_TEST(_bitmap, _index)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
#define BLI_BITMAP_DISABLE(_bitmap, _index)
void BLI_bitmap_set_all(BLI_bitmap *bitmap, bool set, size_t bits)
GSet * BLI_gset_int_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_gset_haskey(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
#define GSET_ITER(gs_iter_, gset_)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
BLI_INLINE void * BLI_gsetIterator_getKey(GSetIterator *gsi)
bool BLI_gset_add(GSet *gs, void *key)
BLI_LINKSTACK_*** wrapper macros for using a LinkNode to store a stack of pointers,...
#define BLI_LINKSTACK_PUSH(var, ptr)
#define BLI_LINKSTACK_DECLARE(var, type)
#define BLI_LINKSTACK_SIZE(var)
#define BLI_LINKSTACK_FREE(var)
#define BLI_LINKSTACK_INIT(var)
#define BLI_LINKSTACK_POP(var)
#define BLI_LINKSTACK_SWAP(var_a, var_b)
float geodesic_distance_propagate_across_triangle(const float v0[3], const float v1[3], const float v2[3], float dist1, float dist2)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
static float limit_radius(const float3 &position_prev, const float3 &position, const float3 &position_next, const float angle_prev, const float angle, const float angle_next, const float radius_prev, const float radius, const float radius_next)
BLI_INLINE void flip_v3_v3(float out[3], const float in[3], const ePaintSymmetryFlags symm)
const float * SCULPT_vertex_co_get(SculptSession *ss, int index)
int SCULPT_nearest_vertex_get(Sculpt *sd, Object *ob, const float co[3], float max_distance, bool use_original)
bool SCULPT_is_symmetry_iteration_valid(char i, char symm)
char SCULPT_mesh_symmetry_xyz_get(Object *object)
MVert * SCULPT_mesh_deformed_mverts_get(SculptSession *ss)
static bool sculpt_geodesic_mesh_test_dist_add(MVert *mvert, const int v0, const int v1, const int v2, float *dists, GSet *initial_vertices)
float * SCULPT_geodesic_from_vertex_and_symm(Sculpt *sd, Object *ob, const int vertex, const float limit_radius)
float * SCULPT_geodesic_distances_create(Object *ob, GSet *initial_vertices, const float limit_radius)
float * SCULPT_geodesic_from_vertex(Object *ob, const int vertex, const float limit_radius)
static float * SCULPT_geodesic_fallback_create(Object *ob, GSet *initial_vertices)
static float * SCULPT_geodesic_mesh_create(Object *ob, GSet *initial_vertices, const float limit_radius)
#define SCULPT_GEODESIC_VERTEX_NONE
struct SculptSession * sculpt
struct MeshElemMap * epmap
struct MeshElemMap * vemap