Skip to content

Commit

Permalink
Merge edarb into edit plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Dec 2, 2024
1 parent 37ac02f commit 0b292be
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 50 deletions.
2 changes: 0 additions & 2 deletions src/libged/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ set(
dbi_state.cpp
display_list.c
draw.cpp
facedef.c
ged.cpp
ged_util.cpp
get_obj_bounds.c
Expand Down Expand Up @@ -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)
Expand Down
22 changes: 0 additions & 22 deletions src/libged/edarb/CMakeLists.txt

This file was deleted.

2 changes: 2 additions & 0 deletions src/libged/edit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
21 changes: 1 addition & 20 deletions src/libged/edarb/edarb.c → src/libged/edit/edarb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions src/libged/edit/edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand All @@ -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)
{
Expand Down
3 changes: 2 additions & 1 deletion src/libged/facedef.c → src/libged/edit/facedef.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down
3 changes: 3 additions & 0 deletions src/libged/edit/ged_edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -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[]);
Expand Down
3 changes: 0 additions & 3 deletions src/libged/ged_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0b292be

Please sign in to comment.