Blender V4.3
paint_curve.cc File Reference
#include <climits>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_brush_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "BLI_math_vector.h"
#include "BLT_translation.hh"
#include "BKE_brush.hh"
#include "BKE_context.hh"
#include "BKE_lib_id.hh"
#include "BKE_paint.hh"
#include "ED_paint.hh"
#include "ED_view3d.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "UI_view2d.hh"
#include "paint_intern.hh"

Go to the source code of this file.

Classes

struct  PointSlideData
 

Macros

#define PAINT_CURVE_SELECT_THRESHOLD   40.0f
 
#define PAINT_CURVE_POINT_SELECT(pcp, i)   (*(&pcp->bez.f1 + i) = SELECT)
 
#define SEL_F1   (1 << 0)
 
#define SEL_F2   (1 << 1)
 
#define SEL_F3   (1 << 2)
 
#define DELETE_TAG   2
 

Functions

bool paint_curve_poll (bContext *C)
 
static PaintCurvePointpaintcurve_point_get_closest (PaintCurve *pc, const float pos[2], bool ignore_pivot, const float threshold, char *point)
 
static int paintcurve_point_co_index (char sel)
 
static char paintcurve_point_side_index (const BezTriple *bezt, const bool is_first, const char fallback)
 
static PaintCurvepaintcurve_for_brush_add (Main *bmain, const char *name, const Brush *brush)
 
static int paintcurve_new_exec (bContext *C, wmOperator *)
 
void PAINTCURVE_OT_new (wmOperatorType *ot)
 
static void paintcurve_point_add (bContext *C, wmOperator *op, const int loc[2])
 
static int paintcurve_add_point_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int paintcurve_add_point_exec (bContext *C, wmOperator *op)
 
void PAINTCURVE_OT_add_point (wmOperatorType *ot)
 
static int paintcurve_delete_point_exec (bContext *C, wmOperator *op)
 
void PAINTCURVE_OT_delete_point (wmOperatorType *ot)
 
static bool paintcurve_point_select (bContext *C, wmOperator *op, const int loc[2], bool toggle, bool extend)
 
static int paintcurve_select_point_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int paintcurve_select_point_exec (bContext *C, wmOperator *op)
 
void PAINTCURVE_OT_select (wmOperatorType *ot)
 
static int paintcurve_slide_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int paintcurve_slide_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
void PAINTCURVE_OT_slide (wmOperatorType *ot)
 
static int paintcurve_draw_exec (bContext *C, wmOperator *)
 
void PAINTCURVE_OT_draw (wmOperatorType *ot)
 
static int paintcurve_cursor_invoke (bContext *C, wmOperator *, const wmEvent *event)
 
void PAINTCURVE_OT_cursor (wmOperatorType *ot)
 

Macro Definition Documentation

◆ DELETE_TAG

#define DELETE_TAG   2

◆ PAINT_CURVE_POINT_SELECT

#define PAINT_CURVE_POINT_SELECT ( pcp,
i )   (*(&pcp->bez.f1 + i) = SELECT)

Definition at line 43 of file paint_curve.cc.

Referenced by paintcurve_point_select(), and paintcurve_slide_invoke().

◆ PAINT_CURVE_SELECT_THRESHOLD

#define PAINT_CURVE_SELECT_THRESHOLD   40.0f

Definition at line 42 of file paint_curve.cc.

Referenced by paintcurve_point_select(), and paintcurve_slide_invoke().

◆ SEL_F1

#define SEL_F1   (1 << 0)

◆ SEL_F2

#define SEL_F2   (1 << 1)

Definition at line 72 of file paint_curve.cc.

Referenced by paintcurve_point_get_closest(), and paintcurve_point_select().

◆ SEL_F3

Function Documentation

◆ paint_curve_poll()

◆ paintcurve_add_point_exec()

static int paintcurve_add_point_exec ( bContext * C,
wmOperator * op )
static

◆ paintcurve_add_point_invoke()

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

◆ paintcurve_cursor_invoke()

◆ paintcurve_delete_point_exec()

◆ paintcurve_draw_exec()

◆ paintcurve_for_brush_add()

static PaintCurve * paintcurve_for_brush_add ( Main * bmain,
const char * name,
const Brush * brush )
static

◆ paintcurve_new_exec()

◆ PAINTCURVE_OT_add_point()

◆ PAINTCURVE_OT_cursor()

◆ PAINTCURVE_OT_delete_point()

◆ PAINTCURVE_OT_draw()

◆ PAINTCURVE_OT_new()

◆ PAINTCURVE_OT_select()

◆ PAINTCURVE_OT_slide()

◆ paintcurve_point_add()

◆ paintcurve_point_co_index()

static int paintcurve_point_co_index ( char sel)
static

Definition at line 117 of file paint_curve.cc.

Referenced by paintcurve_point_select(), and paintcurve_slide_invoke().

◆ paintcurve_point_get_closest()

static PaintCurvePoint * paintcurve_point_get_closest ( PaintCurve * pc,
const float pos[2],
bool ignore_pivot,
const float threshold,
char * point )
static

◆ paintcurve_point_select()

◆ paintcurve_point_side_index()

static char paintcurve_point_side_index ( const BezTriple * bezt,
const bool is_first,
const char fallback )
static

Definition at line 127 of file paint_curve.cc.

References BEZT_ISSEL_ANY, BezTriple::f1, BezTriple::f3, SEL_F1, SEL_F3, and SELECT.

Referenced by paintcurve_slide_invoke().

◆ paintcurve_select_point_exec()

static int paintcurve_select_point_exec ( bContext * C,
wmOperator * op )
static

◆ paintcurve_select_point_invoke()

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

◆ paintcurve_slide_invoke()

◆ paintcurve_slide_modal()