Blender V2.61 - r43446
|
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_heap.h"
#include "BLI_edgehash.h"
#include "BLI_editVert.h"
#include "BLI_utildefines.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_context.h"
#include "BIF_gl.h"
#include "ED_mesh.h"
#include "ED_screen.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 | MirrTopoVert_t |
Defines | |
#define | ME_SEAM_DONE 2 |
Typedefs | |
typedef int | MirrTopoHash_t |
typedef struct MirrTopoVert_t | MirrTopoVert_t |
Functions | |
void | paintface_flush_flags (Object *ob) |
static int | facesel_face_pick (struct bContext *C, Mesh *me, const int mval[2], unsigned int *index, short rect) |
MTFace * | EM_get_active_mtface (EditMesh *em, EditFace **act_efa, MCol **mcol, int sloppy) |
void | paintface_hide (Object *ob, const int unselected) |
void | paintface_reveal (Object *ob) |
static void | hash_add_face (EdgeHash *ehash, MFace *mf) |
static void | select_linked_tfaces_with_seams (int mode, Mesh *me, unsigned int index) |
void | paintface_select_linked (bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]), int mode) |
void | paintface_deselect_all_visible (Object *ob, int action, short flush_flags) |
int | paintface_minmax (Object *ob, float *min, float *max) |
static float | edgetag_cut_cost (int e1, int e2, int vert) |
static void | edgetag_add_adjacent (Heap *heap, int mednum, int vertnum, int *nedges, int *edges, int *prevedge, float *cost) |
void | edgetag_context_set (Scene *scene, EditEdge *eed, int val) |
int | edgetag_context_check (Scene *scene, EditEdge *eed) |
int | edgetag_shortest_path (Scene *scene, EditMesh *em, EditEdge *source, EditEdge *target) |
int | paintface_mouse_select (struct bContext *C, Object *ob, const int mval[2], int extend) |
int | do_paintface_box_select (ViewContext *vc, rcti *rect, int select, int extend) |
static int | mirrtopo_hash_sort (const void *l1, const void *l2) |
static int | mirrtopo_vert_sort (const void *v1, const void *v2) |
int | ED_mesh_mirrtopo_recalc_check (Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store) |
void | ED_mesh_mirrtopo_init (Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store, const short skip_em_vert_array_init) |
void | ED_mesh_mirrtopo_free (MirrTopoStore_t *mesh_topo_store) |
Definition in file editface.c.
#define ME_SEAM_DONE 2 |
Definition at line 436 of file editface.c.
Referenced by edgetag_add_adjacent(), and edgetag_shortest_path().
typedef int MirrTopoHash_t |
Definition at line 824 of file editface.c.
typedef struct MirrTopoVert_t MirrTopoVert_t |
int do_paintface_box_select | ( | ViewContext * | vc, |
rcti * | rect, | ||
int | select, | ||
int | extend | ||
) |
Definition at line 759 of file editface.c.
References ViewContext::ar, B_ENDIAN, ENDIAN_ORDER, FALSE, MFace::flag, get_mesh(), IB_rect, IMB_allocImBuf(), IMB_convert_rgba_to_abgr(), IMB_freeImBuf(), ImBuf::index, ME_FACE_SEL, ME_HIDE, MEM_callocN(), MEM_freeN(), Mesh::mface, NULL, ViewContext::obact, OPERATOR_CANCELLED, OPERATOR_FINISHED, paintface_deselect_all_visible(), paintface_flush_flags(), ImBuf::rect, SEL_DESELECT, Mesh::totface, view3d_validate_backbuf(), ARegion::winrct, WM_framebuffer_to_index(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by view3d_borderselect_exec().
void ED_mesh_mirrtopo_free | ( | MirrTopoStore_t * | mesh_topo_store | ) |
Definition at line 1047 of file editface.c.
References MirrTopoStore_t::index_lookup, MEM_freeN(), NULL, MirrTopoStore_t::prev_edge_tot, and MirrTopoStore_t::prev_vert_tot.
Referenced by ED_mesh_mirrtopo_init(), and mesh_mirrtopo_table().
void ED_mesh_mirrtopo_init | ( | Mesh * | me, |
const int | ob_mode, | ||
MirrTopoStore_t * | mesh_topo_store, | ||
const short | skip_em_vert_array_init | ||
) |
Definition at line 872 of file editface.c.
References ED_mesh_mirrtopo_free(), EditMesh::edges, Mesh::edit_mesh, EM_free_index_arrays(), EM_get_vert_for_index(), EM_init_index_arrays(), FALSE, ListBase::first, hash, MirrTopoVert_t::hash, MirrTopoStore_t::index_lookup, EditVert::l, Mesh::medge, MEM_callocN(), MEM_dupallocN(), MEM_freeN(), MEM_mallocN(), mirrtopo_hash_sort(), mirrtopo_vert_sort(), EditEdge::next, EditVert::next, NULL, EditVert::p, MirrTopoStore_t::prev_edge_tot, MirrTopoStore_t::prev_ob_mode, MirrTopoStore_t::prev_vert_tot, EditVert::tmp, Mesh::totedge, EditMesh::totvert, Mesh::totvert, MEdge::v1, EditEdge::v1, MEdge::v2, EditEdge::v2, MirrTopoVert_t::v_index, and EditMesh::verts.
Referenced by mesh_mirrtopo_table().
int ED_mesh_mirrtopo_recalc_check | ( | Mesh * | me, |
const int | ob_mode, | ||
MirrTopoStore_t * | mesh_topo_store | ||
) |
Definition at line 845 of file editface.c.
References Mesh::edit_mesh, FALSE, MirrTopoStore_t::index_lookup, NULL, MirrTopoStore_t::prev_edge_tot, MirrTopoStore_t::prev_ob_mode, MirrTopoStore_t::prev_vert_tot, EditMesh::totedge, Mesh::totedge, EditMesh::totvert, Mesh::totvert, and TRUE.
Referenced by mesh_mirrtopo_table().
static void edgetag_add_adjacent | ( | Heap * | heap, |
int | mednum, | ||
int | vertnum, | ||
int * | nedges, | ||
int * | edges, | ||
int * | prevedge, | ||
float * | cost | ||
) | [static] |
Definition at line 457 of file editface.c.
References BLI_heap_insert(), edgetag_cut_cost(), EM_get_edge_for_index(), EditEdge::f2, ME_SEAM_DONE, and SET_INT_IN_POINTER.
Referenced by edgetag_shortest_path().
Definition at line 505 of file editface.c.
References EditEdge::bweight, EditEdge::crease, ToolSettings::edge_mode, EDGE_MODE_SELECT, EDGE_MODE_TAG_BEVEL, EDGE_MODE_TAG_CREASE, EDGE_MODE_TAG_SEAM, EDGE_MODE_TAG_SHARP, EditEdge::f, EditEdge::seam, SELECT, EditEdge::sharp, and Scene::toolsettings.
Referenced by edgetag_shortest_path(), and mouse_mesh_shortest_path().
Definition at line 479 of file editface.c.
References EditEdge::bweight, EditEdge::crease, ToolSettings::edge_mode, EDGE_MODE_SELECT, EDGE_MODE_TAG_BEVEL, EDGE_MODE_TAG_CREASE, EDGE_MODE_TAG_SEAM, EDGE_MODE_TAG_SHARP, EM_select_edge(), EditEdge::seam, EditEdge::sharp, and Scene::toolsettings.
Referenced by edgetag_shortest_path(), and mouse_mesh_shortest_path().
static float edgetag_cut_cost | ( | int | e1, |
int | e2, | ||
int | vert | ||
) | [static] |
Definition at line 438 of file editface.c.
References EditVert::co, EM_get_edge_for_index(), EM_get_vert_for_index(), fabsf, EditVert::l, len_v3v3(), sub_v3_v3v3(), EditVert::tmp, EditEdge::v1, and EditEdge::v2.
Referenced by edgetag_add_adjacent().
Definition at line 523 of file editface.c.
References BLI_heap_empty(), BLI_heap_free(), BLI_heap_insert(), BLI_heap_new(), BLI_heap_popmin(), EditMesh::edges, edgetag_add_adjacent(), edgetag_context_check(), edgetag_context_set(), EM_free_index_arrays(), EM_get_edge_for_index(), EM_init_index_arrays(), EditEdge::f2, ListBase::first, GET_INT_FROM_POINTER, EditEdge::h, EditVert::l, EditEdge::l, ME_SEAM_DONE, MEM_callocN(), MEM_freeN(), MEM_mallocN(), EditEdge::next, EditVert::next, NULL, SET_INT_IN_POINTER, EditVert::tmp, EditEdge::tmp, EditEdge::v1, EditEdge::v2, and EditMesh::verts.
Referenced by mouse_mesh_shortest_path().
MTFace* EM_get_active_mtface | ( | EditMesh * | em, |
EditFace ** | act_efa, | ||
MCol ** | mcol, | ||
int | sloppy | ||
) | [read] |
Definition at line 134 of file editface.c.
References CD_MCOL, CD_MTFACE, CustomData_em_get(), CustomData_has_layer(), EditFace::data, EM_get_actFace(), EM_texFaceCheck(), EditMesh::fdata, and NULL.
Referenced by draw_uvs(), and image_refresh().
static int facesel_face_pick | ( | struct bContext * | C, |
Mesh * | me, | ||
const int | mval[2], | ||
unsigned int * | index, | ||
short | rect | ||
) | [static] |
Definition at line 99 of file editface.c.
References NULL, Mesh::totface, view3d_sample_backbuf(), view3d_sample_backbuf_rect(), and view3d_set_viewcontext().
Referenced by paintface_mouse_select().
Definition at line 211 of file editface.c.
References BLI_edgehash_insert(), NULL, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by select_linked_tfaces_with_seams().
static int mirrtopo_hash_sort | ( | const void * | l1, |
const void * | l2 | ||
) | [static] |
Definition at line 831 of file editface.c.
Referenced by ED_mesh_mirrtopo_init().
static int mirrtopo_vert_sort | ( | const void * | v1, |
const void * | v2 | ||
) | [static] |
void paintface_deselect_all_visible | ( | Object * | ob, |
int | action, | ||
short | flush_flags | ||
) |
Definition at line 349 of file editface.c.
References MFace::flag, get_mesh(), ME_FACE_SEL, ME_HIDE, Mesh::mface, NULL, paintface_flush_flags(), SEL_DESELECT, SEL_INVERT, SEL_SELECT, SEL_TOGGLE, and Mesh::totface.
Referenced by do_lasso_select_paintface(), do_paintface_box_select(), face_select_all_exec(), and face_select_inverse_exec().
void paintface_flush_flags | ( | Object * | ob | ) |
Definition at line 70 of file editface.c.
References CD_ORIGINDEX, Object::derivedFinal, MFace::flag, get_mesh(), DerivedMesh::getFaceArray, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, i, Mesh::mface, and NULL.
Referenced by do_lasso_select_paintface(), do_paintface_box_select(), paintface_deselect_all_visible(), paintface_hide(), paintface_mouse_select(), paintface_reveal(), and paintface_select_linked().
void paintface_hide | ( | Object * | ob, |
const int | unselected | ||
) |
Definition at line 158 of file editface.c.
References MFace::flag, get_mesh(), ME_FACE_SEL, ME_HIDE, Mesh::mface, NULL, paintface_flush_flags(), and Mesh::totface.
Referenced by face_select_hide_exec().
int paintface_minmax | ( | Object * | ob, |
float * | min, | ||
float * | max | ||
) |
Definition at line 408 of file editface.c.
References DO_MINMAX, MFace::flag, get_mesh(), i, ME_FACE_SEL, ME_HIDE, Mesh::mface, mul_v3_m4v3(), Mesh::mvert, NULL, Object::obmat, Mesh::totface, MFace::v1, MFace::v4, and NurbSort::vec.
Referenced by viewselected_exec().
Definition at line 716 of file editface.c.
References Mesh::act_face, CTX_wm_region(), Object::data, ED_region_tag_redraw(), facesel_face_pick(), MFace::flag, get_mesh(), ME_FACE_SEL, ME_HIDE, Mesh::mface, NC_GEOM, ND_SELECT, paintface_flush_flags(), Mesh::totface, and WM_event_add_notifier().
Referenced by view3d_select_invoke().
void paintface_reveal | ( | Object * | ob | ) |
Definition at line 187 of file editface.c.
References MFace::flag, get_mesh(), ME_FACE_SEL, ME_HIDE, Mesh::mface, NULL, paintface_flush_flags(), and Mesh::totface.
Referenced by face_select_reveal_exec().
Definition at line 328 of file editface.c.
References get_mesh(), NULL, paintface_flush_flags(), select_linked_tfaces_with_seams(), and Mesh::totface.
static void select_linked_tfaces_with_seams | ( | int | mode, |
Mesh * | me, | ||
unsigned int | index | ||
) | [static] |
Definition at line 224 of file editface.c.
References BLI_edgehash_free(), BLI_edgehash_haskey(), BLI_edgehash_insert(), BLI_edgehash_new(), MEdge::flag, MFace::flag, hash_add_face(), ME_FACE_SEL, ME_HIDE, ME_SEAM, Mesh::medge, MEM_callocN(), MEM_freeN(), Mesh::mface, NULL, Mesh::totface, MEdge::v1, MFace::v1, MEdge::v2, MFace::v2, MFace::v3, and MFace::v4.
Referenced by paintface_select_linked().