Blender  V3.3
Classes | Macros | Typedefs | Functions
paint_curve.c File Reference
#include <limits.h>
#include <string.h>
#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 "BKE_context.h"
#include "BKE_main.h"
#include "BKE_paint.h"
#include "ED_paint.h"
#include "ED_view3d.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_view2d.h"
#include "paint_intern.h"

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
 

Typedefs

typedef struct PointSlideData PointSlideData
 

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 int paintcurve_new_exec (bContext *C, wmOperator *UNUSED(op))
 
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 *UNUSED(op))
 
void PAINTCURVE_OT_draw (wmOperatorType *ot)
 
static int paintcurve_cursor_invoke (bContext *C, wmOperator *UNUSED(op), 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,
 
)    (*(&pcp->bez.f1 + i) = SELECT)

Definition at line 38 of file paint_curve.c.

◆ PAINT_CURVE_SELECT_THRESHOLD

#define PAINT_CURVE_SELECT_THRESHOLD   40.0f

Definition at line 37 of file paint_curve.c.

◆ SEL_F1

#define SEL_F1   (1 << 0)

Definition at line 66 of file paint_curve.c.

◆ SEL_F2

#define SEL_F2   (1 << 1)

Definition at line 67 of file paint_curve.c.

◆ SEL_F3

#define SEL_F3   (1 << 2)

Definition at line 68 of file paint_curve.c.

Typedef Documentation

◆ PointSlideData

Function Documentation

◆ paint_curve_poll()

bool paint_curve_poll ( bContext C)

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

static int paintcurve_cursor_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent event 
)
static

◆ paintcurve_delete_point_exec()

static int paintcurve_delete_point_exec ( bContext C,
wmOperator op 
)
static

◆ paintcurve_draw_exec()

static int paintcurve_draw_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ paintcurve_new_exec()

static int paintcurve_new_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ PAINTCURVE_OT_add_point()

void PAINTCURVE_OT_add_point ( wmOperatorType ot)

◆ PAINTCURVE_OT_cursor()

void PAINTCURVE_OT_cursor ( wmOperatorType ot)

◆ PAINTCURVE_OT_delete_point()

void PAINTCURVE_OT_delete_point ( wmOperatorType ot)

◆ PAINTCURVE_OT_draw()

void PAINTCURVE_OT_draw ( wmOperatorType ot)

◆ PAINTCURVE_OT_new()

void PAINTCURVE_OT_new ( wmOperatorType ot)

◆ PAINTCURVE_OT_select()

void PAINTCURVE_OT_select ( wmOperatorType ot)

◆ PAINTCURVE_OT_slide()

void PAINTCURVE_OT_slide ( wmOperatorType ot)

◆ paintcurve_point_add()

static void paintcurve_point_add ( bContext C,
wmOperator op,
const int  loc[2] 
)
static

◆ paintcurve_point_co_index()

static int paintcurve_point_co_index ( char  sel)
static

Definition at line 112 of file paint_curve.c.

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

static bool paintcurve_point_select ( bContext C,
wmOperator op,
const int  loc[2],
bool  toggle,
bool  extend 
)
static

◆ paintcurve_point_side_index()

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

Definition at line 122 of file paint_curve.c.

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

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

◆ paintcurve_slide_modal()

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