Revision: 76604
          http://sourceforge.net/p/brlcad/code/76604
Author:   starseeker
Date:     2020-07-30 20:37:15 +0000 (Thu, 30 Jul 2020)
Log Message:
-----------
Trickier, but replace raw ged_create_vlist_solid_cb calls

Modified Paths:
--------------
    brlcad/branches/bioh/include/ged/view.h
    brlcad/branches/bioh/src/libged/display_list.c
    brlcad/branches/bioh/src/libged/ged_util.c
    brlcad/branches/bioh/src/libged/vdraw/vdraw.c
    brlcad/branches/bioh/src/mged/dodraw.c

Modified: brlcad/branches/bioh/include/ged/view.h
===================================================================
--- brlcad/branches/bioh/include/ged/view.h     2020-07-30 19:40:27 UTC (rev 
76603)
+++ brlcad/branches/bioh/include/ged/view.h     2020-07-30 20:37:15 UTC (rev 
76604)
@@ -72,7 +72,7 @@
                                               struct solid *freesolid);
 GED_EXPORT extern struct display_list *dl_addToDisplay(struct bu_list *hdlp, 
struct db_i *dbip, const char *name);
 
-GED_EXPORT extern int invent_solid(struct bu_list *hdlp, struct db_i *dbip, 
void (*callback_create)(struct solid *), void (*callback_free)(unsigned int, 
int), char *name, struct bu_list *vhead, long int rgb, int copy, fastf_t 
transparency, int dmode, struct solid *freesolid, int csoltab);
+GED_EXPORT extern int invent_solid(struct ged *gedp, char *name, struct 
bu_list *vhead, long int rgb, int copy, fastf_t transparency, int dmode, int 
csoltab);
 
 /* defined in ged.c */
 GED_EXPORT extern void ged_view_init(struct bview *gvp);

Modified: brlcad/branches/bioh/src/libged/display_list.c
===================================================================
--- brlcad/branches/bioh/src/libged/display_list.c      2020-07-30 19:40:27 UTC 
(rev 76603)
+++ brlcad/branches/bioh/src/libged/display_list.c      2020-07-30 20:37:15 UTC 
(rev 76604)
@@ -34,6 +34,7 @@
 #include "bn/plot3.h"
 
 #include "rt/solid.h"
+#include "ged.h"
 #include "./ged_private.h"
 
 /* defined in draw_calc.cpp */
@@ -700,9 +701,7 @@
     BU_LIST_APPEND(dgcdp->gdlp->dl_headSolid.back, &sp->l);
     bu_semaphore_release(RT_SEM_MODEL);
 
-    if (dgcdp->gedp->ged_create_vlist_solid_callback != 
GED_CREATE_VLIST_SOLID_CALLBACK_PTR_NULL) {
-       (*dgcdp->gedp->ged_create_vlist_solid_callback)(sp);
-    }
+    ged_create_vlist_solid_cb(dgcdp->gedp, sp);
 
 }
 
@@ -1122,11 +1121,12 @@
     sp->s_vlen = bn_vlist_cmd_cnt((struct bn_vlist *)(&(sp->s_vlist)));
 }
 
-int invent_solid(struct bu_list *hdlp, struct db_i *dbip,
-               void (*callback_create)(struct solid *), void 
(*callback_free)(unsigned int, int),
-               char *name, struct bu_list *vhead, long int rgb, int copy, 
fastf_t transparency, int dmode,
-               struct solid *freesolid, int csoltab)
+int invent_solid(struct ged *gedp, char *name, struct bu_list *vhead, long int 
rgb, int copy,
+               fastf_t transparency, int dmode, int csoltab)
 {
+    struct bu_list *hdlp = gedp->ged_gdp->gd_headDisplay;
+    struct db_i *dbip = gedp->ged_wdbp->dbip;
+    struct solid *freesolid = gedp->freesolid;
     struct directory *dp;
     struct solid *sp;
     struct display_list *gdlp;
@@ -1145,7 +1145,7 @@
         * Name exists from some other overlay,
         * zap any associated solids
         */
-       dl_erasePathFromDisplay(hdlp, dbip, callback_free, name, 0, freesolid);
+       dl_erasePathFromDisplay(hdlp, dbip, gedp->ged_free_vlist_callback, 
name, 0, freesolid);
     }
     /* Need to enter phony name in directory structure */
     dp = db_diradd(dbip, name, RT_DIR_PHONY_ADDR, 0, RT_DIR_SOLID, (void 
*)&type);
@@ -1189,8 +1189,7 @@
     if (csoltab)
        color_soltab(sp);
 
-    if (callback_create != GED_CREATE_VLIST_SOLID_CALLBACK_PTR_NULL)
-       (*callback_create)(sp);
+    ged_create_vlist_solid_cb(gedp, sp);
 
     return 0;           /* OK */
 

Modified: brlcad/branches/bioh/src/libged/ged_util.c
===================================================================
--- brlcad/branches/bioh/src/libged/ged_util.c  2020-07-30 19:40:27 UTC (rev 
76603)
+++ brlcad/branches/bioh/src/libged/ged_util.c  2020-07-30 20:37:15 UTC (rev 
76604)
@@ -1037,7 +1037,7 @@
        if (BU_LIST_IS_EMPTY(&(vbp->head[i])))
            continue;
        snprintf(namebuf, 64, "%s%lx", shortname, vbp->rgb[i]);
-       invent_solid(gedp->ged_gdp->gd_headDisplay, gedp->ged_wdbp->dbip, 
gedp->ged_create_vlist_solid_callback, gedp->ged_free_vlist_callback, namebuf, 
&vbp->head[i], vbp->rgb[i], copy, 1.0, 0, gedp->freesolid, 0);
+       invent_solid(gedp, namebuf, &vbp->head[i], vbp->rgb[i], copy, 1.0, 0, 
0);
     }
 }
 

Modified: brlcad/branches/bioh/src/libged/vdraw/vdraw.c
===================================================================
--- brlcad/branches/bioh/src/libged/vdraw/vdraw.c       2020-07-30 19:40:27 UTC 
(rev 76603)
+++ brlcad/branches/bioh/src/libged/vdraw/vdraw.c       2020-07-30 20:37:15 UTC 
(rev 76604)
@@ -542,7 +542,7 @@
     }
 
     /* 0 means OK, -1 means conflict with real solid name */
-    idx = invent_solid(gedp->ged_gdp->gd_headDisplay, gedp->ged_wdbp->dbip, 
gedp->ged_create_vlist_solid_callback, gedp->ged_free_vlist_callback, 
solid_name, &(gedp->ged_gdp->gd_currVHead->vdc_vhd), 
gedp->ged_gdp->gd_currVHead->vdc_rgb, 1, 1.0, 0, gedp->freesolid, 0);
+    idx = invent_solid(gedp, solid_name, 
&(gedp->ged_gdp->gd_currVHead->vdc_vhd), gedp->ged_gdp->gd_currVHead->vdc_rgb, 
1, 1.0, 0, 0);
 
     bu_vls_printf(gedp->ged_result_str, "%d", idx);
 

Modified: brlcad/branches/bioh/src/mged/dodraw.c
===================================================================
--- brlcad/branches/bioh/src/mged/dodraw.c      2020-07-30 19:40:27 UTC (rev 
76603)
+++ brlcad/branches/bioh/src/mged/dodraw.c      2020-07-30 20:37:15 UTC (rev 
76604)
@@ -61,8 +61,8 @@
        if (BU_LIST_IS_EMPTY(&(vbp->head[i]))) continue;
 
        snprintf(namebuf, sizeof(namebuf), "%s%lx",     shortname, vbp->rgb[i]);
-       /*invent_solid(namebuf, &vbp->head[i], vbp->rgb[i], copy);*/
-       invent_solid(GEDP->ged_gdp->gd_headDisplay, DBIP, createDListSolid, 
GEDP->ged_free_vlist_callback, namebuf, &vbp->head[i], vbp->rgb[i], copy, 1.0, 
0, GEDP->freesolid, 0);
+       //mged_invent_solid(GEDP->ged_gdp->gd_headDisplay, DBIP, 
createDListSolid, GEDP->ged_free_vlist_callback, namebuf, &vbp->head[i], 
vbp->rgb[i], copy, 1.0, 0, GEDP->freesolid, 0);
+       invent_solid(GEDP, namebuf, &vbp->head[i], vbp->rgb[i], copy, 1.0, 0, 
0);
     }
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to