Blender V2.61 - r43446

view3d_intern.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version. 
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2008 Blender Foundation.
00019  * All rights reserved.
00020  *
00021  * 
00022  * Contributor(s): Blender Foundation
00023  *
00024  * ***** END GPL LICENSE BLOCK *****
00025  */
00026 
00031 #ifndef ED_VIEW3D_INTERN_H
00032 #define ED_VIEW3D_INTERN_H
00033 
00034 #include "ED_view3d.h"
00035 
00036 /* internal exports only */
00037 
00038 struct bScreen;
00039 struct ARegion;
00040 struct BoundBox;
00041 struct Object;
00042 struct DerivedMesh;
00043 struct wmOperatorType;
00044 struct bContext;
00045 struct wmWindowManager;
00046 struct EditMesh;
00047 struct ViewContext;
00048 struct ARegionType;
00049 struct bPoseChannel;
00050 struct bAnimVizSettings;
00051 struct bMotionPath;
00052 struct wmNDOFMotionData;
00053 
00054 #define BL_NEAR_CLIP 0.001
00055 
00056 /* drawing flags: */
00057 #define DRAW_PICKING    1
00058 #define DRAW_CONSTCOLOR 2
00059 #define DRAW_SCENESET   4
00060 
00061 /* draw_mesh_fancy/draw_mesh_textured draw_flags */
00062 #define DRAW_DYNAMIC_PAINT_PREVIEW 1
00063 #define DRAW_FACE_SELECT 2
00064 
00065 /* view3d_header.c */
00066 void view3d_header_buttons(const struct bContext *C, struct ARegion *ar);
00067 void VIEW3D_OT_layers(struct wmOperatorType *ot);
00068 
00069 /* view3d_ops.c */
00070 void view3d_operatortypes(void);
00071 
00072 /* view3d_edit.c */
00073 void VIEW3D_OT_zoom(struct wmOperatorType *ot);
00074 void VIEW3D_OT_dolly(struct wmOperatorType *ot);
00075 void VIEW3D_OT_zoom_camera_1_to_1(struct wmOperatorType *ot);
00076 void VIEW3D_OT_move(struct wmOperatorType *ot);
00077 void VIEW3D_OT_rotate(struct wmOperatorType *ot);
00078 void VIEW3D_OT_ndof_orbit(struct wmOperatorType *ot);
00079 void VIEW3D_OT_ndof_pan(struct wmOperatorType *ot);
00080 void VIEW3D_OT_view_all(struct wmOperatorType *ot);
00081 void VIEW3D_OT_viewnumpad(struct wmOperatorType *ot);
00082 void VIEW3D_OT_view_selected(struct wmOperatorType *ot);
00083 void VIEW3D_OT_view_center_cursor(struct wmOperatorType *ot);
00084 void VIEW3D_OT_view_center_camera(struct wmOperatorType *ot);
00085 void VIEW3D_OT_view_pan(struct wmOperatorType *ot);
00086 void VIEW3D_OT_view_persportho(struct wmOperatorType *ot);
00087 void VIEW3D_OT_background_image_add(struct wmOperatorType *ot);
00088 void VIEW3D_OT_background_image_remove(struct wmOperatorType *ot);
00089 void VIEW3D_OT_view_orbit(struct wmOperatorType *ot);
00090 void VIEW3D_OT_clip_border(struct wmOperatorType *ot);
00091 void VIEW3D_OT_cursor3d(struct wmOperatorType *ot);
00092 void VIEW3D_OT_manipulator(struct wmOperatorType *ot);
00093 void VIEW3D_OT_enable_manipulator(struct wmOperatorType *ot);
00094 void VIEW3D_OT_render_border(struct wmOperatorType *ot);
00095 void VIEW3D_OT_zoom_border(struct wmOperatorType *ot);
00096 void VIEW3D_OT_drawtype(struct wmOperatorType *ot);
00097 
00098 void view3d_boxview_copy(ScrArea *sa, ARegion *ar);
00099 void ndof_to_quat(struct wmNDOFMotionData* ndof, float q[4]);
00100 float ndof_to_axis_angle(struct wmNDOFMotionData* ndof, float axis[3]);
00101 
00102 /* view3d_fly.c */
00103 void view3d_keymap(struct wmKeyConfig *keyconf);
00104 void VIEW3D_OT_fly(struct wmOperatorType *ot);
00105 
00106 /* drawanim.c */
00107 void draw_motion_paths_init(View3D *v3d, struct ARegion *ar);
00108 void draw_motion_path_instance(Scene *scene,
00109             struct Object *ob, struct bPoseChannel *pchan, 
00110             struct bAnimVizSettings *avs, struct bMotionPath *mpath);
00111 void draw_motion_paths_cleanup(View3D *v3d);
00112 
00113 
00114 
00115 /* drawobject.c */
00116 void draw_object(Scene *scene, struct ARegion *ar, View3D *v3d, Base *base, int flag);
00117 int draw_glsl_material(Scene *scene, struct Object *ob, View3D *v3d, int dt);
00118 void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob, int dt, int outline);
00119 void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob);
00120 void drawaxes(float size, char drawtype);
00121 
00122 void view3d_cached_text_draw_begin(void);
00123 void view3d_cached_text_draw_add(const float co[3], const char *str, short xoffs, short flag, const unsigned char col[4]);
00124 void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, float mat[][4]);
00125 #define V3D_CACHE_TEXT_ZBUF         (1<<0)
00126 #define V3D_CACHE_TEXT_WORLDSPACE   (1<<1)
00127 #define V3D_CACHE_TEXT_ASCII        (1<<2)
00128 #define V3D_CACHE_TEXT_GLOBALSPACE  (1<<3)
00129 
00130 /* drawarmature.c */
00131 int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag, const short is_outline);
00132 
00133 /* drawmesh.c */
00134 void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob, struct DerivedMesh *dm, int faceselect);
00135 
00136 /* view3d_draw.c */
00137 void view3d_main_area_draw(const struct bContext *C, struct ARegion *ar);
00138 void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (* func)(void *));
00139 void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d);
00140 void view3d_clr_clipping(void);
00141 void view3d_set_clipping(RegionView3D *rv3d);
00142 void add_view3d_after(ListBase *lb, Base *base, int flag);
00143 
00144 void circf(float x, float y, float rad);
00145 void circ(float x, float y, float rad);
00146 void view3d_update_depths_rect(struct ARegion *ar, struct ViewDepths *d, struct rcti *rect);
00147 float view3d_depth_near(struct ViewDepths *d);
00148 
00149 /* view3d_select.c */
00150 void VIEW3D_OT_select(struct wmOperatorType *ot);
00151 void VIEW3D_OT_select_extend(struct wmOperatorType *ot);
00152 void VIEW3D_OT_select_circle(struct wmOperatorType *ot);
00153 void VIEW3D_OT_select_border(struct wmOperatorType *ot);
00154 void VIEW3D_OT_select_lasso(struct wmOperatorType *ot);
00155 void VIEW3D_OT_select_menu(struct wmOperatorType *ot);
00156 
00157 void VIEW3D_OT_smoothview(struct wmOperatorType *ot);
00158 void VIEW3D_OT_camera_to_view(struct wmOperatorType *ot);
00159 void VIEW3D_OT_camera_to_view_selected(struct wmOperatorType *ot);
00160 void VIEW3D_OT_object_as_camera(struct wmOperatorType *ot);
00161 void VIEW3D_OT_localview(struct wmOperatorType *ot);
00162 void VIEW3D_OT_game_start(struct wmOperatorType *ot);
00163 
00164 
00165 int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox *bb);
00166 
00167 void smooth_view(struct bContext *C, struct View3D *v3d, struct ARegion *ar, struct Object *, struct Object *, float *ofs, float *quat, float *dist, float *lens);
00168 
00169 void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect);  /* rect: for picking */
00170 void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d);
00171 
00172 void fly_modal_keymap(struct wmKeyConfig *keyconf);
00173 void viewrotate_modal_keymap(struct wmKeyConfig *keyconf);
00174 void viewmove_modal_keymap(struct wmKeyConfig *keyconf);
00175 void viewzoom_modal_keymap(struct wmKeyConfig *keyconf);
00176 void viewdolly_modal_keymap(struct wmKeyConfig *keyconf);
00177 
00178 /* view3d_buttons.c */
00179 void VIEW3D_OT_properties(struct wmOperatorType *ot);
00180 void view3d_buttons_register(struct ARegionType *art);
00181 
00182 /* view3d_toolbar.c */
00183 void VIEW3D_OT_toolshelf(struct wmOperatorType *ot);
00184 void view3d_toolshelf_register(struct ARegionType *art);
00185 void view3d_tool_props_register(struct ARegionType *art);
00186 
00187 /* view3d_snap.c */
00188 int minmax_verts(struct Object *obedit, float *min, float *max);
00189 
00190 void VIEW3D_OT_snap_selected_to_grid(struct wmOperatorType *ot);
00191 void VIEW3D_OT_snap_selected_to_cursor(struct wmOperatorType *ot);
00192 void VIEW3D_OT_snap_cursor_to_grid(struct wmOperatorType *ot);
00193 void VIEW3D_OT_snap_cursor_to_center(struct wmOperatorType *ot);
00194 void VIEW3D_OT_snap_cursor_to_selected(struct wmOperatorType *ot);
00195 void VIEW3D_OT_snap_cursor_to_active(struct wmOperatorType *ot);
00196 
00197 /* space_view3d.c */
00198 ARegion *view3d_has_buttons_region(ScrArea *sa);
00199 ARegion *view3d_has_tools_region(ScrArea *sa);
00200 
00201 extern const char *view3d_context_dir[]; /* doc access */
00202 
00203 /* draw_volume.c */
00204 void draw_volume(struct ARegion *ar, struct GPUTexture *tex, float *min, float *max, int res[3], float dx, struct GPUTexture *tex_shadow);
00205 
00206 /* workaround for trivial but noticable camera bug caused by imprecision
00207  * between view border calculation in 2D/3D space, workaround for bug [#28037].
00208  * without this deifne we get the old behavior which is to try and align them
00209  * both which _mostly_ works fine, but when the camera moves beyond ~1000 in
00210  * any direction it starts to fail */
00211 #define VIEW3D_CAMERA_BORDER_HACK
00212 #ifdef VIEW3D_CAMERA_BORDER_HACK
00213 extern float view3d_camera_border_hack_col[4];
00214 extern short view3d_camera_border_hack_test;
00215 #endif
00216 
00217 #endif /* ED_VIEW3D_INTERN_H */
00218