Revision: 76701
http://sourceforge.net/p/brlcad/code/76701
Author: starseeker
Date: 2020-08-11 13:21:45 +0000 (Tue, 11 Aug 2020)
Log Message:
-----------
Ah - MGED wasn't using ged_blast to implement 'B'.
Modified Paths:
--------------
brlcad/branches/RELEASE/src/libged/blast/blast.c
brlcad/branches/RELEASE/src/libged/draw/draw.c
brlcad/branches/RELEASE/src/mged/cmd.c
Modified: brlcad/branches/RELEASE/src/libged/blast/blast.c
===================================================================
--- brlcad/branches/RELEASE/src/libged/blast/blast.c 2020-08-11 12:32:38 UTC
(rev 76700)
+++ brlcad/branches/RELEASE/src/libged/blast/blast.c 2020-08-11 13:21:45 UTC
(rev 76701)
@@ -60,6 +60,7 @@
}
/* Draw the new object(s) */
+ argv[0] = "draw";
return ged_draw(gedp, argc, argv);
}
@@ -66,17 +67,17 @@
#ifdef GED_PLUGIN
#include "../include/plugin.h"
-struct ged_cmd_impl blast_cmd_impl = {
- "blast",
- ged_blast_core,
- GED_CMD_DEFAULT
-};
-
+struct ged_cmd_impl blast_cmd_impl = {"blast", ged_blast_core,
GED_CMD_DEFAULT};
const struct ged_cmd blast_cmd = { &blast_cmd_impl };
-const struct ged_cmd *blast_cmds[] = { &blast_cmd, NULL };
-static const struct ged_plugin pinfo = { blast_cmds, 1 };
+struct ged_cmd_impl B_cmd_impl = {"B", ged_blast_core, GED_CMD_DEFAULT};
+const struct ged_cmd B_cmd = { &B_cmd_impl };
+
+const struct ged_cmd *blast_cmds[] = { &blast_cmd, &B_cmd, NULL };
+
+static const struct ged_plugin pinfo = { blast_cmds, 2 };
+
COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info()
{
return &pinfo;
Modified: brlcad/branches/RELEASE/src/libged/draw/draw.c
===================================================================
--- brlcad/branches/RELEASE/src/libged/draw/draw.c 2020-08-11 12:32:38 UTC
(rev 76700)
+++ brlcad/branches/RELEASE/src/libged/draw/draw.c 2020-08-11 13:21:45 UTC
(rev 76701)
@@ -1315,9 +1315,6 @@
struct ged_cmd_impl e_cmd_impl = {"e", ged_draw_core, GED_CMD_DEFAULT};
const struct ged_cmd e_cmd = { &e_cmd_impl };
-struct ged_cmd_impl B_cmd_impl = {"B", ged_draw_core, GED_CMD_DEFAULT};
-const struct ged_cmd B_cmd = { &B_cmd_impl };
-
struct ged_cmd_impl ev_cmd_impl = {"ev", ged_ev_core, GED_CMD_DEFAULT};
const struct ged_cmd ev_cmd = { &ev_cmd_impl };
@@ -1329,9 +1326,9 @@
struct ged_cmd_impl preview_cmd_impl = {"preview", ged_preview_core,
GED_CMD_DEFAULT};
const struct ged_cmd preview_cmd = { &preview_cmd_impl };
-const struct ged_cmd *draw_cmds[] = { &draw_cmd, &e_cmd, &B_cmd, &ev_cmd,
&loadview_cmd, &preview_cmd, NULL };
+const struct ged_cmd *draw_cmds[] = { &draw_cmd, &e_cmd, &ev_cmd,
&loadview_cmd, &preview_cmd, NULL };
-static const struct ged_plugin pinfo = { draw_cmds, 6 };
+static const struct ged_plugin pinfo = { draw_cmds, 5 };
COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info()
{
Modified: brlcad/branches/RELEASE/src/mged/cmd.c
===================================================================
--- brlcad/branches/RELEASE/src/mged/cmd.c 2020-08-11 12:32:38 UTC (rev
76700)
+++ brlcad/branches/RELEASE/src/mged/cmd.c 2020-08-11 13:21:45 UTC (rev
76701)
@@ -1807,29 +1807,75 @@
extern int edit_com(int argc, const char *argv[], int kind);
/**
- * ZAP the display -- then edit anew
+ * Run ged_blast, then update the views
* Format: B object
*/
int
cmd_blast(ClientData UNUSED(clientData), Tcl_Interp *UNUSED(interpreter), int
argc, const char *argv[])
{
- const char *av[2];
int ret;
if (GEDP == GED_NULL)
return TCL_OK;
- av[0] = "Z";
- av[1] = (char *)0;
-
- ret = ged_zap(GEDP, 1, av);
+ ret = ged_blast(GEDP, argc, argv);
if (ret)
return TCL_ERROR;
- if (argc == 1) /* "B" alone is same as "Z" */
- return TCL_OK;
+ /* update and resize the views */
+ struct dm_list *save_dmlp = curr_dm_list;
+ struct cmd_list *save_cmd_list = curr_cmd_list;
+ struct dm_list *dmlp;
+ struct display_list *gdlp;
+ struct display_list *next_gdlp;
+ FOR_ALL_DISPLAYS(dmlp, &head_dm_list.l) {
+ int non_empty = 0; /* start out empty */
- return edit_com(argc, argv, 1);
+ set_curr_dm(dmlp);
+
+ if (curr_dm_list->dml_tie) {
+ curr_cmd_list = curr_dm_list->dml_tie;
+ } else {
+ curr_cmd_list = &head_cmd_list;
+ }
+
+ GEDP->ged_gvp = view_state->vs_gvp;
+
+ gdlp = BU_LIST_NEXT(display_list, GEDP->ged_gdp->gd_headDisplay);
+
+ while (BU_LIST_NOT_HEAD(gdlp, GEDP->ged_gdp->gd_headDisplay)) {
+ next_gdlp = BU_LIST_PNEXT(display_list, gdlp);
+
+ if (BU_LIST_NON_EMPTY(&gdlp->dl_headSolid)) {
+ non_empty = 1;
+ break;
+ }
+
+ gdlp = next_gdlp;
+ }
+
+ if (mged_variables->mv_autosize && non_empty) {
+ struct view_ring *vrp;
+ char *av[2];
+
+ av[0] = "autoview";
+ av[1] = (char *)0;
+ ged_autoview(GEDP, 1, (const char **)av);
+
+ (void)mged_svbase();
+
+ for (BU_LIST_FOR(vrp, view_ring, &view_state->vs_headView.l)) {
+ vrp->vr_scale = view_state->vs_gvp->gv_scale;
+ }
+ }
+ }
+
+ set_curr_dm(save_dmlp);
+ curr_cmd_list = save_cmd_list;
+ GEDP->ged_gvp = view_state->vs_gvp;
+
+
+ return TCL_OK;
}
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