From 0b292be188e79feae91a2ee19075e2a7179ec924 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:20:37 -0500 Subject: [PATCH] Merge edarb into edit plugin --- src/libged/CMakeLists.txt | 2 -- src/libged/edarb/CMakeLists.txt | 22 ---------------------- src/libged/edit/CMakeLists.txt | 2 ++ src/libged/{edarb => edit}/edarb.c | 21 +-------------------- src/libged/edit/edit.c | 8 ++++++-- src/libged/{ => edit}/facedef.c | 3 ++- src/libged/edit/ged_edit.h | 3 +++ src/libged/ged_private.h | 3 --- 8 files changed, 14 insertions(+), 50 deletions(-) delete mode 100644 src/libged/edarb/CMakeLists.txt rename src/libged/{edarb => edit}/edarb.c (96%) rename src/libged/{ => edit}/facedef.c (99%) diff --git a/src/libged/CMakeLists.txt b/src/libged/CMakeLists.txt index f6f2873284b..2bcec3ec849 100644 --- a/src/libged/CMakeLists.txt +++ b/src/libged/CMakeLists.txt @@ -127,7 +127,6 @@ set( dbi_state.cpp display_list.c draw.cpp - facedef.c ged.cpp ged_util.cpp get_obj_bounds.c @@ -241,7 +240,6 @@ add_subdirectory(dump) add_subdirectory(dup) add_subdirectory(eac) add_subdirectory(echo) -add_subdirectory(edarb) add_subdirectory(edcodes) add_subdirectory(edcomb) add_subdirectory(edit) diff --git a/src/libged/edarb/CMakeLists.txt b/src/libged/edarb/CMakeLists.txt deleted file mode 100644 index 061366f148d..00000000000 --- a/src/libged/edarb/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${BRLCAD_BINARY_DIR}/include - ${BRLCAD_SOURCE_DIR}/include - ${BU_INCLUDE_DIRS} - ${GED_INCLUDE_DIRS} -) - -ged_plugin_library(ged-edarb edarb.c) -target_link_libraries(ged-edarb libged libbu) - -cmakefiles( - CMakeLists.txt - edarb.c -) - -# Local Variables: -# tab-width: 8 -# mode: cmake -# indent-tabs-mode: t -# End: -# ex: shiftwidth=2 tabstop=8 diff --git a/src/libged/edit/CMakeLists.txt b/src/libged/edit/CMakeLists.txt index 86b287bc477..a074e3e45f5 100644 --- a/src/libged/edit/CMakeLists.txt +++ b/src/libged/edit/CMakeLists.txt @@ -31,6 +31,8 @@ set(edit_srcs scale_tor.c translate_extrude.c translate_tgc.c + edarb.c + facedef.c ) ged_plugin_library(ged-edit ${edit_srcs}) diff --git a/src/libged/edarb/edarb.c b/src/libged/edit/edarb.c similarity index 96% rename from src/libged/edarb/edarb.c rename to src/libged/edit/edarb.c index 8d6a975fea3..5d7b7229570 100644 --- a/src/libged/edarb/edarb.c +++ b/src/libged/edit/edarb.c @@ -30,6 +30,7 @@ #include "bu/cmd.h" #include "rt/arb_edit.h" #include "../ged_private.h" +#include "./ged_edit.h" /* * An ARB edge is moved by finding the direction of the line @@ -365,26 +366,6 @@ ged_edarb_core(struct ged *gedp, int argc, const char *argv[]) return BRLCAD_ERROR; } - -#ifdef GED_PLUGIN -#include "../include/plugin.h" -struct ged_cmd_impl edarb_cmd_impl = { - "edarb", - ged_edarb_core, - GED_CMD_DEFAULT -}; - -const struct ged_cmd edarb_cmd = { &edarb_cmd_impl }; -const struct ged_cmd *edarb_cmds[] = { &edarb_cmd, NULL }; - -static const struct ged_plugin pinfo = { GED_API, edarb_cmds, 1 }; - -COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info(void) -{ - return &pinfo; -} -#endif /* GED_PLUGIN */ - /* * Local Variables: * mode: C diff --git a/src/libged/edit/edit.c b/src/libged/edit/edit.c index e0ea06c13c5..66a3c336a4f 100644 --- a/src/libged/edit/edit.c +++ b/src/libged/edit/edit.c @@ -2437,6 +2437,9 @@ ged_edit_core(struct ged *gedp, int argc, const char *argv[]) struct ged_cmd_impl edit_cmd_impl = {"edit", ged_edit_core, GED_CMD_DEFAULT}; const struct ged_cmd edit_cmd = { &edit_cmd_impl }; +struct ged_cmd_impl edarb_cmd_impl = {"edarb", ged_edarb_core, GED_CMD_DEFAULT}; +const struct ged_cmd edarb_cmd = { &edarb_cmd_impl }; + struct ged_cmd_impl protate_cmd_impl = {"protate", ged_protate_core, GED_CMD_DEFAULT}; const struct ged_cmd protate_cmd = { &protate_cmd_impl }; @@ -2446,9 +2449,10 @@ const struct ged_cmd pscale_cmd = { &pscale_cmd_impl }; struct ged_cmd_impl ptranslate_cmd_impl = {"ptranslate", ged_ptranslate_core, GED_CMD_DEFAULT}; const struct ged_cmd ptranslate_cmd = { &ptranslate_cmd_impl }; -const struct ged_cmd *edit_pcmds[] = { &edit_cmd, &protate_cmd, &pscale_cmd, &ptranslate_cmd, NULL }; -static const struct ged_plugin pinfo = { GED_API, edit_pcmds, 4 }; +const struct ged_cmd *edit_pcmds[] = { &edit_cmd, &edarb_cmd, &protate_cmd, &pscale_cmd, &ptranslate_cmd, NULL }; + +static const struct ged_plugin pinfo = { GED_API, edit_pcmds, 5 }; COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info(void) { diff --git a/src/libged/facedef.c b/src/libged/edit/facedef.c similarity index 99% rename from src/libged/facedef.c rename to src/libged/edit/facedef.c index 62f1a85dfe5..503c0ced2fd 100644 --- a/src/libged/facedef.c +++ b/src/libged/edit/facedef.c @@ -31,7 +31,8 @@ #include "vmath.h" #include "rt/geom.h" #include "raytrace.h" -#include "./ged_private.h" +#include "../ged_private.h" +#include "./ged_edit.h" char *p_rotfb[] = { diff --git a/src/libged/edit/ged_edit.h b/src/libged/edit/ged_edit.h index 015987e694d..dea1b1cda20 100644 --- a/src/libged/edit/ged_edit.h +++ b/src/libged/edit/ged_edit.h @@ -121,8 +121,11 @@ GED_EXPORT extern int _ged_translate_tgc(struct ged *gedp, vect_t tvec, int rflag); +/* defined in facedef.c */ +GED_EXPORT extern int edarb_facedef(void *data, int argc, const char *argv[]); +extern int ged_edarb_core(struct ged *gedp, int argc, const char *argv[]); extern int ged_protate_core(struct ged *gedp, int argc, const char *argv[]); extern int ged_pscale_core(struct ged *gedp, int argc, const char *argv[]); extern int ged_ptranslate_core(struct ged *gedp, int argc, const char *argv[]); diff --git a/src/libged/ged_private.h b/src/libged/ged_private.h index a79eec64e6c..5a368cb8e96 100644 --- a/src/libged/ged_private.h +++ b/src/libged/ged_private.h @@ -245,9 +245,6 @@ GED_EXPORT void draw_gather_paths(struct db_full_path *path, mat_t *curr_mat, vo GED_EXPORT void vls_col_item(struct bu_vls *str, const char *cp); GED_EXPORT void vls_col_eol(struct bu_vls *str); -/* defined in facedef.c */ -GED_EXPORT extern int edarb_facedef(void *data, int argc, const char *argv[]); - /* defined in ged.c */ GED_EXPORT extern struct db_i *_ged_open_dbip(const char *filename, int existing_only);