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 *****
31 /* ********* exports for space_view3d/ module ********** */
45 /* for derivedmesh drawing callbacks, for view3d_select, .... */
46 typedef struct ViewContext {
57 float *give_cursor(struct Scene *scene, struct View3D *v3d);
59 void initgrabz(struct View3D *v3d, float x, float y, float z);
60 void window_to_3d(struct ARegion *ar, struct View3D *v3d, float *vec, short mx, short my);
64 void project_short(struct ARegion *ar, struct View3D *v3d, float *vec, short *adr);
65 void project_short_noclip(struct ARegion *ar, struct View3D *v3d, float *vec, short *adr);
67 void project_int(struct ARegion *ar, struct View3D *v3d, float *vec, int *adr);
68 void project_int_noclip(struct ARegion *ar, struct View3D *v3d, float *vec, int *adr);
70 void project_float(struct ARegion *ar, struct View3D *v3d, float *vec, float *adr);
71 void project_float_noclip(struct ARegion *ar, struct View3D *v3d, float *vec, float *adr);
73 void viewline(struct ARegion *ar, struct View3D *v3d, short mval[2], float ray_start[3], float ray_end[3]);
74 void viewray(struct ARegion *ar, struct View3D *v3d, short mval[2], float ray_start[3], float ray_normal[3]);
76 /* drawobject.c itterators */
77 void mesh_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct EditVert *eve, int x, int y, int index), void *userData, int clipVerts);
78 void mesh_foreachScreenEdge(struct ViewContext *vc, void (*func)(void *userData, struct EditEdge *eed, int x0, int y0, int x1, int y1, int index), void *userData, int clipVerts);
79 void mesh_foreachScreenFace(struct ViewContext *vc, void (*func)(void *userData, struct EditFace *efa, int x, int y, int index), void *userData);
80 void nurbs_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct Nurb *nu, struct BPoint *bp, struct BezTriple *bezt, int beztindex, int x, int y), void *userData);
81 void lattice_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct BPoint *bp, int x, int y), void *userData);
83 int view3d_test_clipping(struct View3D *v3d, float *vec);
84 void view3d_align_axis_to_vector(struct Scene *scene, struct View3D *v3d, int axisidx, float vec[3]);
86 void drawcircball(int mode, float *cent, float rad, float tmat[][4]);
88 /* backbuffer select and draw support */
89 struct ImBuf *view3d_read_backbuf(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
90 unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, unsigned int (*indextest)(unsigned int index));
91 unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y);
94 #define MAXPICKBUF 10000
95 short view3d_opengl_select(struct ViewContext *vc, unsigned int *buffer, unsigned int bufsize, rcti *input);
96 void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc);
97 /* XXX should move to arithb.c */
98 int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2);
101 void ED_view3d_exit_paint_modes(struct bContext *C);
104 #endif /* ED_VIEW3D_H */