Blender V2.61 - r43446
|
#include <assert.h>
#include "DNA_meshdata_types.h"
#include "BLI_listbase.h"
#include "BLI_memarena.h"
#include "BLI_edgehash.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_linklist.h"
#include "MEM_guardedalloc.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_modifier.h"
#include "BKE_particle.h"
#include "MOD_util.h"
Go to the source code of this file.
Definition in file MOD_edgesplit.c.
#define SMOOTHEDGE_NUM_VERTS 2 |
Definition at line 92 of file MOD_edgesplit.c.
Referenced by edge_replace_vert(), other_edge(), smoothedge_has_vert(), and smoothmesh_resize_verts().
#define SMOOTHFACE_MAX_EDGES 4 |
Definition at line 102 of file MOD_edgesplit.c.
Referenced by count_bridge_verts(), face_replace_edge(), face_replace_vert(), other_edge(), smoothmesh_from_derivedmesh(), smoothmesh_resize_edges(), and split_bridge_verts().
typedef struct PropagateEdge PropagateEdge |
typedef struct ReplaceData ReplaceData |
typedef struct SmoothEdge SmoothEdge |
typedef struct SmoothFace SmoothFace |
typedef struct SmoothMesh SmoothMesh |
typedef struct SmoothVert SmoothVert |
static DerivedMesh* applyModifier | ( | ModifierData * | md, |
Object * | UNUSEDob, | ||
DerivedMesh * | derivedData, | ||
int | UNUSEDuseRenderParams, | ||
int | UNUSEDisFinalCalc | ||
) | [static] |
Definition at line 1267 of file MOD_edgesplit.c.
References CDDM_calc_normals(), and edgesplitModifier_do().
Referenced by applyModifierEM().
static DerivedMesh* applyModifierEM | ( | ModifierData * | md, |
Object * | ob, | ||
struct EditMesh * | UNUSEDeditData, | ||
DerivedMesh * | derivedData | ||
) | [static] |
Definition at line 1283 of file MOD_edgesplit.c.
References applyModifier().
static DerivedMesh* CDDM_from_smoothmesh | ( | SmoothMesh * | mesh | ) | [static] |
Definition at line 412 of file MOD_edgesplit.c.
References CDDM_from_template(), CDDM_get_edges(), CDDM_get_faces(), CDDM_get_verts(), SmoothMesh::dm, DM_copy_edge_data(), DM_copy_face_data(), DM_copy_vert_data(), SmoothFace::edges, SmoothMesh::edges, SmoothMesh::faces, SmoothFace::flip, DerivedMesh::getEdge, DerivedMesh::getFace, DerivedMesh::getVert, i, SmoothFace::newIndex, SmoothEdge::newIndex, SmoothVert::newIndex, SmoothMesh::num_edges, SmoothMesh::num_faces, SmoothMesh::num_verts, SmoothFace::oldIndex, SmoothEdge::oldIndex, SmoothVert::oldIndex, MFace::v1, MEdge::v1, MFace::v2, MEdge::v2, MFace::v3, MFace::v4, SmoothEdge::verts, and SmoothMesh::verts.
Referenced by edgesplitModifier_do().
static void copyData | ( | ModifierData * | md, |
ModifierData * | target | ||
) | [static] |
Definition at line 76 of file MOD_edgesplit.c.
References EdgeSplitModifierData::flags, and EdgeSplitModifierData::split_angle.
static int count_bridge_verts | ( | SmoothMesh * | mesh | ) | [static] |
Definition at line 1147 of file MOD_edgesplit.c.
References SmoothFace::edges, SmoothMesh::faces, SmoothVert::faces, SmoothEdge::faces, SmoothFace::flip, i, LinkNode::next, next, SmoothMesh::num_faces, SMOOTHFACE_MAX_EDGES, and SmoothEdge::verts.
Referenced by edgesplitModifier_do().
static int edge_is_loose | ( | SmoothEdge * | edge | ) | [static] |
Definition at line 739 of file MOD_edgesplit.c.
References SmoothEdge::faces, and LinkNode::next.
Referenced by edge_is_sharp(), propagate_split(), split_edge(), and tag_and_count_extra_edges().
static int edge_is_sharp | ( | SmoothEdge * | edge | ) | [static] |
Definition at line 744 of file MOD_edgesplit.c.
References edge_is_loose(), SmoothEdge::flag, ME_SHARP, and SmoothEdge::newIndex.
Referenced by find_other_sharp_edge(), propagate_split(), and split_sharp_edges().
static void edge_replace_vert | ( | void * | ptr, |
void * | userdata | ||
) | [static] |
Definition at line 663 of file MOD_edgesplit.c.
References SmoothVert::faces, SmoothEdge::faces, find(), i, linklist_append_list_unique(), linklist_remove_list(), SmoothEdge::newIndex, SmoothVert::newIndex, NULL, SMOOTHEDGE_NUM_VERTS, and SmoothEdge::verts.
Referenced by face_replace_vert().
static DerivedMesh* edgesplitModifier_do | ( | EdgeSplitModifierData * | emd, |
DerivedMesh * | dm | ||
) | [static] |
Definition at line 1214 of file MOD_edgesplit.c.
References CDDM_from_smoothmesh(), count_bridge_verts(), EdgeSplitModifierData::flags, SmoothMesh::max_edges, SmoothMesh::max_verts, MOD_EDGESPLIT_FROMANGLE, MOD_EDGESPLIT_FROMFLAG, SmoothMesh::num_edges, SmoothMesh::num_verts, smoothmesh_free(), smoothmesh_from_derivedmesh(), smoothmesh_resize_edges(), smoothmesh_resize_verts(), EdgeSplitModifierData::split_angle, split_bridge_verts(), split_sharp_edges(), and tag_and_count_extra_edges().
Referenced by applyModifier().
static void face_replace_edge | ( | void * | ptr, |
void * | userdata | ||
) | [static] |
Definition at line 699 of file MOD_edgesplit.c.
References BLI_linklist_prepend(), SmoothFace::edges, SmoothEdge::faces, find(), i, linklist_remove_first(), SmoothFace::newIndex, SmoothEdge::newIndex, NULL, and SMOOTHFACE_MAX_EDGES.
Referenced by split_edge().
static void face_replace_vert | ( | void * | ptr, |
void * | userdata | ||
) | [static] |
Definition at line 690 of file MOD_edgesplit.c.
References edge_replace_vert(), SmoothFace::edges, i, and SMOOTHFACE_MAX_EDGES.
Referenced by propagate_split(), split_edge(), and split_single_vert().
static SmoothEdge* find_other_sharp_edge | ( | SmoothVert * | vert, |
SmoothEdge * | edge, | ||
LinkNode ** | visited_faces | ||
) | [static] |
Definition at line 774 of file MOD_edgesplit.c.
References BLI_linklist_free(), BLI_linklist_prepend(), edge_is_sharp(), SmoothEdge::faces, LinkNode::link, linklist_contains(), SmoothFace::newIndex, SmoothEdge::newIndex, SmoothVert::newIndex, NULL, other_edge(), and other_face().
Referenced by propagate_split(), and split_edge().
static void initData | ( | ModifierData * | md | ) | [static] |
Definition at line 66 of file MOD_edgesplit.c.
References EdgeSplitModifierData::flags, MOD_EDGESPLIT_FROMANGLE, MOD_EDGESPLIT_FROMFLAG, and EdgeSplitModifierData::split_angle.
Definition at line 549 of file MOD_edgesplit.c.
References LinkNode::link, linklist_append_unique(), and LinkNode::next.
Referenced by edge_replace_vert().
static void linklist_append_unique | ( | LinkNode ** | target, |
void * | source | ||
) | [static] |
Definition at line 531 of file MOD_edgesplit.c.
References MEM_mallocN(), LinkNode::next, and NULL.
Referenced by linklist_append_list_unique().
static int linklist_contains | ( | LinkNode * | list, |
void * | ptr | ||
) | [static] |
Definition at line 571 of file MOD_edgesplit.c.
References LinkNode::link, and LinkNode::next.
Referenced by find_other_sharp_edge(), and linklist_subset().
static void linklist_remove_first | ( | LinkNode ** | list, |
void * | value, | ||
LinkNodeFreeFP | freefunc | ||
) | [static] |
Definition at line 607 of file MOD_edgesplit.c.
References LinkNode::link, MEM_freeN(), LinkNode::next, and NULL.
Referenced by face_replace_edge(), and linklist_remove_list().
static void linklist_remove_list | ( | LinkNode ** | target, |
LinkNode * | source, | ||
LinkNodeFreeFP | freefunc | ||
) | [static] |
Definition at line 632 of file MOD_edgesplit.c.
References LinkNode::link, linklist_remove_first(), and LinkNode::next.
Referenced by edge_replace_vert().
Definition at line 584 of file MOD_edgesplit.c.
References LinkNode::link, linklist_contains(), and LinkNode::next.
Referenced by propagate_split().
static SmoothEdge* other_edge | ( | SmoothFace * | face, |
SmoothVert * | vert, | ||
SmoothEdge * | edge | ||
) | [static] |
Definition at line 477 of file MOD_edgesplit.c.
References SmoothFace::edges, i, NULL, SMOOTHEDGE_NUM_VERTS, SMOOTHFACE_MAX_EDGES, and SmoothEdge::verts.
Referenced by find_other_sharp_edge().
static SmoothFace* other_face | ( | SmoothEdge * | edge, |
SmoothFace * | face | ||
) | [static] |
Definition at line 498 of file MOD_edgesplit.c.
References SmoothEdge::faces, LinkNode::link, LinkNode::next, and NULL.
Referenced by find_other_sharp_edge(), and project_face_seams_init().
static SmoothVert* other_vert | ( | SmoothEdge * | edge, |
SmoothVert * | vert | ||
) | [static] |
Definition at line 467 of file MOD_edgesplit.c.
References SmoothEdge::verts.
Referenced by propagate_split(), and split_edge().
static void pop_propagate_stack | ( | SmoothEdge ** | edge, |
SmoothVert ** | vert, | ||
SmoothMesh * | mesh | ||
) | [static] |
Definition at line 892 of file MOD_edgesplit.c.
References BLI_addhead(), BLI_remlink(), PropagateEdge::edge, ListBase::first, NULL, SmoothMesh::propagatestack, SmoothMesh::reusestack, and PropagateEdge::vert.
Referenced by split_sharp_edges().
static void propagate_split | ( | SmoothEdge * | edge, |
SmoothVert * | vert, | ||
SmoothMesh * | mesh | ||
) | [static] |
Definition at line 910 of file MOD_edgesplit.c.
References BLI_linklist_apply(), BLI_linklist_free(), edge_is_loose(), edge_is_sharp(), face_replace_vert(), SmoothVert::faces, ReplaceData::find, find_other_sharp_edge(), linklist_subset(), SmoothEdge::newIndex, SmoothVert::newIndex, NULL, other_vert(), ReplaceData::replace, smoothvert_copy(), split_edge(), and PropagateEdge::vert.
Referenced by split_sharp_edges().
static void push_propagate_stack | ( | SmoothEdge * | edge, |
SmoothVert * | vert, | ||
SmoothMesh * | mesh | ||
) | [static] |
Definition at line 871 of file MOD_edgesplit.c.
References SmoothMesh::arena, BLI_addhead(), BLI_memarena_alloc(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, BLI_memarena_use_calloc(), BLI_remlink(), PropagateEdge::edge, ListBase::first, SmoothMesh::propagatestack, SmoothMesh::reusestack, and PropagateEdge::vert.
Referenced by split_edge().
static SmoothEdge* smoothedge_copy | ( | SmoothEdge * | edge, |
SmoothMesh * | mesh | ||
) | [static] |
Definition at line 147 of file MOD_edgesplit.c.
References copy(), SmoothMesh::edges, SmoothEdge::faces, SmoothMesh::max_edges, SmoothEdge::newIndex, NULL, and SmoothMesh::num_edges.
Referenced by split_edge().
static int smoothedge_has_vert | ( | SmoothEdge * | edge, |
SmoothVert * | vert | ||
) | [static] |
Definition at line 167 of file MOD_edgesplit.c.
References i, SMOOTHEDGE_NUM_VERTS, and SmoothEdge::verts.
Referenced by split_edge(), and split_sharp_edges().
static void smoothmesh_free | ( | SmoothMesh * | mesh | ) | [static] |
Definition at line 198 of file MOD_edgesplit.c.
References SmoothMesh::arena, BLI_linklist_free(), BLI_memarena_free(), SmoothMesh::edges, SmoothMesh::faces, SmoothVert::faces, SmoothEdge::faces, i, MEM_freeN(), NULL, SmoothMesh::num_edges, SmoothMesh::num_verts, and SmoothMesh::verts.
Referenced by edgesplitModifier_do().
static SmoothMesh* smoothmesh_from_derivedmesh | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 333 of file MOD_edgesplit.c.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_lookup(), BLI_edgehash_new(), BLI_linklist_prepend(), MVert::co, SmoothMesh::dm, SmoothFace::edges, SmoothMesh::edges, SmoothMesh::faces, SmoothVert::faces, SmoothEdge::faces, MEdge::flag, SmoothEdge::flag, SmoothFace::flip, DerivedMesh::getEdge, DerivedMesh::getFace, DerivedMesh::getNumEdges, DerivedMesh::getNumFaces, DerivedMesh::getNumVerts, DerivedMesh::getVert, i, SmoothFace::newIndex, SmoothEdge::newIndex, SmoothVert::newIndex, SmoothFace::normal, normal_quad_v3(), normal_tri_v3(), NULL, SmoothEdge::oldIndex, SmoothVert::oldIndex, SmoothFace::oldIndex, SMOOTHFACE_MAX_EDGES, smoothmesh_new(), MEdge::v1, MFace::v1, MEdge::v2, MFace::v2, MFace::v3, MFace::v4, SmoothEdge::verts, and SmoothMesh::verts.
Referenced by edgesplitModifier_do().
static SmoothMesh* smoothmesh_new | ( | int | num_verts, |
int | num_edges, | ||
int | num_faces, | ||
int | max_verts, | ||
int | max_edges, | ||
int | max_faces | ||
) | [static] |
Definition at line 176 of file MOD_edgesplit.c.
References SmoothMesh::edges, SmoothMesh::faces, SmoothMesh::max_edges, SmoothMesh::max_faces, SmoothMesh::max_verts, MEM_callocN(), SmoothMesh::num_edges, SmoothMesh::num_faces, SmoothMesh::num_verts, and SmoothMesh::verts.
Referenced by smoothmesh_from_derivedmesh().
static void smoothmesh_resize_edges | ( | SmoothMesh * | mesh, |
int | max_edges | ||
) | [static] |
Definition at line 243 of file MOD_edgesplit.c.
References SmoothFace::edges, SmoothMesh::edges, SmoothMesh::faces, i, SmoothMesh::max_edges, MEM_callocN(), MEM_freeN(), SmoothMesh::num_edges, SmoothMesh::num_faces, and SMOOTHFACE_MAX_EDGES.
Referenced by edgesplitModifier_do().
static void smoothmesh_resize_verts | ( | SmoothMesh * | mesh, |
int | max_verts | ||
) | [static] |
Definition at line 217 of file MOD_edgesplit.c.
References SmoothMesh::edges, i, SmoothMesh::max_verts, MEM_callocN(), MEM_freeN(), SmoothMesh::num_edges, SmoothMesh::num_verts, SMOOTHEDGE_NUM_VERTS, SmoothEdge::verts, and SmoothMesh::verts.
Referenced by edgesplitModifier_do().
static SmoothVert* smoothvert_copy | ( | SmoothVert * | vert, |
SmoothMesh * | mesh | ||
) | [static] |
Definition at line 125 of file MOD_edgesplit.c.
References assert, copy(), SmoothVert::faces, SmoothMesh::max_verts, SmoothVert::newIndex, NULL, SmoothMesh::num_verts, and SmoothMesh::verts.
Referenced by propagate_split(), split_edge(), and split_single_vert().
static void split_bridge_verts | ( | SmoothMesh * | mesh | ) | [static] |
Definition at line 1182 of file MOD_edgesplit.c.
References SmoothFace::edges, SmoothMesh::faces, SmoothVert::faces, SmoothEdge::faces, SmoothFace::flip, i, LinkNode::next, next, SmoothMesh::num_faces, SMOOTHFACE_MAX_EDGES, split_single_vert(), and SmoothEdge::verts.
Referenced by edgesplitModifier_do().
static void split_edge | ( | SmoothEdge * | edge, |
SmoothVert * | vert, | ||
SmoothMesh * | mesh | ||
) | [static] |
Definition at line 969 of file MOD_edgesplit.c.
References BLI_linklist_apply(), BLI_linklist_free(), PropagateEdge::edge, edge_is_loose(), face_replace_edge(), face_replace_vert(), ReplaceData::find, find_other_sharp_edge(), SmoothEdge::newIndex, SmoothVert::newIndex, NULL, other_vert(), push_propagate_stack(), ReplaceData::replace, smoothedge_copy(), smoothedge_has_vert(), smoothvert_copy(), and PropagateEdge::vert.
Referenced by propagate_split(), and split_sharp_edges().
static void split_sharp_edges | ( | SmoothMesh * | mesh, |
float | split_angle, | ||
int | flags | ||
) | [static] |
Definition at line 1120 of file MOD_edgesplit.c.
References cosf, edge_is_sharp(), SmoothMesh::edges, SmoothMesh::flags, i, M_PI, SmoothMesh::num_edges, pop_propagate_stack(), propagate_split(), smoothedge_has_vert(), split_edge(), SmoothMesh::threshold, PropagateEdge::vert, and SmoothEdge::verts.
Referenced by edgesplitModifier_do().
static void split_single_vert | ( | SmoothVert * | vert, |
SmoothFace * | face, | ||
SmoothMesh * | mesh | ||
) | [static] |
Definition at line 846 of file MOD_edgesplit.c.
References face_replace_vert(), ReplaceData::find, NULL, ReplaceData::replace, and smoothvert_copy().
Referenced by split_bridge_verts().
static void tag_and_count_extra_edges | ( | SmoothMesh * | mesh, |
float | split_angle, | ||
int | flags, | ||
int * | extra_edges | ||
) | [static] |
Definition at line 1060 of file MOD_edgesplit.c.
References cos(), dot_v3v3(), edge_is_loose(), SmoothMesh::edges, SmoothEdge::faces, SmoothEdge::flag, i, LinkNode::link, M_PI, ME_SHARP, MOD_EDGESPLIT_FROMANGLE, MOD_EDGESPLIT_FROMFLAG, LinkNode::next, SmoothFace::normal, and SmoothMesh::num_edges.
Referenced by edgesplitModifier_do().
{ "EdgeSplit", "EdgeSplitModifierData", sizeof(EdgeSplitModifierData), eModifierTypeType_Constructive, eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_AcceptsCVs | eModifierTypeFlag_SupportsMapping | eModifierTypeFlag_SupportsEditmode | eModifierTypeFlag_EnableInEditmode, copyData, NULL, NULL, NULL, NULL, applyModifier, applyModifierEM, initData, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }
Definition at line 1291 of file MOD_edgesplit.c.