From ef276fb6ebfb171ad17e2da45e8f48f54f019638 Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:10:54 -0500 Subject: [PATCH] Move pipe scaling into edit with other scaling codes. --- src/libged/CMakeLists.txt | 1 - src/libged/edit/CMakeLists.txt | 1 + src/libged/edit/ged_edit.h | 49 ++++++++++++++++++++++++ src/libged/{pipe.c => edit/scale_pipe.c} | 19 ++++----- src/libged/ged_private.h | 49 ------------------------ 5 files changed, 60 insertions(+), 59 deletions(-) rename src/libged/{pipe.c => edit/scale_pipe.c} (97%) diff --git a/src/libged/CMakeLists.txt b/src/libged/CMakeLists.txt index 2bcec3ec84..67f831e8c3 100644 --- a/src/libged/CMakeLists.txt +++ b/src/libged/CMakeLists.txt @@ -133,7 +133,6 @@ set( get_solid_kp.c inside.c path.c - pipe.c pnts_util.c points_eval.c polyclip.cpp diff --git a/src/libged/edit/CMakeLists.txt b/src/libged/edit/CMakeLists.txt index a074e3e45f..08e653956b 100644 --- a/src/libged/edit/CMakeLists.txt +++ b/src/libged/edit/CMakeLists.txt @@ -24,6 +24,7 @@ set(edit_srcs scale_extrude.c scale_hyp.c scale_part.c + scale_pipe.c scale_rhc.c scale_rpc.c scale_superell.c diff --git a/src/libged/edit/ged_edit.h b/src/libged/edit/ged_edit.h index dea1b1cda2..cf58742a02 100644 --- a/src/libged/edit/ged_edit.h +++ b/src/libged/edit/ged_edit.h @@ -106,6 +106,55 @@ extern int _ged_scale_hyp(struct ged *gedp, fastf_t sf, int rflag); +/* defined in scale_part.c */ +GED_EXPORT extern int _ged_scale_part(struct ged *gedp, + struct rt_part_internal *part, + const char *attribute, + fastf_t sf, + int rflag); + +/* defined in edpipe.c */ +GED_EXPORT extern int _ged_scale_pipe(struct ged *gedp, + struct rt_pipe_internal *pipe_internal, + const char *attribute, + fastf_t sf, + int rflag); + +/* defined in scale_rhc.c */ +GED_EXPORT extern int _ged_scale_rhc(struct ged *gedp, + struct rt_rhc_internal *rhc, + const char *attribute, + fastf_t sf, + int rflag); + +/* defined in scale_rpc.c */ +GED_EXPORT extern int _ged_scale_rpc(struct ged *gedp, + struct rt_rpc_internal *rpc, + const char *attribute, + fastf_t sf, + int rflag); + +/* defined in scale_superell.c */ +GED_EXPORT extern int _ged_scale_superell(struct ged *gedp, + struct rt_superell_internal *superell, + const char *attribute, + fastf_t sf, + int rflag); + +/* defined in scale_tgc.c */ +GED_EXPORT extern int _ged_scale_tgc(struct ged *gedp, + struct rt_tgc_internal *tgc, + const char *attribute, + fastf_t sf, + int rflag); + +/* defined in scale_tor.c */ +GED_EXPORT extern int _ged_scale_tor(struct ged *gedp, + struct rt_tor_internal *tor, + const char *attribute, + fastf_t sf, + int rflag); + /* defined in translate_extrude.c */ GED_EXPORT extern int _ged_translate_extrude(struct ged *gedp, diff --git a/src/libged/pipe.c b/src/libged/edit/scale_pipe.c similarity index 97% rename from src/libged/pipe.c rename to src/libged/edit/scale_pipe.c index 98f5fce3a1..931a606a6b 100644 --- a/src/libged/pipe.c +++ b/src/libged/edit/scale_pipe.c @@ -1,4 +1,4 @@ -/* P I P E . C +/* S C A L E _ P I P E . C * BRL-CAD * * Copyright (c) 1995-2024 United States Government as represented by @@ -17,7 +17,7 @@ * License along with this file; see the file named COPYING for more * information. */ -/** @file libged/edpipe.c +/** @file libged/edit/scale_pipe.c * * Functions - * @@ -39,7 +39,8 @@ #include "ged.h" #include "wdb.h" -#include "./ged_private.h" +#include "../ged_private.h" +#include "./ged_edit.h" void pipe_split_pnt(struct bu_list *UNUSED(pipe_hd), struct wdb_pipe_pnt *UNUSED(ps), fastf_t *UNUSED(new_pt)) @@ -61,7 +62,7 @@ edpipe_scale(fastf_t d, fastf_t scale) } -void +static void pipe_scale_od(struct rt_pipe_internal *pipeip, fastf_t scale) { struct wdb_pipe_pnt *ps; @@ -90,7 +91,7 @@ pipe_scale_od(struct rt_pipe_internal *pipeip, fastf_t scale) } -void +static void pipe_scale_id(struct rt_pipe_internal *pipeip, fastf_t scale) { struct wdb_pipe_pnt *ps; @@ -119,7 +120,7 @@ pipe_scale_id(struct rt_pipe_internal *pipeip, fastf_t scale) } -void +static void pipe_seg_scale_od(struct wdb_pipe_pnt *ps, fastf_t scale) { fastf_t tmp_od; @@ -144,7 +145,7 @@ pipe_seg_scale_od(struct wdb_pipe_pnt *ps, fastf_t scale) } -void +static void pipe_seg_scale_id(struct wdb_pipe_pnt *ps, fastf_t scale) { fastf_t tmp_id; @@ -167,7 +168,7 @@ pipe_seg_scale_id(struct wdb_pipe_pnt *ps, fastf_t scale) } -void +static void pipe_seg_scale_radius(struct wdb_pipe_pnt *ps, fastf_t scale) { fastf_t old_radius; @@ -198,7 +199,7 @@ pipe_seg_scale_radius(struct wdb_pipe_pnt *ps, fastf_t scale) } -void +static void pipe_scale_radius(struct rt_pipe_internal *pipeip, fastf_t scale) { struct bu_list head; diff --git a/src/libged/ged_private.h b/src/libged/ged_private.h index eedf667b9f..1289f5b0b4 100644 --- a/src/libged/ged_private.h +++ b/src/libged/ged_private.h @@ -372,55 +372,6 @@ GED_EXPORT extern int _ged_set_metaball(struct ged *gedp, GED_EXPORT extern struct wdb_metaball_pnt * _ged_get_metaball_pt_i(struct rt_metaball_internal *mbip, int mbp_i); -/* defined in scale_part.c */ -GED_EXPORT extern int _ged_scale_part(struct ged *gedp, - struct rt_part_internal *part, - const char *attribute, - fastf_t sf, - int rflag); - -/* defined in edpipe.c */ -GED_EXPORT extern int _ged_scale_pipe(struct ged *gedp, - struct rt_pipe_internal *pipe_internal, - const char *attribute, - fastf_t sf, - int rflag); - -/* defined in scale_rhc.c */ -GED_EXPORT extern int _ged_scale_rhc(struct ged *gedp, - struct rt_rhc_internal *rhc, - const char *attribute, - fastf_t sf, - int rflag); - -/* defined in scale_rpc.c */ -GED_EXPORT extern int _ged_scale_rpc(struct ged *gedp, - struct rt_rpc_internal *rpc, - const char *attribute, - fastf_t sf, - int rflag); - -/* defined in scale_superell.c */ -GED_EXPORT extern int _ged_scale_superell(struct ged *gedp, - struct rt_superell_internal *superell, - const char *attribute, - fastf_t sf, - int rflag); - -/* defined in scale_tgc.c */ -GED_EXPORT extern int _ged_scale_tgc(struct ged *gedp, - struct rt_tgc_internal *tgc, - const char *attribute, - fastf_t sf, - int rflag); - -/* defined in scale_tor.c */ -GED_EXPORT extern int _ged_scale_tor(struct ged *gedp, - struct rt_tor_internal *tor, - const char *attribute, - fastf_t sf, - int rflag); - /* defined in tops.c */ GED_EXPORT struct directory ** _ged_dir_getspace(struct db_i *dbip,