Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions | Variables

MOD_edgesplit.c File Reference

#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.

Classes

struct  SmoothVert
struct  SmoothEdge
struct  SmoothFace
struct  SmoothMesh
struct  ReplaceData
struct  PropagateEdge

Defines

#define SMOOTHEDGE_NUM_VERTS   2
#define SMOOTHFACE_MAX_EDGES   4

Typedefs

typedef struct SmoothVert SmoothVert
typedef struct SmoothEdge SmoothEdge
typedef struct SmoothFace SmoothFace
typedef struct SmoothMesh SmoothMesh
typedef struct ReplaceData ReplaceData
typedef struct PropagateEdge PropagateEdge

Functions

static void initData (ModifierData *md)
static void copyData (ModifierData *md, ModifierData *target)
static SmoothVertsmoothvert_copy (SmoothVert *vert, SmoothMesh *mesh)
static SmoothEdgesmoothedge_copy (SmoothEdge *edge, SmoothMesh *mesh)
static int smoothedge_has_vert (SmoothEdge *edge, SmoothVert *vert)
static SmoothMeshsmoothmesh_new (int num_verts, int num_edges, int num_faces, int max_verts, int max_edges, int max_faces)
static void smoothmesh_free (SmoothMesh *mesh)
static void smoothmesh_resize_verts (SmoothMesh *mesh, int max_verts)
static void smoothmesh_resize_edges (SmoothMesh *mesh, int max_edges)
static SmoothMeshsmoothmesh_from_derivedmesh (DerivedMesh *dm)
static DerivedMeshCDDM_from_smoothmesh (SmoothMesh *mesh)
static SmoothVertother_vert (SmoothEdge *edge, SmoothVert *vert)
static SmoothEdgeother_edge (SmoothFace *face, SmoothVert *vert, SmoothEdge *edge)
static SmoothFaceother_face (SmoothEdge *edge, SmoothFace *face)
static void linklist_append_unique (LinkNode **target, void *source)
static void linklist_append_list_unique (LinkNode **target, LinkNode *source)
static int linklist_contains (LinkNode *list, void *ptr)
static int linklist_subset (LinkNode *list1, LinkNode *list2)
static void linklist_remove_first (LinkNode **list, void *value, LinkNodeFreeFP freefunc)
static void linklist_remove_list (LinkNode **target, LinkNode *source, LinkNodeFreeFP freefunc)
static void edge_replace_vert (void *ptr, void *userdata)
static void face_replace_vert (void *ptr, void *userdata)
static void face_replace_edge (void *ptr, void *userdata)
static int edge_is_loose (SmoothEdge *edge)
static int edge_is_sharp (SmoothEdge *edge)
static SmoothEdgefind_other_sharp_edge (SmoothVert *vert, SmoothEdge *edge, LinkNode **visited_faces)
static void split_single_vert (SmoothVert *vert, SmoothFace *face, SmoothMesh *mesh)
static void push_propagate_stack (SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh)
static void pop_propagate_stack (SmoothEdge **edge, SmoothVert **vert, SmoothMesh *mesh)
static void split_edge (SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh)
static void propagate_split (SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh)
static void tag_and_count_extra_edges (SmoothMesh *mesh, float split_angle, int flags, int *extra_edges)
static void split_sharp_edges (SmoothMesh *mesh, float split_angle, int flags)
static int count_bridge_verts (SmoothMesh *mesh)
static void split_bridge_verts (SmoothMesh *mesh)
static DerivedMeshedgesplitModifier_do (EdgeSplitModifierData *emd, DerivedMesh *dm)
static DerivedMeshapplyModifier (ModifierData *md, Object *UNUSED(ob), DerivedMesh *derivedData, int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
static DerivedMeshapplyModifierEM (ModifierData *md, Object *ob, struct EditMesh *UNUSED(editData), DerivedMesh *derivedData)

Variables

ModifierTypeInfo modifierType_EdgeSplit

Detailed Description

Definition in file MOD_edgesplit.c.


Define Documentation

#define SMOOTHEDGE_NUM_VERTS   2
#define SMOOTHFACE_MAX_EDGES   4

Typedef Documentation

typedef struct PropagateEdge PropagateEdge
typedef struct ReplaceData ReplaceData
typedef struct SmoothEdge SmoothEdge
typedef struct SmoothFace SmoothFace
typedef struct SmoothMesh SmoothMesh
typedef struct SmoothVert SmoothVert

Function Documentation

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]
static void copyData ( ModifierData md,
ModifierData target 
) [static]
static int count_bridge_verts ( SmoothMesh mesh) [static]
static int edge_is_loose ( SmoothEdge edge) [static]
static int edge_is_sharp ( SmoothEdge edge) [static]
static void edge_replace_vert ( void *  ptr,
void *  userdata 
) [static]
static DerivedMesh* edgesplitModifier_do ( EdgeSplitModifierData emd,
DerivedMesh dm 
) [static]
static void face_replace_edge ( void *  ptr,
void *  userdata 
) [static]
static void face_replace_vert ( void *  ptr,
void *  userdata 
) [static]
static SmoothEdge* find_other_sharp_edge ( SmoothVert vert,
SmoothEdge edge,
LinkNode **  visited_faces 
) [static]
static void initData ( ModifierData md) [static]
static void linklist_append_list_unique ( LinkNode **  target,
LinkNode source 
) [static]

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().

static int linklist_subset ( LinkNode list1,
LinkNode list2 
) [static]

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]
static SmoothFace* other_face ( SmoothEdge edge,
SmoothFace face 
) [static]
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]
static void propagate_split ( SmoothEdge edge,
SmoothVert vert,
SmoothMesh mesh 
) [static]
static void push_propagate_stack ( SmoothEdge edge,
SmoothVert vert,
SmoothMesh mesh 
) [static]
static SmoothEdge* smoothedge_copy ( SmoothEdge edge,
SmoothMesh mesh 
) [static]
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]
static SmoothMesh* smoothmesh_from_derivedmesh ( DerivedMesh dm) [static]
static SmoothMesh* smoothmesh_new ( int  num_verts,
int  num_edges,
int  num_faces,
int  max_verts,
int  max_edges,
int  max_faces 
) [static]
static void smoothmesh_resize_edges ( SmoothMesh mesh,
int  max_edges 
) [static]
static void smoothmesh_resize_verts ( SmoothMesh mesh,
int  max_verts 
) [static]
static SmoothVert* smoothvert_copy ( SmoothVert vert,
SmoothMesh mesh 
) [static]
static void split_bridge_verts ( SmoothMesh mesh) [static]
static void split_edge ( SmoothEdge edge,
SmoothVert vert,
SmoothMesh mesh 
) [static]
static void split_sharp_edges ( SmoothMesh mesh,
float  split_angle,
int  flags 
) [static]
static void split_single_vert ( SmoothVert vert,
SmoothFace face,
SmoothMesh mesh 
) [static]
static void tag_and_count_extra_edges ( SmoothMesh mesh,
float  split_angle,
int  flags,
int *  extra_edges 
) [static]

Variable Documentation