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 *****
29 /** \file blender/editors/space_view3d/view3d_intern.h
33 #ifndef ED_VIEW3D_INTERN_H
34 #define ED_VIEW3D_INTERN_H
36 #include "ED_view3d.h"
38 /* internal exports only */
45 struct wmOperatorType;
47 struct wmWindowManager;
52 struct bAnimVizSettings;
55 #define BL_NEAR_CLIP 0.001
58 #define DRAW_PICKING 1
59 #define DRAW_CONSTCOLOR 2
60 #define DRAW_SCENESET 4
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);
70 void VIEW3D_OT_zoom(struct wmOperatorType *ot);
71 void VIEW3D_OT_dolly(struct wmOperatorType *ot);
72 void VIEW3D_OT_zoom_camera_1_to_1(struct wmOperatorType *ot);
73 void VIEW3D_OT_move(struct wmOperatorType *ot);
74 void VIEW3D_OT_rotate(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_background_image_add(struct wmOperatorType *ot);
83 void VIEW3D_OT_background_image_remove(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 view3d_keymap(struct wmKeyConfig *keyconf);
97 void VIEW3D_OT_fly(struct wmOperatorType *ot);
100 void draw_motion_paths_init(View3D *v3d, struct ARegion *ar);
101 void draw_motion_path_instance(Scene *scene,
102 struct Object *ob, struct bPoseChannel *pchan,
103 struct bAnimVizSettings *avs, struct bMotionPath *mpath);
104 void draw_motion_paths_cleanup(View3D *v3d);
109 void draw_object(Scene *scene, struct ARegion *ar, View3D *v3d, Base *base, int flag);
110 int draw_glsl_material(Scene *scene, struct Object *ob, View3D *v3d, int dt);
111 void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob, int dt, int outline);
112 void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob);
113 void drawaxes(float size, char drawtype);
115 void view3d_cached_text_draw_begin(void);
116 void view3d_cached_text_draw_add(const float co[3], const char *str, short xoffs, short flag, const unsigned char col[4]);
117 void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, float mat[][4]);
118 #define V3D_CACHE_TEXT_ZBUF (1<<0)
119 #define V3D_CACHE_TEXT_WORLDSPACE (1<<1)
120 #define V3D_CACHE_TEXT_ASCII (1<<2)
123 int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag);
126 void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob, struct DerivedMesh *dm, int faceselect);
129 void view3d_main_area_draw(const struct bContext *C, struct ARegion *ar);
130 void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (* func)(void *));
131 void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d);
132 void view3d_clr_clipping(void);
133 void view3d_set_clipping(RegionView3D *rv3d);
134 void add_view3d_after(ListBase *lb, Base *base, int flag);
135 void view3d_viewborder_size_get(struct Scene *scene, struct ARegion *ar, float size_r[2]);
137 void circf(float x, float y, float rad);
138 void circ(float x, float y, float rad);
139 void view3d_update_depths_rect(struct ARegion *ar, struct ViewDepths *d, struct rcti *rect);
140 float view3d_depth_near(struct ViewDepths *d);
142 /* view3d_select.c */
143 void VIEW3D_OT_select(struct wmOperatorType *ot);
144 void VIEW3D_OT_select_extend(struct wmOperatorType *ot);
145 void VIEW3D_OT_select_circle(struct wmOperatorType *ot);
146 void VIEW3D_OT_select_border(struct wmOperatorType *ot);
147 void VIEW3D_OT_select_lasso(struct wmOperatorType *ot);
149 void VIEW3D_OT_smoothview(struct wmOperatorType *ot);
150 void VIEW3D_OT_setcameratoview(struct wmOperatorType *ot);
151 void VIEW3D_OT_object_as_camera(struct wmOperatorType *ot);
152 void VIEW3D_OT_localview(struct wmOperatorType *ot);
153 void VIEW3D_OT_game_start(struct wmOperatorType *ot);
156 int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox *bb);
158 void smooth_view(struct bContext *C, struct View3D *v3d, struct ARegion *ar, struct Object *, struct Object *, float *ofs, float *quat, float *dist, float *lens);
160 void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect); /* rect: for picking */
161 void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d);
163 void fly_modal_keymap(struct wmKeyConfig *keyconf);
164 void viewrotate_modal_keymap(struct wmKeyConfig *keyconf);
165 void viewmove_modal_keymap(struct wmKeyConfig *keyconf);
166 void viewzoom_modal_keymap(struct wmKeyConfig *keyconf);
167 void viewdolly_modal_keymap(struct wmKeyConfig *keyconf);
169 /* view3d_buttons.c */
170 void VIEW3D_OT_properties(struct wmOperatorType *ot);
171 void view3d_buttons_register(struct ARegionType *art);
173 /* view3d_toolbar.c */
174 void VIEW3D_OT_toolshelf(struct wmOperatorType *ot);
175 void view3d_toolshelf_register(struct ARegionType *art);
176 void view3d_tool_props_register(struct ARegionType *art);
179 int minmax_verts(struct Object *obedit, float *min, float *max);
181 void VIEW3D_OT_snap_selected_to_grid(struct wmOperatorType *ot);
182 void VIEW3D_OT_snap_selected_to_cursor(struct wmOperatorType *ot);
183 void VIEW3D_OT_snap_cursor_to_grid(struct wmOperatorType *ot);
184 void VIEW3D_OT_snap_cursor_to_center(struct wmOperatorType *ot);
185 void VIEW3D_OT_snap_cursor_to_selected(struct wmOperatorType *ot);
186 void VIEW3D_OT_snap_cursor_to_active(struct wmOperatorType *ot);
189 ARegion *view3d_has_buttons_region(ScrArea *sa);
190 ARegion *view3d_has_tools_region(ScrArea *sa);
192 extern const char *view3d_context_dir[]; /* doc access */
195 void draw_volume(struct ARegion *ar, struct GPUTexture *tex, float *min, float *max, int res[3], float dx, struct GPUTexture *tex_shadow);
198 #endif /* ED_VIEW3D_INTERN_H */