Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_intern.h
| Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | typedef struct SculptVertexNeighborIter { | ||||
| /* Public */ | /* Public */ | ||||
| int index; | int index; | ||||
| bool is_duplicate; | bool is_duplicate; | ||||
| } SculptVertexNeighborIter; | } SculptVertexNeighborIter; | ||||
| void SCULPT_vertex_neighbors_get(struct SculptSession *ss, | void SCULPT_vertex_neighbors_get(struct SculptSession *ss, | ||||
| const int index, | const int index, | ||||
| const bool include_duplicates, | const bool include_duplicates, | ||||
| const bool include_face_neighbors, | |||||
| SculptVertexNeighborIter *iter); | SculptVertexNeighborIter *iter); | ||||
| /* Iterator over neighboring vertices. */ | /* Iterator over neighboring vertices. */ | ||||
| #define SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator) \ | #define SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator) \ | ||||
| SCULPT_vertex_neighbors_get(ss, v_index, false, &neighbor_iterator); \ | SCULPT_vertex_neighbors_get(ss, v_index, false, false, &neighbor_iterator); \ | ||||
| for (neighbor_iterator.i = 0; neighbor_iterator.i < neighbor_iterator.size; \ | for (neighbor_iterator.i = 0; neighbor_iterator.i < neighbor_iterator.size; \ | ||||
| neighbor_iterator.i++) { \ | neighbor_iterator.i++) { \ | ||||
| neighbor_iterator.index = neighbor_iterator.neighbors[neighbor_iterator.i]; | neighbor_iterator.index = neighbor_iterator.neighbors[neighbor_iterator.i]; | ||||
| /* Iterate over neighboring and duplicate vertices (for PBVH_GRIDS). Duplicates come | /* Iterate over neighboring and duplicate vertices (for PBVH_GRIDS). Duplicates come | ||||
| * first since they are nearest for floodfill. */ | * first since they are nearest for floodfill. */ | ||||
| #define SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator) \ | #define SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator) \ | ||||
| SCULPT_vertex_neighbors_get(ss, v_index, true, &neighbor_iterator); \ | SCULPT_vertex_neighbors_get(ss, v_index, true, false, &neighbor_iterator); \ | ||||
| for (neighbor_iterator.i = neighbor_iterator.size - 1; neighbor_iterator.i >= 0; \ | for (neighbor_iterator.i = neighbor_iterator.size - 1; neighbor_iterator.i >= 0; \ | ||||
| neighbor_iterator.i--) { \ | neighbor_iterator.i--) { \ | ||||
| neighbor_iterator.index = neighbor_iterator.neighbors[neighbor_iterator.i]; \ | neighbor_iterator.index = neighbor_iterator.neighbors[neighbor_iterator.i]; \ | ||||
| neighbor_iterator.is_duplicate = (neighbor_iterator.i >= \ | neighbor_iterator.is_duplicate = (neighbor_iterator.i >= \ | ||||
| neighbor_iterator.size - neighbor_iterator.num_duplicates); | neighbor_iterator.size - neighbor_iterator.num_duplicates); | ||||
| /* Iterator over all vertices that share a face with a given vertex. */ | |||||
| #define SCULPT_VERTEX_FACE_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator) \ | |||||
| SCULPT_vertex_neighbors_get(ss, v_index, false, true, &neighbor_iterator); \ | |||||
| for (neighbor_iterator.i = 0; neighbor_iterator.i < neighbor_iterator.size; \ | |||||
| neighbor_iterator.i++) { \ | |||||
| neighbor_iterator.index = neighbor_iterator.neighbors[neighbor_iterator.i]; | |||||
| #define SCULPT_VERTEX_NEIGHBORS_ITER_END(neighbor_iterator) \ | #define SCULPT_VERTEX_NEIGHBORS_ITER_END(neighbor_iterator) \ | ||||
| } \ | } \ | ||||
| if (neighbor_iterator.neighbors != neighbor_iterator.neighbors_fixed) { \ | if (neighbor_iterator.neighbors != neighbor_iterator.neighbors_fixed) { \ | ||||
| MEM_freeN(neighbor_iterator.neighbors); \ | MEM_freeN(neighbor_iterator.neighbors); \ | ||||
| } \ | } \ | ||||
| ((void)0) | ((void)0) | ||||
| int SCULPT_active_vertex_get(SculptSession *ss); | int SCULPT_active_vertex_get(SculptSession *ss); | ||||
| const float *SCULPT_active_vertex_co_get(SculptSession *ss); | const float *SCULPT_active_vertex_co_get(SculptSession *ss); | ||||
| void SCULPT_active_vertex_normal_get(SculptSession *ss, float normal[3]); | void SCULPT_active_vertex_normal_get(SculptSession *ss, float normal[3]); | ||||
| bool SCULPT_vertex_is_boundary(SculptSession *ss, const int index); | bool SCULPT_vertex_is_boundary(SculptSession *ss, const int index); | ||||
| bool SCULPT_vertices_share_face(SculptSession *ss, const int v1, const int v2); | |||||
| /* Sculpt Visibility API */ | /* Sculpt Visibility API */ | ||||
| void SCULPT_vertex_visible_set(SculptSession *ss, int index, bool visible); | void SCULPT_vertex_visible_set(SculptSession *ss, int index, bool visible); | ||||
| bool SCULPT_vertex_visible_get(SculptSession *ss, int index); | bool SCULPT_vertex_visible_get(SculptSession *ss, int index); | ||||
| void SCULPT_visibility_sync_all_face_sets_to_vertices(struct SculptSession *ss); | void SCULPT_visibility_sync_all_face_sets_to_vertices(struct SculptSession *ss); | ||||
| void SCULPT_visibility_sync_all_vertex_to_face_sets(struct SculptSession *ss); | void SCULPT_visibility_sync_all_vertex_to_face_sets(struct SculptSession *ss); | ||||
| ▲ Show 20 Lines • Show All 764 Lines • Show Last 20 Lines | |||||