Blender V2.61 - r43446
|
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_curve_types.h"
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "RNA_access.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_mesh.h"
#include "ED_lattice.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "ED_util.h"
#include "WM_api.h"
#include "WM_types.h"
#include "object_intern.h"
Go to the source code of this file.
Classes | |
struct | UndoLattice |
Typedefs | |
typedef struct UndoLattice | UndoLattice |
Functions | |
void | free_editLatt (Object *ob) |
void | make_editLatt (Object *obedit) |
void | load_editLatt (Object *obedit) |
void | ED_setflagsLatt (Object *obedit, int flag) |
static int | lattice_select_all_exec (bContext *C, wmOperator *op) |
void | LATTICE_OT_select_all (wmOperatorType *ot) |
static int | make_regular_poll (bContext *C) |
static int | make_regular_exec (bContext *C, wmOperator *UNUSED(op)) |
void | LATTICE_OT_make_regular (wmOperatorType *ot) |
static void | findnearestLattvert__doClosest (void *userData, BPoint *bp, int x, int y) |
static BPoint * | findnearestLattvert (ViewContext *vc, const int mval[2], int sel) |
int | mouse_lattice (bContext *C, const int mval[2], int extend) |
static void | undoLatt_to_editLatt (void *data, void *edata) |
static void * | editLatt_to_undoLatt (void *edata) |
static void | free_undoLatt (void *data) |
static int | validate_undoLatt (void *data, void *edata) |
static void * | get_editlatt (bContext *C) |
void | undo_push_lattice (bContext *C, const char *name) |
Definition in file object_lattice.c.
typedef struct UndoLattice UndoLattice |
void ED_setflagsLatt | ( | Object * | obedit, |
int | flag | ||
) |
Definition at line 172 of file object_lattice.c.
References Object::data, Lattice::def, Lattice::editlatt, BPoint::f1, BPoint::hide, EditLatt::latt, Lattice::pntsu, Lattice::pntsv, and Lattice::pntsw.
Referenced by do_lasso_select_lattice(), do_lattice_box_select(), lattice_select_all_exec(), and mouse_lattice().
static void* editLatt_to_undoLatt | ( | void * | edata | ) | [static] |
Definition at line 378 of file object_lattice.c.
References Lattice::def, UndoLattice::def, EditLatt::latt, MEM_callocN(), MEM_dupallocN(), UndoLattice::pntsu, Lattice::pntsu, UndoLattice::pntsv, Lattice::pntsv, UndoLattice::pntsw, and Lattice::pntsw.
Referenced by undo_push_lattice().
static BPoint* findnearestLattvert | ( | ViewContext * | vc, |
const int | mval[2], | ||
int | sel | ||
) | [static] |
Definition at line 320 of file object_lattice.c.
References data, ED_view3d_init_mats_rv3d(), findnearestLattvert__doClosest(), lattice_foreachScreenVert(), NULL, ViewContext::obedit, and ViewContext::rv3d.
Referenced by mouse_lattice().
static void findnearestLattvert__doClosest | ( | void * | userData, |
BPoint * | bp, | ||
int | x, | ||
int | y | ||
) | [static] |
Definition at line 305 of file object_lattice.c.
References abs(), data, BPoint::f1, and SELECT.
Referenced by findnearestLattvert().
void free_editLatt | ( | Object * | ob | ) |
Definition at line 69 of file object_lattice.c.
References Object::data, Lattice::def, Lattice::dvert, Lattice::editlatt, free_dverts(), EditLatt::latt, MEM_freeN(), NULL, Lattice::pntsu, Lattice::pntsv, and Lattice::pntsw.
Referenced by ED_object_exit_editmode(), and make_editLatt().
static void free_undoLatt | ( | void * | data | ) | [static] |
Definition at line 391 of file object_lattice.c.
References UndoLattice::def, and MEM_freeN().
Referenced by undo_push_lattice().
static void* get_editlatt | ( | bContext * | C | ) | [static] |
Definition at line 409 of file object_lattice.c.
References CTX_data_edit_object(), Object::data, Lattice::editlatt, NULL, OB_LATTICE, and Object::type.
Referenced by undo_push_lattice().
void LATTICE_OT_make_regular | ( | wmOperatorType * | ot | ) |
Definition at line 288 of file object_lattice.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, make_regular_exec(), make_regular_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, and wmOperatorType::poll.
Referenced by ED_operatortypes_object().
void LATTICE_OT_select_all | ( | wmOperatorType * | ot | ) |
Definition at line 240 of file object_lattice.c.
References wmOperatorType::description, ED_operator_editlattice(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, lattice_select_all_exec(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and WM_operator_properties_select_all().
Referenced by ED_operatortypes_object().
static int lattice_select_all_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 190 of file object_lattice.c.
References CTX_data_edit_object(), Object::data, Lattice::def, ED_setflagsLatt(), Lattice::editlatt, BPoint::f1, BPoint::hide, EditLatt::latt, NC_GEOM, ND_SELECT, OPERATOR_FINISHED, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, wmOperator::ptr, RNA_enum_get(), SEL_DESELECT, SEL_INVERT, SEL_SELECT, SEL_TOGGLE, and WM_event_add_notifier().
Referenced by LATTICE_OT_select_all().
void load_editLatt | ( | Object * | obedit | ) |
Definition at line 112 of file object_lattice.c.
References BLI_findlink(), Key::block, copy_dverts(), copy_v3_v3(), KeyBlock::data, Object::data, Lattice::def, Lattice::dvert, Lattice::editlatt, Key::elemsize, Lattice::flag, free_dverts(), Lattice::key, EditLatt::latt, MEM_callocN(), MEM_dupallocN(), MEM_freeN(), MEM_mallocN(), NULL, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, EditLatt::shapenr, KeyBlock::totelem, Lattice::typeu, Lattice::typev, Lattice::typew, and BPoint::vec.
Referenced by ED_object_exit_editmode().
void make_editLatt | ( | Object * | obedit | ) |
Definition at line 88 of file object_lattice.c.
References copy_dverts(), Object::data, Lattice::def, Lattice::dvert, Lattice::editlatt, free_editLatt(), Lattice::key, key_to_latt(), EditLatt::latt, MEM_callocN(), MEM_dupallocN(), MEM_mallocN(), ob_get_keyblock(), Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Object::shapenr, and EditLatt::shapenr.
Referenced by ED_object_enter_editmode().
static int make_regular_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 267 of file object_lattice.c.
References CTX_data_active_object(), CTX_data_edit_object(), DAG_id_tag_update(), Object::data, Lattice::editlatt, Object::id, EditLatt::latt, NC_GEOM, ND_DATA, NULL, OB_RECALC_DATA, OPERATOR_FINISHED, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, resizelattice(), and WM_event_add_notifier().
Referenced by LATTICE_OT_make_regular().
static int make_regular_poll | ( | bContext * | C | ) | [static] |
Definition at line 257 of file object_lattice.c.
References CTX_data_active_object(), ED_operator_editlattice(), OB_LATTICE, and Object::type.
Referenced by LATTICE_OT_make_regular().
int mouse_lattice | ( | bContext * | C, |
const int | mval[2], | ||
int | extend | ||
) |
Definition at line 338 of file object_lattice.c.
References Object::data, ED_setflagsLatt(), BPoint::f1, findnearestLattvert(), NC_GEOM, ND_SELECT, NULL, ViewContext::obedit, SELECT, view3d_set_viewcontext(), and WM_event_add_notifier().
Referenced by view3d_select_invoke().
void undo_push_lattice | ( | bContext * | C, |
const char * | name | ||
) |
Definition at line 422 of file object_lattice.c.
References editLatt_to_undoLatt(), free_undoLatt(), get_editlatt(), undo_editmode_push(), undoLatt_to_editLatt(), and validate_undoLatt().
Referenced by ED_undo_push().
static void undoLatt_to_editLatt | ( | void * | data, |
void * | edata | ||
) | [static] |
Definition at line 369 of file object_lattice.c.
References Lattice::def, UndoLattice::def, EditLatt::latt, Lattice::pntsu, Lattice::pntsv, and Lattice::pntsw.
Referenced by undo_push_lattice().
static int validate_undoLatt | ( | void * | data, |
void * | edata | ||
) | [static] |
Definition at line 399 of file object_lattice.c.
References EditLatt::latt, UndoLattice::pntsu, Lattice::pntsu, UndoLattice::pntsv, Lattice::pntsv, UndoLattice::pntsw, and Lattice::pntsw.
Referenced by undo_push_lattice().