Blender  V3.3
editcurve_select.c File Reference
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_bitmap.h"
#include "BLI_heap_simple.h"
#include "BLI_kdtree.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_fcurve.h"
#include "BKE_layer.h"
#include "BKE_report.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_curve.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "ED_types.h"
#include "ED_view3d.h"
#include "curve_intern.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "DEG_depsgraph.h"

Go to the source code of this file.

Functions

Utilities
bool select_beztriple (BezTriple *bezt, bool selstatus, uint8_t flag, eVisible_Types hidden)
 
bool select_bpoint (BPoint *bp, bool selstatus, uint8_t flag, bool hidden)
 
static bool swap_selection_beztriple (BezTriple *bezt)
 
static bool swap_selection_bpoint (BPoint *bp)
 
bool ED_curve_nurb_select_check (const View3D *v3d, const Nurb *nu)
 
int ED_curve_nurb_select_count (const View3D *v3d, const Nurb *nu)
 
bool ED_curve_nurb_select_all (const Nurb *nu)
 
bool ED_curve_select_all (EditNurb *editnurb)
 
bool ED_curve_nurb_deselect_all (const Nurb *nu)
 
int ED_curve_select_count (const View3D *v3d, const EditNurb *editnurb)
 
bool ED_curve_select_check (const View3D *v3d, const EditNurb *editnurb)
 
bool ED_curve_deselect_all (EditNurb *editnurb)
 
bool ED_curve_deselect_all_multi_ex (Base **bases, int bases_len)
 
bool ED_curve_deselect_all_multi (struct bContext *C)
 
bool ED_curve_select_swap (EditNurb *editnurb, bool hide_handles)
 
static void select_adjacent_cp (ListBase *editnurb, short next, const bool cont, const bool selstatus)
 
Select Start/End Operators
static void selectend_nurb (Object *obedit, eEndPoint_Types selfirst, bool doswap, bool selstatus)
 
static int de_select_first_exec (bContext *C, wmOperator *UNUSED(op))
 
void CURVE_OT_de_select_first (wmOperatorType *ot)
 
static int de_select_last_exec (bContext *C, wmOperator *UNUSED(op))
 
void CURVE_OT_de_select_last (wmOperatorType *ot)
 
Select All Operator
static int de_select_all_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_select_all (wmOperatorType *ot)
 
Select Linked Operator
static int select_linked_exec (bContext *C, wmOperator *UNUSED(op))
 
static int select_linked_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void CURVE_OT_select_linked (wmOperatorType *ot)
 
Select Linked Pick Operator
static int select_linked_pick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void CURVE_OT_select_linked_pick (wmOperatorType *ot)
 
Select Row Operator
static int select_row_exec (bContext *C, wmOperator *UNUSED(op))
 
void CURVE_OT_select_row (wmOperatorType *ot)
 
Select Next Operator
static int select_next_exec (bContext *C, wmOperator *UNUSED(op))
 
void CURVE_OT_select_next (wmOperatorType *ot)
 
Select Previous Operator
static int select_previous_exec (bContext *C, wmOperator *UNUSED(op))
 
void CURVE_OT_select_previous (wmOperatorType *ot)
 
Select More Operator
static void curve_select_more (Object *obedit)
 
static int curve_select_more_exec (bContext *C, wmOperator *UNUSED(op))
 
void CURVE_OT_select_more (wmOperatorType *ot)
 
Select Less Operator
static void curve_select_less (Object *obedit)
 
static int curve_select_less_exec (bContext *C, wmOperator *UNUSED(op))
 
void CURVE_OT_select_less (wmOperatorType *ot)
 
Select Random Operator
static int curve_select_random_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_select_random (wmOperatorType *ot)
 
Select Every Nth Number of Point Operator
static void select_nth_bezt (Nurb *nu, BezTriple *bezt, const struct CheckerIntervalParams *params)
 
static void select_nth_bp (Nurb *nu, BPoint *bp, const struct CheckerIntervalParams *params)
 
static bool ed_curve_select_nth (Curve *cu, const struct CheckerIntervalParams *params)
 
static int select_nth_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_select_nth (wmOperatorType *ot)
 
Select Shortest Path Operator
static float curve_calc_dist_pair (const Nurb *nu, int a, int b)
 
static float curve_calc_dist_span (Nurb *nu, int vert_src, int vert_dst)
 
static void curve_select_shortest_path_curve (Nurb *nu, int vert_src, int vert_dst)
 
static void curve_select_shortest_path_surf (Nurb *nu, int vert_src, int vert_dst)
 
static int edcu_shortest_path_pick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void CURVE_OT_shortest_path_pick (wmOperatorType *ot)
 

Select Similar Operator

enum  { SIMCURHAND_TYPE = 0 , SIMCURHAND_RADIUS , SIMCURHAND_WEIGHT , SIMCURHAND_DIRECTION }
 
static const EnumPropertyItem curve_prop_similar_compare_types []
 
static const EnumPropertyItem curve_prop_similar_types []
 
static void nurb_bezt_direction_worldspace_get (Object *ob, Nurb *nu, BezTriple *bezt, float r_dir[3])
 
static void nurb_bpoint_direction_worldspace_get (Object *ob, Nurb *nu, BPoint *bp, float r_dir[3])
 
static void curve_nurb_selected_type_get (Object *ob, Nurb *nu, const int type, KDTree_1d *tree_1d, KDTree_3d *tree_3d)
 
static bool curve_nurb_select_similar_type (Object *ob, Nurb *nu, const int type, const KDTree_1d *tree_1d, const KDTree_3d *tree_3d, const float thresh, const int compare)
 
static int curve_select_similar_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_select_similar (wmOperatorType *ot)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SIMCURHAND_TYPE 
SIMCURHAND_RADIUS 
SIMCURHAND_WEIGHT 
SIMCURHAND_DIRECTION 

Definition at line 1490 of file editcurve_select.c.

Function Documentation

◆ curve_calc_dist_pair()

static float curve_calc_dist_pair ( const Nurb nu,
int  a,
int  b 
)
static

◆ curve_calc_dist_span()

static float curve_calc_dist_span ( Nurb nu,
int  vert_src,
int  vert_dst 
)
static

◆ curve_nurb_select_similar_type()

static bool curve_nurb_select_similar_type ( Object ob,
Nurb nu,
const int  type,
const KDTree_1d *  tree_1d,
const KDTree_3d *  tree_3d,
const float  thresh,
const int  compare 
)
static

◆ curve_nurb_selected_type_get()

static void curve_nurb_selected_type_get ( Object ob,
Nurb nu,
const int  type,
KDTree_1d *  tree_1d,
KDTree_3d *  tree_3d 
)
static

◆ CURVE_OT_de_select_first()

void CURVE_OT_de_select_first ( wmOperatorType ot)

◆ CURVE_OT_de_select_last()

void CURVE_OT_de_select_last ( wmOperatorType ot)

◆ CURVE_OT_select_all()

void CURVE_OT_select_all ( wmOperatorType ot)

◆ CURVE_OT_select_less()

void CURVE_OT_select_less ( wmOperatorType ot)

◆ CURVE_OT_select_linked()

void CURVE_OT_select_linked ( wmOperatorType ot)

◆ CURVE_OT_select_linked_pick()

void CURVE_OT_select_linked_pick ( wmOperatorType ot)

◆ CURVE_OT_select_more()

void CURVE_OT_select_more ( wmOperatorType ot)

◆ CURVE_OT_select_next()

void CURVE_OT_select_next ( wmOperatorType ot)

◆ CURVE_OT_select_nth()

void CURVE_OT_select_nth ( wmOperatorType ot)

◆ CURVE_OT_select_previous()

void CURVE_OT_select_previous ( wmOperatorType ot)

◆ CURVE_OT_select_random()

void CURVE_OT_select_random ( wmOperatorType ot)

◆ CURVE_OT_select_row()

void CURVE_OT_select_row ( wmOperatorType ot)

◆ CURVE_OT_select_similar()

void CURVE_OT_select_similar ( wmOperatorType ot)

◆ CURVE_OT_shortest_path_pick()

void CURVE_OT_shortest_path_pick ( wmOperatorType ot)

◆ curve_select_less()

static void curve_select_less ( Object obedit)
static

◆ curve_select_less_exec()

static int curve_select_less_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ curve_select_more()

static void curve_select_more ( Object obedit)
static

◆ curve_select_more_exec()

static int curve_select_more_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ curve_select_random_exec()

static int curve_select_random_exec ( bContext C,
wmOperator op 
)
static

◆ curve_select_shortest_path_curve()

static void curve_select_shortest_path_curve ( Nurb nu,
int  vert_src,
int  vert_dst 
)
static

◆ curve_select_shortest_path_surf()

static void curve_select_shortest_path_surf ( Nurb nu,
int  vert_src,
int  vert_dst 
)
static

◆ curve_select_similar_exec()

static int curve_select_similar_exec ( bContext C,
wmOperator op 
)
static

◆ de_select_all_exec()

static int de_select_all_exec ( bContext C,
wmOperator op 
)
static

◆ de_select_first_exec()

static int de_select_first_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ de_select_last_exec()

static int de_select_last_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ ED_curve_deselect_all()

bool ED_curve_deselect_all ( EditNurb editnurb)

◆ ED_curve_deselect_all_multi()

bool ED_curve_deselect_all_multi ( struct bContext C)

◆ ED_curve_deselect_all_multi_ex()

bool ED_curve_deselect_all_multi_ex ( Base **  bases,
int  bases_len 
)

◆ ED_curve_nurb_deselect_all()

bool ED_curve_nurb_deselect_all ( const Nurb nu)

◆ ED_curve_nurb_select_all()

bool ED_curve_nurb_select_all ( const Nurb nu)

◆ ED_curve_nurb_select_check()

bool ED_curve_nurb_select_check ( const View3D v3d,
const Nurb nu 
)

◆ ED_curve_nurb_select_count()

int ED_curve_nurb_select_count ( const View3D v3d,
const Nurb nu 
)

◆ ED_curve_select_all()

bool ED_curve_select_all ( EditNurb editnurb)

Definition at line 178 of file editcurve_select.c.

References ED_curve_nurb_select_all(), LISTBASE_FOREACH, and EditNurb::nurbs.

Referenced by de_select_all_exec().

◆ ED_curve_select_check()

bool ED_curve_select_check ( const View3D v3d,
const EditNurb editnurb 
)

◆ ED_curve_select_count()

int ED_curve_select_count ( const View3D v3d,
const EditNurb editnurb 
)

◆ ed_curve_select_nth()

static bool ed_curve_select_nth ( Curve cu,
const struct CheckerIntervalParams params 
)
static

◆ ED_curve_select_swap()

bool ED_curve_select_swap ( EditNurb editnurb,
bool  hide_handles 
)

◆ edcu_shortest_path_pick_invoke()

static int edcu_shortest_path_pick_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ nurb_bezt_direction_worldspace_get()

static void nurb_bezt_direction_worldspace_get ( Object ob,
Nurb nu,
BezTriple bezt,
float  r_dir[3] 
)
static

◆ nurb_bpoint_direction_worldspace_get()

static void nurb_bpoint_direction_worldspace_get ( Object ob,
Nurb nu,
BPoint bp,
float  r_dir[3] 
)
static

◆ select_adjacent_cp()

static void select_adjacent_cp ( ListBase editnurb,
short  next,
const bool  cont,
const bool  selstatus 
)
static
Parameters
next-1/1 for prev/next
contwhen true select continuously
selstatusinverts behavior

Definition at line 312 of file editcurve_select.c.

References Freestyle::a, blender::math::abs(), CU_BEZIER, DESELECT, BPoint::f1, BezTriple::f2, BezTriple::hide, BPoint::hide, LISTBASE_FOREACH, next, SELECT, select_beztriple(), select_bpoint(), and VISIBLE.

Referenced by curve_select_more(), select_next_exec(), and select_previous_exec().

◆ select_beztriple()

bool select_beztriple ( BezTriple bezt,
bool  selstatus,
uint8_t  flag,
eVisible_Types  hidden 
)

◆ select_bpoint()

bool select_bpoint ( BPoint bp,
bool  selstatus,
uint8_t  flag,
bool  hidden 
)

◆ select_linked_exec()

static int select_linked_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ select_linked_invoke()

static int select_linked_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

Definition at line 650 of file editcurve_select.c.

References C, and select_linked_exec().

Referenced by CURVE_OT_select_linked().

◆ select_linked_pick_invoke()

static int select_linked_pick_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ select_next_exec()

static int select_next_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ select_nth_bezt()

static void select_nth_bezt ( Nurb nu,
BezTriple bezt,
const struct CheckerIntervalParams params 
)
static

◆ select_nth_bp()

static void select_nth_bp ( Nurb nu,
BPoint bp,
const struct CheckerIntervalParams params 
)
static

◆ select_nth_exec()

static int select_nth_exec ( bContext C,
wmOperator op 
)
static

◆ select_previous_exec()

static int select_previous_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ select_row_exec()

static int select_row_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ selectend_nurb()

static void selectend_nurb ( Object obedit,
eEndPoint_Types  selfirst,
bool  doswap,
bool  selstatus 
)
static

(De)selects first or last of visible part of each Nurb depending on selfirst.

Parameters
selfirstdefines the end of which to select.
doswapdefines if selection state of each first/last control point is swapped.
selstatusselection status in case doswap is false.

Definition at line 400 of file editcurve_select.c.

References Freestyle::a, Curve::actvert, CU_ACT_NONE, CU_BEZIER, Object::data, BPoint::hide, LAST, LISTBASE_FOREACH, NULL, object_editcurve_get(), SELECT, select_beztriple(), select_bpoint(), swap_selection_beztriple(), swap_selection_bpoint(), and VISIBLE.

Referenced by de_select_first_exec(), and de_select_last_exec().

◆ swap_selection_beztriple()

static bool swap_selection_beztriple ( BezTriple bezt)
static

Definition at line 80 of file editcurve_select.c.

References DESELECT, BezTriple::f2, SELECT, select_beztriple(), and VISIBLE.

Referenced by selectend_nurb().

◆ swap_selection_bpoint()

static bool swap_selection_bpoint ( BPoint bp)
static

Definition at line 88 of file editcurve_select.c.

References DESELECT, BPoint::f1, SELECT, select_bpoint(), and VISIBLE.

Referenced by ED_curve_select_swap(), and selectend_nurb().

Variable Documentation

◆ curve_prop_similar_compare_types

const EnumPropertyItem curve_prop_similar_compare_types[]
static
Initial value:
= {
{SIM_CMP_EQ, "EQUAL", 0, "Equal", ""},
{SIM_CMP_GT, "GREATER", 0, "Greater", ""},
{SIM_CMP_LT, "LESS", 0, "Less", ""},
{0, NULL, 0, NULL, NULL},
}
@ SIM_CMP_LT
@ SIM_CMP_GT
@ SIM_CMP_EQ

Definition at line 1482 of file editcurve_select.c.

Referenced by CURVE_OT_select_similar().

◆ curve_prop_similar_types

const EnumPropertyItem curve_prop_similar_types[]
static
Initial value:
= {
{SIMCURHAND_TYPE, "TYPE", 0, "Type", ""},
{SIMCURHAND_RADIUS, "RADIUS", 0, "Radius", ""},
{SIMCURHAND_WEIGHT, "WEIGHT", 0, "Weight", ""},
{SIMCURHAND_DIRECTION, "DIRECTION", 0, "Direction", ""},
{0, NULL, 0, NULL, NULL},
}
@ SIMCURHAND_WEIGHT
@ SIMCURHAND_DIRECTION
@ SIMCURHAND_RADIUS
@ SIMCURHAND_TYPE

Definition at line 1497 of file editcurve_select.c.

Referenced by CURVE_OT_select_similar().