Blender  V3.3
Typedefs | Enumerations | Functions
annotate_draw.c File Reference
#include <float.h>
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_sys_types.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLF_api.h"
#include "BLT_translation.h"
#include "DNA_gpencil_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "WM_api.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_view3d.h"
#include "UI_interface_icons.h"
#include "UI_resources.h"

Go to the source code of this file.

Typedefs

typedef enum eDrawStrokeFlags eDrawStrokeFlags
 

Enumerations

enum  eDrawStrokeFlags {
  GP_DRAWDATA_NOSTATUS = (1 << 0) , GP_DRAWDATA_ONLY3D = (1 << 1) , GP_DRAWDATA_ONLYV2D = (1 << 2) , GP_DRAWDATA_ONLYI2D = (1 << 3) ,
  GP_DRAWDATA_IEDITHACK = (1 << 4) , GP_DRAWDATA_NO_XRAY = (1 << 5) , GP_DRAWDATA_NO_ONIONS = (1 << 6) , GP_DRAWDATA_NOSTATUS = (1 << 0) ,
  GP_DRAWDATA_ONLY3D = (1 << 1) , GP_DRAWDATA_ONLYV2D = (1 << 2) , GP_DRAWDATA_ONLYI2D = (1 << 3) , GP_DRAWDATA_IEDITHACK = (1 << 4) ,
  GP_DRAWDATA_NO_XRAY = (1 << 5) , GP_DRAWDATA_NO_ONIONS = (1 << 6) , GP_DRAWDATA_VOLUMETRIC = (1 << 7) , GP_DRAWDATA_FILL = (1 << 8)
}
 

Functions

static void annotation_draw_stroke_arrow_buffer (uint pos, const float *corner_point, const float *arrow_coords, const int arrow_style)
 
static void annotation_draw_stroke_buffer (bGPdata *gps, short thickness, short dflag, const float ink[4])
 
static void annotation_calc_2d_stroke_fxy (const float pt[3], short sflag, int offsx, int offsy, int winx, int winy, float r_co[2])
 
static void annotation_draw_stroke_point (const bGPDspoint *points, short thickness, short sflag, int offsx, int offsy, int winx, int winy, const float ink[4])
 
static void annotation_draw_stroke_3d (const bGPDspoint *points, int totpoints, short thickness, const float ink[4], bool cyclic)
 
static void annotation_draw_stroke_2d (const bGPDspoint *points, int totpoints, short thickness_s, short sflag, int offsx, int offsy, int winx, int winy, const float ink[4])
 
static bool annotation_can_draw_stroke (const bGPDstroke *gps, const int dflag)
 
static void annotation_draw_strokes (const bGPDframe *gpf, int offsx, int offsy, int winx, int winy, int dflag, short lthick, const float color[4])
 
static void annotation_draw_onionskins (bGPDlayer *gpl, bGPDframe *gpf, int offsx, int offsy, int winx, int winy, int dflag)
 
static void annotation_draw_data_layers (bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag)
 
static void annotation_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag)
 
static void annotation_draw_data_all (Scene *scene, bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag, const eSpace_Type space_type)
 
void ED_annotation_draw_2dimage (const bContext *C)
 
void ED_annotation_draw_view2d (const bContext *C, bool onlyv2d)
 
void ED_annotation_draw_view3d (Scene *scene, struct Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
 
void ED_annotation_draw_ex (Scene *scene, bGPdata *gpd, int winx, int winy, const int cfra, const char spacetype)
 

Typedef Documentation

◆ eDrawStrokeFlags

Enumeration Type Documentation

◆ eDrawStrokeFlags

Enumerator
GP_DRAWDATA_NOSTATUS 

don't draw status info

GP_DRAWDATA_ONLY3D 

only draw 3d-strokes

GP_DRAWDATA_ONLYV2D 

only draw 'canvas' strokes

GP_DRAWDATA_ONLYI2D 

only draw 'image' strokes

GP_DRAWDATA_IEDITHACK 

special hack for drawing strokes in Image Editor (weird coordinates)

GP_DRAWDATA_NO_XRAY 

don't draw xray in 3D view (which is default)

GP_DRAWDATA_NO_ONIONS 

no onionskins should be drawn (for animation playback)

GP_DRAWDATA_NOSTATUS 

don't draw status info

GP_DRAWDATA_ONLY3D 

only draw 3d-strokes

GP_DRAWDATA_ONLYV2D 

only draw 'canvas' strokes

GP_DRAWDATA_ONLYI2D 

only draw 'image' strokes

GP_DRAWDATA_IEDITHACK 

special hack for drawing strokes in Image Editor (weird coordinates)

GP_DRAWDATA_NO_XRAY 

Don't draw XRAY in 3D view (which is default).

GP_DRAWDATA_NO_ONIONS 

No onion-skins should be drawn (for animation playback).

GP_DRAWDATA_VOLUMETRIC 

draw strokes as "volumetric" circular billboards

GP_DRAWDATA_FILL 

fill insides/bounded-regions of strokes

Definition at line 57 of file annotate_draw.c.

Function Documentation

◆ annotation_calc_2d_stroke_fxy()

static void annotation_calc_2d_stroke_fxy ( const float  pt[3],
short  sflag,
int  offsx,
int  offsy,
int  winx,
int  winy,
float  r_co[2] 
)
static

◆ annotation_can_draw_stroke()

static bool annotation_can_draw_stroke ( const bGPDstroke gps,
const int  dflag 
)
static

◆ annotation_draw_data()

static void annotation_draw_data ( bGPdata gpd,
int  offsx,
int  offsy,
int  winx,
int  winy,
int  cfra,
int  dflag 
)
static

◆ annotation_draw_data_all()

static void annotation_draw_data_all ( Scene scene,
bGPdata gpd,
int  offsx,
int  offsy,
int  winx,
int  winy,
int  cfra,
int  dflag,
const eSpace_Type  space_type 
)
static

◆ annotation_draw_data_layers()

static void annotation_draw_data_layers ( bGPdata gpd,
int  offsx,
int  offsy,
int  winx,
int  winy,
int  cfra,
int  dflag 
)
static

◆ annotation_draw_onionskins()

static void annotation_draw_onionskins ( bGPDlayer gpl,
bGPDframe gpf,
int  offsx,
int  offsy,
int  winx,
int  winy,
int  dflag 
)
static

◆ annotation_draw_stroke_2d()

static void annotation_draw_stroke_2d ( const bGPDspoint points,
int  totpoints,
short  thickness_s,
short  sflag,
int  offsx,
int  offsy,
int  winx,
int  winy,
const float  ink[4] 
)
static

◆ annotation_draw_stroke_3d()

static void annotation_draw_stroke_3d ( const bGPDspoint points,
int  totpoints,
short  thickness,
const float  ink[4],
bool  cyclic 
)
static

◆ annotation_draw_stroke_arrow_buffer()

static void annotation_draw_stroke_arrow_buffer ( uint  pos,
const float corner_point,
const float arrow_coords,
const int  arrow_style 
)
static

◆ annotation_draw_stroke_buffer()

static void annotation_draw_stroke_buffer ( bGPdata gps,
short  thickness,
short  dflag,
const float  ink[4] 
)
static

◆ annotation_draw_stroke_point()

static void annotation_draw_stroke_point ( const bGPDspoint points,
short  thickness,
short  sflag,
int  offsx,
int  offsy,
int  winx,
int  winy,
const float  ink[4] 
)
static

◆ annotation_draw_strokes()

static void annotation_draw_strokes ( const bGPDframe gpf,
int  offsx,
int  offsy,
int  winx,
int  winy,
int  dflag,
short  lthick,
const float  color[4] 
)
static

◆ ED_annotation_draw_2dimage()

void ED_annotation_draw_2dimage ( const bContext C)

◆ ED_annotation_draw_ex()

void ED_annotation_draw_ex ( Scene scene,
bGPdata gpd,
int  winx,
int  winy,
const int  cfra,
const char  spacetype 
)

◆ ED_annotation_draw_view2d()

void ED_annotation_draw_view2d ( const bContext C,
bool  onlyv2d 
)

◆ ED_annotation_draw_view3d()

void ED_annotation_draw_view3d ( struct Scene scene,
struct Depsgraph depsgraph,
struct View3D v3d,
struct ARegion region,
bool  only3d 
)

Draw annotations sketches to specified 3d-view assuming that matrices are already set correctly. NOTE: this gets called twice - first time with only3d=true to draw 3d-strokes, second time with only3d=false for screen-aligned strokes.

Definition at line 884 of file annotate_draw.c.

References annotation_draw_data_all(), RenderData::cfra, depsgraph, ED_view3d_calc_camera_border(), View3D::flag2, G, G_FLAG_RENDER_VIEWPORT, GP_DRAWDATA_NOSTATUS, GP_DRAWDATA_ONLY3D, Scene::gpd, NULL, RegionView3D::persp, Scene::r, ARegion::regiondata, round_fl_to_int(), RV3D_CAMOB, scene, View3D::spacetype, V3D_HIDE_OVERLAYS, ARegion::winx, ARegion::winy, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by DRW_draw_callbacks_post_scene().