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

BKE_DerivedMesh.h File Reference

#include "DNA_customdata_types.h"
#include "BKE_customdata.h"
#include "BKE_bvhutils.h"

Go to the source code of this file.

Classes

struct  DMGridData
struct  DMGridAdjacency
struct  DerivedMesh
struct  DMVertexAttribs
struct  EditMeshDerivedMesh

Defines

#define SUB_ELEMS_VERT   0
#define SUB_ELEMS_EDGE   2
#define SUB_ELEMS_FACE   4

Typedefs

typedef struct DMGridData DMGridData
typedef struct DMGridAdjacency DMGridAdjacency
typedef enum DerivedMeshType DerivedMeshType
typedef struct DerivedMesh DerivedMesh
typedef float EdgeVertWeight [SUB_ELEMS_EDGE][SUB_ELEMS_EDGE]
typedef float FaceVertWeight [SUB_ELEMS_FACE][SUB_ELEMS_FACE]
typedef struct DMVertexAttribs DMVertexAttribs

Enumerations

enum  DerivedMeshType { DM_TYPE_CDDM, DM_TYPE_EDITMESH, DM_TYPE_CCGDM }

Functions

void DM_init_funcs (DerivedMesh *dm)
void DM_init (DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges, int numFaces)
void DM_from_template (DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type, int numVerts, int numEdges, int numFaces)
int DM_release (DerivedMesh *dm)
void DM_to_mesh (DerivedMesh *dm, struct Mesh *me)
void DM_to_meshkey (DerivedMesh *dm, struct Mesh *me, struct KeyBlock *kb)
void DM_set_only_copy (DerivedMesh *dm, CustomDataMask mask)
void DM_add_vert_layer (struct DerivedMesh *dm, int type, int alloctype, void *layer)
void DM_add_edge_layer (struct DerivedMesh *dm, int type, int alloctype, void *layer)
void DM_add_face_layer (struct DerivedMesh *dm, int type, int alloctype, void *layer)
void * DM_get_vert_data (struct DerivedMesh *dm, int index, int type)
void * DM_get_edge_data (struct DerivedMesh *dm, int index, int type)
void * DM_get_face_data (struct DerivedMesh *dm, int index, int type)
void * DM_get_vert_data_layer (struct DerivedMesh *dm, int type)
void * DM_get_edge_data_layer (struct DerivedMesh *dm, int type)
void * DM_get_face_data_layer (struct DerivedMesh *dm, int type)
void DM_set_vert_data (struct DerivedMesh *dm, int index, int type, void *data)
void DM_set_edge_data (struct DerivedMesh *dm, int index, int type, void *data)
void DM_set_face_data (struct DerivedMesh *dm, int index, int type, void *data)
void DM_copy_vert_data (struct DerivedMesh *source, struct DerivedMesh *dest, int source_index, int dest_index, int count)
void DM_copy_edge_data (struct DerivedMesh *source, struct DerivedMesh *dest, int source_index, int dest_index, int count)
void DM_copy_face_data (struct DerivedMesh *source, struct DerivedMesh *dest, int source_index, int dest_index, int count)
void DM_free_vert_data (struct DerivedMesh *dm, int index, int count)
void DM_free_edge_data (struct DerivedMesh *dm, int index, int count)
void DM_free_face_data (struct DerivedMesh *dm, int index, int count)
void DM_interp_vert_data (struct DerivedMesh *source, struct DerivedMesh *dest, int *src_indices, float *weights, int count, int dest_index)
void DM_interp_edge_data (struct DerivedMesh *source, struct DerivedMesh *dest, int *src_indices, float *weights, EdgeVertWeight *vert_weights, int count, int dest_index)
void DM_interp_face_data (struct DerivedMesh *source, struct DerivedMesh *dest, int *src_indices, float *weights, FaceVertWeight *vert_weights, int count, int dest_index)
void DM_swap_face_data (struct DerivedMesh *dm, int index, const int *corner_indices)
void vDM_ColorBand_store (struct ColorBand *coba)
float * mesh_get_mapped_verts_nors (struct Scene *scene, struct Object *ob)
DerivedMeshmesh_get_derived_final (struct Scene *scene, struct Object *ob, CustomDataMask dataMask)
DerivedMeshmesh_get_derived_deform (struct Scene *scene, struct Object *ob, CustomDataMask dataMask)
DerivedMeshmesh_create_derived_for_modifier (struct Scene *scene, struct Object *ob, struct ModifierData *md)
DerivedMeshmesh_create_derived_render (struct Scene *scene, struct Object *ob, CustomDataMask dataMask)
DerivedMeshmesh_create_derived_index_render (struct Scene *scene, struct Object *ob, CustomDataMask dataMask, int index)
DerivedMeshmesh_create_derived (struct Mesh *me, struct Object *ob, float(*vertCos)[3])
DerivedMeshmesh_create_derived_view (struct Scene *scene, struct Object *ob, CustomDataMask dataMask)
DerivedMeshmesh_create_derived_no_deform (struct Scene *scene, struct Object *ob, float(*vertCos)[3], CustomDataMask dataMask)
DerivedMeshmesh_create_derived_no_deform_render (struct Scene *scene, struct Object *ob, float(*vertCos)[3], CustomDataMask dataMask)
DerivedMeshmesh_create_derived_no_virtual (struct Scene *scene, struct Object *ob, float(*vertCos)[3], CustomDataMask dataMask)
DerivedMeshmesh_create_derived_physics (struct Scene *scene, struct Object *ob, float(*vertCos)[3], CustomDataMask dataMask)
DerivedMesheditmesh_get_derived (struct EditMesh *em, float(*vertexCos)[3])
DerivedMesheditmesh_get_derived_base (struct Object *, struct EditMesh *em)
DerivedMesheditmesh_get_derived_cage (struct Scene *scene, struct Object *, struct EditMesh *em, CustomDataMask dataMask)
DerivedMesheditmesh_get_derived_cage_and_final (struct Scene *scene, struct Object *, struct EditMesh *em, DerivedMesh **final_r, CustomDataMask dataMask)
float(* editmesh_get_vertex_cos (struct EditMesh *em, int *numVerts_r))[3]
int editmesh_modifier_is_enabled (struct Scene *scene, struct ModifierData *md, DerivedMesh *dm)
void makeDerivedMesh (struct Scene *scene, struct Object *ob, struct EditMesh *em, CustomDataMask dataMask)
int editmesh_get_first_deform_matrices (struct Scene *, struct Object *, struct EditMesh *em, float(**deformmats)[3][3], float(**deformcos)[3])
int sculpt_get_deform_matrices (struct Scene *scene, struct Object *ob, float(**deformmats)[3][3], float(**deformcos)[3])
void weight_to_rgb (float r_rgb[3], const float weight)
void DM_vertex_attributes_from_gpu (DerivedMesh *dm, struct GPUVertexAttribs *gattribs, DMVertexAttribs *attribs)
void DM_add_tangent_layer (DerivedMesh *dm)
void DM_calc_auto_bump_scale (DerivedMesh *dm)
void DM_set_object_boundbox (struct Object *ob, DerivedMesh *dm)

Detailed Description

Todo:
  • Make drawMapped* functions take a predicate function that determines whether to draw the edge (this predicate can also set color, etc). This will be slightly more general and allow some of the functions to be collapsed.
  • Once accessor functions are added then single element draw functions can be implemented using primitive accessors.
  • Add function to dispatch to renderer instead of using conversion to DLM.

Definition in file BKE_DerivedMesh.h.


Define Documentation

#define SUB_ELEMS_EDGE   2

Definition at line 68 of file BKE_DerivedMesh.h.

#define SUB_ELEMS_FACE   4

Definition at line 69 of file BKE_DerivedMesh.h.

#define SUB_ELEMS_VERT   0

Definition at line 67 of file BKE_DerivedMesh.h.


Typedef Documentation

typedef struct DerivedMesh DerivedMesh

Definition at line 87 of file BKE_DerivedMesh.h.

typedef struct DMGridData DMGridData
typedef float EdgeVertWeight[SUB_ELEMS_EDGE][SUB_ELEMS_EDGE]

Definition at line 461 of file BKE_DerivedMesh.h.

typedef float FaceVertWeight[SUB_ELEMS_FACE][SUB_ELEMS_FACE]

Definition at line 474 of file BKE_DerivedMesh.h.


Enumeration Type Documentation

Enumerator:
DM_TYPE_CDDM 
DM_TYPE_EDITMESH 
DM_TYPE_CCGDM 

Definition at line 81 of file BKE_DerivedMesh.h.


Function Documentation

void DM_add_edge_layer ( struct DerivedMesh dm,
int  type,
int  alloctype,
void *  layer 
)
void DM_add_face_layer ( struct DerivedMesh dm,
int  type,
int  alloctype,
void *  layer 
)
void DM_add_tangent_layer ( DerivedMesh dm)
void DM_add_vert_layer ( struct DerivedMesh dm,
int  type,
int  alloctype,
void *  layer 
)
void DM_calc_auto_bump_scale ( DerivedMesh dm)
void DM_copy_edge_data ( struct DerivedMesh source,
struct DerivedMesh dest,
int  source_index,
int  dest_index,
int  count 
)
void DM_copy_face_data ( struct DerivedMesh source,
struct DerivedMesh dest,
int  source_index,
int  dest_index,
int  count 
)
void DM_copy_vert_data ( struct DerivedMesh source,
struct DerivedMesh dest,
int  source_index,
int  dest_index,
int  count 
)
void DM_free_edge_data ( struct DerivedMesh dm,
int  index,
int  count 
)

Definition at line 403 of file DerivedMesh.c.

References CustomData_free_elem(), and DerivedMesh::edgeData.

void DM_free_face_data ( struct DerivedMesh dm,
int  index,
int  count 
)

Definition at line 408 of file DerivedMesh.c.

References CustomData_free_elem(), and DerivedMesh::faceData.

Referenced by arrayModifier_doArray().

void DM_free_vert_data ( struct DerivedMesh dm,
int  index,
int  count 
)

Definition at line 398 of file DerivedMesh.c.

References CustomData_free_elem(), and DerivedMesh::vertData.

Referenced by arrayModifier_doArray().

void DM_from_template ( DerivedMesh dm,
DerivedMesh source,
DerivedMeshType  type,
int  numVerts,
int  numEdges,
int  numFaces 
)
void* DM_get_edge_data ( struct DerivedMesh dm,
int  index,
int  type 
)

Definition at line 328 of file DerivedMesh.c.

References CustomData_get(), and DerivedMesh::edgeData.

Referenced by cdDM_create(), DM_init_funcs(), and getCCGDerivedMesh().

void* DM_get_edge_data_layer ( struct DerivedMesh dm,
int  type 
)
void* DM_get_face_data ( struct DerivedMesh dm,
int  index,
int  type 
)

Definition at line 333 of file DerivedMesh.c.

References CustomData_get(), and DerivedMesh::faceData.

Referenced by cdDM_create(), DM_init_funcs(), and getCCGDerivedMesh().

void* DM_get_face_data_layer ( struct DerivedMesh dm,
int  type 
)
void* DM_get_vert_data ( struct DerivedMesh dm,
int  index,
int  type 
)
void* DM_get_vert_data_layer ( struct DerivedMesh dm,
int  type 
)
void DM_init ( DerivedMesh dm,
DerivedMeshType  type,
int  numVerts,
int  numEdges,
int  numFaces 
)
void DM_init_funcs ( DerivedMesh dm)
void DM_interp_edge_data ( struct DerivedMesh source,
struct DerivedMesh dest,
int *  src_indices,
float *  weights,
EdgeVertWeight vert_weights,
int  count,
int  dest_index 
)

Definition at line 421 of file DerivedMesh.c.

References CustomData_interp(), and DerivedMesh::edgeData.

void DM_interp_face_data ( struct DerivedMesh source,
struct DerivedMesh dest,
int *  src_indices,
float *  weights,
FaceVertWeight vert_weights,
int  count,
int  dest_index 
)

Definition at line 430 of file DerivedMesh.c.

References CustomData_interp(), and DerivedMesh::faceData.

Referenced by getCCGDerivedMesh().

void DM_interp_vert_data ( struct DerivedMesh source,
struct DerivedMesh dest,
int *  src_indices,
float *  weights,
int  count,
int  dest_index 
)

Definition at line 413 of file DerivedMesh.c.

References CustomData_interp(), NULL, and DerivedMesh::vertData.

Referenced by getCCGDerivedMesh().

int DM_release ( DerivedMesh dm)
void DM_set_edge_data ( struct DerivedMesh dm,
int  index,
int  type,
void *  data 
)

Definition at line 367 of file DerivedMesh.c.

References CustomData_set(), and DerivedMesh::edgeData.

void DM_set_face_data ( struct DerivedMesh dm,
int  index,
int  type,
void *  data 
)

Definition at line 372 of file DerivedMesh.c.

References CustomData_set(), and DerivedMesh::faceData.

void DM_set_object_boundbox ( struct Object ob,
DerivedMesh dm 
)
void DM_set_only_copy ( DerivedMesh dm,
CustomDataMask  mask 
)
void DM_set_vert_data ( struct DerivedMesh dm,
int  index,
int  type,
void *  data 
)

Definition at line 362 of file DerivedMesh.c.

References CustomData_set(), and DerivedMesh::vertData.

Referenced by editmesh_get_derived().

void DM_swap_face_data ( struct DerivedMesh dm,
int  index,
const int *  corner_indices 
)

Definition at line 439 of file DerivedMesh.c.

References CustomData_swap(), and DerivedMesh::faceData.

Referenced by applyModifier(), and doMirrorOnAxis().

void DM_to_mesh ( DerivedMesh dm,
struct Mesh me 
)
void DM_to_meshkey ( DerivedMesh dm,
struct Mesh me,
struct KeyBlock kb 
)
void DM_vertex_attributes_from_gpu ( DerivedMesh dm,
struct GPUVertexAttribs gattribs,
DMVertexAttribs attribs 
)
DerivedMesh* editmesh_get_derived ( struct EditMesh em,
float(*)  vertexCos[3] 
)

Definition at line 1193 of file editderivedmesh.c.

References add_v3_v3(), BLI_countlist(), CD_CALLOC, CD_MDEFORMVERT, DerivedMesh::copyEdgeArray, DerivedMesh::copyFaceArray, DerivedMesh::copyVertArray, CustomData_em_get(), CustomData_has_layer(), EditVert::data, EditMeshDerivedMesh::dm, DM_add_vert_layer(), DM_init(), DM_set_vert_data(), DM_TYPE_EDITMESH, DerivedMesh::drawEdges, DerivedMesh::drawFacesGLSL, DerivedMesh::drawFacesTex, DerivedMesh::drawMappedEdges, DerivedMesh::drawMappedEdgesInterp, DerivedMesh::drawMappedFaces, DerivedMesh::drawMappedFacesGLSL, DerivedMesh::drawMappedFacesMat, DerivedMesh::drawMappedFacesTex, DerivedMesh::drawUVEdges, EditMesh::edges, EditMeshDerivedMesh::em, emDM_copyEdgeArray(), emDM_copyFaceArray(), emDM_copyVertArray(), emDM_drawEdges(), emDM_drawFacesGLSL(), emDM_drawFacesTex(), emDM_drawMappedEdges(), emDM_drawMappedEdgesInterp(), emDM_drawMappedFaces(), emDM_drawMappedFacesGLSL(), emDM_drawMappedFacesMat(), emDM_drawMappedFacesTex(), emDM_drawUVEdges(), emDM_foreachMappedEdge(), emDM_foreachMappedFaceCenter(), emDM_foreachMappedVert(), emDM_getEdge(), emDM_getFace(), emDM_getFaceDataArray(), emDM_getMinMax(), emDM_getNumEdges(), emDM_getNumFaces(), emDM_getNumVerts(), emDM_getVert(), emDM_getVertCos(), emDM_release(), EditMeshDerivedMesh::faceNos, EditMesh::faces, ListBase::first, DerivedMesh::foreachMappedEdge, DerivedMesh::foreachMappedFaceCenter, DerivedMesh::foreachMappedVert, DerivedMesh::getEdge, DerivedMesh::getFace, DerivedMesh::getFaceDataArray, DerivedMesh::getMinMax, DerivedMesh::getNumEdges, DerivedMesh::getNumFaces, DerivedMesh::getNumVerts, DerivedMesh::getVert, DerivedMesh::getVertCos, i, if(), EditVert::l, MEM_callocN(), MEM_mallocN(), EditFace::next, EditVert::next, normal_quad_v3(), normal_tri_v3(), normalize_v3(), normalize_v3_v3(), NULL, DerivedMesh::release, EditVert::tmp, EditFace::v1, EditFace::v2, EditFace::v3, EditFace::v4, EditMesh::vdata, EditMeshDerivedMesh::vertexCos, EditMeshDerivedMesh::vertexNos, and EditMesh::verts.

Referenced by editmesh_calc_modifiers(), editmesh_get_derived_base(), and editmesh_get_first_deform_matrices().

DerivedMesh* editmesh_get_derived_base ( struct Object ,
struct EditMesh em 
)
DerivedMesh* editmesh_get_derived_cage ( struct Scene scene,
struct Object ,
struct EditMesh em,
CustomDataMask  dataMask 
)
DerivedMesh* editmesh_get_derived_cage_and_final ( struct Scene scene,
struct Object ,
struct EditMesh em,
DerivedMesh **  final_r,
CustomDataMask  dataMask 
)
int editmesh_get_first_deform_matrices ( struct Scene ,
struct Object ,
struct EditMesh em,
float(**)  deformmats[3][3],
float(**)  deformcos[3] 
)
float(* editmesh_get_vertex_cos ( struct EditMesh em,
int *  numVerts_r 
) )[3]
int editmesh_modifier_is_enabled ( struct Scene scene,
struct ModifierData md,
DerivedMesh dm 
)
void makeDerivedMesh ( struct Scene scene,
struct Object ob,
struct EditMesh em,
CustomDataMask  dataMask 
)
DerivedMesh* mesh_create_derived ( struct Mesh me,
struct Object ob,
float(*)  vertCos[3] 
)
DerivedMesh* mesh_create_derived_for_modifier ( struct Scene scene,
struct Object ob,
struct ModifierData md 
)
DerivedMesh* mesh_create_derived_index_render ( struct Scene scene,
struct Object ob,
CustomDataMask  dataMask,
int  index 
)

Definition at line 1499 of file DerivedMesh.c.

References mesh_calc_modifiers(), and NULL.

Referenced by initElbeemMesh().

DerivedMesh* mesh_create_derived_no_deform ( struct Scene scene,
struct Object ob,
float(*)  vertCos[3],
CustomDataMask  dataMask 
)

Definition at line 1517 of file DerivedMesh.c.

References mesh_calc_modifiers(), and NULL.

Referenced by mesh_deform_bind().

DerivedMesh* mesh_create_derived_no_deform_render ( struct Scene scene,
struct Object ob,
float(*)  vertCos[3],
CustomDataMask  dataMask 
)

Definition at line 1547 of file DerivedMesh.c.

References mesh_calc_modifiers(), and NULL.

DerivedMesh* mesh_create_derived_no_virtual ( struct Scene scene,
struct Object ob,
float(*)  vertCos[3],
CustomDataMask  dataMask 
)
DerivedMesh* mesh_create_derived_physics ( struct Scene scene,
struct Object ob,
float(*)  vertCos[3],
CustomDataMask  dataMask 
)

Definition at line 1537 of file DerivedMesh.c.

References mesh_calc_modifiers(), and NULL.

Referenced by BL_ModifierDeformer::GetPhysicsMesh().

DerivedMesh* mesh_create_derived_render ( struct Scene scene,
struct Object ob,
CustomDataMask  dataMask 
)
DerivedMesh* mesh_create_derived_view ( struct Scene scene,
struct Object ob,
CustomDataMask  dataMask 
)

Definition at line 1508 of file DerivedMesh.c.

References mesh_calc_modifiers(), and NULL.

Referenced by meshdeform_bind_exec(), and NewBooleanMesh().

DerivedMesh* mesh_get_derived_deform ( struct Scene scene,
struct Object ob,
CustomDataMask  dataMask 
)
DerivedMesh* mesh_get_derived_final ( struct Scene scene,
struct Object ob,
CustomDataMask  dataMask 
)
float* mesh_get_mapped_verts_nors ( struct Scene scene,
struct Object ob 
)
int sculpt_get_deform_matrices ( struct Scene scene,
struct Object ob,
float(**)  deformmats[3][3],
float(**)  deformcos[3] 
)
void vDM_ColorBand_store ( struct ColorBand coba)

Definition at line 715 of file DerivedMesh.c.

Referenced by init_userdef_do_versions().

void weight_to_rgb ( float  r_rgb[3],
const float  weight 
)