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

view3d_select.c File Reference

#include <string.h>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <assert.h>
#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
#include "DNA_meta_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_tracking_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
#include "BLI_rand.h"
#include "BLI_linklist.h"
#include "BLI_utildefines.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "BKE_global.h"
#include "BKE_context.h"
#include "BKE_paint.h"
#include "BKE_armature.h"
#include "BKE_movieclip.h"
#include "BKE_object.h"
#include "BKE_tracking.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "ED_armature.h"
#include "ED_curve.h"
#include "ED_particle.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_mball.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "view3d_intern.h"

Go to the source code of this file.

Classes

struct  SelMenuItemF

Defines

#define MOVES_GESTURE   50
#define MOVES_LASSO   500
#define SEL_MENU_SIZE   22

Typedefs

typedef struct SelMenuItemF SelMenuItemF

Functions

void view3d_set_viewcontext (bContext *C, ViewContext *vc)
int view3d_get_view_aligned_coordinate (ViewContext *vc, float fp[3], const int mval[2], const short do_fallback)
void view3d_get_transformation (const ARegion *ar, RegionView3D *rv3d, Object *ob, bglMats *mats)
static void EM_backbuf_checkAndSelectVerts (EditMesh *em, int select)
static void EM_backbuf_checkAndSelectEdges (EditMesh *em, int select)
static void EM_backbuf_checkAndSelectFaces (EditMesh *em, int select)
static void EM_backbuf_checkAndSelectVerts_obmode (Mesh *me, int select)
static void EM_backbuf_checkAndSelectTFaces (Mesh *me, int select)
static int view3d_selectable_data (bContext *C)
static int edge_fully_inside_rect (rcti *rect, short x1, short y1, short x2, short y2)
static int edge_inside_rect (rcti *rect, short x1, short y1, short x2, short y2)
int lasso_inside (int mcords[][2], short moves, int sx, int sy)
int lasso_inside_edge (int mcords[][2], short moves, int x0, int y0, int x1, int y1)
static void do_lasso_select_pose (ViewContext *vc, Object *ob, int mcords[][2], short moves, short select)
static void object_deselect_all_visible (Scene *scene, View3D *v3d)
static void do_lasso_select_objects (ViewContext *vc, int mcords[][2], short moves, short extend, short select)
static void lasso_select_boundbox (rcti *rect, int mcords[][2], short moves)
static void do_lasso_select_mesh__doSelectVert (void *userData, EditVert *eve, int x, int y, int UNUSED(index))
static void do_lasso_select_mesh__doSelectEdge (void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index)
static void do_lasso_select_mesh__doSelectFace (void *userData, EditFace *efa, int x, int y, int UNUSED(index))
static void do_lasso_select_mesh (ViewContext *vc, int mcords[][2], short moves, short extend, short select)
static void do_lasso_select_curve__doSelect (void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
static void do_lasso_select_curve (ViewContext *vc, int mcords[][2], short moves, short extend, short select)
static void do_lasso_select_lattice__doSelect (void *userData, BPoint *bp, int x, int y)
static void do_lasso_select_lattice (ViewContext *vc, int mcords[][2], short moves, short extend, short select)
static void do_lasso_select_armature (ViewContext *vc, int mcords[][2], short moves, short extend, short select)
static void do_lasso_select_meta (ViewContext *vc, int mcords[][2], short moves, short extend, short select)
int do_paintvert_box_select (ViewContext *vc, rcti *rect, int select, int extend)
static void do_lasso_select_paintvert (ViewContext *vc, int mcords[][2], short moves, short extend, short select)
static void do_lasso_select_paintface (ViewContext *vc, int mcords[][2], short moves, short extend, short select)
static void view3d_lasso_select (bContext *C, ViewContext *vc, int mcords[][2], short moves, short extend, short select)
static int view3d_lasso_select_exec (bContext *C, wmOperator *op)
void VIEW3D_OT_select_lasso (wmOperatorType *ot)
static EnumPropertyItemobject_select_menu_enum_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
static int object_select_menu_exec (bContext *C, wmOperator *op)
void VIEW3D_OT_select_menu (wmOperatorType *ot)
static void deselectall_except (Scene *scene, Base *b)
static Baseobject_mouse_select_menu (bContext *C, ViewContext *vc, unsigned int *buffer, int hits, const int mval[2], short extend)
static short mixed_bones_object_selectbuffer (ViewContext *vc, unsigned int *buffer, const int mval[2])
static Basemouse_select_eval_buffer (ViewContext *vc, unsigned int *buffer, int hits, const int mval[2], Base *startbase, int has_bones)
BaseED_view3d_give_base_under_cursor (bContext *C, const int mval[2])
static void deselect_all_tracks (MovieTracking *tracking)
static int mouse_select (bContext *C, const int mval[2], short extend, short obcenter, short enumerate)
int edge_inside_circle (short centx, short centy, short rad, short x1, short y1, short x2, short y2)
static void do_nurbs_box_select__doSelect (void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
static int do_nurbs_box_select (ViewContext *vc, rcti *rect, int select, int extend)
static void do_lattice_box_select__doSelect (void *userData, BPoint *bp, int x, int y)
static int do_lattice_box_select (ViewContext *vc, rcti *rect, int select, int extend)
static void do_mesh_box_select__doSelectVert (void *userData, EditVert *eve, int x, int y, int UNUSED(index))
static void do_mesh_box_select__doSelectEdge (void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index)
static void do_mesh_box_select__doSelectFace (void *userData, EditFace *efa, int x, int y, int UNUSED(index))
static int do_mesh_box_select (ViewContext *vc, rcti *rect, int select, int extend)
static int do_meta_box_select (ViewContext *vc, rcti *rect, int select, int extend)
static int do_armature_box_select (ViewContext *vc, rcti *rect, short select, short extend)
static int do_object_pose_box_select (bContext *C, ViewContext *vc, rcti *rect, int select, int extend)
static int view3d_borderselect_exec (bContext *C, wmOperator *op)
void VIEW3D_OT_select_border (wmOperatorType *ot)
static int vertsel_vert_pick (struct bContext *C, Mesh *me, const int mval[2], unsigned int *index, int size)
static int mouse_weight_paint_vertex_select (bContext *C, const int mval[2], short extend, Object *obact)
static int view3d_select_invoke (bContext *C, wmOperator *op, wmEvent *event)
void VIEW3D_OT_select (wmOperatorType *ot)
static void mesh_circle_doSelectVert (void *userData, EditVert *eve, int x, int y, int UNUSED(index))
static void mesh_circle_doSelectEdge (void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int UNUSED(index))
static void mesh_circle_doSelectFace (void *userData, EditFace *efa, int x, int y, int UNUSED(index))
static void mesh_circle_select (ViewContext *vc, int select, const int mval[2], float rad)
static void paint_facesel_circle_select (ViewContext *vc, int select, const int mval[2], float rad)
static void paint_vertsel_circle_select (ViewContext *vc, int select, const int mval[2], float rad)
static void nurbscurve_circle_doSelect (void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
static void nurbscurve_circle_select (ViewContext *vc, int select, const int mval[2], float rad)
static void latticecurve_circle_doSelect (void *userData, BPoint *bp, int x, int y)
static void lattice_circle_select (ViewContext *vc, int select, const int mval[2], float rad)
static short pchan_circle_doSelectJoint (void *userData, bPoseChannel *pchan, int x, int y)
static void pose_circle_select (ViewContext *vc, int select, const int mval[2], float rad)
static short armature_circle_doSelectJoint (void *userData, EditBone *ebone, int x, int y, short head)
static void armature_circle_select (ViewContext *vc, int select, const int mval[2], float rad)
static void obedit_circle_select (ViewContext *vc, short select, const int mval[2], float rad)
static int view3d_circle_select_exec (bContext *C, wmOperator *op)
void VIEW3D_OT_select_circle (wmOperatorType *ot)

Variables

static SelMenuItemF object_mouse_select_menu_data [SEL_MENU_SIZE]

Detailed Description

Definition in file view3d_select.c.


Define Documentation

#define MOVES_GESTURE   50

Definition at line 302 of file view3d_select.c.

#define MOVES_LASSO   500

Definition at line 303 of file view3d_select.c.

#define SEL_MENU_SIZE   22

Definition at line 1054 of file view3d_select.c.

Referenced by object_mouse_select_menu(), and object_select_menu_enum_itemf().


Typedef Documentation

typedef struct SelMenuItemF SelMenuItemF

Function Documentation

static short armature_circle_doSelectJoint ( void *  userData,
EditBone ebone,
int  x,
int  y,
short  head 
) [static]

Definition at line 2495 of file view3d_select.c.

References BONE_ROOTSEL, BONE_TIPSEL, data, EditBone::flag, and sqrt().

Referenced by armature_circle_select().

static void armature_circle_select ( ViewContext vc,
int  select,
const int  mval[2],
float  rad 
) [static]
static void deselect_all_tracks ( MovieTracking tracking) [static]
static void deselectall_except ( Scene scene,
Base b 
) [static]

Definition at line 1148 of file view3d_select.c.

References BA_DESELECT, ED_base_object_select(), FIRSTBASE, Base::flag, Base::next, and SELECT.

Referenced by mouse_select().

static int do_armature_box_select ( ViewContext vc,
rcti rect,
short  select,
short  extend 
) [static]
static void do_lasso_select_armature ( ViewContext vc,
int  mcords[][2],
short  moves,
short  extend,
short  select 
) [static]
static void do_lasso_select_curve ( ViewContext vc,
int  mcords[][2],
short  moves,
short  extend,
short  select 
) [static]
static void do_lasso_select_curve__doSelect ( void *  userData,
Nurb UNUSEDnu,
BPoint bp,
BezTriple bezt,
int  beztindex,
int  x,
int  y 
) [static]
static void do_lasso_select_lattice ( ViewContext vc,
int  mcords[][2],
short  moves,
short  extend,
short  select 
) [static]
static void do_lasso_select_lattice__doSelect ( void *  userData,
BPoint bp,
int  x,
int  y 
) [static]

Definition at line 655 of file view3d_select.c.

References data, BPoint::f1, lasso_inside(), and SELECT.

Referenced by do_lasso_select_lattice().

static void do_lasso_select_mesh ( ViewContext vc,
int  mcords[][2],
short  moves,
short  extend,
short  select 
) [static]
static void do_lasso_select_mesh__doSelectEdge ( void *  userData,
EditEdge eed,
int  x0,
int  y0,
int  x1,
int  y1,
int  index 
) [static]
static void do_lasso_select_mesh__doSelectFace ( void *  userData,
EditFace efa,
int  x,
int  y,
int   UNUSEDindex 
) [static]

Definition at line 482 of file view3d_select.c.

References BLI_in_rcti(), data, EM_select_face_fgon(), and lasso_inside().

Referenced by do_lasso_select_mesh().

static void do_lasso_select_mesh__doSelectVert ( void *  userData,
EditVert eve,
int  x,
int  y,
int   UNUSEDindex 
) [static]

Definition at line 455 of file view3d_select.c.

References BLI_in_rcti(), data, EditVert::f, and lasso_inside().

Referenced by do_lasso_select_mesh().

static void do_lasso_select_meta ( ViewContext vc,
int  mcords[][2],
short  moves,
short  extend,
short  select 
) [static]
static void do_lasso_select_objects ( ViewContext vc,
int  mcords[][2],
short  moves,
short  extend,
short  select 
) [static]
static void do_lasso_select_paintface ( ViewContext vc,
int  mcords[][2],
short  moves,
short  extend,
short  select 
) [static]
static void do_lasso_select_paintvert ( ViewContext vc,
int  mcords[][2],
short  moves,
short  extend,
short  select 
) [static]
static void do_lasso_select_pose ( ViewContext vc,
Object ob,
int  mcords[][2],
short  moves,
short  select 
) [static]
static int do_lattice_box_select ( ViewContext vc,
rcti rect,
int  select,
int  extend 
) [static]
static void do_lattice_box_select__doSelect ( void *  userData,
BPoint bp,
int  x,
int  y 
) [static]

Definition at line 1693 of file view3d_select.c.

References BLI_in_rcti(), data, BPoint::f1, and SELECT.

Referenced by do_lattice_box_select().

static int do_mesh_box_select ( ViewContext vc,
rcti rect,
int  select,
int  extend 
) [static]
static void do_mesh_box_select__doSelectEdge ( void *  userData,
EditEdge eed,
int  x0,
int  y0,
int  x1,
int  y1,
int  index 
) [static]
static void do_mesh_box_select__doSelectFace ( void *  userData,
EditFace efa,
int  x,
int  y,
int   UNUSEDindex 
) [static]

Definition at line 1743 of file view3d_select.c.

References BLI_in_rcti(), data, and EM_select_face_fgon().

Referenced by do_mesh_box_select().

static void do_mesh_box_select__doSelectVert ( void *  userData,
EditVert eve,
int  x,
int  y,
int   UNUSEDindex 
) [static]

Definition at line 1718 of file view3d_select.c.

References BLI_in_rcti(), data, and EditVert::f.

Referenced by do_mesh_box_select().

static int do_meta_box_select ( ViewContext vc,
rcti rect,
int  select,
int  extend 
) [static]
static int do_nurbs_box_select ( ViewContext vc,
rcti rect,
int  select,
int  extend 
) [static]
static void do_nurbs_box_select__doSelect ( void *  userData,
Nurb UNUSEDnu,
BPoint bp,
BezTriple bezt,
int  beztindex,
int  x,
int  y 
) [static]
static int do_object_pose_box_select ( bContext C,
ViewContext vc,
rcti rect,
int  select,
int  extend 
) [static]
int do_paintvert_box_select ( ViewContext vc,
rcti rect,
int  select,
int  extend 
)
Base* ED_view3d_give_base_under_cursor ( bContext C,
const int  mval[2] 
)
static int edge_fully_inside_rect ( rcti rect,
short  x1,
short  y1,
short  x2,
short  y2 
) [static]
int edge_inside_circle ( short  centx,
short  centy,
short  rad,
short  x1,
short  y1,
short  x2,
short  y2 
)
static int edge_inside_rect ( rcti rect,
short  x1,
short  y1,
short  x2,
short  y2 
) [static]
static void EM_backbuf_checkAndSelectEdges ( EditMesh em,
int  select 
) [static]
static void EM_backbuf_checkAndSelectFaces ( EditMesh em,
int  select 
) [static]
static void EM_backbuf_checkAndSelectTFaces ( Mesh me,
int  select 
) [static]
static void EM_backbuf_checkAndSelectVerts ( EditMesh em,
int  select 
) [static]
static void EM_backbuf_checkAndSelectVerts_obmode ( Mesh me,
int  select 
) [static]
int lasso_inside ( int  mcords[][2],
short  moves,
int  sx,
int  sy 
)
int lasso_inside_edge ( int  mcords[][2],
short  moves,
int  x0,
int  y0,
int  x1,
int  y1 
)
static void lasso_select_boundbox ( rcti rect,
int  mcords[][2],
short  moves 
) [static]
static void lattice_circle_select ( ViewContext vc,
int  select,
const int  mval[2],
float  rad 
) [static]
static void latticecurve_circle_doSelect ( void *  userData,
BPoint bp,
int  x,
int  y 
) [static]

Definition at line 2408 of file view3d_select.c.

References data, BPoint::f1, SELECT, and sqrt().

Referenced by lattice_circle_select().

static void mesh_circle_doSelectEdge ( void *  userData,
EditEdge eed,
int  x0,
int  y0,
int  x1,
int  y1,
int   UNUSEDindex 
) [static]

Definition at line 2262 of file view3d_select.c.

References data, edge_inside_circle(), and EM_select_edge().

Referenced by mesh_circle_select().

static void mesh_circle_doSelectFace ( void *  userData,
EditFace efa,
int  x,
int  y,
int   UNUSEDindex 
) [static]

Definition at line 2270 of file view3d_select.c.

References data, EM_select_face_fgon(), and sqrt().

Referenced by mesh_circle_select().

static void mesh_circle_doSelectVert ( void *  userData,
EditVert eve,
int  x,
int  y,
int   UNUSEDindex 
) [static]

Definition at line 2252 of file view3d_select.c.

References data, EditVert::f, and sqrt().

Referenced by mesh_circle_select().

static void mesh_circle_select ( ViewContext vc,
int  select,
const int  mval[2],
float  rad 
) [static]
static short mixed_bones_object_selectbuffer ( ViewContext vc,
unsigned int *  buffer,
const int  mval[2] 
) [static]
static int mouse_select ( bContext C,
const int  mval[2],
short  extend,
short  obcenter,
short  enumerate 
) [static]
static Base* mouse_select_eval_buffer ( ViewContext vc,
unsigned int *  buffer,
int  hits,
const int  mval[2],
Base startbase,
int  has_bones 
) [static]
static int mouse_weight_paint_vertex_select ( bContext C,
const int  mval[2],
short  extend,
Object obact 
) [static]
static void nurbscurve_circle_doSelect ( void *  userData,
Nurb UNUSEDnu,
BPoint bp,
BezTriple bezt,
int  beztindex,
int  x,
int  y 
) [static]
static void nurbscurve_circle_select ( ViewContext vc,
int  select,
const int  mval[2],
float  rad 
) [static]
static void obedit_circle_select ( ViewContext vc,
short  select,
const int  mval[2],
float  rad 
) [static]
static void object_deselect_all_visible ( Scene scene,
View3D v3d 
) [static]
static Base* object_mouse_select_menu ( bContext C,
ViewContext vc,
unsigned int *  buffer,
int  hits,
const int  mval[2],
short  extend 
) [static]
static EnumPropertyItem* object_select_menu_enum_itemf ( bContext C,
PointerRNA UNUSEDptr,
PropertyRNA UNUSEDprop,
int *  free 
) [static]
static int object_select_menu_exec ( bContext C,
wmOperator op 
) [static]
static void paint_facesel_circle_select ( ViewContext vc,
int  select,
const int  mval[2],
float  rad 
) [static]
static void paint_vertsel_circle_select ( ViewContext vc,
int  select,
const int  mval[2],
float  rad 
) [static]
static short pchan_circle_doSelectJoint ( void *  userData,
bPoseChannel pchan,
int  x,
int  y 
) [static]

Definition at line 2435 of file view3d_select.c.

References bPoseChannel::bone, BONE_SELECTED, data, Bone::flag, and sqrt().

Referenced by pose_circle_select().

static void pose_circle_select ( ViewContext vc,
int  select,
const int  mval[2],
float  rad 
) [static]
static int vertsel_vert_pick ( struct bContext C,
Mesh me,
const int  mval[2],
unsigned int *  index,
int  size 
) [static]
static int view3d_borderselect_exec ( bContext C,
wmOperator op 
) [static]
static int view3d_circle_select_exec ( bContext C,
wmOperator op 
) [static]
void view3d_get_transformation ( const ARegion ar,
RegionView3D rv3d,
Object ob,
bglMats mats 
)
int view3d_get_view_aligned_coordinate ( ViewContext vc,
float  fp[3],
const int  mval[2],
const short  do_fallback 
)
static void view3d_lasso_select ( bContext C,
ViewContext vc,
int  mcords[][2],
short  moves,
short  extend,
short  select 
) [static]
static int view3d_lasso_select_exec ( bContext C,
wmOperator op 
) [static]
void VIEW3D_OT_select ( wmOperatorType ot)
void VIEW3D_OT_select_border ( wmOperatorType ot)
void VIEW3D_OT_select_circle ( wmOperatorType ot)
void VIEW3D_OT_select_lasso ( wmOperatorType ot)
void VIEW3D_OT_select_menu ( wmOperatorType ot)
static int view3d_select_invoke ( bContext C,
wmOperator op,
wmEvent event 
) [static]
static int view3d_selectable_data ( bContext C) [static]
void view3d_set_viewcontext ( bContext C,
ViewContext vc 
)

Variable Documentation

Definition at line 1055 of file view3d_select.c.