Blender V2.61 - r43446
|
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "MEM_guardedalloc.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_editVert.h"
#include "BLI_ghash.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_mesh.h"
#include "BKE_array_mallocn.h"
#include "PIL_time.h"
#include "BIF_gl.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_mesh.h"
#include "ED_view3d.h"
#include "mesh_intern.h"
Go to the source code of this file.
Classes | |
struct | CutCurve |
Defines | |
#define | TRAIL_POLYLINE 1 |
#define | TRAIL_FREEHAND 2 |
#define | TRAIL_MIXED 3 |
#define | TRAIL_AUTO 4 |
#define | TRAIL_MIDPOINTS 8 |
#define | KNIFE_EXACT 1 |
#define | KNIFE_MIDPOINT 2 |
#define | KNIFE_MULTICUT 3 |
#define | MAXSLOPE 100000 |
#define | MAX_CUTS 256 |
#define | MAX_CUT_EDGES 1024 |
Typedefs | |
typedef struct CutCurve | CutCurve |
Functions | |
static void | error (const char *UNUSED(arg)) |
static float | seg_intersect (EditEdge *e, CutCurve *c, int len, char mode, struct GHash *gh) |
static int | knife_cut_exec (bContext *C, wmOperator *op) |
void | MESH_OT_knife_cut (wmOperatorType *ot) |
Variables | |
static EnumPropertyItem | knife_items [] |
Definition in file editmesh_loop.c.
#define KNIFE_EXACT 1 |
Definition at line 443 of file editmesh_loop.c.
Referenced by MESH_OT_knife_cut().
#define KNIFE_MIDPOINT 2 |
Definition at line 444 of file editmesh_loop.c.
Referenced by knife_cut_exec().
#define KNIFE_MULTICUT 3 |
Definition at line 445 of file editmesh_loop.c.
Referenced by knife_cut_exec(), and seg_intersect().
#define MAX_CUT_EDGES 1024 |
Definition at line 613 of file editmesh_loop.c.
Referenced by knife_cut_exec().
#define MAX_CUTS 256 |
Definition at line 610 of file editmesh_loop.c.
Referenced by MESH_OT_knife_cut().
#define MAXSLOPE 100000 |
Referenced by seg_intersect().
#define TRAIL_AUTO 4 |
Definition at line 415 of file editmesh_loop.c.
#define TRAIL_FREEHAND 2 |
Definition at line 413 of file editmesh_loop.c.
#define TRAIL_MIDPOINTS 8 |
Definition at line 416 of file editmesh_loop.c.
#define TRAIL_MIXED 3 |
Definition at line 414 of file editmesh_loop.c.
#define TRAIL_POLYLINE 1 |
Definition at line 412 of file editmesh_loop.c.
static void error | ( | const char * | UNUSEDarg | ) | [static] |
Definition at line 77 of file editmesh_loop.c.
Referenced by knife_cut_exec().
static int knife_cut_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 615 of file editmesh_loop.c.
References B_KNIFE, B_PERCENTSUBD, BKE_mesh_end_editmesh(), BKE_mesh_get_editmesh(), BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), EditVert::co, CTX_data_edit_object(), CTX_wm_region(), DAG_id_tag_update(), Object::data, EditMesh::edges, ELEM3, EM_nvertices_selected(), error(), esubdivideflag(), EditVert::f, EditVert::f1, EditEdge::f1, EditEdge::f2, ListBase::first, EditEdge::fp, KNIFE_MIDPOINT, KNIFE_MULTICUT, len(), MAX_CUT_EDGES, MEM_freeN(), MEM_mallocN(), mul_m4_v4(), NC_GEOM, ND_DATA, EditEdge::next, EditVert::next, NULL, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, project_float(), wmOperator::ptr, ARegion::regiondata, RNA_BEGIN, RNA_END, RNA_enum_get(), RNA_float_get_array(), RNA_int_get(), seg_intersect(), SELECT, SUBDIV_CORNER_INNERVERT, SUBDIV_SELECT_INNER, EditEdge::tmp, EditEdge::v1, EditEdge::v2, VECCOPY, EditMesh::verts, and WM_event_add_notifier().
Referenced by MESH_OT_knife_cut().
void MESH_OT_knife_cut | ( | wmOperatorType * | ot | ) |
Definition at line 709 of file editmesh_loop.c.
References BC_KNIFECURSOR, wmOperatorType::cancel, wmOperatorType::description, EM_view3d_poll(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, knife_cut_exec(), KNIFE_EXACT, MAX_CUTS, wmOperatorType::modal, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, PROP_COLLECTION, PROP_NONE, RNA_def_enum(), RNA_def_int(), RNA_def_property(), RNA_def_property_struct_runtime(), RNA_OperatorMousePath, wmOperatorType::srna, WM_gesture_lines_cancel(), WM_gesture_lines_invoke(), and WM_gesture_lines_modal().
Referenced by ED_operatortypes_mesh().
static float seg_intersect | ( | EditEdge * | e, |
CutCurve * | c, | ||
int | len, | ||
char | mode, | ||
struct GHash * | gh | ||
) | [static] |
Definition at line 456 of file editmesh_loop.c.
References BLI_ghash_lookup(), EditVert::f1, i, KNIFE_MULTICUT, len(), MAX2, MAXSLOPE, MIN2, EditEdge::v1, EditEdge::v2, CutCurve::x, and CutCurve::y.
Referenced by knife_cut_exec().
EnumPropertyItem knife_items[] [static] |
{ {KNIFE_EXACT, "EXACT", 0, "Exact", ""}, {KNIFE_MIDPOINT, "MIDPOINTS", 0, "Midpoints", ""}, {KNIFE_MULTICUT, "MULTICUT", 0, "Multicut", ""}, {0, NULL, 0, NULL, NULL} }
Definition at line 447 of file editmesh_loop.c.