Skip to content

Commit

Permalink
ws cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
brlcad committed Jan 6, 2025
1 parent 0a30112 commit c7c339a
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 41 deletions.
4 changes: 2 additions & 2 deletions src/libbv/lod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ obb_arb(vect_t obb_center, vect_t obb_extent1, vect_t obb_extent2, vect_t obb_ex

static void
view_obb(struct bview *v,
point_t sbbc, fastf_t radius,
point_t sbbc, fastf_t radius,
vect_t dir,
point_t ec, point_t ep1, point_t ep2)
{
Expand Down Expand Up @@ -1036,7 +1036,7 @@ POPState::tri_process()

// Beyond a certain depth, there is little benefit to the POP process. If
// we check the count of level_tris, we will find a level at which most of
// the triangles are active.
// the triangles are active.
// TODO: Not clear yet when the tradeoff between memory and the work of LoD
// point snapping trades off - 0.66 is just a guess. We also need to
// calculate this maximum size ratio as a function of the overall database
Expand Down
1 change: 0 additions & 1 deletion src/libbv/polygon_fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,3 @@ int bv_polygon_calc_fdelta(struct bv_polygon *p)
// c-file-style: "stroustrup"
// End:
// ex: shiftwidth=4 tabstop=8

1 change: 0 additions & 1 deletion src/libbv/polygon_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,3 @@ bv_polygon_csg(struct bv_scene_obj *target, struct bv_scene_obj *stencil, bg_cli
// c-file-style: "stroustrup"
// End:
// ex: shiftwidth=4 tabstop=8

1 change: 0 additions & 1 deletion src/libbv/tig/vectfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,6 @@ tp_getchar(const unsigned char *c)
}



/*
* Local Variables:
* mode: C
Expand Down
67 changes: 33 additions & 34 deletions src/libbv/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,23 +406,23 @@ _bound_objs_view(int *is_empty, vect_t min, vect_t max, struct bu_ptbl *so, stru
for (size_t i = 0; i < BU_PTBL_LEN(so); i++) {
struct bv_scene_obj *s = (struct bv_scene_obj *)BU_PTBL_GET(so, i);
_bound_objs_view(is_empty, min, max, &s->children, v, have_geom_objs, all_view_objs);
if (have_geom_objs && !all_view_objs) {
if (!(s->s_type_flags & BV_DBOBJ_BASED) &&
!(s->s_type_flags & BV_POLYGONS) &&
!(s->s_type_flags & BV_LABELS))
continue;
}
if (bv_scene_obj_bound(s, v)) {
(*is_empty) = 0;
minus[X] = s->s_center[X] - s->s_size;
minus[Y] = s->s_center[Y] - s->s_size;
minus[Z] = s->s_center[Z] - s->s_size;
VMIN(min, minus);
plus[X] = s->s_center[X] + s->s_size;
plus[Y] = s->s_center[Y] + s->s_size;
plus[Z] = s->s_center[Z] + s->s_size;
VMAX(max, plus);
}
if (have_geom_objs && !all_view_objs) {
if (!(s->s_type_flags & BV_DBOBJ_BASED) &&
!(s->s_type_flags & BV_POLYGONS) &&
!(s->s_type_flags & BV_LABELS))
continue;
}
if (bv_scene_obj_bound(s, v)) {
(*is_empty) = 0;
minus[X] = s->s_center[X] - s->s_size;
minus[Y] = s->s_center[Y] - s->s_size;
minus[Z] = s->s_center[Z] - s->s_size;
VMIN(min, minus);
plus[X] = s->s_center[X] + s->s_size;
plus[Y] = s->s_center[Y] + s->s_size;
plus[Z] = s->s_center[Z] + s->s_size;
VMAX(max, plus);
}
}
}

Expand Down Expand Up @@ -512,9 +512,9 @@ bv_mat_aet(struct bview *v)
fastf_t s_twist;

bn_mat_angles(v->gv_rotation,
270.0 + v->gv_aet[1],
0.0,
270.0 - v->gv_aet[0]);
270.0 + v->gv_aet[1],
0.0,
270.0 - v->gv_aet[0]);

twist = -v->gv_aet[2] * DEG2RAD;
c_twist = cos(twist);
Expand Down Expand Up @@ -662,11 +662,11 @@ bv_update(struct bview *gvp)
vect_t temp, temp1;

if (!gvp)
return;
return;

bn_mat_mul(gvp->gv_model2view,
gvp->gv_rotation,
gvp->gv_center);
gvp->gv_rotation,
gvp->gv_center);
gvp->gv_model2view[15] = gvp->gv_scale;
bn_mat_inv(gvp->gv_view2model, gvp->gv_model2view);

Expand All @@ -679,18 +679,18 @@ bv_update(struct bview *gvp)
/* calculate angles using accuracy of 0.005, since display
* shows 2 digits right of decimal point */
bn_aet_vec(&gvp->gv_aet[0],
&gvp->gv_aet[1],
&gvp->gv_aet[2],
temp, temp1, (fastf_t)0.005);
&gvp->gv_aet[1],
&gvp->gv_aet[2],
temp, temp1, (fastf_t)0.005);

/* Force azimuth range to be [0, 360] */
if ((NEAR_EQUAL(gvp->gv_aet[1], 90.0, (fastf_t)0.005) ||
NEAR_EQUAL(gvp->gv_aet[1], -90.0, (fastf_t)0.005)) &&
gvp->gv_aet[0] < 0 &&
!NEAR_ZERO(gvp->gv_aet[0], (fastf_t)0.005))
gvp->gv_aet[0] += 360.0;
NEAR_EQUAL(gvp->gv_aet[1], -90.0, (fastf_t)0.005)) &&
gvp->gv_aet[0] < 0 &&
!NEAR_ZERO(gvp->gv_aet[0], (fastf_t)0.005))
gvp->gv_aet[0] += 360.0;
else if (NEAR_ZERO(gvp->gv_aet[0], (fastf_t)0.005))
gvp->gv_aet[0] = 0.0;
gvp->gv_aet[0] = 0.0;

/* apply the perspective angle to model2view */
bn_mat_mul(gvp->gv_pmodel2view, gvp->gv_pmat, gvp->gv_model2view);
Expand Down Expand Up @@ -853,7 +853,7 @@ _bv_scale(struct bview *v, int sensitivity, int factor, point_t UNUSED(keypoint)
double f = (double)factor/(double)sensitivity;
v->gv_scale /= f;
if (v->gv_scale < BV_MINVIEWSCALE)
v->gv_scale = BV_MINVIEWSCALE;
v->gv_scale = BV_MINVIEWSCALE;
v->gv_size = 2.0 * v->gv_scale;
v->gv_isize = 1.0 / v->gv_size;

Expand Down Expand Up @@ -1049,7 +1049,7 @@ bv_obj_stale(struct bv_scene_obj *s)

std::unordered_map<struct bview *, struct bv_scene_obj *>::iterator vo_it;
for (vo_it = s->i->vobjs.begin(); vo_it != s->i->vobjs.end(); vo_it++) {
struct bv_scene_obj *sv = vo_it->second;
struct bv_scene_obj *sv = vo_it->second;
bv_obj_stale(sv);
}
}
Expand Down Expand Up @@ -1464,7 +1464,6 @@ bv_obj_get_vo(struct bv_scene_obj *s, struct bview *v)
vo->dp = s->dp;



s->i->vobjs[v] = vo;
vo->s_os = s->s_os;
bv_log(1, "bv_obj_get_vo %s[%s]", bu_vls_cstr(&s->s_name), bu_vls_cstr(&v->gv_name));
Expand Down
1 change: 0 additions & 1 deletion src/libbv/view_sets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ bv_set_fsos(struct bview_set *s)
}



// Local Variables:
// tab-width: 8
// mode: C++
Expand Down
2 changes: 1 addition & 1 deletion src/libbv/vlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bv_vlist_bbox_internal(struct bv_vlist *vp, point_t *bmin, point_t *bmax, int *d
break;
case BV_VLIST_DISPLAY_MAT:
*disp_mode = 1;
*dispmode_used = 1;
*dispmode_used = 1;
/* fall through */
case BV_VLIST_POINT_DRAW:
V_MIN((*bmin)[X], (*pt)[X]-1.0);
Expand Down

0 comments on commit c7c339a

Please sign in to comment.