Skip to content

Commit

Permalink
Need to rethink how scene objects are being managed.
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Apr 5, 2022
1 parent 76b6814 commit 7bbc3cd
Show file tree
Hide file tree
Showing 38 changed files with 223 additions and 207 deletions.
70 changes: 43 additions & 27 deletions include/bv/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,44 @@ struct bview_settings {
struct bu_ptbl *gv_selected;
};

/* A view needs to know what objects are active within it, but this is a
* function not just of adding and removing objects via commands like
* "draw" and "erase" but also what settings are active. Shared objects
* are common to multiple views, but if adaptive plotting is enabled the
* scene objects cannot also be common - the representations of the objects
* may be different in each view, even though the object list is shared.
*/
struct bview_objs {

// Container for db object groups unique to this view (typical use case is
// adaptive plotting, where geometry wireframes may differ from view to
// view and thus need unique vlists.)
struct bu_ptbl *view_grps;
// Container for storing bv_scene_obj elements unique to this view.
struct bu_ptbl *view_objs;


// Container for shared db object groups (usually comes from the app and is
// owned by gedp - if not, defaults to the same container as gv_view_grps)
struct bu_ptbl *db_grps;
// Shared view objects common to multiple views. Defaults to gv_view_objs
// unless/until the app supplies a container.
struct bu_ptbl *view_shared_objs;


// bv_vlist entities to recycle for shared objects
struct bu_list *vlfree;

// Available bv_vlist entities to recycle before allocating new for local
// view objects. This is used only if the app doesn't supply a vlfree -
// normally the app should do so, so memory from one view can be reused for
// other views.
struct bu_list gv_vlfree;

/* Container for reusing bv_scene_obj allocations */
struct bv_scene_obj *free_scene_obj;
};

struct bview {
uint32_t magic; /**< @brief magic number */
struct bu_vls gv_name;
Expand Down Expand Up @@ -451,33 +489,11 @@ struct bview {
* if multiple views draw the same objects. */
int independent;

// Container for db object groups unique to this view (typical use case is
// adaptive plotting, where geometry wireframes may differ from view to
// view and thus need unique vlists.)
struct bu_ptbl *gv_view_grps;
// Container for storing bv_scene_obj elements unique to this view.
struct bu_ptbl *gv_view_objs;


// Container for shared db object groups (usually comes from the app and is
// owned by gedp - if not, defaults to the same container as gv_view_grps)
struct bu_ptbl *gv_db_grps;
// Shared view objects common to multiple views. Defaults to gv_view_objs
// unless/until the app supplies a container.
struct bu_ptbl *gv_view_shared_objs;


// bv_vlist entities to recycle for shared objects
struct bu_list *vlfree;

// Available bv_vlist entities to recycle before allocating new for local
// view objects. This is used only if the app doesn't supply a vlfree -
// normally the app should do so, so memory from one view can be reused for
// other views.
struct bu_list gv_vlfree;

/* Container for reusing bv_scene_obj allocations */
struct bv_scene_obj *free_scene_obj;
/* Scene objects active in a view. Managing these is a relatively complex
* topic and depends on whether a view is shared, independent or adaptive.
* Shared objects are common across views to make more efficient use of
* system memory. */
struct bview_objs gv_objs;

/*
* gv_data_vZ is an internal parameter used by commands creating and
Expand Down
24 changes: 12 additions & 12 deletions src/libbg/polygon_bview.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,23 @@ bv_polygon_contour(struct bv_scene_obj *s, struct bg_poly_contour *c, int curr_c
return;

if (do_pnt) {
BV_ADD_VLIST(s->s_v->vlfree, &s->s_vlist, c->point[0], BV_VLIST_POINT_DRAW);
BV_ADD_VLIST(s->s_v->gv_objs.vlfree, &s->s_vlist, c->point[0], BV_VLIST_POINT_DRAW);
return;
}

BV_ADD_VLIST(&s->s_v->gv_vlfree, &s->s_vlist, c->point[0], BV_VLIST_LINE_MOVE);
BV_ADD_VLIST(&s->s_v->gv_objs.gv_vlfree, &s->s_vlist, c->point[0], BV_VLIST_LINE_MOVE);
for (size_t i = 0; i < c->num_points; i++) {
BV_ADD_VLIST(&s->s_v->gv_vlfree, &s->s_vlist, c->point[i], BV_VLIST_LINE_DRAW);
BV_ADD_VLIST(&s->s_v->gv_objs.gv_vlfree, &s->s_vlist, c->point[i], BV_VLIST_LINE_DRAW);
}
if (!c->open)
BV_ADD_VLIST(&s->s_v->gv_vlfree, &s->s_vlist, c->point[0], BV_VLIST_LINE_DRAW);
BV_ADD_VLIST(&s->s_v->gv_objs.gv_vlfree, &s->s_vlist, c->point[0], BV_VLIST_LINE_DRAW);

if (curr_c && curr_i >= 0) {
point_t psize;
VSET(psize, 10, 0, 0);
BV_ADD_VLIST(&s->s_v->gv_vlfree, &s->s_vlist, c->point[curr_i], BV_VLIST_LINE_MOVE);
BV_ADD_VLIST(&s->s_v->gv_vlfree, &s->s_vlist, psize, BV_VLIST_POINT_SIZE);
BV_ADD_VLIST(&s->s_v->gv_vlfree, &s->s_vlist, c->point[curr_i], BV_VLIST_POINT_DRAW);
BV_ADD_VLIST(&s->s_v->gv_objs.gv_vlfree, &s->s_vlist, c->point[curr_i], BV_VLIST_LINE_MOVE);
BV_ADD_VLIST(&s->s_v->gv_objs.gv_vlfree, &s->s_vlist, psize, BV_VLIST_POINT_SIZE);
BV_ADD_VLIST(&s->s_v->gv_objs.gv_vlfree, &s->s_vlist, c->point[curr_i], BV_VLIST_POINT_DRAW);
}
}

Expand All @@ -89,7 +89,7 @@ bv_fill_polygon(struct bv_scene_obj *s)
struct bv_scene_obj *s_c = (struct bv_scene_obj *)BU_PTBL_GET(&s->children, i);
if (BU_STR_EQUAL(bu_vls_cstr(&s_c->s_uuid), "fill")) {
fobj = s_c;
BV_FREE_VLIST(&s->s_v->gv_vlfree, &s_c->s_vlist);
BV_FREE_VLIST(&s->s_v->gv_objs.gv_vlfree, &s_c->s_vlist);
break;
}
}
Expand Down Expand Up @@ -132,10 +132,10 @@ bv_polygon_vlist(struct bv_scene_obj *s)
return;

// free old s->s_vlist
BV_FREE_VLIST(&s->s_v->gv_vlfree, &s->s_vlist);
BV_FREE_VLIST(&s->s_v->gv_objs.gv_vlfree, &s->s_vlist);
for (size_t i = 0; i < BU_PTBL_LEN(&s->children); i++) {
struct bv_scene_obj *s_c = (struct bv_scene_obj *)BU_PTBL_GET(&s->children, i);
BV_FREE_VLIST(&s->s_v->gv_vlfree, &s_c->s_vlist);
BV_FREE_VLIST(&s->s_v->gv_objs.gv_vlfree, &s_c->s_vlist);
// TODO - free bv_scene_obj itself (ptbls, etc.)
}

Expand Down Expand Up @@ -858,7 +858,7 @@ bv_update_polygon(struct bv_scene_obj *s, int utype)
if (!s_c)
continue;
if (BU_STR_EQUAL(bu_vls_cstr(&s_c->s_uuid), "fill")) {
BV_FREE_VLIST(&s->s_v->gv_vlfree, &s_c->s_vlist);
BV_FREE_VLIST(&s->s_v->gv_objs.gv_vlfree, &s_c->s_vlist);
break;
}
}
Expand Down Expand Up @@ -891,7 +891,7 @@ bg_dup_view_polygon(const char *nname, struct bv_scene_obj *s)
// Since we want to create our copy using s's original creation frame and
// not (necessarily) the current s_v, make sure the s_v's vlfree list is
// set in the internal polygon's stored view.
ip->v.vlfree = s->s_v->vlfree;
ip->v.gv_objs.vlfree = s->s_v->gv_objs.vlfree;

struct bv_scene_obj *np = bv_create_polygon(&ip->v, ip->type, ip->v.gv_prevMouseX, ip->v.gv_prevMouseY, s->free_scene_obj);

Expand Down
16 changes: 8 additions & 8 deletions src/libbv/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ bv_hash(struct bview *v)
_bv_data_polygon_state_hash(state, &v->gv_tcl.gv_sdata_polygons);
_bv_other_state_hash(state, &v->gv_tcl.gv_prim_labels);

for (size_t i = 0; i < BU_PTBL_LEN(v->gv_db_grps); i++) {
struct bv_scene_group *g = (struct bv_scene_group *)BU_PTBL_GET(v->gv_db_grps, i);
for (size_t i = 0; i < BU_PTBL_LEN(v->gv_objs.db_grps); i++) {
struct bv_scene_group *g = (struct bv_scene_group *)BU_PTBL_GET(v->gv_objs.db_grps, i);
if (BU_PTBL_IS_INITIALIZED(&g->children)) {
for (size_t j = 0; j < BU_PTBL_LEN(&g->children); j++) {
struct bv_scene_obj *s_c = (struct bv_scene_obj *)BU_PTBL_GET(&g->children, j);
Expand All @@ -320,8 +320,8 @@ bv_hash(struct bview *v)
bv_scene_obj_hash(state, g);
}

for (size_t i = 0; i < BU_PTBL_LEN(v->gv_view_grps); i++) {
struct bv_scene_group *g = (struct bv_scene_group *)BU_PTBL_GET(v->gv_view_grps, i);
for (size_t i = 0; i < BU_PTBL_LEN(v->gv_objs.view_grps); i++) {
struct bv_scene_group *g = (struct bv_scene_group *)BU_PTBL_GET(v->gv_objs.view_grps, i);
if (BU_PTBL_IS_INITIALIZED(&g->children)) {
for (size_t j = 0; j < BU_PTBL_LEN(&g->children); j++) {
struct bv_scene_obj *s_c = (struct bv_scene_obj *)BU_PTBL_GET(&g->children, j);
Expand All @@ -331,8 +331,8 @@ bv_hash(struct bview *v)
bv_scene_obj_hash(state, g);
}

for (size_t i = 0; i < BU_PTBL_LEN(v->gv_view_objs); i++) {
struct bv_scene_obj *s = (struct bv_scene_obj *)BU_PTBL_GET(v->gv_view_objs, i);
for (size_t i = 0; i < BU_PTBL_LEN(v->gv_objs.view_objs); i++) {
struct bv_scene_obj *s = (struct bv_scene_obj *)BU_PTBL_GET(v->gv_objs.view_objs, i);
if (BU_PTBL_IS_INITIALIZED(&s->children)) {
for (size_t j = 0; j < BU_PTBL_LEN(&s->children); j++) {
struct bv_scene_obj *s_c = (struct bv_scene_obj *)BU_PTBL_GET(&s->children, j);
Expand All @@ -342,8 +342,8 @@ bv_hash(struct bview *v)
bv_scene_obj_hash(state, s);
}

for (size_t i = 0; i < BU_PTBL_LEN(v->gv_view_shared_objs); i++) {
struct bv_scene_obj *s = (struct bv_scene_obj *)BU_PTBL_GET(v->gv_view_shared_objs, i);
for (size_t i = 0; i < BU_PTBL_LEN(v->gv_objs.view_shared_objs); i++) {
struct bv_scene_obj *s = (struct bv_scene_obj *)BU_PTBL_GET(v->gv_objs.view_shared_objs, i);
if (BU_PTBL_IS_INITIALIZED(&s->children)) {
for (size_t j = 0; j < BU_PTBL_LEN(&s->children); j++) {
struct bv_scene_obj *s_c = (struct bv_scene_obj *)BU_PTBL_GET(&s->children, j);
Expand Down
30 changes: 15 additions & 15 deletions src/libbv/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,25 @@ bv_init(struct bview *gvp)
VSET(gvp->gv_tcl.gv_prim_labels.gos_text_color, 255, 255, 0);


// gv_view_grps is local to this view and thus is controlled
// gv_objs.view_grps is local to this view and thus is controlled
// by the bv init and free routines.
BU_GET(gvp->gv_view_grps, struct bu_ptbl);
bu_ptbl_init(gvp->gv_view_grps, 8, "view_objs init");
BU_GET(gvp->gv_objs.view_grps, struct bu_ptbl);
bu_ptbl_init(gvp->gv_objs.view_grps, 8, "view_objs init");

// gv_view_objs is local to this view and thus is controlled
// gv_objs.view_objs is local to this view and thus is controlled
// by the bv init and free routines.
BU_GET(gvp->gv_view_objs, struct bu_ptbl);
bu_ptbl_init(gvp->gv_view_objs, 8, "view_objs init");
BU_GET(gvp->gv_objs.view_objs, struct bu_ptbl);
bu_ptbl_init(gvp->gv_objs.view_objs, 8, "view_objs init");

// These should come from the app (usually ged_db_grps and ged_view_shared_objs).
// Initialize to the local containers until we get the shared ones from the app.
gvp->gv_db_grps = gvp->gv_view_grps;
gvp->gv_view_shared_objs = gvp->gv_view_objs;
gvp->gv_objs.db_grps = gvp->gv_objs.view_grps;
gvp->gv_objs.view_shared_objs = gvp->gv_objs.view_objs;

// Until the app tells us differently, we need to use our local vlist
// container
BU_LIST_INIT(&gvp->gv_vlfree);
gvp->vlfree = &gvp->gv_vlfree;
BU_LIST_INIT(&gvp->gv_objs.gv_vlfree);
gvp->gv_objs.vlfree = &gvp->gv_objs.gv_vlfree;

// Out of the gate we don't have callbacks
gvp->callbacks = NULL;
Expand All @@ -121,10 +121,10 @@ bv_free(struct bview *gvp)
return;

bu_vls_free(&gvp->gv_name);
bu_ptbl_free(gvp->gv_view_grps);
BU_PUT(gvp->gv_view_grps, struct bu_ptbl);
bu_ptbl_free(gvp->gv_view_objs);
BU_PUT(gvp->gv_view_objs, struct bu_ptbl);
bu_ptbl_free(gvp->gv_objs.view_grps);
BU_PUT(gvp->gv_objs.view_grps, struct bu_ptbl);
bu_ptbl_free(gvp->gv_objs.view_objs);
BU_PUT(gvp->gv_objs.view_objs, struct bu_ptbl);

if (gvp->gv_ls.gv_selected) {
bu_ptbl_free(gvp->gv_ls.gv_selected);
Expand Down Expand Up @@ -548,7 +548,7 @@ bv_scene_obj_free(struct bv_scene_obj *s, struct bv_scene_obj *free_scene_obj)

// free vlist
if (BU_LIST_IS_INITIALIZED(&s->s_vlist)) {
BV_FREE_VLIST(&s->s_v->gv_vlfree, &s->s_vlist);
BV_FREE_VLIST(&s->s_v->gv_objs.gv_vlfree, &s->s_vlist);
}

bv_scene_obj_init(s, free_scene_obj);
Expand Down
18 changes: 9 additions & 9 deletions src/libdm/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,15 +652,15 @@ dm_draw_viewobjs(struct rt_wdb *wdbp, struct bview *v, struct dm_view_data *vd,
#endif

// Draw geometry view objects
for (size_t i = 0; i < BU_PTBL_LEN(v->gv_db_grps); i++) {
struct bv_scene_group *g = (struct bv_scene_group *)BU_PTBL_GET(v->gv_db_grps, i);
for (size_t i = 0; i < BU_PTBL_LEN(v->gv_objs.db_grps); i++) {
struct bv_scene_group *g = (struct bv_scene_group *)BU_PTBL_GET(v->gv_objs.db_grps, i);
bu_log("Draw %s\n", bu_vls_cstr(&g->s_name));
dm_draw_scene_obj(dmp, g);
}

// Draw view-only objects
for (size_t i = 0; i < BU_PTBL_LEN(v->gv_view_objs); i++) {
struct bv_scene_obj *s = (struct bv_scene_obj *)BU_PTBL_GET(v->gv_view_objs, i);
for (size_t i = 0; i < BU_PTBL_LEN(v->gv_objs.view_objs); i++) {
struct bv_scene_obj *s = (struct bv_scene_obj *)BU_PTBL_GET(v->gv_objs.view_objs, i);
dm_draw_scene_obj(dmp, s);
}

Expand Down Expand Up @@ -749,24 +749,24 @@ dm_draw_objs(struct bview *v, double base2local, double local2base, void (*dm_dr

// Draw geometry view objects
// TODO - draw opaque, then transparent
struct bu_ptbl *sg = (v->independent || v->gv_s->adaptive_plot) ? v->gv_view_grps : v->gv_db_grps;
struct bu_ptbl *sg = (v->independent || v->gv_s->adaptive_plot) ? v->gv_objs.view_grps : v->gv_objs.db_grps;
for (size_t i = 0; i < BU_PTBL_LEN(sg); i++) {
struct bv_scene_group *g = (struct bv_scene_group *)BU_PTBL_GET(sg, i);
bu_log("Draw %s\n", bu_vls_cstr(&g->s_name));
dm_draw_scene_obj(dmp, g);
}

// Draw view-only objects (shared if settings match, otherwise view-specific)
struct bu_ptbl *vo = (v->independent) ? v->gv_view_objs : v->gv_view_shared_objs;
struct bu_ptbl *vo = (v->independent) ? v->gv_objs.view_objs : v->gv_objs.view_shared_objs;
for (size_t i = 0; i < BU_PTBL_LEN(vo); i++) {
struct bv_scene_obj *s = (struct bv_scene_obj *)BU_PTBL_GET(vo, i);
dm_draw_scene_obj(dmp, s);
}

// Draw view-specific view-only objects if we haven't already done so
if (vo != v->gv_view_objs) {
for (size_t i = 0; i < BU_PTBL_LEN(v->gv_view_objs); i++) {
struct bv_scene_obj *s = (struct bv_scene_obj *)BU_PTBL_GET(v->gv_view_objs, i);
if (vo != v->gv_objs.view_objs) {
for (size_t i = 0; i < BU_PTBL_LEN(v->gv_objs.view_objs); i++) {
struct bv_scene_obj *s = (struct bv_scene_obj *)BU_PTBL_GET(v->gv_objs.view_objs, i);
dm_draw_scene_obj(dmp, s);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/libged/autoview/autoview2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ ged_autoview2_core(struct ged *gedp, int argc, const char *argv[])

struct bu_ptbl *so;
if (v->gv_s->adaptive_plot || v->independent) {
so = v->gv_view_grps;
so = v->gv_objs.view_grps;
} else {
so = v->gv_db_grps;
so = v->gv_objs.db_grps;
}
vect_t minus, plus;
int have_geom_objs = 0;
Expand Down Expand Up @@ -188,9 +188,9 @@ ged_autoview2_core(struct ged *gedp, int argc, const char *argv[])
// then basing autoview on the view-only objs is more intuitive than just
// using the default view settings.
if (v->independent) {
so = v->gv_view_objs;
so = v->gv_objs.view_objs;
} else {
so = v->gv_view_shared_objs;
so = v->gv_objs.view_shared_objs;
}
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);
Expand Down
2 changes: 1 addition & 1 deletion src/libged/bot/bot_fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ show_dangling_edges(struct ged *gedp, const uint32_t *magic_p, const char *name,
struct bu_vls nroot = BU_VLS_INIT_ZERO;
bu_vls_sprintf(&nroot, "bot_fuse::%s", name);
struct bview *view = gedp->ged_gvp;
struct bu_ptbl *vobjs = (view->independent) ? view->gv_view_objs : view->gv_view_shared_objs;
struct bu_ptbl *vobjs = (view->independent) ? view->gv_objs.view_objs : view->gv_objs.view_shared_objs;
bv_vlblock_to_objs(vobjs, bu_vls_cstr(&nroot), vbp, view, gedp->free_scene_obj, &gedp->vlfree);
bu_vls_free(&nroot);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/libged/bot/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ draw_edges(struct ged *gedp, struct rt_bot_internal *bot, int num_edges, int edg
struct bu_vls nroot = BU_VLS_INIT_ZERO;
bu_vls_sprintf(&nroot, "bot_check::%s", draw_name);
struct bview *view = gedp->ged_gvp;
struct bu_ptbl *vobjs = (view->independent) ? view->gv_view_objs : view->gv_view_shared_objs;
struct bu_ptbl *vobjs = (view->independent) ? view->gv_objs.view_objs : view->gv_objs.view_shared_objs;
bv_vlblock_to_objs(vobjs, bu_vls_cstr(&nroot), vbp, view, gedp->free_scene_obj, &gedp->vlfree);
bu_vls_free(&nroot);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/libged/brep/brep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ _brep_cmd_intersect(void *bs, int argc, const char **argv)
const char *nview = getenv("GED_TEST_NEW_CMD_FORMS");
if (BU_STR_EQUAL(nview, "1")) {
struct bview *view = gedp->ged_gvp;
struct bu_ptbl *vobjs = (view->independent) ? view->gv_view_objs : view->gv_view_shared_objs;
struct bu_ptbl *vobjs = (view->independent) ? view->gv_objs.view_objs : view->gv_objs.view_shared_objs;
bv_vlblock_to_objs(vobjs, "brep_intersect::", gb->vbp, view, gedp->free_scene_obj, &gedp->vlfree);
} else {
char namebuf[65];
Expand Down
2 changes: 1 addition & 1 deletion src/libged/brep/plot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ _brep_vlblock_plot(struct ged *gedp, struct bv_vlblock *vbp, const char *sname)
const char *nview = getenv("GED_TEST_NEW_CMD_FORMS");
struct bu_vls nroot = BU_VLS_INIT_ZERO;
struct bview *view = gedp->ged_gvp;
struct bu_ptbl *vobjs = (view->independent) ? view->gv_view_objs : view->gv_view_shared_objs;
struct bu_ptbl *vobjs = (view->independent) ? view->gv_objs.view_objs : view->gv_objs.view_shared_objs;
if (BU_STR_EQUAL(nview, "1")) {
bu_vls_sprintf(&nroot, "brep::%s", sname);
bv_vlblock_to_objs(vobjs, bu_vls_cstr(&nroot), vbp, view, gedp->free_scene_obj, &gedp->vlfree);
Expand Down
2 changes: 1 addition & 1 deletion src/libged/check/check_overlaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ int check_overlaps(struct current_state *state,
const char *nview = getenv("GED_TEST_NEW_CMD_FORMS");
if (BU_STR_EQUAL(nview, "1")) {
struct bview *view = _ged_current_gedp->ged_gvp;
struct bu_ptbl *vobjs = (view->independent) ? view->gv_view_objs : view->gv_view_shared_objs;
struct bu_ptbl *vobjs = (view->independent) ? view->gv_objs.view_objs : view->gv_objs.view_shared_objs;
bv_vlblock_to_objs(vobjs, "check::overlaps_", check_plot.vbp, view, _ged_current_gedp->free_scene_obj, &_ged_current_gedp->vlfree);
} else {
_ged_cvt_vlblock_to_solids(_ged_current_gedp, check_plot.vbp, "OVERLAPS", 0);
Expand Down
4 changes: 2 additions & 2 deletions src/libged/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ prim_tess(struct bv_scene_obj *s, struct rt_db_internal *ip)
}

NMG_CK_REGION(r);
nmg_r_to_vlist(&s->s_vlist, r, NMG_VLIST_STYLE_POLYGON, &s->s_v->gv_vlfree);
nmg_r_to_vlist(&s->s_vlist, r, NMG_VLIST_STYLE_POLYGON, &s->s_v->gv_objs.gv_vlfree);
nmg_km(m);
return 0;
}
Expand Down Expand Up @@ -340,7 +340,7 @@ draw_update(struct bv_scene_obj *s, int UNUSED(flag))
}

// Clear out existing vlist, if any...
BV_FREE_VLIST(&s->s_v->gv_vlfree, &s->s_vlist);
BV_FREE_VLIST(&s->s_v->gv_objs.gv_vlfree, &s->s_vlist);

// Get the new geometry
draw_scene(s);
Expand Down
Loading

0 comments on commit 7bbc3cd

Please sign in to comment.