Revision: 76397
          http://sourceforge.net/p/brlcad/code/76397
Author:   starseeker
Date:     2020-07-21 19:14:28 +0000 (Tue, 21 Jul 2020)
Log Message:
-----------
Place dl_dump with the command it is specific to

Modified Paths:
--------------
    brlcad/branches/gedplugins/src/libged/bot/bot_dump.c
    brlcad/branches/gedplugins/src/libged/display_list.c
    brlcad/branches/gedplugins/src/libged/ged_private.h

Modified: brlcad/branches/gedplugins/src/libged/bot/bot_dump.c
===================================================================
--- brlcad/branches/gedplugins/src/libged/bot/bot_dump.c        2020-07-21 
19:08:41 UTC (rev 76396)
+++ brlcad/branches/gedplugins/src/libged/bot/bot_dump.c        2020-07-21 
19:14:28 UTC (rev 76397)
@@ -86,6 +86,13 @@
 int curr_obj_blue;
 fastf_t curr_obj_alpha;
 
+enum otype {
+    OTYPE_DXF = 1,
+    OTYPE_OBJ,
+    OTYPE_SAT,
+    OTYPE_STL
+};
+
 static enum otype output_type;
 static int binary;
 static int normals;
@@ -1327,7 +1334,57 @@
     return GED_OK;
 }
 
+static void
+dl_botdump(struct bu_list *hdlp, struct db_i *dbip, FILE *fp, int fd, char 
*file_ext, int out_type, int *red, int *green, int *blue, fastf_t *alpha)
+{
+    int ret;
+    mat_t mat;
+    struct display_list *gdlp;
 
+    MAT_IDN(mat);
+
+    for (BU_LIST_FOR(gdlp, display_list, hdlp)) {
+       struct solid *sp;
+
+       FOR_ALL_SOLIDS(sp, &gdlp->dl_headSolid) {
+           struct directory *dp;
+           struct rt_db_internal intern;
+           struct rt_bot_internal *bot;
+
+           dp = sp->s_fullpath.fp_names[sp->s_fullpath.fp_len-1];
+
+           /* get the internal form */
+           ret=rt_db_get_internal(&intern, dp, dbip, mat, &rt_uniresource);
+
+           if (ret < 0) {
+               bu_log("rt_get_internal failure %d on %s\n", ret, dp->d_namep);
+               continue;
+           }
+
+           if (ret != ID_BOT) {
+               bu_log("%s is not a bot (ignored)\n", dp->d_namep);
+               rt_db_free_internal(&intern);
+               continue;
+           }
+
+           /* Write out object color */
+           if (out_type == OTYPE_OBJ) {
+               (*red) = sp->s_color[0];
+               (*green) = sp->s_color[1];
+               (*blue) = sp->s_color[2];
+               (*alpha) = sp->s_transparency;
+           }
+
+           bot = (struct rt_bot_internal *)intern.idb_ptr;
+           _ged_bot_dump(dp, NULL, bot, fp, fd, file_ext, dbip->dbi_filename);
+           rt_db_free_internal(&intern);
+       }
+    }
+
+}
+
+
+
 int
 ged_dbot_dump(struct ged *gedp, int argc, const char *argv[])
 {

Modified: brlcad/branches/gedplugins/src/libged/display_list.c
===================================================================
--- brlcad/branches/gedplugins/src/libged/display_list.c        2020-07-21 
19:08:41 UTC (rev 76396)
+++ brlcad/branches/gedplugins/src/libged/display_list.c        2020-07-21 
19:14:28 UTC (rev 76397)
@@ -2489,55 +2489,6 @@
 
 }
 
-void
-dl_botdump(struct bu_list *hdlp, struct db_i *dbip, FILE *fp, int fd, char 
*file_ext, int output_type, int *red, int *green, int *blue, fastf_t *alpha)
-{
-    int ret;
-    mat_t mat;
-    struct display_list *gdlp;
-
-    MAT_IDN(mat);
-
-    for (BU_LIST_FOR(gdlp, display_list, hdlp)) {
-       struct solid *sp;
-
-       FOR_ALL_SOLIDS(sp, &gdlp->dl_headSolid) {
-           struct directory *dp;
-           struct rt_db_internal intern;
-           struct rt_bot_internal *bot;
-
-           dp = sp->s_fullpath.fp_names[sp->s_fullpath.fp_len-1];
-
-           /* get the internal form */
-           ret=rt_db_get_internal(&intern, dp, dbip, mat, &rt_uniresource);
-
-           if (ret < 0) {
-               bu_log("rt_get_internal failure %d on %s\n", ret, dp->d_namep);
-               continue;
-           }
-
-           if (ret != ID_BOT) {
-               bu_log("%s is not a bot (ignored)\n", dp->d_namep);
-               rt_db_free_internal(&intern);
-               continue;
-           }
-
-           /* Write out object color */
-           if (output_type == OTYPE_OBJ) {
-               (*red) = sp->s_color[0];
-               (*green) = sp->s_color[1];
-               (*blue) = sp->s_color[2];
-               (*alpha) = sp->s_transparency;
-           }
-
-           bot = (struct rt_bot_internal *)intern.idb_ptr;
-           _ged_bot_dump(dp, NULL, bot, fp, fd, file_ext, dbip->dbi_filename);
-           rt_db_free_internal(&intern);
-       }
-    }
-
-}
-
 /*
  * Local Variables:
  * mode: C

Modified: brlcad/branches/gedplugins/src/libged/ged_private.h
===================================================================
--- brlcad/branches/gedplugins/src/libged/ged_private.h 2020-07-21 19:08:41 UTC 
(rev 76396)
+++ brlcad/branches/gedplugins/src/libged/ged_private.h 2020-07-21 19:14:28 UTC 
(rev 76397)
@@ -224,16 +224,6 @@
 GED_EXPORT int dl_select_partial(struct bu_list *hdlp, mat_t model2view, 
struct bu_vls *vls, double vx, double vy, double vwidth, double vheight, int 
rflag);
 GED_EXPORT void dl_set_transparency(struct bu_list *hdlp, struct directory 
**dpp, double transparency, void (*callback)(struct display_list *));
 
-enum otype {
-    OTYPE_DXF = 1,
-    OTYPE_OBJ,
-    OTYPE_SAT,
-    OTYPE_STL
-};
-void _ged_bot_dump(struct directory *dp, const struct db_full_path *pathp, 
struct rt_bot_internal *bot, FILE *fp, int fd, const char *file_ext, const char 
*db_name);
-GED_EXPORT void dl_botdump(struct bu_list *hdlp, struct db_i *dbip, FILE *fp, 
int fd, char *file_ext, int output_type, int *red, int *green, int *blue, 
fastf_t *alpha);
-
-
 /* defined in draw.c */
 GED_EXPORT extern void _ged_cvt_vlblock_to_solids(struct ged *gedp,
                                       struct bn_vlblock *vbp,

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