Blender  V3.3
view3d_intern.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "ED_view3d.h"
11 
12 /* internal exports only */
13 
14 struct ARegion;
15 struct ARegionType;
16 struct BoundBox;
17 struct Depsgraph;
18 struct Object;
19 struct Scene;
20 struct ViewContext;
21 struct ViewLayer;
22 struct bContext;
23 struct wmGizmoGroupType;
24 struct wmGizmoType;
25 struct wmKeyConfig;
26 struct wmOperatorType;
27 struct wmWindowManager;
28 
29 /* view3d_header.c */
30 
32 
33 /* view3d_ops.c */
34 
35 void view3d_operatortypes(void);
36 
37 /* view3d_edit.c */
38 
55 
56 /* view3d_draw.c */
57 
58 void view3d_main_region_draw(const struct bContext *C, struct ARegion *region);
62 void view3d_draw_region_info(const struct bContext *C, struct ARegion *region);
63 
64 /* view3d_draw_legacy.c */
65 
67  struct ViewContext *vc,
68  struct Scene *scene,
69  struct ViewLayer *view_layer,
70  struct View3D *v3d,
71  struct ARegion *region,
72  bool use_obedit_skip,
73  bool use_nearest);
74 
76  struct Scene *scene,
77  struct ARegion *region,
78  View3D *v3d);
79 
80 void view3d_depths_rect_create(struct ARegion *region, struct rcti *rect, struct ViewDepths *r_d);
84 float view3d_depth_near(struct ViewDepths *d);
85 
86 /* view3d_select.c */
87 
88 void VIEW3D_OT_select(struct wmOperatorType *ot);
94 
95 /* view3d_utils.c */
96 
100 void view3d_boxview_copy(struct ScrArea *area, struct ARegion *region);
104 void view3d_boxview_sync(struct ScrArea *area, struct ARegion *region);
105 
107  const struct BoundBox *bb,
108  float obmat[4][4]);
109 bool ED_view3d_boundbox_clip(RegionView3D *rv3d, const struct BoundBox *bb);
110 
111 /* view3d_view.c */
112 
118 
123  struct ARegion *region,
124  const View3D *v3d,
125  const rcti *rect);
139  const struct Scene *scene,
140  const View3D *v3d,
141  RegionView3D *rv3d,
142  const float rect_scale[2]);
143 
144 /* Called in transform_ops.c, on each regeneration of key-maps. */
145 
146 /* view3d_placement.c */
147 
148 void viewplace_modal_keymap(struct wmKeyConfig *keyconf);
149 
150 /* view3d_buttons.c */
151 
153 void view3d_buttons_register(struct ARegionType *art);
154 
155 /* view3d_camera_control.c */
156 
162  struct Scene *scene,
163  View3D *v3d,
164  RegionView3D *rv3d);
169  bool use_autokey,
170  struct bContext *C,
171  bool do_rotate,
172  bool do_translate);
179 void ED_view3d_cameracontrol_release(struct View3DCameraControl *vctrl, bool restore);
184 
185 /* view3d_snap.c */
186 
191 bool ED_view3d_minmax_verts(struct Object *obedit, float min[3], float max[3]);
192 
200 
201 /* view3d_placement.c */
202 
204 
205 /* space_view3d.c */
206 
207 extern const char *view3d_context_dir[]; /* doc access */
208 
209 /* view3d_widgets.c */
210 
211 void VIEW3D_GGT_light_spot(struct wmGizmoGroupType *gzgt);
212 void VIEW3D_GGT_light_area(struct wmGizmoGroupType *gzgt);
213 void VIEW3D_GGT_light_target(struct wmGizmoGroupType *gzgt);
214 void VIEW3D_GGT_camera(struct wmGizmoGroupType *gzgt);
215 void VIEW3D_GGT_camera_view(struct wmGizmoGroupType *gzgt);
216 void VIEW3D_GGT_force_field(struct wmGizmoGroupType *gzgt);
217 void VIEW3D_GGT_empty_image(struct wmGizmoGroupType *gzgt);
219 void VIEW3D_GGT_navigate(struct wmGizmoGroupType *gzgt);
224 
225 void VIEW3D_GGT_ruler(struct wmGizmoGroupType *gzgt);
226 void VIEW3D_GT_ruler_item(struct wmGizmoType *gzt);
229 
230 void VIEW3D_GT_navigate_rotate(struct wmGizmoType *gzt);
231 
232 void VIEW3D_GGT_placement(struct wmGizmoGroupType *gzgt);
233 
234 /* workaround for trivial but noticeable camera bug caused by imprecision
235  * between view border calculation in 2D/3D space, workaround for bug T28037.
236  * without this define we get the old behavior which is to try and align them
237  * both which _mostly_ works fine, but when the camera moves beyond ~1000 in
238  * any direction it starts to fail */
239 #define VIEW3D_CAMERA_BORDER_HACK
240 #ifdef VIEW3D_CAMERA_BORDER_HACK
243 #endif
unsigned char uchar
Definition: BLI_sys_types.h:70
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
#define C
Definition: RandGen.cpp:25
Scene scene
const Depsgraph * depsgraph
static void area(int d1, int d2, int e1, int e2, float weights[2])
#define min(a, b)
Definition: sort.c:35
float max
void VIEW3D_GT_ruler_item(struct wmGizmoType *gzt)
bool ED_view3d_minmax_verts(struct Object *obedit, float min[3], float max[3])
Definition: view3d_snap.c:1000
void VIEW3D_OT_snap_selected_to_grid(struct wmOperatorType *ot)
Definition: view3d_snap.c:267
void VIEW3D_OT_zoom_camera_1_to_1(struct wmOperatorType *ot)
Definition: view3d_edit.c:444
void VIEW3D_OT_toggle_shading(struct wmOperatorType *ot)
Definition: view3d_edit.c:1170
void VIEW3D_OT_camera_to_view(struct wmOperatorType *ot)
Definition: view3d_view.c:100
void VIEW3D_GGT_light_area(struct wmGizmoGroupType *gzgt)
float view3d_depth_near(struct ViewDepths *d)
Definition: view3d_draw.c:2271
void view3d_depths_rect_create(struct ARegion *region, struct rcti *rect, struct ViewDepths *r_d)
Definition: view3d_draw.c:2206
void VIEW3D_GGT_placement(struct wmGizmoGroupType *gzgt)
void view3d_operatortypes(void)
Definition: view3d_ops.c:135
void view3d_draw_region_info(const struct bContext *C, struct ARegion *region)
void ED_view3d_cameracontrol_update(struct View3DCameraControl *vctrl, bool use_autokey, struct bContext *C, bool do_rotate, bool do_translate)
void VIEW3D_OT_clip_border(struct wmOperatorType *ot)
Definition: view3d_edit.c:793
void VIEW3D_GGT_ruler(struct wmGizmoGroupType *gzgt)
void VIEW3D_GGT_camera_view(struct wmGizmoGroupType *gzgt)
void VIEW3D_OT_select_box(struct wmOperatorType *ot)
void VIEW3D_OT_drop_world(struct wmOperatorType *ot)
Definition: view3d_edit.c:713
void VIEW3D_OT_toggle_xray(struct wmOperatorType *ot)
Definition: view3d_edit.c:1225
void VIEW3D_OT_snap_selected_to_active(struct wmOperatorType *ot)
Definition: view3d_snap.c:652
void VIEW3D_GT_navigate_rotate(struct wmGizmoType *gzt)
void VIEW3D_OT_snap_selected_to_cursor(struct wmOperatorType *ot)
Definition: view3d_snap.c:608
void VIEW3D_OT_background_image_add(struct wmOperatorType *ot)
Definition: view3d_edit.c:595
void VIEW3D_OT_render_border(struct wmOperatorType *ot)
Definition: view3d_edit.c:326
void VIEW3D_OT_snap_cursor_to_selected(struct wmOperatorType *ot)
Definition: view3d_snap.c:893
void VIEW3D_OT_background_image_remove(struct wmOperatorType *ot)
Definition: view3d_edit.c:660
struct View3DCameraControl * ED_view3d_cameracontrol_acquire(struct Depsgraph *depsgraph, struct Scene *scene, View3D *v3d, RegionView3D *rv3d)
void VIEW3D_OT_view_persportho(struct wmOperatorType *ot)
Definition: view3d_edit.c:489
void view3d_boxview_sync(struct ScrArea *area, struct ARegion *region)
Definition: view3d_utils.c:890
uchar view3d_camera_border_hack_col[3]
Definition: drawobject.c:38
void ED_view3d_draw_select_loop(struct Depsgraph *depsgraph, struct ViewContext *vc, struct Scene *scene, struct ViewLayer *view_layer, struct View3D *v3d, struct ARegion *region, bool use_obedit_skip, bool use_nearest)
void view3d_winmatrix_set(struct Depsgraph *depsgraph, struct ARegion *region, const View3D *v3d, const rcti *rect)
Definition: view3d_view.c:306
void VIEW3D_GGT_tool_generic_handle_normal(struct wmGizmoGroupType *gzgt)
bool view3d_camera_border_hack_test
Definition: drawobject.c:39
void VIEW3D_OT_select(struct wmOperatorType *ot)
void VIEW3D_OT_bone_select_menu(struct wmOperatorType *ot)
void VIEW3D_OT_camera_to_view_selected(struct wmOperatorType *ot)
Definition: view3d_view.c:143
void VIEW3D_OT_view_lock_to_active(struct wmOperatorType *ot)
Definition: view3d_edit.c:147
void VIEW3D_OT_toggle_matcap_flip(struct wmOperatorType *ot)
Definition: view3d_header.c:67
void VIEW3D_OT_ruler_remove(struct wmOperatorType *ot)
void VIEW3D_OT_select_menu(struct wmOperatorType *ot)
void VIEW3D_OT_cursor3d(struct wmOperatorType *ot)
Definition: view3d_edit.c:1076
void view3d_buttons_register(struct ARegionType *art)
void VIEW3D_GGT_mesh_preselect_elem(struct wmGizmoGroupType *gzgt)
void view3d_main_region_draw(const struct bContext *C, struct ARegion *region)
void VIEW3D_OT_ruler_add(struct wmOperatorType *ot)
void VIEW3D_OT_view_center_lock(struct wmOperatorType *ot)
Definition: view3d_edit.c:232
void VIEW3D_OT_select_circle(struct wmOperatorType *ot)
const char * view3d_context_dir[]
void VIEW3D_OT_select_lasso(struct wmOperatorType *ot)
struct Object * ED_view3d_cameracontrol_object_get(struct View3DCameraControl *vctrl)
void VIEW3D_GGT_empty_image(struct wmGizmoGroupType *gzgt)
void VIEW3D_OT_snap_cursor_to_grid(struct wmOperatorType *ot)
Definition: view3d_snap.c:694
void VIEW3D_OT_navigate(struct wmOperatorType *ot)
Definition: view3d_edit.c:529
void VIEW3D_GGT_light_spot(struct wmGizmoGroupType *gzgt)
void VIEW3D_OT_clear_render_border(struct wmOperatorType *ot)
Definition: view3d_edit.c:386
void VIEW3D_GGT_light_target(struct wmGizmoGroupType *gzgt)
void VIEW3D_GGT_armature_spline(struct wmGizmoGroupType *gzgt)
void ED_view3d_draw_depth_loop(struct Depsgraph *depsgraph, struct Scene *scene, struct ARegion *region, View3D *v3d)
void VIEW3D_GGT_camera(struct wmGizmoGroupType *gzgt)
void VIEW3D_GGT_navigate(struct wmGizmoGroupType *gzgt)
void VIEW3D_OT_localview(struct wmOperatorType *ot)
Definition: view3d_view.c:1070
bool ED_view3d_boundbox_clip(RegionView3D *rv3d, const struct BoundBox *bb)
void VIEW3D_GGT_mesh_preselect_edgering(struct wmGizmoGroupType *gzgt)
void VIEW3D_OT_object_mode_pie_or_toggle(struct wmOperatorType *ot)
void VIEW3D_OT_snap_cursor_to_center(struct wmOperatorType *ot)
Definition: view3d_snap.c:979
void VIEW3D_OT_interactive_add(struct wmOperatorType *ot)
void VIEW3D_OT_object_as_camera(struct wmOperatorType *ot)
Definition: view3d_view.c:285
void VIEW3D_OT_localview_remove_from(struct wmOperatorType *ot)
Definition: view3d_view.c:1132
void view3d_boxview_copy(struct ScrArea *area, struct ARegion *region)
Definition: view3d_utils.c:914
void viewplace_modal_keymap(struct wmKeyConfig *keyconf)
void VIEW3D_OT_view_lock_clear(struct wmOperatorType *ot)
Definition: view3d_edit.c:90
void view3d_viewmatrix_set(struct Depsgraph *depsgraph, const struct Scene *scene, const View3D *v3d, RegionView3D *rv3d, const float rect_scale[2])
void VIEW3D_OT_snap_cursor_to_active(struct wmOperatorType *ot)
Definition: view3d_snap.c:942
bool ED_view3d_boundbox_clip_ex(const RegionView3D *rv3d, const struct BoundBox *bb, float obmat[4][4])
void ED_view3d_cameracontrol_release(struct View3DCameraControl *vctrl, bool restore)
void VIEW3D_OT_view_center_camera(struct wmOperatorType *ot)
Definition: view3d_edit.c:200
void VIEW3D_GGT_tool_generic_handle_free(struct wmGizmoGroupType *gzgt)
void VIEW3D_GGT_force_field(struct wmGizmoGroupType *gzgt)
wmOperatorType * ot
Definition: wm_files.c:3479