Blender V5.0
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 "BKE_paint_types.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)
#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 wmOperatorStatus 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 wmOperatorStatus paintcurve_add_point_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus paintcurve_add_point_exec (bContext *C, wmOperator *op)
void PAINTCURVE_OT_add_point (wmOperatorType *ot)
static wmOperatorStatus 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 wmOperatorStatus paintcurve_select_point_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus paintcurve_select_point_exec (bContext *C, wmOperator *op)
void PAINTCURVE_OT_select (wmOperatorType *ot)
static wmOperatorStatus paintcurve_slide_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus paintcurve_slide_modal (bContext *C, wmOperator *op, const wmEvent *event)
void PAINTCURVE_OT_slide (wmOperatorType *ot)
static wmOperatorStatus paintcurve_draw_exec (bContext *C, wmOperator *)
void PAINTCURVE_OT_draw (wmOperatorType *ot)
static wmOperatorStatus 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 )
Value:
(*(&pcp->bez.f1 + i) = SELECT)
#define SELECT
i
Definition text_draw.cc:230

Definition at line 44 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 43 of file paint_curve.cc.

Referenced by paintcurve_point_select(), and paintcurve_slide_invoke().

◆ SEL_F1

#define SEL_F1   (1 << 0)

Definition at line 72 of file paint_curve.cc.

◆ SEL_F2

#define SEL_F2   (1 << 1)

Definition at line 73 of file paint_curve.cc.

◆ SEL_F3

#define SEL_F3   (1 << 2)

Definition at line 74 of file paint_curve.cc.

Function Documentation

◆ paint_curve_poll()

◆ paintcurve_add_point_exec()

◆ paintcurve_add_point_invoke()

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

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

◆ paintcurve_new_exec()

◆ PAINTCURVE_OT_add_point()

◆ PAINTCURVE_OT_cursor()

void PAINTCURVE_OT_cursor ( wmOperatorType * ot)

Definition at line 761 of file paint_curve.cc.

References ot, paint_curve_poll(), and paintcurve_cursor_invoke().

Referenced by ED_operatortypes_paint().

◆ PAINTCURVE_OT_delete_point()

void PAINTCURVE_OT_delete_point ( wmOperatorType * ot)

Definition at line 367 of file paint_curve.cc.

References OPTYPE_UNDO, ot, paint_curve_poll(), and paintcurve_delete_point_exec().

Referenced by ED_operatortypes_paint().

◆ PAINTCURVE_OT_draw()

void PAINTCURVE_OT_draw ( wmOperatorType * ot)

Definition at line 716 of file paint_curve.cc.

References OPTYPE_UNDO, ot, paint_curve_poll(), and paintcurve_draw_exec().

Referenced by ED_operatortypes_paint().

◆ PAINTCURVE_OT_new()

void PAINTCURVE_OT_new ( wmOperatorType * ot)

Definition at line 173 of file paint_curve.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, paint_curve_poll(), and paintcurve_new_exec().

Referenced by ED_operatortypes_paint().

◆ PAINTCURVE_OT_select()

◆ PAINTCURVE_OT_slide()

void PAINTCURVE_OT_slide ( wmOperatorType * ot)

◆ paintcurve_point_add()

◆ paintcurve_point_co_index()

int paintcurve_point_co_index ( char sel)
static

Definition at line 118 of file paint_curve.cc.

References i.

Referenced by paintcurve_point_select(), and paintcurve_slide_invoke().

◆ paintcurve_point_get_closest()

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

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

Definition at line 128 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()

◆ paintcurve_select_point_invoke()

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

◆ paintcurve_slide_invoke()

◆ paintcurve_slide_modal()