Skip to content

Commit

Permalink
Consolidate big E command into draw plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Dec 2, 2024
1 parent 173e343 commit ccca135
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 48 deletions.
1 change: 0 additions & 1 deletion src/libged/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ add_subdirectory(arot)
add_subdirectory(attr)
add_subdirectory(bb)
add_subdirectory(bev)
add_subdirectory(bigE)
add_subdirectory(blast)
add_subdirectory(bo)
add_subdirectory(bot)
Expand Down
22 changes: 0 additions & 22 deletions src/libged/bigE/CMakeLists.txt

This file was deleted.

3 changes: 2 additions & 1 deletion src/libged/draw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ include_directories(
${GED_INCLUDE_DIRS}
)

set(DRAW_SRCS draw.c draw2.cpp loadview.c preview.c)
set(DRAW_SRCS bigE.c draw.c draw2.cpp loadview.c preview.c)

ged_plugin_library(ged-draw ${DRAW_SRCS})
target_link_libraries(ged-draw libged libbu)

cmakefiles(
CMakeLists.txt
ged_draw.h
${DRAW_SRCS}
)

Expand Down
22 changes: 1 addition & 21 deletions src/libged/bigE/bigE.c → src/libged/draw/bigE.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "rt/func.h"

#include "../ged_private.h"

#include "./ged_draw.h"

/* #define debug 1 */

Expand Down Expand Up @@ -2126,26 +2126,6 @@ ged_E_core(struct ged *gedp, int argc, const char *argv[])
return BRLCAD_OK;
}


#ifdef GED_PLUGIN
#include "../include/plugin.h"
struct ged_cmd_impl bigE_cmd_impl = {
"E",
ged_E_core,
GED_CMD_DEFAULT
};

const struct ged_cmd bigE_cmd = { &bigE_cmd_impl };
const struct ged_cmd *bigE_cmds[] = { &bigE_cmd, NULL };

static const struct ged_plugin pinfo = { GED_API, bigE_cmds, 1 };

COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info(void)
{
return &pinfo;
}
#endif /* GED_PLUGIN */

/*
* Local Variables:
* mode: C
Expand Down
9 changes: 6 additions & 3 deletions src/libged/draw/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "bu/time.h"
#include "raytrace.h"


#include "../ged_private.h"
#include "./ged_draw.h"

/* declare our callbacks used by _ged_drawtrees() */
static int drawtrees_depth = 0;
Expand Down Expand Up @@ -1609,6 +1609,9 @@ ged_redraw_core(struct ged *gedp, int argc, const char *argv[])
struct ged_cmd_impl draw_cmd_impl = {"draw", ged_draw_core, GED_CMD_DEFAULT};
const struct ged_cmd draw_cmd = { &draw_cmd_impl };

struct ged_cmd_impl bigE_cmd_impl = {"E", ged_E_core, GED_CMD_DEFAULT};
const struct ged_cmd bigE_cmd = { &bigE_cmd_impl };

struct ged_cmd_impl e_cmd_impl = {"e", ged_draw_core, GED_CMD_DEFAULT};
const struct ged_cmd e_cmd = { &e_cmd_impl };

Expand All @@ -1626,9 +1629,9 @@ extern int ged_preview_core(struct ged *gedp, int argc, const char *argv[]);
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, &ev_cmd, &redraw_cmd, &loadview_cmd, &preview_cmd, NULL };
const struct ged_cmd *draw_cmds[] = { &draw_cmd, &bigE_cmd, &e_cmd, &ev_cmd, &redraw_cmd, &loadview_cmd, &preview_cmd, NULL };

static const struct ged_plugin pinfo = { GED_API, draw_cmds, 6 };
static const struct ged_plugin pinfo = { GED_API, draw_cmds, 7 };

COMPILER_DLLEXPORT const struct ged_plugin *ged_plugin_info(void)
{
Expand Down
50 changes: 50 additions & 0 deletions src/libged/draw/ged_draw.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* G E D _ D R A W . H
* BRL-CAD
*
* Copyright (c) 2008-2024 United States Government as represented by
* the U.S. Army Research Laboratory.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this file; see the file named COPYING for more
* information.
*/
/** @file ged_brep.h
*
* Private header for libged draw cmd.
*
*/

#ifndef LIBGED_DRAW_GED_PRIVATE_H
#define LIBGED_DRAW_GED_PRIVATE_H

#include "common.h"

#include "ged.h"

__BEGIN_DECLS

extern int ged_E_core(struct ged *gedp, int argc, const char *argv[]);

__END_DECLS

#endif /* LIBGED_DRAW_GED_PRIVATE_H */

/** @} */
/*
* Local Variables:
* mode: C
* tab-width: 8
* indent-tabs-mode: t
* c-file-style: "stroustrup"
* End:
* ex: shiftwidth=4 tabstop=8
*/

0 comments on commit ccca135

Please sign in to comment.