Blender V4.3
editcurve_select.cc 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_matrix.h"
#include "BLI_math_vector.h"
#include "BLI_rand.h"
#include "BKE_context.hh"
#include "BKE_curve.hh"
#include "BKE_fcurve.hh"
#include "BKE_layer.hh"
#include "BKE_report.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_curve.hh"
#include "ED_object.hh"
#include "ED_screen.hh"
#include "ED_select_utils.hh"
#include "ED_view3d.hh"
#include "curve_intern.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "DEG_depsgraph.hh"

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 (Span< Base * > bases)
 
bool ED_curve_deselect_all_multi (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 *)
 
void CURVE_OT_de_select_first (wmOperatorType *ot)
 
static int de_select_last_exec (bContext *C, wmOperator *)
 
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 *)
 
static int select_linked_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
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 *)
 
void CURVE_OT_select_row (wmOperatorType *ot)
 
Select Next Operator
static int select_next_exec (bContext *C, wmOperator *)
 
void CURVE_OT_select_next (wmOperatorType *ot)
 
Select Previous Operator
static int select_previous_exec (bContext *C, wmOperator *)
 
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 *)
 
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 *)
 
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 CheckerIntervalParams *params)
 
static void select_nth_bp (Nurb *nu, BPoint *bp, const CheckerIntervalParams *params)
 
static bool ed_curve_select_nth (Curve *cu, const 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 1489 of file editcurve_select.cc.

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()

◆ curve_nurb_selected_type_get()

◆ CURVE_OT_de_select_first()

◆ CURVE_OT_de_select_last()

◆ CURVE_OT_select_all()

◆ CURVE_OT_select_less()

◆ CURVE_OT_select_linked()

◆ CURVE_OT_select_linked_pick()

◆ CURVE_OT_select_more()

◆ CURVE_OT_select_next()

◆ CURVE_OT_select_nth()

◆ CURVE_OT_select_previous()

◆ CURVE_OT_select_random()

◆ CURVE_OT_select_row()

◆ CURVE_OT_select_similar()

◆ CURVE_OT_shortest_path_pick()

◆ curve_select_less()

◆ curve_select_less_exec()

◆ curve_select_more()

◆ curve_select_more_exec()

◆ curve_select_random_exec()

◆ 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()

◆ curve_select_similar_exec()

◆ de_select_all_exec()

◆ de_select_first_exec()

◆ de_select_last_exec()

◆ ED_curve_deselect_all()

◆ ED_curve_deselect_all_multi()

◆ ED_curve_deselect_all_multi_ex()

bool ED_curve_deselect_all_multi_ex ( Span< Base * > bases)

◆ ED_curve_nurb_deselect_all()

bool ED_curve_nurb_deselect_all ( const Nurb * nu)

◆ ED_curve_nurb_select_all()

◆ ED_curve_nurb_select_check()

◆ 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 182 of file editcurve_select.cc.

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

Referenced by de_select_all_exec().

◆ ED_curve_select_check()

◆ 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 CheckerIntervalParams * params )
static

◆ ED_curve_select_swap()

◆ edcu_shortest_path_pick_invoke()

◆ 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 331 of file editcurve_select.cc.

References abs(), CU_BEZIER, 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()

◆ select_bpoint()

◆ select_linked_exec()

◆ select_linked_invoke()

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

Definition at line 660 of file editcurve_select.cc.

References select_linked_exec().

Referenced by CURVE_OT_select_linked().

◆ select_linked_pick_invoke()

◆ select_next_exec()

◆ select_nth_bezt()

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

◆ select_nth_bp()

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

◆ select_nth_exec()

◆ select_previous_exec()

◆ select_row_exec()

◆ 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 419 of file editcurve_select.cc.

References Curve::actvert, CU_ACT_NONE, CU_BEZIER, Object::data, BPoint::hide, LAST, LISTBASE_FOREACH, 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 84 of file editcurve_select.cc.

References 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 92 of file editcurve_select.cc.

References 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, nullptr, 0, nullptr, nullptr},
}
@ SIM_CMP_LT
@ SIM_CMP_GT
@ SIM_CMP_EQ

Definition at line 1481 of file editcurve_select.cc.

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, nullptr, 0, nullptr, nullptr},
}
@ SIMCURHAND_WEIGHT
@ SIMCURHAND_DIRECTION
@ SIMCURHAND_RADIUS
@ SIMCURHAND_TYPE

Definition at line 1496 of file editcurve_select.cc.

Referenced by CURVE_OT_select_similar().