Skip to content

Commit

Permalink
Move dl_set_illum to illum.c
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Nov 26, 2024
1 parent 0ca9a56 commit 00c56c6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 29 deletions.
28 changes: 0 additions & 28 deletions src/libged/display_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,34 +1092,6 @@ int invent_solid(struct ged *gedp, char *name, struct bu_list *vhead, long int r

}


int
dl_set_illum(struct display_list *gdlp, const char *obj, int illum)
{
int found = 0;
struct bv_scene_obj *sp;

for (BU_LIST_FOR(sp, bv_scene_obj, &gdlp->dl_head_scene_obj)) {
size_t i;
if (!sp->s_u_data)
continue;
struct ged_bv_data *bdata = (struct ged_bv_data *)sp->s_u_data;

for (i = 0; i < bdata->s_fullpath.fp_len; ++i) {
if (*obj == *DB_FULL_PATH_GET(&bdata->s_fullpath, i)->d_namep &&
BU_STR_EQUAL(obj, DB_FULL_PATH_GET(&bdata->s_fullpath, i)->d_namep)) {
found = 1;
if (illum)
sp->s_iflag = UP;
else
sp->s_iflag = DOWN;
}
}
}
return found;
}


void
dl_set_iflag(struct bu_list *hdlp, int iflag)
{
Expand Down
1 change: 0 additions & 1 deletion src/libged/ged_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ GED_EXPORT extern void dl_add_path(int dashflag, struct bu_list *vhead, const st

GED_EXPORT extern int dl_redraw(struct display_list *gdlp, struct ged *gedp, int skip_subtractions);
GED_EXPORT extern union tree * append_solid_to_display_list(struct db_tree_state *tsp, const struct db_full_path *pathp, struct rt_db_internal *ip, void *client_data);
GED_EXPORT int dl_set_illum(struct display_list *gdlp, const char *obj, int illum);

/* defined in draw.c */
GED_EXPORT extern void _ged_cvt_vlblock_to_solids(struct ged *gedp,
Expand Down
25 changes: 25 additions & 0 deletions src/libged/illum/illum.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,31 @@
#include "ged.h"
#include "../ged_private.h"

static int
dl_set_illum(struct display_list *gdlp, const char *obj, int illum)
{
int found = 0;
struct bv_scene_obj *sp;

for (BU_LIST_FOR(sp, bv_scene_obj, &gdlp->dl_head_scene_obj)) {
size_t i;
if (!sp->s_u_data)
continue;
struct ged_bv_data *bdata = (struct ged_bv_data *)sp->s_u_data;

for (i = 0; i < bdata->s_fullpath.fp_len; ++i) {
if (*obj == *DB_FULL_PATH_GET(&bdata->s_fullpath, i)->d_namep &&
BU_STR_EQUAL(obj, DB_FULL_PATH_GET(&bdata->s_fullpath, i)->d_namep)) {
found = 1;
if (illum)
sp->s_iflag = UP;
else
sp->s_iflag = DOWN;
}
}
}
return found;
}

/*
* Illuminate/highlight database object
Expand Down

0 comments on commit 00c56c6

Please sign in to comment.