Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions

view3d_draw.c File Reference

#include <string.h>
#include <stdio.h>
#include <math.h>
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
#include "DNA_customdata_types.h"
#include "DNA_object_types.h"
#include "DNA_group_types.h"
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_scene_types.h"
#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "BKE_anim.h"
#include "BKE_camera.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_image.h"
#include "BKE_key.h"
#include "BKE_object.h"
#include "BKE_global.h"
#include "BKE_paint.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_unit.h"
#include "BKE_movieclip.h"
#include "RE_engine.h"
#include "RE_pipeline.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "WM_api.h"
#include "BLF_api.h"
#include "ED_armature.h"
#include "ED_keyframing.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_screen_types.h"
#include "ED_transform.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "GPU_draw.h"
#include "GPU_material.h"
#include "GPU_extensions.h"
#include "view3d_intern.h"

Go to the source code of this file.

Classes

struct  View3DAfter
struct  View3DShadow

Defines

#define GRID_MIN_PX   6.0f
#define ROT_AXIS_DETAIL   13

Typedefs

typedef struct View3DAfter View3DAfter
typedef struct View3DShadow View3DShadow

Functions

static void star_stuff_init_func (void)
static void star_stuff_vertex_func (float *i)
static void star_stuff_term_func (void)
void circf (float x, float y, float rad)
void circ (float x, float y, float rad)
static void view3d_draw_clipping (RegionView3D *rv3d)
void view3d_set_clipping (RegionView3D *rv3d)
void view3d_clr_clipping (void)
static int test_clipping (const float vec[3], float clip[][4])
int ED_view3d_test_clipping (RegionView3D *rv3d, const float vec[3], const int local)
static void drawgrid_draw (ARegion *ar, float wx, float wy, float x, float y, float dx)
static void drawgrid (UnitSettings *unit, ARegion *ar, View3D *v3d, const char **grid_unit)
static void drawfloor (Scene *scene, View3D *v3d, const char **grid_unit)
static void drawcursor (Scene *scene, ARegion *ar, View3D *v3d)
static void draw_view_axis (RegionView3D *rv3d)
static void draw_rotation_guide (RegionView3D *rv3d)
static void draw_view_icon (RegionView3D *rv3d)
static const char * view3d_get_name (View3D *v3d, RegionView3D *rv3d)
static void draw_viewport_name (ARegion *ar, View3D *v3d)
static void draw_selected_name (Scene *scene, Object *ob)
static void view3d_camera_border (Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewborder_r, short no_shift, short no_zoom)
void ED_view3d_calc_camera_border_size (Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, float size_r[2])
void ED_view3d_calc_camera_border (Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewborder_r, short no_shift)
static void drawviewborder_grid3 (float x1, float x2, float y1, float y2, float fac)
static void drawviewborder_triangle (float x1, float x2, float y1, float y2, const char golden, const char dir)
static void drawviewborder (Scene *scene, ARegion *ar, View3D *v3d)
static void backdrawview3d (Scene *scene, ARegion *ar, View3D *v3d)
void view3d_validate_backbuf (ViewContext *vc)
unsigned int view3d_sample_backbuf (ViewContext *vc, int x, int y)
ImBufview3d_read_backbuf (ViewContext *vc, short xmin, short ymin, short xmax, short ymax)
unsigned int view3d_sample_backbuf_rect (ViewContext *vc, const int mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, void *handle, unsigned int(*indextest)(void *handle, unsigned int index))
static void draw_bgpic (Scene *scene, ARegion *ar, View3D *v3d)
void add_view3d_after (ListBase *lb, Base *base, int flag)
static void view3d_draw_transp (Scene *scene, ARegion *ar, View3D *v3d)
static void view3d_draw_xray (Scene *scene, ARegion *ar, View3D *v3d, int clear)
static void view3d_draw_xraytransp (Scene *scene, ARegion *ar, View3D *v3d, int clear)
static DupliObjectdupli_step (DupliObject *dob)
static void draw_dupli_objects_color (Scene *scene, ARegion *ar, View3D *v3d, Base *base, int color)
static void draw_dupli_objects (Scene *scene, ARegion *ar, View3D *v3d, Base *base)
void view3d_update_depths_rect (ARegion *ar, ViewDepths *d, rcti *rect)
void ED_view3d_depth_update (ARegion *ar)
float view3d_depth_near (ViewDepths *d)
void draw_depth_gpencil (Scene *scene, ARegion *ar, View3D *v3d)
void draw_depth (Scene *scene, ARegion *ar, View3D *v3d, int(*func)(void *))
static void gpu_render_lamp_update (Scene *scene, View3D *v3d, Object *ob, Object *par, float obmat[][4], ListBase *shadows)
static void gpu_update_lamps_shadows (Scene *scene, View3D *v3d)
CustomDataMask ED_view3d_datamask (Scene *scene, View3D *v3d)
CustomDataMask ED_view3d_object_datamask (Scene *scene)
CustomDataMask ED_view3d_screen_datamask (bScreen *screen)
static void view3d_main_area_setup_view (Scene *scene, View3D *v3d, ARegion *ar, float viewmat[][4], float winmat[][4])
void ED_view3d_draw_offscreen (Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy, float viewmat[][4], float winmat[][4])
ImBufED_view3d_draw_offscreen_imbuf (Scene *scene, View3D *v3d, ARegion *ar, int sizex, int sizey, unsigned int flag, char err_out[256])
ImBufED_view3d_draw_offscreen_imbuf_simple (Scene *scene, Object *camera, int width, int height, unsigned int flag, int drawtype, char err_out[256])
static void draw_viewport_fps (Scene *scene, ARegion *ar)
static int view3d_main_area_draw_engine (const bContext *C, ARegion *ar)
static void view3d_main_area_draw_engine_info (RegionView3D *rv3d, ARegion *ar)
static void view3d_main_area_draw_objects (const bContext *C, ARegion *ar, const char **grid_unit)
static void view3d_main_area_draw_info (const bContext *C, ARegion *ar, const char *grid_unit)
void view3d_main_area_draw (const bContext *C, ARegion *ar)

Detailed Description

Definition in file view3d_draw.c.


Define Documentation

#define GRID_MIN_PX   6.0f

Definition at line 255 of file view3d_draw.c.

Referenced by drawgrid().

#define ROT_AXIS_DETAIL   13

Referenced by draw_rotation_guide().


Typedef Documentation

typedef struct View3DAfter View3DAfter
typedef struct View3DShadow View3DShadow

Function Documentation

void add_view3d_after ( ListBase lb,
Base base,
int  flag 
)
static void backdrawview3d ( Scene scene,
ARegion ar,
View3D v3d 
) [static]
void circ ( float  x,
float  y,
float  rad 
)

Definition at line 131 of file view3d_draw.c.

Referenced by drawcursor(), and drawlamp().

void circf ( float  x,
float  y,
float  rad 
)

Definition at line 114 of file view3d_draw.c.

static void draw_bgpic ( Scene scene,
ARegion ar,
View3D v3d 
) [static]
void draw_depth ( Scene scene,
ARegion ar,
View3D v3d,
int(*)(void *)  func 
)
void draw_depth_gpencil ( Scene scene,
ARegion ar,
View3D v3d 
)
static void draw_dupli_objects ( Scene scene,
ARegion ar,
View3D v3d,
Base base 
) [static]
static void draw_dupli_objects_color ( Scene scene,
ARegion ar,
View3D v3d,
Base base,
int  color 
) [static]
static void draw_rotation_guide ( RegionView3D rv3d) [static]
static void draw_selected_name ( Scene scene,
Object ob 
) [static]
static void draw_view_axis ( RegionView3D rv3d) [static]
static void draw_view_icon ( RegionView3D rv3d) [static]
static void draw_viewport_fps ( Scene scene,
ARegion ar 
) [static]
static void draw_viewport_name ( ARegion ar,
View3D v3d 
) [static]
static void drawcursor ( Scene scene,
ARegion ar,
View3D v3d 
) [static]
static void drawfloor ( Scene scene,
View3D v3d,
const char **  grid_unit 
) [static]
static void drawgrid ( UnitSettings unit,
ARegion ar,
View3D v3d,
const char **  grid_unit 
) [static]
static void drawgrid_draw ( ARegion ar,
float  wx,
float  wy,
float  x,
float  y,
float  dx 
) [static]

Definition at line 220 of file view3d_draw.c.

References floorf, ARegion::winx, and ARegion::winy.

Referenced by drawgrid().

static void drawviewborder ( Scene scene,
ARegion ar,
View3D v3d 
) [static]
static void drawviewborder_grid3 ( float  x1,
float  x2,
float  y1,
float  y2,
float  fac 
) [static]

Definition at line 970 of file view3d_draw.c.

Referenced by drawviewborder().

static void drawviewborder_triangle ( float  x1,
float  x2,
float  y1,
float  y2,
const char  golden,
const char  dir 
) [static]

Definition at line 995 of file view3d_draw.c.

References SWAP, and simple_enum_gen::w.

Referenced by drawviewborder().

static DupliObject* dupli_step ( DupliObject dob) [static]

Definition at line 1755 of file view3d_draw.c.

References DupliObject::next, and DupliObject::no_draw.

Referenced by draw_dupli_objects_color().

void ED_view3d_calc_camera_border ( Scene scene,
ARegion ar,
View3D v3d,
RegionView3D rv3d,
rctf viewborder_r,
short  no_shift 
)
void ED_view3d_calc_camera_border_size ( Scene scene,
ARegion ar,
View3D v3d,
RegionView3D rv3d,
float  size_r[2] 
)
CustomDataMask ED_view3d_datamask ( Scene scene,
View3D v3d 
)
void ED_view3d_depth_update ( ARegion ar)
void ED_view3d_draw_offscreen ( Scene scene,
View3D v3d,
ARegion ar,
int  winx,
int  winy,
float  viewmat[][4],
float  winmat[][4] 
)
ImBuf* ED_view3d_draw_offscreen_imbuf ( Scene scene,
View3D v3d,
ARegion ar,
int  sizex,
int  sizey,
unsigned int  flag,
char  err_out[256] 
) [read]
ImBuf* ED_view3d_draw_offscreen_imbuf_simple ( Scene scene,
Object camera,
int  width,
int  height,
unsigned int  flag,
int  drawtype,
char  err_out[256] 
) [read]
CustomDataMask ED_view3d_object_datamask ( Scene scene)
CustomDataMask ED_view3d_screen_datamask ( bScreen screen)
int ED_view3d_test_clipping ( RegionView3D rv3d,
const float  vec[3],
const int  local 
)
static void gpu_render_lamp_update ( Scene scene,
View3D v3d,
Object ob,
Object par,
float  obmat[][4],
ListBase shadows 
) [static]
static void gpu_update_lamps_shadows ( Scene scene,
View3D v3d 
) [static]
static void star_stuff_init_func ( void  ) [static]

Definition at line 99 of file view3d_draw.c.

References cpack.

Referenced by view3d_main_area_draw_objects().

static void star_stuff_term_func ( void  ) [static]

Definition at line 109 of file view3d_draw.c.

Referenced by view3d_main_area_draw_objects().

static void star_stuff_vertex_func ( float *  i) [static]

Definition at line 105 of file view3d_draw.c.

Referenced by view3d_main_area_draw_objects().

static int test_clipping ( const float  vec[3],
float  clip[][4] 
) [static]

Definition at line 196 of file view3d_draw.c.

References copy_v3_v3(), and dot_v3v3().

Referenced by ED_view3d_test_clipping().

static void view3d_camera_border ( Scene scene,
ARegion ar,
View3D v3d,
RegionView3D rv3d,
rctf viewborder_r,
short  no_shift,
short  no_zoom 
) [static]
void view3d_clr_clipping ( void  )
float view3d_depth_near ( ViewDepths d)
static void view3d_draw_clipping ( RegionView3D rv3d) [static]
static void view3d_draw_transp ( Scene scene,
ARegion ar,
View3D v3d 
) [static]
static void view3d_draw_xray ( Scene scene,
ARegion ar,
View3D v3d,
int  clear 
) [static]
static void view3d_draw_xraytransp ( Scene scene,
ARegion ar,
View3D v3d,
int  clear 
) [static]
static const char* view3d_get_name ( View3D v3d,
RegionView3D rv3d 
) [static]
void view3d_main_area_draw ( const bContext C,
ARegion ar 
)
static int view3d_main_area_draw_engine ( const bContext C,
ARegion ar 
) [static]
static void view3d_main_area_draw_engine_info ( RegionView3D rv3d,
ARegion ar 
) [static]
static void view3d_main_area_draw_info ( const bContext C,
ARegion ar,
const char *  grid_unit 
) [static]
static void view3d_main_area_draw_objects ( const bContext C,
ARegion ar,
const char **  grid_unit 
) [static]

Definition at line 2668 of file view3d_draw.c.

References View3D::afterdraw_transp, View3D::afterdraw_xray, View3D::afterdraw_xraytransp, Scene::base, BDR_drawSketch(), BIF_draw_manipulator(), BKE_area_find_region_type(), RenderData::color_mgt_flag, copy_v3_v3(), CTX_data_scene(), CTX_wm_area(), CTX_wm_region_view3d(), CTX_wm_view3d(), draw_bgpic(), DRAW_CONSTCOLOR, draw_dupli_objects(), draw_dupli_objects_color(), draw_glsl_material(), draw_gpencil_view3d(), draw_object(), draw_rotation_guide(), DRAW_SCENESET, drawfloor(), drawgrid(), View3D::drawtype, ED_region_draw_cb_draw(), ED_region_pixelspace(), ED_region_tag_redraw(), FALSE, ListBase::first, Base::flag, View3D::flag, View3D::flag2, glLoadMatrixf, GPU_default_lights(), gpu_update_lamps_shadows(), View3D::grid, RegionView3D::gridview, World::horr, Base::lay, View3D::lay, View3D::lay_used, linearrgb_to_srgb_v3_v3(), World::mode, UserDef::ndof_flag, NDOF_SHOW_GUIDE, Base::next, NULL, OB_DUPLI, OB_WIRE, Scene::obedit, Base::object, RegionView3D::persp, Scene::r, R_COLOR_MANAGEMENT, RE_make_stars(), REGION_DRAW_POST_VIEW, REGION_DRAW_PRE_VIEW, RegionView3D::rflag, RGN_TYPE_HEADER, RV3D_CAMOB, RV3D_CLIPPING, RV3D_GPULIGHT_UPDATE, RV3D_LOCKED, RV3D_ORTHO, RV3D_VIEW_USER, SELECT, Scene::set, SETLOOPER, star_stuff_init_func(), star_stuff_term_func(), star_stuff_vertex_func(), TH_BACK, TH_WIRE, Object::transflag, TRUE, U, UI_ThemeClearColor(), UI_ThemeColorBlend(), Scene::unit, V3D_DISPBGPICS, V3D_RENDER_OVERRIDE, RegionView3D::view, view3d_clr_clipping(), view3d_draw_clipping(), view3d_draw_transp(), view3d_draw_xray(), view3d_draw_xraytransp(), view3d_main_area_setup_view(), view3d_set_clipping(), RegionView3D::viewlock, RegionView3D::viewmat, RegionView3D::winmat, WO_STARS, Scene::world, and View3D::zbuf.

Referenced by view3d_main_area_draw().

static void view3d_main_area_setup_view ( Scene scene,
View3D v3d,
ARegion ar,
float  viewmat[][4],
float  winmat[][4] 
) [static]
ImBuf* view3d_read_backbuf ( ViewContext vc,
short  xmin,
short  ymin,
short  xmax,
short  ymax 
) [read]
unsigned int view3d_sample_backbuf ( ViewContext vc,
int  x,
int  y 
)
unsigned int view3d_sample_backbuf_rect ( ViewContext vc,
const int  mval[2],
int  size,
unsigned int  min,
unsigned int  max,
int *  dist,
short  strict,
void *  handle,
unsigned int(*)(void *handle, unsigned int index)  indextest 
)
void view3d_set_clipping ( RegionView3D rv3d)
void view3d_update_depths_rect ( ARegion ar,
ViewDepths d,
rcti rect 
)
void view3d_validate_backbuf ( ViewContext vc)