Skip to content

Commit 9e83746

Browse files
committed
Restore MGED altered for librt editing in branch
This reverts commit 7177651.
1 parent 7177651 commit 9e83746

39 files changed

+2489
-9918
lines changed

src/mged/CMakeLists.txt

+12-8
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,14 @@ set(
1414
chgmodel.c
1515
chgtree.c
1616
chgview.c
17-
cmd.c
1817
clone.c
18+
cmd.c
1919
color_scheme.c
2020
columns.c
2121
dm-generic.c
2222
dodraw.c
2323
doevent.c
2424
dozoom.c
25-
edarb.c
26-
edars.c
27-
edpipe.c
2825
edsol.c
2926
f_db.c
3027
facedef.c
@@ -34,6 +31,7 @@ set(
3431
mater.c
3532
menu.c
3633
mged.c
34+
mged_impl.cpp
3735
mover.c
3836
overlay.c
3937
plot.c
@@ -76,12 +74,15 @@ set(
7674
# but I'm not sure if that would be a problem for scripting with mged.exe on
7775
# Windows so leave it for now...
7876
if(BRLCAD_ENABLE_TCL)
79-
set(MGED_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../libtermio)
77+
set(MGED_INCLUDE_DIRS
78+
${CMAKE_CURRENT_SOURCE_DIR}
79+
${CMAKE_CURRENT_SOURCE_DIR}/../libtermio
80+
)
8081
brlcad_addexec(mged "${MGED_SOURCES}" "${mged_libs}")
8182
if(TK_LIBRARY)
8283
target_compile_definitions(mged PRIVATE HAVE_TK=1)
8384
endif(TK_LIBRARY)
84-
target_include_directories(mged BEFORE PRIVATE ${MGED_INCLUDE_DIRS})
85+
target_include_directories(mged BEFORE PRIVATE ${MGED_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
8586
add_target_deps(mged Tkhtml Tktable itcl_pkgIndex itk_pkgIndex TclIndexBld dm_plugins)
8687

8788
# MGED needs the tclIndex and pkgIndex files set up correctly
@@ -108,17 +109,20 @@ set(
108109
f_cmd.h
109110
menu.h
110111
mged.h
112+
mged.ico
113+
mged.rc
111114
mged_dm.h
115+
mged_impl.h
112116
mged_wdb.h
113117
sedit.h
114-
mged.ico
115-
mged.rc
116118
)
117119
cmakefiles(${mged_ignore_files})
118120

121+
119122
# Local Variables:
120123
# tab-width: 8
121124
# mode: cmake
122125
# indent-tabs-mode: t
123126
# End:
124127
# ex: shiftwidth=2 tabstop=8
128+

src/mged/attach.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@
5151
#include "./sedit.h"
5252
#include "./mged_dm.h"
5353

54+
55+
/* Ew. Globals. */
56+
5457
/* Geometry display instances used by MGED */
5558
struct bu_ptbl active_dm_set = BU_PTBL_INIT_ZERO; /* set of active display managers */
5659
struct mged_dm *mged_dm_init_state = NULL;
5760

58-
5961
extern struct _color_scheme default_color_scheme;
6062
extern void share_dlist(struct mged_dm *dlp2); /* defined in share.c */
6163
int mged_default_dlist = 0; /* This variable is available via Tcl for controlling use of display lists */

src/mged/axes.c

+7-12
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
#include "./mged.h"
3434
#include "./mged_dm.h"
3535

36-
37-
extern point_t es_keypoint;
38-
extern point_t e_axes_pos;
39-
extern point_t curr_e_axes_pos;
40-
4136
/* local sp_hook function */
4237
static void ax_set_dirty_flag(const struct bu_structparse *, const char *, void *, const char *, void *);
4338

@@ -105,14 +100,14 @@ draw_e_axes(struct mged_state *s)
105100
mat_t rot_mat;
106101
struct bv_axes gas;
107102

108-
if (GEOM_EDIT_STATE == ST_S_EDIT) {
109-
MAT4X3PNT(v_ap1, view_state->vs_gvp->gv_model2view, e_axes_pos);
110-
MAT4X3PNT(v_ap2, view_state->vs_gvp->gv_model2view, curr_e_axes_pos);
111-
} else if (GEOM_EDIT_STATE == ST_O_EDIT) {
103+
if (s->edit_state.global_editing_state == ST_S_EDIT) {
104+
MAT4X3PNT(v_ap1, view_state->vs_gvp->gv_model2view, s->s_edit->e_axes_pos);
105+
MAT4X3PNT(v_ap2, view_state->vs_gvp->gv_model2view, s->s_edit->curr_e_axes_pos);
106+
} else if (s->edit_state.global_editing_state == ST_O_EDIT) {
112107
point_t m_ap2;
113108

114-
MAT4X3PNT(v_ap1, view_state->vs_gvp->gv_model2view, es_keypoint);
115-
MAT4X3PNT(m_ap2, modelchanges, es_keypoint);
109+
MAT4X3PNT(v_ap1, view_state->vs_gvp->gv_model2view, s->s_edit->e_keypoint);
110+
MAT4X3PNT(m_ap2, s->s_edit->model_changes, s->s_edit->e_keypoint);
116111
MAT4X3PNT(v_ap2, view_state->vs_gvp->gv_model2view, m_ap2);
117112
} else
118113
return;
@@ -135,7 +130,7 @@ draw_e_axes(struct mged_state *s)
135130
VMOVE(gas.label_color, color_scheme->cs_edit_axes_label2);
136131
gas.line_width = axes_state->ax_edit_linewidth2;
137132

138-
bn_mat_mul(rot_mat, view_state->vs_gvp->gv_rotation, acc_rot_sol);
133+
bn_mat_mul(rot_mat, view_state->vs_gvp->gv_rotation, s->s_edit->acc_rot_sol);
139134
dm_draw_hud_axes(DMP, view_state->vs_gvp->gv_size, rot_mat, &gas);
140135
}
141136

0 commit comments

Comments
 (0)