Blender
V3.3
|
#include "BKE_subdiv_ccg.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
#include "BLI_math_bits.h"
#include "BLI_math_vector.h"
#include "BLI_task.h"
#include "BKE_DerivedMesh.h"
#include "BKE_ccg.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_subdiv.h"
#include "BKE_subdiv_eval.h"
#include "opensubdiv_topology_refiner_capi.h"
Go to the source code of this file.
Classes | |
struct | CCGEvalGridsData |
struct | StaticOrHeapIntStorage |
struct | RecalcInnerNormalsData |
struct | RecalcInnerNormalsTLSData |
struct | RecalcModifiedInnerNormalsData |
struct | AverageInnerGridsData |
struct | GridElementAccumulator |
struct | AverageGridsBoundariesData |
struct | AverageGridsBoundariesTLSData |
struct | AverageGridsCornerData |
struct | StitchFacesInnerGridsData |
typedef struct AverageGridsBoundariesData AverageGridsBoundariesData |
typedef struct AverageGridsBoundariesTLSData AverageGridsBoundariesTLSData |
typedef struct AverageGridsCornerData AverageGridsCornerData |
typedef struct AverageInnerGridsData AverageInnerGridsData |
typedef struct CCGEvalGridsData CCGEvalGridsData |
typedef struct GridElementAccumulator GridElementAccumulator |
typedef struct RecalcInnerNormalsData RecalcInnerNormalsData |
typedef struct RecalcInnerNormalsTLSData RecalcInnerNormalsTLSData |
typedef struct RecalcModifiedInnerNormalsData RecalcModifiedInnerNormalsData |
typedef struct StaticOrHeapIntStorage StaticOrHeapIntStorage |
typedef struct StitchFacesInnerGridsData StitchFacesInnerGridsData |
|
static |
Definition at line 1641 of file subdiv_ccg.c.
References BLI_assert, SubdivCCG::faces, OpenSubdiv_TopologyRefiner::getFaceEdges, OpenSubdiv_TopologyRefiner::getNumFaceEdges, SubdivCCG::grid_faces, SubdivCCGCoord::grid_index, SubdivCCG::grid_size, SubdivCCGFace::num_grids, SubdivCCGFace::start_grid_index, static_or_heap_storage_free(), static_or_heap_storage_get(), static_or_heap_storage_init(), SubdivCCG::subdiv, Subdiv::topology_refiner, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by neighbor_coords_edge_get().
|
static |
Definition at line 1672 of file subdiv_ccg.c.
References adjacent_vertex_index_from_coord(), BLI_assert, OpenSubdiv_TopologyRefiner::getEdgeVertices, SubdivCCG::grid_size, SubdivCCG::subdiv, Subdiv::topology_refiner, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by neighbor_coords_edge_get().
|
static |
Definition at line 1732 of file subdiv_ccg.c.
References SubdivCCG::grid_size, and point_index.
Referenced by neighbor_coords_edge_get().
|
static |
Definition at line 1552 of file subdiv_ccg.c.
References SubdivCCG::faces, OpenSubdiv_TopologyRefiner::getFaceVertices, SubdivCCG::grid_faces, SubdivCCGCoord::grid_index, SubdivCCGFace::num_grids, SubdivCCGFace::start_grid_index, static_or_heap_storage_free(), static_or_heap_storage_get(), static_or_heap_storage_init(), SubdivCCG::subdiv, and Subdiv::topology_refiner.
Referenced by adjacent_edge_point_index_from_coord(), and neighbor_coords_corner_vertex_get().
|
static |
Definition at line 1978 of file subdiv_ccg.c.
References BKE_subdiv_ccg_grid_to_face_index(), SubdivCCGCoord::grid_index, SubdivCCG::grid_size, MPoly::loopstart, ME_POLY_LOOP_NEXT, ME_POLY_LOOP_PREV, next, poly_find_loop_from_vert(), blender::meshintersect::prev(), MLoop::v, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by BKE_subdiv_ccg_coarse_mesh_adjacency_info_get().
|
static |
Definition at line 909 of file subdiv_ccg.c.
References average_grid_element_value_v3(), CCG_elem_co(), CCG_elem_mask(), CCG_elem_no(), SubdivCCG::has_mask, SubdivCCG::has_normal, and mask().
Referenced by subdiv_ccg_average_inner_face_grids().
Definition at line 902 of file subdiv_ccg.c.
References Freestyle::a, add_v3_v3(), usdtokens::b(), copy_v3_v3(), and mul_v3_fl().
Referenced by average_grid_element().
Definition at line 1197 of file subdiv_ccg.c.
References BKE_subdiv_ccg_key_top_level(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), SubdivCCG::num_faces, AverageInnerGridsData::subdiv_ccg, subdiv_ccg_average_all_boundaries_and_corners(), and subdiv_ccg_average_inner_grids_task().
Referenced by BKE_subdiv_ccg_recalc_normals().
void BKE_subdiv_ccg_average_stitch_faces | ( | SubdivCCG * | subdiv_ccg, |
struct CCGFace ** | effected_faces, | ||
int | num_effected_faces | ||
) |
Definition at line 1329 of file subdiv_ccg.c.
References BKE_subdiv_ccg_key_top_level(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), data, subdiv_ccg_average_all_boundaries_and_corners(), and subdiv_ccg_stitch_face_inner_grids_task().
Referenced by multires_stitch_grids().
bool BKE_subdiv_ccg_check_coord_valid | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1379 of file subdiv_ccg.c.
References SubdivCCGCoord::grid_index, SubdivCCG::grid_size, SubdivCCG::num_grids, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by BKE_subdiv_ccg_neighbor_coords_get().
SubdivCCGAdjacencyType BKE_subdiv_ccg_coarse_mesh_adjacency_info_get | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord, | ||
const MLoop * | mloop, | ||
const MPoly * | mpoly, | ||
int * | r_v1, | ||
int * | r_v2 | ||
) |
Definition at line 2001 of file subdiv_ccg.c.
References adjacet_vertices_index_from_adjacent_edge(), SubdivCCGCoord::grid_index, SubdivCCG::grid_size, is_boundary_grid_coord(), is_corner_grid_coord(), is_inner_edge_grid_coordinate(), SUBDIV_CCG_ADJACENT_EDGE, SUBDIV_CCG_ADJACENT_NONE, SUBDIV_CCG_ADJACENT_VERTEX, MLoop::v, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Definition at line 615 of file subdiv_ccg.c.
References SubdivCCG::adjacent_edges, SubdivCCG::adjacent_vertices, BKE_subdiv_free(), SubdivCCGAdjacentEdge::boundary_coords, SubdivCCG::cache_, SubdivCCGAdjacentVertex::corner_coords, SubdivCCG::edges, SubdivCCG::faces, SubdivCCG::grid_faces, SubdivCCG::grid_flag_mats, SubdivCCG::grid_hidden, SubdivCCG::grids, SubdivCCG::grids_storage, MEM_freeN, MEM_SAFE_FREE, NULL, SubdivCCG::num_adjacent_edges, SubdivCCGAdjacentEdge::num_adjacent_faces, SubdivCCG::num_adjacent_vertices, SubdivCCG::num_grids, SubdivCCG::start_face_grid_index, SubdivCCG::subdiv, and SubdivCCG::vertices.
Referenced by BKE_mesh_runtime_clear_geometry(), and BKE_subdiv_to_ccg().
void BKE_subdiv_ccg_eval_limit_point | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord, | ||
float | r_point[3] | ||
) |
Definition at line 2078 of file subdiv_ccg.c.
References BKE_subdiv_eval_limit_point(), SubdivCCG::subdiv, subdiv_ccg_coord_to_ptex_coord(), and v.
Referenced by SCULPT_vertex_limit_surface_get().
Definition at line 2035 of file subdiv_ccg.c.
References BKE_subdiv_ccg_key_top_level(), BLI_BITMAP_NEW, CCGKey::grid_area, SubdivCCG::grid_hidden, and NULL.
Referenced by BKE_sculpt_sync_face_sets_visibility_to_grids().
int BKE_subdiv_ccg_grid_to_face_index | ( | const SubdivCCG * | subdiv_ccg, |
const int | grid_index | ||
) |
Definition at line 1940 of file subdiv_ccg.c.
References SubdivCCG::faces, and SubdivCCG::grid_faces.
Referenced by adjacet_vertices_index_from_adjacent_edge(), BKE_pbvh_sync_face_sets_to_grids(), BKE_sculpt_sync_face_sets_visibility_to_grids(), GPU_pbvh_grid_buffers_update(), SCULPT_active_face_set_get(), sculpt_expand_active_face_set_id_get(), SCULPT_vertex_all_face_sets_visible_get(), SCULPT_vertex_face_set_get(), SCULPT_vertex_face_set_set(), SCULPT_vertex_has_face_set(), and subdiv_ccg_coord_to_ptex_coord().
Definition at line 653 of file subdiv_ccg.c.
References BKE_subdiv_grid_size_from_level(), CCGKey::elem_size, element_size_bytes_get(), CCGKey::grid_area, CCGKey::grid_bytes, CCGKey::grid_size, CCGKey::has_mask, SubdivCCG::has_mask, SubdivCCG::has_normal, CCGKey::has_normals, CCGKey::level, CCGKey::mask_offset, SubdivCCG::mask_offset, CCGKey::normal_offset, and SubdivCCG::normal_offset.
Referenced by BKE_subdiv_ccg_key_top_level(), and multires_reshape_assign_final_coords_from_ccg().
Definition at line 668 of file subdiv_ccg.c.
References BKE_subdiv_ccg_key(), and SubdivCCG::level.
Referenced by BKE_sculpt_sync_face_sets_visibility_to_grids(), BKE_subdiv_ccg_average_grids(), BKE_subdiv_ccg_average_stitch_faces(), BKE_subdiv_ccg_grid_hidden_ensure(), BKE_subdiv_ccg_update_normals(), build_pbvh_from_ccg(), sculpt_undo_restore_coords(), sculpt_undo_restore_mask(), subdiv_ccg_init_faces_vertex_neighborhood(), subdiv_ccg_recalc_inner_grid_normals(), and subdiv_ccg_recalc_modified_inner_grid_normals().
void BKE_subdiv_ccg_neighbor_coords_get | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord, | ||
const bool | include_duplicates, | ||
SubdivCCGNeighbors * | r_neighbors | ||
) |
Definition at line 1911 of file subdiv_ccg.c.
References BKE_subdiv_ccg_check_coord_valid(), BLI_assert, SubdivCCGNeighbors::coords, SubdivCCGCoord::grid_index, SubdivCCG::grid_size, is_boundary_grid_coord(), is_corner_grid_coord(), neighbor_coords_boundary_get(), neighbor_coords_corner_get(), neighbor_coords_inner_get(), SubdivCCG::num_grids, SubdivCCGNeighbors::size, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by sculpt_vertex_neighbors_get_grids().
void BKE_subdiv_ccg_print_coord | ( | const char * | message, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1374 of file subdiv_ccg.c.
References SubdivCCGCoord::grid_index, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Definition at line 804 of file subdiv_ccg.c.
References BKE_subdiv_ccg_average_grids(), SubdivCCG::has_normal, and subdiv_ccg_recalc_inner_grid_normals().
Referenced by subdiv_ccg_evaluate_grids().
const int* BKE_subdiv_ccg_start_face_grid_index_ensure | ( | SubdivCCG * | subdiv_ccg | ) |
Definition at line 1947 of file subdiv_ccg.c.
References SubdivCCG::cache_, OpenSubdiv_TopologyRefiner::getNumFaces, OpenSubdiv_TopologyRefiner::getNumFaceVertices, MEM_malloc_arrayN, NULL, SubdivCCG::start_face_grid_index, SubdivCCG::subdiv, and Subdiv::topology_refiner.
const int* BKE_subdiv_ccg_start_face_grid_index_get | ( | const SubdivCCG * | subdiv_ccg | ) |
Definition at line 1973 of file subdiv_ccg.c.
References SubdivCCG::cache_, and SubdivCCG::start_face_grid_index.
void BKE_subdiv_ccg_topology_counters | ( | const SubdivCCG * | subdiv_ccg, |
int * | r_num_vertices, | ||
int * | r_num_edges, | ||
int * | r_num_faces, | ||
int * | r_num_loops | ||
) |
Definition at line 1352 of file subdiv_ccg.c.
References SubdivCCG::grid_size, and SubdivCCG::num_grids.
Referenced by stats_mesheval().
void BKE_subdiv_ccg_update_normals | ( | SubdivCCG * | subdiv_ccg, |
struct CCGFace ** | effected_faces, | ||
int | num_effected_faces | ||
) |
Definition at line 870 of file subdiv_ccg.c.
References BKE_subdiv_ccg_key_top_level(), SubdivCCG::has_normal, subdiv_ccg_average_faces_boundaries_and_corners(), and subdiv_ccg_recalc_modified_inner_grid_normals().
Referenced by BKE_pbvh_update_normals().
SubdivCCG* BKE_subdiv_to_ccg | ( | Subdiv * | subdiv, |
const SubdivToCCGSettings * | settings, | ||
SubdivCCGMaskEvaluator * | mask_evaluator, | ||
SubdivCCGMaterialFlagsEvaluator * | material_flags_evaluator | ||
) |
Definition at line 561 of file subdiv_ccg.c.
References bitscan_forward_i(), BKE_subdiv_ccg_destroy(), BKE_subdiv_grid_size_from_level(), BKE_subdiv_stats_begin(), BKE_subdiv_stats_end(), SubdivCCG::grid_size, SubdivCCG::level, MEM_callocN, NULL, SubdivToCCGSettings::resolution, Subdiv::stats, SubdivCCG::subdiv, subdiv_ccg_alloc_elements(), subdiv_ccg_evaluate_grids(), subdiv_ccg_init_faces(), subdiv_ccg_init_faces_neighborhood(), subdiv_ccg_init_layers(), and SUBDIV_STATS_SUBDIV_TO_CCG.
Referenced by BKE_subdiv_to_ccg_mesh().
Mesh* BKE_subdiv_to_ccg_mesh | ( | Subdiv * | subdiv, |
const SubdivToCCGSettings * | settings, | ||
const Mesh * | coarse_mesh | ||
) |
Definition at line 584 of file subdiv_ccg.c.
References BKE_mesh_new_nomain_from_template(), BKE_subdiv_ccg_mask_init_from_paint(), BKE_subdiv_ccg_material_flags_init_from_mesh(), BKE_subdiv_eval_begin_from_mesh(), BKE_subdiv_stats_begin(), BKE_subdiv_stats_end(), BKE_subdiv_to_ccg(), SubdivCCGMaskEvaluator::free, SubdivCCGMaterialFlagsEvaluator::free, NULL, result, Subdiv::stats, SUBDIV_EVALUATOR_TYPE_CPU, SUBDIV_STATS_SUBDIV_TO_CCG, and Mesh::totpoly.
BLI_INLINE SubdivCCGCoord coord_at_next_col | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1466 of file subdiv_ccg.c.
References BLI_assert, SubdivCCG::grid_size, result, UNUSED_VARS_NDEBUG, and SubdivCCGCoord::x.
Referenced by neighbor_coords_boundary_inner_get(), and neighbor_coords_inner_get().
BLI_INLINE SubdivCCGCoord coord_at_next_row | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1448 of file subdiv_ccg.c.
References BLI_assert, SubdivCCG::grid_size, result, UNUSED_VARS_NDEBUG, and SubdivCCGCoord::y.
Referenced by neighbor_coords_boundary_inner_get(), and neighbor_coords_inner_get().
BLI_INLINE SubdivCCGCoord coord_at_prev_col | ( | const SubdivCCG * | UNUSEDsubdiv_ccg, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1458 of file subdiv_ccg.c.
References BLI_assert, result, and SubdivCCGCoord::x.
Referenced by neighbor_coords_boundary_inner_get(), and neighbor_coords_inner_get().
BLI_INLINE SubdivCCGCoord coord_at_prev_row | ( | const SubdivCCG * | UNUSEDsubdiv_ccg, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1440 of file subdiv_ccg.c.
References BLI_assert, result, and SubdivCCGCoord::y.
Referenced by neighbor_coords_boundary_inner_get(), and neighbor_coords_inner_get().
|
static |
Definition at line 1477 of file subdiv_ccg.c.
References BLI_assert_msg, SubdivCCG::grid_size, and result.
Referenced by neighbor_coords_edge_get().
|
static |
Definition at line 942 of file subdiv_ccg.c.
References add_v3_v3(), CCG_elem_co(), CCG_elem_mask(), CCG_elem_no(), GridElementAccumulator::co, SubdivCCG::has_mask, SubdivCCG::has_normal, GridElementAccumulator::mask, and GridElementAccumulator::no.
Referenced by subdiv_ccg_average_grids_boundary(), subdiv_ccg_average_grids_corners(), and subdiv_ccg_average_inner_face_grids().
|
static |
Definition at line 963 of file subdiv_ccg.c.
References CCG_elem_co(), CCG_elem_mask(), CCG_elem_no(), GridElementAccumulator::co, copy_v3_v3(), SubdivCCG::has_mask, SubdivCCG::has_normal, GridElementAccumulator::mask, and GridElementAccumulator::no.
Referenced by subdiv_ccg_average_grids_boundary(), subdiv_ccg_average_grids_corners(), and subdiv_ccg_average_inner_face_grids().
|
static |
Definition at line 935 of file subdiv_ccg.c.
References GridElementAccumulator::co, GridElementAccumulator::mask, GridElementAccumulator::no, and zero_v3().
Referenced by subdiv_ccg_average_grids_boundary(), subdiv_ccg_average_grids_corners(), and subdiv_ccg_average_inner_face_grids().
|
static |
Definition at line 956 of file subdiv_ccg.c.
References GridElementAccumulator::co, GridElementAccumulator::mask, mul_v3_fl(), and GridElementAccumulator::no.
Referenced by subdiv_ccg_average_grids_boundary(), subdiv_ccg_average_grids_corners(), and subdiv_ccg_average_inner_face_grids().
|
static |
Definition at line 65 of file subdiv_ccg.c.
References float(), and num_element_float_get().
Referenced by BKE_subdiv_ccg_key(), subdiv_ccg_alloc_elements(), subdiv_ccg_eval_regular_grid(), and subdiv_ccg_eval_special_grid().
BLI_INLINE bool is_boundary_grid_coord | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1420 of file subdiv_ccg.c.
References SubdivCCG::grid_size, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by BKE_subdiv_ccg_coarse_mesh_adjacency_info_get(), and BKE_subdiv_ccg_neighbor_coords_get().
BLI_INLINE bool is_corner_grid_coord | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1411 of file subdiv_ccg.c.
References SubdivCCG::grid_size, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by BKE_subdiv_ccg_coarse_mesh_adjacency_info_get(), BKE_subdiv_ccg_neighbor_coords_get(), and neighbor_coords_edge_get().
BLI_INLINE bool is_inner_edge_grid_coordinate | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1427 of file subdiv_ccg.c.
References SubdivCCG::grid_size, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by BKE_subdiv_ccg_coarse_mesh_adjacency_info_get(), and neighbor_coords_boundary_get().
|
static |
Definition at line 1885 of file subdiv_ccg.c.
References is_inner_edge_grid_coordinate(), neighbor_coords_boundary_inner_get(), and neighbor_coords_boundary_outer_get().
Referenced by BKE_subdiv_ccg_neighbor_coords_get().
|
static |
Definition at line 1836 of file subdiv_ccg.c.
References coord_at_next_col(), coord_at_next_row(), coord_at_prev_col(), coord_at_prev_row(), SubdivCCGNeighbors::coords, SubdivCCGCoord::grid_index, next_grid_index_from_coord(), prev_grid_index_from_coord(), subdiv_ccg_neighbors_init(), SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by neighbor_coords_boundary_get().
|
static |
Definition at line 1874 of file subdiv_ccg.c.
References neighbor_coords_edge_get().
Referenced by neighbor_coords_boundary_get().
|
static |
Definition at line 1525 of file subdiv_ccg.c.
References SubdivCCGNeighbors::coords, SubdivCCG::grid_faces, SubdivCCGCoord::grid_index, SubdivCCGFace::num_grids, SubdivCCGFace::start_grid_index, subdiv_ccg_neighbors_init(), SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by neighbor_coords_corner_get().
|
static |
Definition at line 1805 of file subdiv_ccg.c.
References neighbor_coords_edge_get().
Referenced by neighbor_coords_corner_get().
|
static |
Definition at line 1814 of file subdiv_ccg.c.
References SubdivCCG::grid_size, neighbor_coords_corner_center_get(), neighbor_coords_corner_edge_get(), neighbor_coords_corner_vertex_get(), SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by BKE_subdiv_ccg_neighbor_coords_get().
|
static |
Definition at line 1576 of file subdiv_ccg.c.
References SubdivCCG::adjacent_edges, adjacent_vertex_index_from_coord(), SubdivCCG::adjacent_vertices, BLI_assert, SubdivCCGAdjacentEdge::boundary_coords, SubdivCCGNeighbors::coords, SubdivCCGAdjacentVertex::corner_coords, OpenSubdiv_TopologyRefiner::getEdgeVertices, OpenSubdiv_TopologyRefiner::getNumVertexEdges, OpenSubdiv_TopologyRefiner::getVertexEdges, SubdivCCGCoord::grid_index, SubdivCCG::grid_size, SubdivCCGAdjacentVertex::num_adjacent_faces, static_or_heap_storage_free(), static_or_heap_storage_get(), static_or_heap_storage_init(), SubdivCCG::subdiv, subdiv_ccg_neighbors_init(), and Subdiv::topology_refiner.
Referenced by neighbor_coords_corner_get().
|
static |
Definition at line 1743 of file subdiv_ccg.c.
References adjacent_edge_index_from_coord(), adjacent_edge_point_index_from_coord(), SubdivCCG::adjacent_edges, adjacent_grid_corner_point_index_on_edge(), BLI_assert, SubdivCCGAdjacentEdge::boundary_coords, coord_step_inside_from_boundary(), SubdivCCGNeighbors::coords, SubdivCCGCoord::grid_index, is_corner_grid_coord(), next_adjacent_edge_point_index(), SubdivCCGAdjacentEdge::num_adjacent_faces, point_index, prev_adjacent_edge_point_index(), and subdiv_ccg_neighbors_init().
Referenced by neighbor_coords_boundary_outer_get(), and neighbor_coords_corner_edge_get().
|
static |
Definition at line 1899 of file subdiv_ccg.c.
References coord_at_next_col(), coord_at_next_row(), coord_at_prev_col(), coord_at_prev_row(), SubdivCCGNeighbors::coords, and subdiv_ccg_neighbors_init().
Referenced by BKE_subdiv_ccg_neighbor_coords_get().
|
static |
Definition at line 1714 of file subdiv_ccg.c.
References SubdivCCG::grid_size, and point_index.
Referenced by neighbor_coords_edge_get().
BLI_INLINE int next_grid_index_from_coord | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1502 of file subdiv_ccg.c.
References SubdivCCG::grid_faces, SubdivCCGCoord::grid_index, SubdivCCGFace::num_grids, and SubdivCCGFace::start_grid_index.
Referenced by neighbor_coords_boundary_inner_get().
|
static |
Definition at line 51 of file subdiv_ccg.c.
References SubdivCCG::has_mask, and SubdivCCG::has_normal.
Referenced by element_size_bytes_get().
|
static |
Definition at line 1721 of file subdiv_ccg.c.
References SubdivCCG::grid_size, and point_index.
Referenced by neighbor_coords_edge_get().
BLI_INLINE int prev_grid_index_from_coord | ( | const SubdivCCG * | subdiv_ccg, |
const SubdivCCGCoord * | coord | ||
) |
Definition at line 1512 of file subdiv_ccg.c.
References SubdivCCG::grid_faces, SubdivCCGCoord::grid_index, SubdivCCGFace::num_grids, and SubdivCCGFace::start_grid_index.
Referenced by neighbor_coords_boundary_inner_get().
|
static |
Definition at line 373 of file subdiv_ccg.c.
References StaticOrHeapIntStorage::heap_storage, and MEM_SAFE_FREE.
Referenced by adjacent_edge_index_from_coord(), adjacent_vertex_index_from_coord(), neighbor_coords_corner_vertex_get(), subdiv_ccg_affected_face_adjacency(), subdiv_ccg_average_faces_boundaries_and_corners(), subdiv_ccg_init_faces_edge_neighborhood(), and subdiv_ccg_init_faces_vertex_neighborhood().
|
static |
Definition at line 358 of file subdiv_ccg.c.
References StaticOrHeapIntStorage::heap_storage, StaticOrHeapIntStorage::heap_storage_len, MEM_malloc_arrayN, MEM_SAFE_FREE, and StaticOrHeapIntStorage::static_storage.
Referenced by adjacent_edge_index_from_coord(), adjacent_vertex_index_from_coord(), neighbor_coords_corner_vertex_get(), subdiv_ccg_affected_face_adjacency(), subdiv_ccg_average_faces_boundaries_and_corners(), subdiv_ccg_init_faces_edge_neighborhood(), and subdiv_ccg_init_faces_vertex_neighborhood().
|
static |
Definition at line 351 of file subdiv_ccg.c.
References StaticOrHeapIntStorage::heap_storage, StaticOrHeapIntStorage::heap_storage_len, NULL, StaticOrHeapIntStorage::static_storage, and StaticOrHeapIntStorage::static_storage_len.
Referenced by adjacent_edge_index_from_coord(), adjacent_vertex_index_from_coord(), neighbor_coords_corner_vertex_get(), subdiv_ccg_affected_face_adjacency(), subdiv_ccg_average_faces_boundaries_and_corners(), subdiv_ccg_init_faces_edge_neighborhood(), and subdiv_ccg_init_faces_vertex_neighborhood().
|
static |
Definition at line 399 of file subdiv_ccg.c.
References SubdivCCGAdjacentEdge::boundary_coords, SubdivCCG::grid_size, MEM_malloc_arrayN, MEM_reallocN, and SubdivCCGAdjacentEdge::num_adjacent_faces.
Referenced by subdiv_ccg_init_faces_edge_neighborhood().
|
static |
Definition at line 497 of file subdiv_ccg.c.
References SubdivCCGAdjacentVertex::corner_coords, MEM_reallocN, and SubdivCCGAdjacentVertex::num_adjacent_faces.
Referenced by subdiv_ccg_init_faces_vertex_neighborhood().
|
static |
Definition at line 1217 of file subdiv_ccg.c.
References SubdivCCG::adjacent_edges, SubdivCCG::adjacent_vertices, BLI_gset_add(), SubdivCCG::faces, OpenSubdiv_TopologyRefiner::getEdgeVertices, OpenSubdiv_TopologyRefiner::getFaceEdges, OpenSubdiv_TopologyRefiner::getFaceVertices, SubdivCCGFace::num_grids, static_or_heap_storage_free(), static_or_heap_storage_get(), static_or_heap_storage_init(), SubdivCCG::subdiv, and Subdiv::topology_refiner.
Referenced by subdiv_ccg_average_faces_boundaries_and_corners().
Definition at line 118 of file subdiv_ccg.c.
References BKE_subdiv_grid_size_from_level(), BLI_BITMAP_NEW, element_size_bytes_get(), SubdivCCG::faces, OpenSubdiv_TopologyRefiner::getNumFaces, SubdivCCG::grid_element_size, SubdivCCG::grid_faces, SubdivCCG::grid_flag_mats, SubdivCCG::grid_hidden, SubdivCCG::grids, SubdivCCG::grids_storage, SubdivCCG::level, MEM_calloc_arrayN, SubdivCCG::num_faces, SubdivCCG::num_grids, Subdiv::topology_refiner, and topology_refiner_count_face_corners().
Referenced by BKE_subdiv_to_ccg().
|
static |
Definition at line 378 of file subdiv_ccg.c.
References SubdivCCG::adjacent_edges, MEM_calloc_arrayN, and SubdivCCG::num_adjacent_edges.
Referenced by subdiv_ccg_init_faces_edge_neighborhood().
|
static |
Definition at line 487 of file subdiv_ccg.c.
References SubdivCCG::adjacent_vertices, MEM_calloc_arrayN, and SubdivCCG::num_adjacent_vertices.
Referenced by subdiv_ccg_init_faces_vertex_neighborhood().
Definition at line 1166 of file subdiv_ccg.c.
References NULL, SubdivCCG::num_adjacent_edges, and subdiv_ccg_average_boundaries().
Referenced by subdiv_ccg_average_all_boundaries_and_corners().
|
static |
Definition at line 1191 of file subdiv_ccg.c.
References subdiv_ccg_average_all_boundaries(), and subdiv_ccg_average_all_corners().
Referenced by BKE_subdiv_ccg_average_grids(), and BKE_subdiv_ccg_average_stitch_faces().
Definition at line 1186 of file subdiv_ccg.c.
References NULL, SubdivCCG::num_adjacent_vertices, and subdiv_ccg_average_corners().
Referenced by subdiv_ccg_average_all_boundaries_and_corners().
|
static |
Definition at line 1146 of file subdiv_ccg.c.
References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), TaskParallelSettings::func_free, NULL, AverageGridsBoundariesData::subdiv_ccg, subdiv_ccg_average_grids_boundaries_free(), subdiv_ccg_average_grids_boundaries_task(), TaskParallelSettings::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.
Referenced by subdiv_ccg_average_all_boundaries(), and subdiv_ccg_average_faces_boundaries_and_corners().
|
static |
Definition at line 1171 of file subdiv_ccg.c.
References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), AverageGridsCornerData::subdiv_ccg, and subdiv_ccg_average_grids_corners_task().
Referenced by subdiv_ccg_average_all_corners(), and subdiv_ccg_average_faces_boundaries_and_corners().
void subdiv_ccg_average_faces_boundaries_and_corners | ( | SubdivCCG * | subdiv_ccg, |
CCGKey * | key, | ||
struct CCGFace ** | effected_faces, | ||
int | num_effected_faces | ||
) |
Definition at line 1263 of file subdiv_ccg.c.
References SubdivCCG::adjacent_edges, SubdivCCG::adjacent_vertices, BLI_gset_free(), BLI_gset_len(), BLI_gset_ptr_new(), BLI_gsetIterator_getKey(), GSET_ITER_INDEX, NULL, static_or_heap_storage_free(), static_or_heap_storage_get(), static_or_heap_storage_init(), subdiv_ccg_affected_face_adjacency(), subdiv_ccg_average_boundaries(), and subdiv_ccg_average_corners().
Referenced by BKE_subdiv_ccg_update_normals().
|
static |
Definition at line 1092 of file subdiv_ccg.c.
References AverageGridsBoundariesTLSData::accumulators, and MEM_SAFE_FREE.
Referenced by subdiv_ccg_average_boundaries().
|
static |
Definition at line 1076 of file subdiv_ccg.c.
References SubdivCCG::adjacent_edges, data, and subdiv_ccg_average_grids_boundary().
Referenced by subdiv_ccg_average_boundaries().
|
static |
Definition at line 1036 of file subdiv_ccg.c.
References AverageGridsBoundariesTLSData::accumulators, SubdivCCGAdjacentEdge::boundary_coords, element_accumulator_add(), element_accumulator_copy(), element_accumulator_init(), element_accumulator_mul_fl(), SubdivCCG::grid_size, MEM_calloc_arrayN, NULL, SubdivCCGAdjacentEdge::num_adjacent_faces, and subdiv_ccg_coord_to_elem().
Referenced by subdiv_ccg_average_grids_boundaries_task().
|
static |
Definition at line 1107 of file subdiv_ccg.c.
References SubdivCCGAdjacentVertex::corner_coords, element_accumulator_add(), element_accumulator_copy(), element_accumulator_init(), element_accumulator_mul_fl(), SubdivCCGAdjacentVertex::num_adjacent_faces, and subdiv_ccg_coord_to_elem().
Referenced by subdiv_ccg_average_grids_corners_task().
|
static |
Definition at line 1132 of file subdiv_ccg.c.
References SubdivCCG::adjacent_vertices, data, and subdiv_ccg_average_grids_corners().
Referenced by subdiv_ccg_average_corners().
|
static |
Definition at line 977 of file subdiv_ccg.c.
References average_grid_element(), CCG_grid_elem(), element_accumulator_add(), element_accumulator_copy(), element_accumulator_init(), element_accumulator_mul_fl(), SubdivCCG::grid_size, SubdivCCG::grids, SubdivCCGFace::num_grids, and SubdivCCGFace::start_grid_index.
Referenced by subdiv_ccg_average_inner_grids_task(), subdiv_ccg_recalc_modified_inner_normal_task(), and subdiv_ccg_stitch_face_inner_grids_task().
|
static |
Definition at line 727 of file subdiv_ccg.c.
References add_v3_v3(), CCG_grid_elem_no(), counter, RecalcInnerNormalsTLSData::face_normals, float(), SubdivCCG::grid_size, SubdivCCG::grids, mul_v3_v3fl(), x, and y.
Referenced by subdiv_ccg_recalc_inner_normal_task(), and subdiv_ccg_recalc_modified_inner_normal_task().
|
static |
Definition at line 1012 of file subdiv_ccg.c.
References data, SubdivCCG::faces, faces, and subdiv_ccg_average_inner_face_grids().
Referenced by BKE_subdiv_ccg_average_grids().
|
static |
Definition at line 385 of file subdiv_ccg.c.
References SubdivCCGCoord::grid_index, x, and y.
Referenced by subdiv_ccg_init_faces_edge_neighborhood(), and subdiv_ccg_init_faces_vertex_neighborhood().
|
static |
Definition at line 391 of file subdiv_ccg.c.
References CCG_grid_elem(), SubdivCCGCoord::grid_index, SubdivCCG::grids, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by subdiv_ccg_average_grids_boundary(), and subdiv_ccg_average_grids_corners().
|
static |
Definition at line 2046 of file subdiv_ccg.c.
References BKE_subdiv_ccg_grid_to_face_index(), BKE_subdiv_face_ptex_offset_get(), BKE_subdiv_rotate_grid_to_quad(), SubdivCCG::faces, faces, SubdivCCGCoord::grid_index, SubdivCCG::grid_size, SubdivCCGFace::num_grids, SubdivCCGFace::start_grid_index, SubdivCCG::subdiv, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by BKE_subdiv_ccg_eval_limit_point().
|
static |
Definition at line 213 of file subdiv_ccg.c.
References data, element, subdiv_ccg_eval_grid_element_limit(), subdiv_ccg_eval_grid_element_mask(), and v.
Referenced by subdiv_ccg_eval_regular_grid(), and subdiv_ccg_eval_special_grid().
|
static |
Definition at line 170 of file subdiv_ccg.c.
References BKE_subdiv_eval_final_point(), BKE_subdiv_eval_limit_point(), BKE_subdiv_eval_limit_point_and_normal(), data, Subdiv::displacement_evaluator, element, SubdivCCG::has_normal, SubdivCCG::normal_offset, NULL, and v.
Referenced by subdiv_ccg_eval_grid_element().
|
static |
Definition at line 194 of file subdiv_ccg.c.
References data, element, SubdivCCG::has_mask, SubdivCCG::mask_offset, NULL, and v.
Referenced by subdiv_ccg_eval_grid_element().
|
static |
Definition at line 285 of file subdiv_ccg.c.
References data, SubdivCCG::faces, SubdivCCGFace::num_grids, subdiv_ccg_eval_regular_grid(), and subdiv_ccg_eval_special_grid().
Referenced by subdiv_ccg_evaluate_grids().
|
static |
Definition at line 223 of file subdiv_ccg.c.
References BKE_subdiv_rotate_grid_to_quad(), data, element_size_bytes_get(), SubdivCCG::faces, faces, SubdivCCG::grid_faces, SubdivCCG::grid_flag_mats, SubdivCCG::grid_size, SubdivCCG::grids, SubdivCCGFace::num_grids, SubdivCCGFace::start_grid_index, subdiv_ccg_eval_grid_element(), v, x, and y.
Referenced by subdiv_ccg_eval_grids_task().
|
static |
Definition at line 255 of file subdiv_ccg.c.
References data, element_size_bytes_get(), SubdivCCG::faces, faces, SubdivCCG::grid_faces, SubdivCCG::grid_flag_mats, SubdivCCG::grid_size, SubdivCCG::grids, SubdivCCGFace::num_grids, SubdivCCGFace::start_grid_index, subdiv_ccg_eval_grid_element(), v, x, and y.
Referenced by subdiv_ccg_eval_grids_task().
|
static |
Definition at line 300 of file subdiv_ccg.c.
References BKE_subdiv_ccg_recalc_normals(), BKE_subdiv_face_ptex_offset_get(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), data, Subdiv::displacement_evaluator, OpenSubdiv_TopologyRefiner::getNumFaces, NULL, subdiv_ccg_eval_grids_task(), and Subdiv::topology_refiner.
Referenced by BKE_subdiv_to_ccg().
Definition at line 329 of file subdiv_ccg.c.
References SubdivCCG::faces, OpenSubdiv_TopologyRefiner::getNumFaceVertices, SubdivCCG::num_faces, SubdivCCGFace::num_grids, SubdivCCGFace::start_grid_index, SubdivCCG::subdiv, and Subdiv::topology_refiner.
Referenced by BKE_subdiv_to_ccg().
Definition at line 414 of file subdiv_ccg.c.
References SubdivCCG::adjacent_edges, SubdivCCG::faces, faces, OpenSubdiv_TopologyRefiner::getEdgeVertices, OpenSubdiv_TopologyRefiner::getFaceEdges, OpenSubdiv_TopologyRefiner::getFaceVertices, OpenSubdiv_TopologyRefiner::getNumEdges, SubdivCCG::grid_size, SubdivCCG::num_faces, SubdivCCGFace::num_grids, SubdivCCGFace::start_grid_index, static_or_heap_storage_free(), static_or_heap_storage_get(), static_or_heap_storage_init(), SubdivCCG::subdiv, subdiv_ccg_adjacent_edge_add_face(), subdiv_ccg_allocate_adjacent_edges(), subdiv_ccg_coord(), and Subdiv::topology_refiner.
Referenced by subdiv_ccg_init_faces_neighborhood().
Definition at line 549 of file subdiv_ccg.c.
References subdiv_ccg_init_faces_edge_neighborhood(), and subdiv_ccg_init_faces_vertex_neighborhood().
Referenced by BKE_subdiv_to_ccg().
Definition at line 509 of file subdiv_ccg.c.
References SubdivCCG::adjacent_vertices, BKE_subdiv_ccg_key_top_level(), SubdivCCG::faces, faces, OpenSubdiv_TopologyRefiner::getFaceVertices, OpenSubdiv_TopologyRefiner::getNumVertices, SubdivCCG::grid_size, SubdivCCG::num_faces, SubdivCCGFace::num_grids, SubdivCCGFace::start_grid_index, static_or_heap_storage_free(), static_or_heap_storage_get(), static_or_heap_storage_init(), SubdivCCG::subdiv, subdiv_ccg_adjacent_vertex_add_face(), subdiv_ccg_allocate_adjacent_vertices(), subdiv_ccg_coord(), and Subdiv::topology_refiner.
Referenced by subdiv_ccg_init_faces_neighborhood().
|
static |
Definition at line 76 of file subdiv_ccg.c.
References float(), SubdivCCG::has_mask, SubdivCCG::has_normal, SubdivCCG::mask_offset, SubdivToCCGSettings::need_mask, SubdivToCCGSettings::need_normal, and SubdivCCG::normal_offset.
Referenced by BKE_subdiv_to_ccg().
BLI_INLINE void subdiv_ccg_neighbors_init | ( | SubdivCCGNeighbors * | neighbors, |
const int | num_unique, | ||
const int | num_duplicates | ||
) |
Definition at line 1394 of file subdiv_ccg.c.
References ARRAY_SIZE, SubdivCCGNeighbors::coords, SubdivCCGNeighbors::coords_fixed, MEM_mallocN, SubdivCCGNeighbors::num_duplicates, size(), and SubdivCCGNeighbors::size.
Referenced by neighbor_coords_boundary_inner_get(), neighbor_coords_corner_center_get(), neighbor_coords_corner_vertex_get(), neighbor_coords_edge_get(), and neighbor_coords_inner_get().
|
static |
Definition at line 693 of file subdiv_ccg.c.
References CCG_elem_co(), CCG_grid_elem(), RecalcInnerNormalsTLSData::face_normals, SubdivCCG::grid_size, SubdivCCG::grids, MEM_malloc_arrayN, normal_quad_v3(), NULL, x, and y.
Referenced by subdiv_ccg_recalc_inner_normal_task(), and subdiv_ccg_recalc_modified_inner_normal_task().
Definition at line 783 of file subdiv_ccg.c.
References BKE_subdiv_ccg_key_top_level(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), data, TaskParallelSettings::func_free, NULL, SubdivCCG::num_grids, subdiv_ccg_recalc_inner_normal_free(), subdiv_ccg_recalc_inner_normal_task(), TaskParallelSettings::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.
Referenced by BKE_subdiv_ccg_recalc_normals().
|
static |
Definition at line 775 of file subdiv_ccg.c.
References RecalcInnerNormalsTLSData::face_normals, and MEM_SAFE_FREE.
Referenced by subdiv_ccg_recalc_inner_grid_normals().
|
static |
Definition at line 765 of file subdiv_ccg.c.
References data, subdiv_ccg_average_inner_face_normals(), and subdiv_ccg_recalc_inner_face_normals().
Referenced by subdiv_ccg_recalc_inner_grid_normals().
|
static |
Definition at line 846 of file subdiv_ccg.c.
References BKE_subdiv_ccg_key_top_level(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), data, TaskParallelSettings::func_free, NULL, subdiv_ccg_recalc_modified_inner_normal_free(), subdiv_ccg_recalc_modified_inner_normal_task(), TaskParallelSettings::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.
Referenced by BKE_subdiv_ccg_update_normals().
|
static |
Definition at line 839 of file subdiv_ccg.c.
References RecalcInnerNormalsTLSData::face_normals, and MEM_SAFE_FREE.
Referenced by subdiv_ccg_recalc_modified_inner_grid_normals().
|
static |
Definition at line 820 of file subdiv_ccg.c.
References data, faces, SubdivCCGFace::num_grids, SubdivCCGFace::start_grid_index, subdiv_ccg_average_inner_face_grids(), subdiv_ccg_average_inner_face_normals(), and subdiv_ccg_recalc_inner_face_normals().
Referenced by subdiv_ccg_recalc_modified_inner_grid_normals().
|
static |
Definition at line 1315 of file subdiv_ccg.c.
References data, and subdiv_ccg_average_inner_face_grids().
Referenced by BKE_subdiv_ccg_average_stitch_faces().
|
static |
Definition at line 106 of file subdiv_ccg.c.
References OpenSubdiv_TopologyRefiner::getNumFaces, and OpenSubdiv_TopologyRefiner::getNumFaceVertices.
Referenced by subdiv_ccg_alloc_elements().