Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_laplaciansmooth.c
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | struct BLaplacianSystem { | ||||
| LinearSolver *context; | LinearSolver *context; | ||||
| /*Data*/ | /*Data*/ | ||||
| float min_area; | float min_area; | ||||
| float vert_centroid[3]; | float vert_centroid[3]; | ||||
| }; | }; | ||||
| typedef struct BLaplacianSystem LaplacianSystem; | typedef struct BLaplacianSystem LaplacianSystem; | ||||
| static CustomDataMask required_data_mask(Object *ob, ModifierData *md); | static void required_data_mask(Object *ob, ModifierData *md, CustomData_MeshMasks *r_cddata_masks); | ||||
| static bool is_disabled(const struct Scene *UNUSED(scene), ModifierData *md, bool useRenderParams); | static bool is_disabled(const struct Scene *UNUSED(scene), ModifierData *md, bool useRenderParams); | ||||
| static float compute_volume(const float center[3], float (*vertexCos)[3], const MPoly *mpoly, int numPolys, const MLoop *mloop); | static float compute_volume(const float center[3], float (*vertexCos)[3], const MPoly *mpoly, int numPolys, const MLoop *mloop); | ||||
| static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numPolys, int a_numLoops, int a_numVerts); | static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numPolys, int a_numLoops, int a_numVerts); | ||||
| static void delete_laplacian_system(LaplacianSystem *sys); | static void delete_laplacian_system(LaplacianSystem *sys); | ||||
| static void fill_laplacian_matrix(LaplacianSystem *sys); | static void fill_laplacian_matrix(LaplacianSystem *sys); | ||||
| static void init_data(ModifierData *md); | static void init_data(ModifierData *md); | ||||
| static void init_laplacian_matrix(LaplacianSystem *sys); | static void init_laplacian_matrix(LaplacianSystem *sys); | ||||
| static void memset_laplacian_system(LaplacianSystem *sys, int val); | static void memset_laplacian_system(LaplacianSystem *sys, int val); | ||||
| ▲ Show 20 Lines • Show All 390 Lines • ▼ Show 20 Lines | static bool is_disabled(const struct Scene *UNUSED(scene), ModifierData *md, bool UNUSED(useRenderParams)) | ||||
| flag = smd->flag & (MOD_LAPLACIANSMOOTH_X | MOD_LAPLACIANSMOOTH_Y | MOD_LAPLACIANSMOOTH_Z); | flag = smd->flag & (MOD_LAPLACIANSMOOTH_X | MOD_LAPLACIANSMOOTH_Y | MOD_LAPLACIANSMOOTH_Z); | ||||
| /* disable if modifier is off for X, Y and Z or if factor is 0 */ | /* disable if modifier is off for X, Y and Z or if factor is 0 */ | ||||
| if (flag == 0) return 1; | if (flag == 0) return 1; | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| static CustomDataMask required_data_mask(Object *UNUSED(ob), ModifierData *md) | static void required_data_mask(Object *UNUSED(ob), ModifierData *md, CustomData_MeshMasks *r_cddata_masks) | ||||
| { | { | ||||
| LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *)md; | LaplacianSmoothModifierData *smd = (LaplacianSmoothModifierData *)md; | ||||
| CustomDataMask dataMask = 0; | |||||
| /* ask for vertexgroups if we need them */ | /* ask for vertexgroups if we need them */ | ||||
| if (smd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT; | if (smd->defgrp_name[0] != '\0') { | ||||
| r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT; | |||||
| return dataMask; | } | ||||
| } | } | ||||
| static void deformVerts( | static void deformVerts( | ||||
| ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, | ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, | ||||
| float (*vertexCos)[3], int numVerts) | float (*vertexCos)[3], int numVerts) | ||||
| { | { | ||||
| Mesh *mesh_src; | Mesh *mesh_src; | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||