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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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;
46 typedef struct ViewDepths {
49 double depth_range[2];
55 #define DRAW_PICKING 1
56 #define DRAW_CONSTCOLOR 2
57 #define DRAW_SCENESET 4
62 #define V3D_SELECT_MOUSE 1
65 #define IS_CLIPPED 12000
68 void view3d_header_buttons(const struct bContext *C, struct ARegion *ar);
71 void view3d_operatortypes(void);
72 void view3d_keymap(struct wmWindowManager *wm);
75 void VIEW3D_OT_viewzoom(struct wmOperatorType *ot);
76 void VIEW3D_OT_viewmove(struct wmOperatorType *ot);
77 void VIEW3D_OT_viewrotate(struct wmOperatorType *ot);
78 void VIEW3D_OT_viewhome(struct wmOperatorType *ot);
79 void VIEW3D_OT_viewnumpad(struct wmOperatorType *ot);
80 void VIEW3D_OT_viewcenter(struct wmOperatorType *ot);
81 void VIEW3D_OT_clipping(struct wmOperatorType *ot);
82 void VIEW3D_OT_cursor3d(struct wmOperatorType *ot);
83 void VIEW3D_OT_render_border(struct wmOperatorType *ot);
84 void VIEW3D_OT_border_zoom(struct wmOperatorType *ot);
85 void VIEW3D_OT_drawtype(struct wmOperatorType *ot);
88 void draw_object(Scene *scene, struct ARegion *ar, View3D *v3d, Base *base, int flag);
89 int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, int dt);
90 void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, int dt, int outline);
91 void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob);
92 void drawaxes(float size, int flag, char drawtype);
95 int draw_armature(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int dt, int flag);
98 void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, struct DerivedMesh *dm, int faceselect);
101 void view3d_main_area_draw(const struct bContext *C, struct ARegion *ar);
102 void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (* func)(void *));
103 void view3d_clr_clipping(void);
104 void view3d_set_clipping(RegionView3D *rv3d);
105 void add_view3d_after(View3D *v3d, Base *base, int type, int flag);
106 void make_axis_color(char *col, char *col2, char axis);
107 void calc_viewborder(Scene *scene, struct ARegion *ar, View3D *v3d, rctf *viewborder_r);
109 void circf(float x, float y, float rad);
110 void circ(float x, float y, float rad);
111 void view3d_update_depths(struct ARegion *ar, View3D *v3d);
113 /* view3d_select.c */
114 void VIEW3D_OT_select(struct wmOperatorType *ot);
115 void VIEW3D_OT_select_extend(struct wmOperatorType *ot);
116 void VIEW3D_OT_circle_select(struct wmOperatorType *ot);
117 void VIEW3D_OT_borderselect(struct wmOperatorType *ot);
118 void VIEW3D_OT_lasso_select(struct wmOperatorType *ot);
121 void VIEW3D_OT_vpaint_toggle(struct wmOperatorType *ot);
122 void VIEW3D_OT_vpaint(struct wmOperatorType *ot);
123 void VIEW3D_OT_wpaint_toggle(struct wmOperatorType *ot);
124 void VIEW3D_OT_wpaint(struct wmOperatorType *ot);
127 void VIEW3D_OT_smoothview(struct wmOperatorType *ot);
128 void VIEW3D_OT_setcameratoview(struct wmOperatorType *ot);
130 int boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox *bb);
132 void view3d_project_short_clip(struct ARegion *ar, float *vec, short *adr, float projmat[4][4], float wmat[4][4]);
133 void view3d_project_short_noclip(struct ARegion *ar, float *vec, short *adr, float mat[4][4]);
134 void view3d_project_float(struct ARegion *a, float *vec, float *adr, float mat[4][4]);
135 void view3d_get_object_project_mat(RegionView3D *v3d, struct Object *ob, float pmat[4][4], float vmat[4][4]);
137 int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize);
139 void initlocalview(Scene *scene, struct ARegion *ar, View3D *v3d);
140 void restore_localviewdata(View3D *vd);
141 void endlocalview(Scene *scene, ScrArea *sa);
143 void centerview(struct ARegion *ar, View3D *v3d);
145 void smooth_view(struct bContext *C, Object *, Object *, float *ofs, float *quat, float *dist, float *lens);
147 void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect); /* rect: for picking */
148 void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d);
150 #endif /* ED_VIEW3D_INTERN_H */