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

meshtools.c File Reference

#include <stddef.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "MEM_guardedalloc.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BLI_editVert.h"
#include "BLI_ghash.h"
#include "BLI_rand.h"
#include "BLI_threads.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_deform.h"
#include "BKE_DerivedMesh.h"
#include "BKE_key.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_material.h"
#include "BKE_report.h"
#include "BKE_multires.h"
#include "BLO_sys_types.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_view3d.h"
#include "WM_api.h"
#include "WM_types.h"
#include "mesh_intern.h"

Go to the source code of this file.

Classes

struct  MocNode

Defines

#define MOC_RES   8
#define MOC_NODE_RES   8
#define MOC_THRESH   0.00002f
#define MOC_INDEX(vx, vy, vz)   (((vx)*MOC_RES*MOC_RES) + (vy)*MOC_RES + (vz))

Typedefs

typedef struct MocNode MocNode

Functions

int join_mesh_exec (bContext *C, wmOperator *op)
int join_mesh_shapes_exec (bContext *C, wmOperator *op)
static int mesh_octree_get_base_offs (float *co, float *offs, float *div)
static void mesh_octree_add_node (MocNode **bt, intptr_t index)
static void mesh_octree_free_node (MocNode **bt)
static void mesh_octree_add_nodes (MocNode **basetable, float *co, float *offs, float *div, intptr_t index)
static intptr_t mesh_octree_find_index (MocNode **bt, MVert *mvert, float *co)
intptr_t mesh_octree_table (Object *ob, EditMesh *em, float *co, char mode)
int mesh_mirrtopo_table (Object *ob, char mode)
static int mesh_get_x_mirror_vert_spacial (Object *ob, int index)
static int mesh_get_x_mirror_vert_topo (Object *ob, int index)
int mesh_get_x_mirror_vert (Object *ob, int index)
static EditVerteditmesh_get_x_mirror_vert_spacial (Object *ob, EditMesh *em, float *co)
static EditVerteditmesh_get_x_mirror_vert_topo (Object *ob, struct EditMesh *em, EditVert *eve, int index)
EditVerteditmesh_get_x_mirror_vert (Object *ob, struct EditMesh *em, EditVert *eve, float *co, int index)
static unsigned int mirror_facehash (const void *ptr)
static int mirror_facerotation (MFace *a, MFace *b)
static int mirror_facecmp (const void *a, const void *b)
int * mesh_get_x_mirror_faces (Object *ob, EditMesh *em)

Variables

struct {
   MocNode **   table
   float   offs [3]
   float   div [3]
MeshOctree
MirrTopoStore_t mesh_topo_store = {NULL, -1. -1, -1}

Detailed Description

Definition in file meshtools.c.


Define Documentation

#define MOC_INDEX (   vx,
  vy,
  vz 
)    (((vx)*MOC_RES*MOC_RES) + (vy)*MOC_RES + (vz))

Definition at line 674 of file meshtools.c.

Referenced by mesh_octree_add_nodes().

#define MOC_NODE_RES   8

Definition at line 621 of file meshtools.c.

Referenced by mesh_octree_add_node(), and mesh_octree_find_index().

#define MOC_RES   8
#define MOC_THRESH   0.00002f

Definition at line 622 of file meshtools.c.

Referenced by mesh_octree_add_nodes(), mesh_octree_find_index(), and mesh_octree_table().


Typedef Documentation

typedef struct MocNode MocNode

Function Documentation

EditVert* editmesh_get_x_mirror_vert ( Object ob,
struct EditMesh em,
EditVert eve,
float *  co,
int  index 
) [read]
static EditVert* editmesh_get_x_mirror_vert_spacial ( Object ob,
EditMesh em,
float *  co 
) [static]

Definition at line 903 of file meshtools.c.

References mesh_octree_table(), and NULL.

Referenced by editmesh_get_x_mirror_vert().

static EditVert* editmesh_get_x_mirror_vert_topo ( Object ob,
struct EditMesh em,
EditVert eve,
int  index 
) [static]
int join_mesh_exec ( bContext C,
wmOperator op 
)

Definition at line 91 of file meshtools.c.

References Object::actdef, add_key(), KeyBlock::adrcode, BKE_report(), BKE_reportf(), BLI_addtail(), BLI_findlink(), BLI_remlink(), Key::block, CD_CALLOC, CD_DEFAULT, CD_MASK_MESH, CD_MDEFORMVERT, CD_MEDGE, CD_MFACE, CD_MVERT, MVert::co, copy_key(), CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_main(), CTX_data_scene(), CustomData_add_layer(), CustomData_copy_data(), CustomData_free(), CustomData_get(), CustomData_merge(), DAG_id_tag_update(), DAG_scene_sort(), KeyBlock::data, Object::data, MDeformWeight::def_nr, Object::defbase, defgroup_find_name(), MDeformVert::dw, ED_base_object_free_and_unlink(), ED_object_enter_editmode(), ED_object_exit_editmode(), EM_DO_UNDO, EM_FREEDATA, EM_WAITCURSOR, Mesh::fdata, ListBase::first, free_editMesh(), free_ipo(), free_key(), give_current_material(), i, Object::id, Material::id, id_us_plus(), invert_m4_m4(), Main::ipo, Main::key, Mesh::key, key_get_named_keyblock(), KEY_RELATIVE, ListBase::last, load_editMesh(), make_editMesh(), Mesh::mat, Object::mat, MFace::mat_nr, Object::matbits, MAXMAT, MEM_callocN(), MEM_dupallocN(), MEM_freeN(), MESH_MAX_VERTS, mesh_update_customdata_pointers(), mul_m4_v3(), mult_m4_m4m4(), multiresModifier_prepare_join(), KeyBlock::name, bDeformGroup::name, NC_SCENE, ND_OB_ACTIVE, bDeformGroup::next, KeyBlock::next, NULL, OB_MESH, OB_RECALC_DATA, OB_RECALC_OB, Scene::obedit, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, KeyBlock::pos, KeyBlock::prev, Key::refkey, wmOperator::reports, RPT_WARNING, STRINGIFY, test_object_materials(), Mesh::totcol, Object::totcol, Mesh::totedge, KeyBlock::totelem, Mesh::totface, LaplacianSystem::totface, Key::totkey, Mesh::totvert, LaplacianSystem::totvert, MDeformVert::totweight, Key::type, Object::type, ID::us, MEdge::v1, MFace::v1, MEdge::v2, MFace::v2, MFace::v3, MFace::v4, VECCOPY, KeyBlock::weights, and WM_event_add_notifier().

Referenced by join_exec().

int join_mesh_shapes_exec ( bContext C,
wmOperator op 
)
int* mesh_get_x_mirror_faces ( Object ob,
EditMesh em 
)
int mesh_get_x_mirror_vert ( Object ob,
int  index 
)
static int mesh_get_x_mirror_vert_spacial ( Object ob,
int  index 
) [static]

Definition at line 872 of file meshtools.c.

References MVert::co, Object::data, mesh_octree_table(), Mesh::mvert, and NULL.

Referenced by mesh_get_x_mirror_vert().

static int mesh_get_x_mirror_vert_topo ( Object ob,
int  index 
) [static]

Definition at line 886 of file meshtools.c.

References MirrTopoStore_t::index_lookup, and mesh_mirrtopo_table().

Referenced by mesh_get_x_mirror_vert().

int mesh_mirrtopo_table ( Object ob,
char  mode 
)
static void mesh_octree_add_node ( MocNode **  bt,
intptr_t  index 
) [static]

Definition at line 644 of file meshtools.c.

References MocNode::index, MEM_callocN(), MOC_NODE_RES, and NULL.

Referenced by mesh_octree_add_nodes().

static void mesh_octree_add_nodes ( MocNode **  basetable,
float *  co,
float *  offs,
float *  div,
intptr_t  index 
) [static]

Definition at line 676 of file meshtools.c.

References CLAMP(), floorf, mesh_octree_add_node(), MOC_INDEX, MOC_RES, and MOC_THRESH.

Referenced by mesh_octree_table().

static intptr_t mesh_octree_find_index ( MocNode **  bt,
MVert mvert,
float *  co 
) [static]

Definition at line 724 of file meshtools.c.

References EditVert::co, compare_v3v3(), MOC_NODE_RES, MOC_THRESH, and NULL.

Referenced by mesh_octree_table().

static void mesh_octree_free_node ( MocNode **  bt) [static]

Definition at line 664 of file meshtools.c.

References MEM_freeN().

Referenced by mesh_octree_table().

static int mesh_octree_get_base_offs ( float *  co,
float *  offs,
float *  div 
) [static]

Definition at line 629 of file meshtools.c.

References CLAMP(), and MOC_RES.

Referenced by mesh_octree_table().

intptr_t mesh_octree_table ( Object ob,
EditMesh em,
float *  co,
char  mode 
)
static int mirror_facecmp ( const void *  a,
const void *  b 
) [static]

Definition at line 1047 of file meshtools.c.

References mirror_facerotation().

Referenced by mesh_get_x_mirror_faces().

static unsigned int mirror_facehash ( const void *  ptr) [static]

Definition at line 1006 of file meshtools.c.

References MAX3(), MAX4, MIN3, MIN4, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.

Referenced by mesh_get_x_mirror_faces().

static int mirror_facerotation ( MFace a,
MFace b 
) [static]

Definition at line 1023 of file meshtools.c.

References MFace::v1, MFace::v2, MFace::v3, and MFace::v4.

Referenced by mesh_get_x_mirror_faces(), and mirror_facecmp().


Variable Documentation

float div[3]
MirrTopoStore_t mesh_topo_store = {NULL, -1. -1, -1}

Definition at line 851 of file meshtools.c.

struct { ... } MeshOctree [static]

Referenced by mesh_octree_table().

float offs[3]