Blender V4.3
gpencil_intern.hh File Reference
#include "DNA_vec_types.h"
#include "ED_numinput.hh"

Go to the source code of this file.

Classes

struct  GP_SpaceConversion
 

Macros

#define DEPTH_INVALID   1.0f
 
#define GP_STROKE_BUFFER_CHUNK   2048
 

Enumerations

enum  eGPencil_PaintModes {
  GP_PAINTMODE_DRAW = 0 , GP_PAINTMODE_ERASER , GP_PAINTMODE_DRAW_STRAIGHT , GP_PAINTMODE_DRAW_POLY ,
  GP_PAINTMODE_SET_CP
}
 

Functions

bool gpencil_stroke_inside_circle (const float mval[2], int rad, int x0, int y0, int x1, int y1)
 
void gpencil_point_to_xy (const GP_SpaceConversion *gsc, const bGPDstroke *gps, const bGPDspoint *pt, int *r_x, int *r_y)
 
void GPENCIL_OT_annotate (wmOperatorType *ot)
 
void GPENCIL_OT_annotation_add (wmOperatorType *ot)
 
void GPENCIL_OT_data_unlink (wmOperatorType *ot)
 
void GPENCIL_OT_layer_annotation_add (wmOperatorType *ot)
 
void GPENCIL_OT_layer_annotation_remove (wmOperatorType *ot)
 
void GPENCIL_OT_layer_annotation_move (wmOperatorType *ot)
 
void GPENCIL_OT_annotation_active_frame_delete (wmOperatorType *ot)
 
void gpencil_undo_init (bGPdata *gpd)
 
void gpencil_undo_push (bGPdata *gpd)
 
void gpencil_undo_finish ()
 

Variables

ListBase gpencil_strokes_copypastebuf
 

Macro Definition Documentation

◆ DEPTH_INVALID

#define DEPTH_INVALID   1.0f

Definition at line 15 of file gpencil_intern.hh.

◆ GP_STROKE_BUFFER_CHUNK

#define GP_STROKE_BUFFER_CHUNK   2048

Definition at line 123 of file gpencil_intern.hh.

Referenced by ED_gpencil_sbuffer_ensure().

Enumeration Type Documentation

◆ eGPencil_PaintModes

Enumerator
GP_PAINTMODE_DRAW 
GP_PAINTMODE_ERASER 
GP_PAINTMODE_DRAW_STRAIGHT 
GP_PAINTMODE_DRAW_POLY 
GP_PAINTMODE_SET_CP 

Definition at line 114 of file gpencil_intern.hh.

Function Documentation

◆ GPENCIL_OT_annotate()

◆ GPENCIL_OT_annotation_active_frame_delete()

◆ GPENCIL_OT_annotation_add()

◆ GPENCIL_OT_data_unlink()

◆ GPENCIL_OT_layer_annotation_add()

◆ GPENCIL_OT_layer_annotation_move()

◆ GPENCIL_OT_layer_annotation_remove()

◆ gpencil_point_to_xy()

void gpencil_point_to_xy ( const GP_SpaceConversion * gsc,
const bGPDstroke * gps,
const bGPDspoint * pt,
int * r_x,
int * r_y )

Convert a Grease Pencil coordinate (i.e. can be 2D or 3D) to screen-space (2D)

Parameters
[out]r_xThe screen-space x-coordinate of the point
[out]r_yThe screen-space y-coordinate of the point
Warning
This assumes that the caller has already checked whether the stroke in question can be drawn.

Definition at line 332 of file gpencil_utils.cc.

References GP_SpaceConversion::area, BLI_assert, BLI_rctf_size_x(), BLI_rctf_size_y(), ED_view3d_project_int_global(), bGPDstroke::flag, GP_STROKE_2DSPACE, GP_STROKE_3DSPACE, int, GP_SpaceConversion::mat, mul_m4_v3(), GP_SpaceConversion::region, SPACE_VIEW3D, ScrArea::spacetype, GP_SpaceConversion::subrect, UI_view2d_view_to_region_clip(), GP_SpaceConversion::v2d, V2D_IS_CLIPPED, V3D_PROJ_RET_OK, V3D_PROJ_TEST_NOP, bGPDspoint::x, rctf::xmin, bGPDspoint::y, and rctf::ymin.

Referenced by annotation_stroke_eraser_dostroke().

◆ gpencil_stroke_inside_circle()

bool gpencil_stroke_inside_circle ( const float mval[2],
int rad,
int x0,
int y0,
int x1,
int y1 )

Check whether a given stroke segment is inside a circular brush

Parameters
mvalThe current screen-space coordinates (midpoint) of the brush
radThe radius of the brush
x0,y0The screen-space x and y coordinates of the start of the stroke segment
x1,y1The screen-space x and y coordinates of the end of the stroke segment

Definition at line 265 of file gpencil_utils.cc.

References edge_inside_circle(), and float.

Referenced by annotation_stroke_eraser_dostroke().

◆ gpencil_undo_finish()

void gpencil_undo_finish ( )

◆ gpencil_undo_init()

void gpencil_undo_init ( bGPdata * gpd)

Definition at line 97 of file gpencil_undo.cc.

References gpencil_undo_push().

Referenced by annotation_session_initdata().

◆ gpencil_undo_push()

Variable Documentation

◆ gpencil_strokes_copypastebuf

ListBase gpencil_strokes_copypastebuf
extern

list of bGPDstroke instances

Note
is exposed within the editors/gpencil module so that other tools can use it too.

Definition at line 92 of file gpencil_edit.cc.

Referenced by ED_gpencil_strokes_copybuf_free().