Skip to content

Commit

Permalink
Restore (in a branch) the in-progress MGED using librt editing
Browse files Browse the repository at this point in the history
OK, main has a version of MGED from before the code relocations started.
We now make another branch to focus on shaking down MGED's editing
capabilities with this new form of the edit code.

Doing it this way so we (hopefully) wind up with fewer conflicts when
rebasing and/or merging main - prior branch was getting a bit unwieldy.

This reverts commit 187b138.
  • Loading branch information
starseeker committed Feb 7, 2025
1 parent bb228a0 commit 555be21
Show file tree
Hide file tree
Showing 39 changed files with 2,524 additions and 10,722 deletions.
20 changes: 12 additions & 8 deletions src/mged/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@ set(
chgmodel.c
chgtree.c
chgview.c
cmd.c
clone.c
cmd.c
color_scheme.c
columns.c
dm-generic.c
dodraw.c
doevent.c
dozoom.c
edarb.c
edars.c
edpipe.c
edsol.c
f_db.c
facedef.c
Expand All @@ -34,6 +31,7 @@ set(
mater.c
menu.c
mged.c
mged_impl.cpp
mover.c
overlay.c
plot.c
Expand Down Expand Up @@ -76,12 +74,15 @@ set(
# but I'm not sure if that would be a problem for scripting with mged.exe on
# Windows so leave it for now...
if(BRLCAD_ENABLE_TCL)
set(MGED_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../libtermio)
set(MGED_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../libtermio
)
brlcad_addexec(mged "${MGED_SOURCES}" "${mged_libs}")
if(TK_LIBRARY)
target_compile_definitions(mged PRIVATE HAVE_TK=1)
endif(TK_LIBRARY)
target_include_directories(mged BEFORE PRIVATE ${MGED_INCLUDE_DIRS})
target_include_directories(mged BEFORE PRIVATE ${MGED_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
add_target_deps(mged Tkhtml Tktable itcl_pkgIndex itk_pkgIndex TclIndexBld dm_plugins)

# MGED needs the tclIndex and pkgIndex files set up correctly
Expand All @@ -108,17 +109,20 @@ set(
f_cmd.h
menu.h
mged.h
mged.ico
mged.rc
mged_dm.h
mged_impl.h
mged_wdb.h
sedit.h
mged.ico
mged.rc
)
cmakefiles(${mged_ignore_files})


# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8

4 changes: 3 additions & 1 deletion src/mged/attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@
#include "./sedit.h"
#include "./mged_dm.h"


/* Ew. Globals. */

/* Geometry display instances used by MGED */
struct bu_ptbl active_dm_set = BU_PTBL_INIT_ZERO; /* set of active display managers */
struct mged_dm *mged_dm_init_state = NULL;


extern struct _color_scheme default_color_scheme;
extern void share_dlist(struct mged_dm *dlp2); /* defined in share.c */
int mged_default_dlist = 0; /* This variable is available via Tcl for controlling use of display lists */
Expand Down
19 changes: 7 additions & 12 deletions src/mged/axes.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
#include "./mged.h"
#include "./mged_dm.h"


extern point_t es_keypoint;
extern point_t e_axes_pos;
extern point_t curr_e_axes_pos;

/* local sp_hook function */
static void ax_set_dirty_flag(const struct bu_structparse *, const char *, void *, const char *, void *);

Expand Down Expand Up @@ -105,14 +100,14 @@ draw_e_axes(struct mged_state *s)
mat_t rot_mat;
struct bv_axes gas;

if (GEOM_EDIT_STATE == ST_S_EDIT) {
MAT4X3PNT(v_ap1, view_state->vs_gvp->gv_model2view, e_axes_pos);
MAT4X3PNT(v_ap2, view_state->vs_gvp->gv_model2view, curr_e_axes_pos);
} else if (GEOM_EDIT_STATE == ST_O_EDIT) {
if (s->edit_state.global_editing_state == ST_S_EDIT) {
MAT4X3PNT(v_ap1, view_state->vs_gvp->gv_model2view, s->s_edit->e_axes_pos);
MAT4X3PNT(v_ap2, view_state->vs_gvp->gv_model2view, s->s_edit->curr_e_axes_pos);
} else if (s->edit_state.global_editing_state == ST_O_EDIT) {
point_t m_ap2;

MAT4X3PNT(v_ap1, view_state->vs_gvp->gv_model2view, es_keypoint);
MAT4X3PNT(m_ap2, modelchanges, es_keypoint);
MAT4X3PNT(v_ap1, view_state->vs_gvp->gv_model2view, s->s_edit->e_keypoint);
MAT4X3PNT(m_ap2, s->s_edit->model_changes, s->s_edit->e_keypoint);
MAT4X3PNT(v_ap2, view_state->vs_gvp->gv_model2view, m_ap2);
} else
return;
Expand All @@ -135,7 +130,7 @@ draw_e_axes(struct mged_state *s)
VMOVE(gas.label_color, color_scheme->cs_edit_axes_label2);
gas.line_width = axes_state->ax_edit_linewidth2;

bn_mat_mul(rot_mat, view_state->vs_gvp->gv_rotation, acc_rot_sol);
bn_mat_mul(rot_mat, view_state->vs_gvp->gv_rotation, s->s_edit->acc_rot_sol);
dm_draw_hud_axes(DMP, view_state->vs_gvp->gv_size, rot_mat, &gas);
}

Expand Down
Loading

0 comments on commit 555be21

Please sign in to comment.