Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-05-21 12:56:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-21 12:56:37 +0400
commite038b25579af0a540cc2b41c03e6771c12044d2b (patch)
treee60dc9f5ecd1a8175ea6392d52682953a63c2e6e /source/blender/editors/space_view3d
parentb1025f2a3068ab31662d2da584c5dc7c26fe9b37 (diff)
view3d function naming, no functional changes.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c18
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c14
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c28
-rw-r--r--source/blender/editors/space_view3d/view3d_intern.h4
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c28
5 files changed, 46 insertions, 46 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index e88ee7dd69a..ccfc45826cf 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -147,7 +147,7 @@ static void view3d_project_short_clip(ARegion *ar, float *vec, short *adr, int l
/* clipplanes in eye space */
if(rv3d->rflag & RV3D_CLIPPING) {
- if(view3d_test_clipping(rv3d, vec, local))
+ if(ED_view3d_test_clipping(rv3d, vec, local))
return;
}
@@ -630,7 +630,7 @@ void drawcircball(int mode, const float cent[3], float rad, float tmat[][4])
/* circle for object centers, special_color is for library or ob users */
static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3], int selstate, int special_color)
{
- const float size= view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f;
+ const float size= ED_view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f;
/* using gldepthfunc guarantees that it does write z values, but not checks for it, so centers remain visible independt order of drawing */
if(v3d->zbuf) glDepthFunc(GL_ALWAYS);
@@ -1015,7 +1015,7 @@ static void draw_transp_spot_volume(Lamp *la, float x, float z)
static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int dt, int flag)
{
Object *ob= base->object;
- const float pixsize= view3d_pixel_size(rv3d, ob->obmat[3]);
+ const float pixsize= ED_view3d_pixel_size(rv3d, ob->obmat[3]);
Lamp *la= ob->data;
float vec[3], lvec[3], vvec[3], circrad, x,y,z;
float lampsize;
@@ -2886,7 +2886,7 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
}
else {
/* don't create boundbox here with mesh_get_bb(), the derived system will make it, puts deformed bb's OK */
- if(me->totface<=4 || boundbox_clip(rv3d, ob->obmat, (ob->bb)? ob->bb: me->bb)) {
+ if(me->totface<=4 || ED_view3d_boundbox_clip(rv3d, ob->obmat, (ob->bb)? ob->bb: me->bb)) {
glsl = draw_glsl_material(scene, ob, v3d, dt);
check_alpha = check_material_alpha(base, me, glsl);
@@ -3672,7 +3672,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
case PART_DRAW_CROSS:
case PART_DRAW_AXIS:
/* lets calculate the scale: */
- pixsize= view3d_pixel_size(rv3d, ob->obmat[3]);
+ pixsize= ED_view3d_pixel_size(rv3d, ob->obmat[3]);
if(part->draw_size==0.0)
pixsize *= 2.0f;
@@ -5522,7 +5522,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
hasfaces= displist_has_faces(&ob->disp);
}
- if (hasfaces && boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
+ if (hasfaces && ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
draw_index_wire= 0;
if (dm) {
draw_mesh_object_outline(v3d, ob, dm);
@@ -5575,7 +5575,7 @@ static void drawWireExtra(Scene *scene, RegionView3D *rv3d, Object *ob)
if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
Curve *cu = ob->data;
- if (boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
+ if (ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
if (ob->type==OB_CURVE)
draw_index_wire= 0;
@@ -6010,7 +6010,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
draw_bounding_volume(scene, ob);
}
- else if(boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb))
+ else if(ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb))
empty_object= drawDispList(scene, v3d, rv3d, base, dt);
break;
@@ -6026,7 +6026,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
draw_bounding_volume(scene, ob);
}
- else if(boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
+ else if(ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
empty_object= drawDispList(scene, v3d, rv3d, base, dt);
//XXX old animsys if(cu->path)
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index adce40f58ce..7e9c219fdaa 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -206,7 +206,7 @@ static int test_clipping(const float vec[3], float clip[][4])
/* for 'local' ED_view3d_local_clipping must run first
* then all comparisons can be done in localspace */
-int view3d_test_clipping(RegionView3D *rv3d, const float vec[3], const int local)
+int ED_view3d_test_clipping(RegionView3D *rv3d, const float vec[3], const int local)
{
return test_clipping(vec, local ? rv3d->clip_local : rv3d->clip);
}
@@ -869,7 +869,7 @@ void view3d_viewborder_size_get(Scene *scene, ARegion *ar, float size_r[2])
}
}
-void view3d_calc_camera_border(Scene *scene, ARegion *ar, RegionView3D *rv3d, View3D *v3d, rctf *viewborder_r, short do_shift)
+void ED_view3d_calc_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewborder_r, short do_shift)
{
const float zoomfac= BKE_screen_view3d_zoom_to_fac((float)rv3d->camzoom);
float size[2];
@@ -998,7 +998,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
if(v3d->camera->type==OB_CAMERA)
ca = v3d->camera->data;
- view3d_calc_camera_border(scene, ar, rv3d, v3d, &viewborder, FALSE);
+ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &viewborder, FALSE);
/* the offsets */
x1= viewborder.xmin;
y1= viewborder.ymin;
@@ -1398,7 +1398,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
if(rv3d->persp==RV3D_CAMOB) {
rctf vb;
- view3d_calc_camera_border(scene, ar, rv3d, v3d, &vb, FALSE);
+ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &vb, FALSE);
x1= vb.xmin;
y1= vb.ymin;
@@ -1418,7 +1418,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
asp= ( (float)ibuf->y)/(float)ibuf->x;
vec[0] = vec[1] = vec[2] = 0.0;
- view3d_project_float(ar, vec, sco, rv3d->persmat);
+ ED_view3d_project_float(ar, vec, sco, rv3d->persmat);
cx = sco[0];
cy = sco[1];
@@ -1678,7 +1678,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
}
if(use_displist) {
glMultMatrixf(dob->mat);
- if(boundbox_clip(rv3d, dob->mat, &bb))
+ if(ED_view3d_boundbox_clip(rv3d, dob->mat, &bb))
glCallList(displist);
glLoadMatrixf(rv3d->viewmat);
}
@@ -1768,7 +1768,7 @@ void view3d_update_depths_rect(ARegion *ar, ViewDepths *d, rcti *rect)
}
/* note, with nouveau drivers the glReadPixels() is very slow. [#24339] */
-void view3d_update_depths(ARegion *ar)
+void ED_view3d_depth_update(ARegion *ar)
{
RegionView3D *rv3d= ar->regiondata;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 95e845b3462..ae020b91cdf 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -783,7 +783,7 @@ static int viewrotate_modal(bContext *C, wmOperator *op, wmEvent *event)
viewrotate_apply(vod, event->x, event->y);
}
else if (event_code==VIEW_CONFIRM) {
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
return OPERATOR_FINISHED;
@@ -831,7 +831,7 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (event->type == MOUSEPAN) {
viewrotate_apply(vod, event->prevx, event->prevy);
- request_depth_update(rv3d);
+ ED_view3d_depth_tag_update(rv3d);
viewops_data_free(C, op);
@@ -840,7 +840,7 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event)
else if (event->type == MOUSEROTATE) {
/* MOUSEROTATE performs orbital rotation, so y axis delta is set to 0 */
viewrotate_apply(vod, event->prevx, event->y);
- request_depth_update(rv3d);
+ ED_view3d_depth_tag_update(rv3d);
viewops_data_free(C, op);
@@ -986,7 +986,7 @@ static int viewmove_modal(bContext *C, wmOperator *op, wmEvent *event)
viewmove_apply(vod, event->x, event->y);
}
else if (event_code==VIEW_CONFIRM) {
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
@@ -1006,7 +1006,7 @@ static int viewmove_invoke(bContext *C, wmOperator *op, wmEvent *event)
if (event->type == MOUSEPAN) {
viewmove_apply(vod, event->prevx, event->prevy);
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
@@ -1224,7 +1224,7 @@ static int viewzoom_modal(bContext *C, wmOperator *op, wmEvent *event)
viewzoom_apply(vod, event->x, event->y, U.viewzoom, (U.uiflag & USER_ZOOM_INVERT) != 0);
}
else if (event_code==VIEW_CONFIRM) {
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
return OPERATOR_FINISHED;
@@ -1286,7 +1286,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
if(rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_sync(sa, ar);
- request_depth_update(rv3d);
+ ED_view3d_depth_tag_update(rv3d);
ED_view3d_camera_lock_sync(v3d, rv3d);
@@ -1329,7 +1329,7 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
vod->origy = vod->oldy = vod->origy + event->x - event->prevx;
viewzoom_apply(vod, event->prevx, event->prevy, USER_ZOOM_DOLLY, FALSE);
}
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
return OPERATOR_FINISHED;
@@ -1445,7 +1445,7 @@ static int viewdolly_modal(bContext *C, wmOperator *op, wmEvent *event)
viewdolly_apply(vod, event->x, event->y, (U.uiflag & USER_ZOOM_INVERT) != 0);
}
else if (event_code==VIEW_CONFIRM) {
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
return OPERATOR_FINISHED;
@@ -1496,7 +1496,7 @@ static int viewdolly_exec(bContext *C, wmOperator *op)
if(rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_sync(sa, ar);
- request_depth_update(rv3d);
+ ED_view3d_depth_tag_update(rv3d);
ED_region_tag_redraw(ar);
viewops_data_free(C, op);
@@ -1543,7 +1543,7 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, wmEvent *event)
vod->origy = vod->oldy = vod->origy + event->x - event->prevx;
viewdolly_apply(vod, event->prevx, event->prevy, FALSE);
}
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
return OPERATOR_FINISHED;
@@ -1940,7 +1940,7 @@ static int render_border_exec(bContext *C, wmOperator *op)
rect.ymax= RNA_int_get(op->ptr, "ymax");
/* calculate range */
- view3d_calc_camera_border(scene, ar, rv3d, v3d, &vb, FALSE);
+ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &vb, FALSE);
scene->r.border.xmin= ((float)rect.xmin-vb.xmin)/(vb.xmax-vb.xmin);
scene->r.border.ymin= ((float)rect.ymin-vb.ymin)/(vb.ymax-vb.ymin);
@@ -2740,7 +2740,7 @@ static int view3d_clipping_exec(bContext *C, wmOperator *op)
view3d_set_viewcontext(C, &vc);
view3d_get_transformation(vc.ar, vc.rv3d, NULL, &mats); /* NULL because we don't want it in object space */
- view3d_calculate_clipping(rv3d->clipbb, rv3d->clip, &mats, &rect);
+ ED_view3d_calc_clipping(rv3d->clipbb, rv3d->clip, &mats, &rect);
return OPERATOR_FINISHED;
}
@@ -3550,7 +3550,7 @@ void ED_view3d_from_object(Object *ob, float ofs[3], float quat[4], float *dist,
ED_view3d_from_m4(ob->obmat, ofs, quat, dist);
if (lens) {
- get_object_clip_range(ob, lens, NULL, NULL);
+ ED_view3d_ob_clip_range_get(ob, lens, NULL, NULL);
}
}
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index 717e46800b1..f4d198f7515 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -154,9 +154,7 @@ void VIEW3D_OT_localview(struct wmOperatorType *ot);
void VIEW3D_OT_game_start(struct wmOperatorType *ot);
-int boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox *bb);
-
-void centerview(struct ARegion *ar, View3D *v3d);
+int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox *bb);
void smooth_view(struct bContext *C, struct View3D *v3d, struct ARegion *ar, struct Object *, struct Object *, float *ofs, float *quat, float *dist, float *lens);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 678ffc09e39..32e8ae81f90 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -106,7 +106,7 @@ float *give_cursor(Scene *scene, View3D *v3d)
/* Gets the lens and clipping values from a camera of lamp type object */
-void get_object_clip_range(Object *ob, float *lens, float *clipsta, float *clipend)
+void ED_view3d_ob_clip_range_get(Object *ob, float *lens, float *clipsta, float *clipend)
{
if(ob->type==OB_LAMP ) {
Lamp *la = ob->data;
@@ -463,7 +463,7 @@ void VIEW3D_OT_object_as_camera(wmOperatorType *ot)
/* ********************************** */
-void view3d_calculate_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, rcti *rect)
+void ED_view3d_calc_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, rcti *rect)
{
double xs, ys, p[3];
short val;
@@ -657,7 +657,7 @@ void ED_view3d_win_to_vector(ARegion *ar, const float mval[2], float out[3])
normalize_v3(out);
}
-float read_cached_depth(ViewContext *vc, int x, int y)
+float ED_view3d_depth_read_cached(ViewContext *vc, int x, int y)
{
ViewDepths *vd = vc->rv3d->depths;
@@ -670,13 +670,13 @@ float read_cached_depth(ViewContext *vc, int x, int y)
return 1;
}
-void request_depth_update(RegionView3D *rv3d)
+void ED_view3d_depth_tag_update(RegionView3D *rv3d)
{
if(rv3d->depths)
rv3d->depths->damaged= 1;
}
-void view3d_get_object_project_mat(RegionView3D *rv3d, Object *ob, float pmat[4][4])
+void ED_view3d_ob_project_mat_get(RegionView3D *rv3d, Object *ob, float pmat[4][4])
{
float vmat[4][4];
@@ -684,6 +684,7 @@ void view3d_get_object_project_mat(RegionView3D *rv3d, Object *ob, float pmat[4]
mul_m4_m4m4(pmat, vmat, rv3d->winmat);
}
+#if 0
/* Uses window coordinates (x,y) and depth component z to find a point in
modelspace */
void view3d_unproject(bglMats *mats, float out[3], const short x, const short y, const float z)
@@ -696,9 +697,10 @@ void view3d_unproject(bglMats *mats, float out[3], const short x, const short y,
out[1] = uy;
out[2] = uz;
}
+#endif
/* use above call to get projecting mat */
-void view3d_project_float(ARegion *ar, const float vec[3], float adr[2], float mat[4][4])
+void ED_view3d_project_float(ARegion *ar, const float vec[3], float adr[2], float mat[4][4])
{
float vec4[4];
@@ -716,7 +718,7 @@ void view3d_project_float(ARegion *ar, const float vec[3], float adr[2], float m
}
}
-int boundbox_clip(RegionView3D *rv3d, float obmat[][4], BoundBox *bb)
+int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], BoundBox *bb)
{
/* return 1: draw */
@@ -759,7 +761,7 @@ void project_short(ARegion *ar, const float vec[3], short adr[2]) /* clips */
adr[0]= IS_CLIPPED;
if(rv3d->rflag & RV3D_CLIPPING) {
- if(view3d_test_clipping(rv3d, vec, 0))
+ if(ED_view3d_test_clipping(rv3d, vec, 0))
return;
}
@@ -896,7 +898,7 @@ void project_float_noclip(ARegion *ar, const float vec[3], float adr[2])
}
/* copies logic of get_view3d_viewplane(), keep in sync */
-int get_view3d_cliprange(View3D *v3d, RegionView3D *rv3d, float *clipsta, float *clipend)
+int ED_view3d_clip_range_get(View3D *v3d, RegionView3D *rv3d, float *clipsta, float *clipend)
{
int orth= 0;
@@ -931,7 +933,7 @@ int get_view3d_cliprange(View3D *v3d, RegionView3D *rv3d, float *clipsta, float
}
/* also exposed in previewrender.c */
-int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize)
+int ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize)
{
Camera *cam=NULL;
float lens, fac, x1, y1, x2, y2;
@@ -1064,7 +1066,7 @@ void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) /* rect: for pick
float clipsta, clipend, x1, y1, x2, y2;
int orth;
- orth= get_view3d_viewplane(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend, NULL);
+ orth= ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend, NULL);
rv3d->is_persp= !orth;
// printf("%d %d %f %f %f %f %f %f\n", winx, winy, viewplane.xmin, viewplane.ymin, viewplane.xmax, viewplane.ymax, clipsta, clipend);
@@ -1775,7 +1777,7 @@ static int game_engine_exec(bContext *C, wmOperator *op)
if(rv3d->persp==RV3D_CAMOB && startscene->gm.framing.type == SCE_GAMEFRAMING_BARS && startscene->gm.stereoflag != STEREO_DOME) { /* Letterbox */
rctf cam_framef;
- view3d_calc_camera_border(startscene, ar, rv3d, CTX_wm_view3d(C), &cam_framef, FALSE);
+ ED_view3d_calc_camera_border(startscene, ar, CTX_wm_view3d(C), rv3d, &cam_framef, FALSE);
cam_frame.xmin = cam_framef.xmin + ar->winrct.xmin;
cam_frame.xmax = cam_framef.xmax + ar->winrct.xmin;
cam_frame.ymin = cam_framef.ymin + ar->winrct.ymin;
@@ -1873,7 +1875,7 @@ void view3d_align_axis_to_vector(View3D *v3d, RegionView3D *rv3d, int axisidx, f
}
}
-float view3d_pixel_size(struct RegionView3D *rv3d, const float co[3])
+float ED_view3d_pixel_size(struct RegionView3D *rv3d, const float co[3])
{
return (rv3d->persmat[3][3] + (
rv3d->persmat[0][3]*co[0] +