4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * The Original Code is Copyright (C) 2008 Blender Foundation.
21 * All rights reserved.
24 * Contributor(s): Blender Foundation
26 * ***** END GPL LICENSE BLOCK *****
28 #ifndef ED_VIEW3D_INTERN_H
29 #define ED_VIEW3D_INTERN_H
31 #include "ED_view3d.h"
33 /* internal exports only */
40 struct wmOperatorType;
42 struct wmWindowManager;
47 struct bAnimVizSettings;
50 #define BL_NEAR_CLIP 0.001
53 #define DRAW_PICKING 1
54 #define DRAW_CONSTCOLOR 2
55 #define DRAW_SCENESET 4
60 #define V3D_SELECT_MOUSE 1
63 void view3d_header_buttons(const struct bContext *C, struct ARegion *ar);
64 void VIEW3D_OT_layers(struct wmOperatorType *ot);
67 void view3d_operatortypes(void);
68 void view3d_keymap(struct wmKeyConfig *keyconf);
71 void VIEW3D_OT_zoom(struct wmOperatorType *ot);
72 void VIEW3D_OT_move(struct wmOperatorType *ot);
73 void VIEW3D_OT_rotate(struct wmOperatorType *ot);
74 void VIEW3D_OT_ndof(struct wmOperatorType *ot);
75 void VIEW3D_OT_view_all(struct wmOperatorType *ot);
76 void VIEW3D_OT_viewnumpad(struct wmOperatorType *ot);
77 void VIEW3D_OT_view_selected(struct wmOperatorType *ot);
78 void VIEW3D_OT_view_center_cursor(struct wmOperatorType *ot);
79 void VIEW3D_OT_view_center_camera(struct wmOperatorType *ot);
80 void VIEW3D_OT_view_pan(struct wmOperatorType *ot);
81 void VIEW3D_OT_view_persportho(struct wmOperatorType *ot);
82 void VIEW3D_OT_add_background_image(struct wmOperatorType *ot);
83 void VIEW3D_OT_remove_background_image(struct wmOperatorType *ot);
84 void VIEW3D_OT_view_orbit(struct wmOperatorType *ot);
85 void VIEW3D_OT_clip_border(struct wmOperatorType *ot);
86 void VIEW3D_OT_cursor3d(struct wmOperatorType *ot);
87 void VIEW3D_OT_manipulator(struct wmOperatorType *ot);
88 void VIEW3D_OT_enable_manipulator(struct wmOperatorType *ot);
89 void VIEW3D_OT_render_border(struct wmOperatorType *ot);
90 void VIEW3D_OT_zoom_border(struct wmOperatorType *ot);
91 void VIEW3D_OT_drawtype(struct wmOperatorType *ot);
93 void view3d_boxview_copy(ScrArea *sa, ARegion *ar);
96 void draw_motion_paths_init(Scene *scene, View3D *v3d, struct ARegion *ar);
97 void draw_motion_path_instance(Scene *scene, View3D *v3d, struct ARegion *ar,
98 struct Object *ob, struct bPoseChannel *pchan,
99 struct bAnimVizSettings *avs, struct bMotionPath *mpath);
100 void draw_motion_paths_cleanup(Scene *scene, View3D *v3d, struct ARegion *ar);
103 void draw_object(Scene *scene, struct ARegion *ar, View3D *v3d, Base *base, int flag);
104 int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, int dt);
105 void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, int dt, int outline);
106 void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob);
107 void drawaxes(float size, int flag, char drawtype);
109 void view3d_cached_text_draw_begin(void);
110 void view3d_cached_text_draw_add(float x, float y, float z, char *str, short xoffs, short flag);
111 void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, float mat[][4]);
112 #define V3D_CACHE_TEXT_ZBUF 1
113 #define V3D_CACHE_TEXT_WORLDSPACE 2
116 int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag);
119 void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, struct DerivedMesh *dm, int faceselect);
122 void view3d_main_area_draw(const struct bContext *C, struct ARegion *ar);
123 void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (* func)(void *));
124 void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d);
125 void view3d_clr_clipping(void);
126 void view3d_set_clipping(RegionView3D *rv3d);
127 void add_view3d_after(View3D *v3d, Base *base, int type, int flag);
128 void calc_viewborder(Scene *scene, struct ARegion *ar, struct RegionView3D *rv3d, View3D *v3d, rctf *viewborder_r);
130 void circf(float x, float y, float rad);
131 void circ(float x, float y, float rad);
132 void view3d_update_depths(struct ARegion *ar, View3D *v3d);
134 /* view3d_select.c */
135 void VIEW3D_OT_select(struct wmOperatorType *ot);
136 void VIEW3D_OT_select_extend(struct wmOperatorType *ot);
137 void VIEW3D_OT_select_circle(struct wmOperatorType *ot);
138 void VIEW3D_OT_select_border(struct wmOperatorType *ot);
139 void VIEW3D_OT_select_lasso(struct wmOperatorType *ot);
142 void view3d_settings_from_ob(struct Object *ob, float *ofs, float *quat, float *dist, float *lens);
144 void VIEW3D_OT_smoothview(struct wmOperatorType *ot);
145 void VIEW3D_OT_setcameratoview(struct wmOperatorType *ot);
146 void VIEW3D_OT_object_as_camera(struct wmOperatorType *ot);
147 void VIEW3D_OT_localview(struct wmOperatorType *ot);
148 void VIEW3D_OT_game_start(struct wmOperatorType *ot);
149 void VIEW3D_OT_fly(struct wmOperatorType *ot);
152 int boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox *bb);
154 void centerview(struct ARegion *ar, View3D *v3d);
156 void smooth_view(struct bContext *C, Object *, Object *, float *ofs, float *quat, float *dist, float *lens);
158 void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect); /* rect: for picking */
159 void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d);
161 void fly_modal_keymap(struct wmKeyConfig *keyconf);
162 void viewrotate_modal_keymap(struct wmKeyConfig *keyconf);
163 void viewmove_modal_keymap(struct wmKeyConfig *keyconf);
164 void viewzoom_modal_keymap(struct wmKeyConfig *keyconf);
166 /* view3d_buttons.c */
167 void VIEW3D_OT_properties(struct wmOperatorType *ot);
168 void view3d_buttons_register(struct ARegionType *art);
170 /* view3d_toolbar.c */
171 void VIEW3D_OT_toolshelf(struct wmOperatorType *ot);
172 void view3d_toolshelf_register(struct ARegionType *art);
173 void view3d_tool_props_register(struct ARegionType *art);
176 int minmax_verts(Object *obedit, float *min, float *max);
178 void VIEW3D_OT_snap_selected_to_grid(struct wmOperatorType *ot);
179 void VIEW3D_OT_snap_selected_to_cursor(struct wmOperatorType *ot);
180 void VIEW3D_OT_snap_cursor_to_grid(struct wmOperatorType *ot);
181 void VIEW3D_OT_snap_cursor_to_center(struct wmOperatorType *ot);
182 void VIEW3D_OT_snap_cursor_to_selected(struct wmOperatorType *ot);
183 void VIEW3D_OT_snap_cursor_to_active(struct wmOperatorType *ot);
186 ARegion *view3d_has_buttons_region(ScrArea *sa);
187 ARegion *view3d_has_tools_region(ScrArea *sa);
190 void draw_volume(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct Base *base, struct GPUTexture *tex, float *min, float *max, int res[3], float dx, struct GPUTexture *tex_shadow);
193 #endif /* ED_VIEW3D_INTERN_H */