diff --git a/src/mged/edsol.c b/src/mged/edsol.c index fde656551c..18dacd61de 100644 --- a/src/mged/edsol.c +++ b/src/mged/edsol.c @@ -453,189 +453,6 @@ get_file_name(struct mged_state *s, char *str) return (char *)NULL; } - - -/* - * Partial scaling of a solid. - */ -void -pscale(struct mged_state *s) -{ - switch (es_menu) { - - case MENU_VOL_CSIZE: - menu_vol_csize(s); - break; - case MENU_TGC_SCALE_H: - menu_tgc_scale_h(s); - break; - case MENU_TGC_SCALE_H_V: - menu_tgc_scale_h_v(s); - break; - case MENU_TGC_SCALE_H_CD: - menu_tgc_scale_h_cd(s); - break; - case MENU_TGC_SCALE_H_V_AB: - menu_tgc_scale_h_v_ab(s); - break; - case MENU_TOR_R1: - menu_tor_r1(s); - break; - case MENU_TOR_R2: - menu_tor_r2(s); - break; - case MENU_ETO_R: - menu_eto_r(s); - break; - case MENU_ETO_RD: - menu_eto_rd(s); - break; - case MENU_ETO_SCALE_C: - menu_eto_scale_c(s); - break; - case MENU_RPC_B: - menu_rpc_b(s); - break; - case MENU_RPC_H: - menu_rpc_h(s); - break; - case MENU_RPC_R: - menu_rpc_r(s); - break; - case MENU_RHC_B: - menu_rhc_b(s); - break; - case MENU_RHC_H: - menu_rhc_h(s); - break; - case MENU_RHC_R: - menu_rhc_r(s); - break; - case MENU_RHC_C: - menu_rhc_c(s); - break; - case MENU_EPA_H: - menu_epa_h(s); - break; - case MENU_EPA_R1: - menu_epa_r1(s); - break; - case MENU_EPA_R2: - menu_epa_r2(s); - break; - case MENU_EHY_H: - menu_ehy_h(s); - break; - case MENU_EHY_R1: - menu_ehy_r1(s); - break; - case MENU_EHY_R2: - menu_ehy_r2(s); - break; - case MENU_EHY_C: - menu_ehy_c(s); - break; - case MENU_HYP_H: - menu_hyp_h(s); - break; - case MENU_HYP_SCALE_A: - menu_hyp_scale_a(s); - break; - case MENU_HYP_SCALE_B: - menu_hyp_scale_b(s); - break; - case MENU_HYP_C: - menu_hyp_c(s); - break; - case MENU_TGC_SCALE_A: - menu_tgc_scale_a(s); - break; - case MENU_TGC_SCALE_B: - menu_tgc_scale_b(s); - break; - case MENU_ELL_SCALE_A: - menu_ell_scale_a(s); - break; - case MENU_ELL_SCALE_B: - menu_ell_scale_b(s); - break; - case MENU_ELL_SCALE_C: - menu_ell_scale_c(s); - break; - case MENU_TGC_SCALE_C: - menu_tgc_scale_c(s); - break; - case MENU_TGC_SCALE_D: - menu_tgc_scale_d(s); - break; - case MENU_TGC_SCALE_AB: - menu_tgc_scale_ab(s); - break; - case MENU_TGC_SCALE_CD: - menu_tgc_scale_cd(s); - break; - case MENU_TGC_SCALE_ABCD: - menu_tgc_scale_abcd(s); - break; - case MENU_ELL_SCALE_ABC: - menu_ell_scale_abc(s); - break; - /* begin super ellipse menu options */ - case MENU_SUPERELL_SCALE_A: - menu_superell_scale_a(s); - break; - case MENU_SUPERELL_SCALE_B: - menu_superell_scale_b(s); - break; - case MENU_SUPERELL_SCALE_C: - menu_superell_scale_c(s); - break; - case MENU_SUPERELL_SCALE_ABC: - menu_superell_scale_abc(s); - break; - case MENU_PIPE_PT_OD: /* scale OD of one pipe segment */ - menu_pipe_pt_od(s); - break; - case MENU_PIPE_PT_ID: /* scale ID of one pipe segment */ - menu_pipe_pt_od(s); - break; - case MENU_PIPE_PT_RADIUS: /* scale bend radius at selected point */ - menu_pipe_pt_radius(s); - break; - case MENU_PIPE_SCALE_OD: /* scale entire pipe OD */ - menu_pipe_scale_od(s); - break; - case MENU_PIPE_SCALE_ID: /* scale entire pipe ID */ - menu_pipe_scale_id(s); - break; - case MENU_PIPE_SCALE_RADIUS: /* scale entire pipr bend radius */ - menu_pipe_scale_radius(s); - break; - case MENU_PART_H: - menu_part_h(s); - break; - case MENU_PART_v: - menu_part_v(s); - break; - case MENU_PART_h: - menu_part_h_end_r(s); - break; - case MENU_METABALL_SET_THRESHOLD: - menu_metaball_set_threshold(s); - break; - case MENU_METABALL_SET_METHOD: - menu_metaball_set_method(s); - break; - case MENU_METABALL_PT_SET_GOO: - menu_metaball_pt_set_goo(s); - break; - case MENU_METABALL_PT_FLDSTR: - menu_metaball_pt_fldstr(s); - break; - } -} - - /* * A great deal of magic takes place here, to accomplish solid editing. * @@ -678,13 +495,6 @@ sedit(struct mged_state *s) /* do nothing more */ --update_views; break; - case PSCALE: - es_eu = (struct edgeuse *)NULL; /* Reset es_eu */ - bot_verts[0] = -1; - bot_verts[1] = -1; - bot_verts[2] = -1; - pscale(s); - break; default: { if (had_method) diff --git a/src/mged/primitives/eddatum.c b/src/mged/primitives/eddatum.c index ecdf4b5e4c..1870d343ad 100644 --- a/src/mged/primitives/eddatum.c +++ b/src/mged/primitives/eddatum.c @@ -120,7 +120,7 @@ mged_datum_read_params( } else { first_line = 0; } - + if (bu_strncasecmp(lc, "point", strlen("point")) == 0) { sscanf(lc, "%lf %lf %lf", &a, &b, &c); VSET(datum->pnt, a, b, c); diff --git a/src/mged/primitives/edehy.c b/src/mged/primitives/edehy.c index c05ae4e037..7ab04a710b 100644 --- a/src/mged/primitives/edehy.c +++ b/src/mged/primitives/edehy.c @@ -240,6 +240,48 @@ menu_ehy_c(struct mged_state *s) ehy->ehy_c *= s->edit_state.es_scale; } +static void +mged_ehy_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_EHY_H: + menu_ehy_h(s); + break; + case MENU_EHY_R1: + menu_ehy_r1(s); + break; + case MENU_EHY_R2: + menu_ehy_r2(s); + break; + case MENU_EHY_C: + menu_ehy_c(s); + break; + }; +} + +int +mged_ehy_edit(struct mged_state *s, int edflag) +{ + switch (edflag) { + case SSCALE: + /* scale the solid uniformly about its vertex point */ + mged_generic_sscale(s, &s->edit_state.es_int); + break; + case STRANS: + /* translate solid */ + mged_generic_strans(s, &s->edit_state.es_int); + break; + case SROT: + /* rot solid about vertex */ + mged_generic_srot(s, &s->edit_state.es_int); + break; + case PSCALE: + mged_ehy_pscale(s, es_menu); + break; + } + return 0; +} + /* * Local Variables: * mode: C diff --git a/src/mged/primitives/edehy.h b/src/mged/primitives/edehy.h index 297dd11e20..463f4e46df 100644 --- a/src/mged/primitives/edehy.h +++ b/src/mged/primitives/edehy.h @@ -33,11 +33,6 @@ #define MENU_EHY_R2 55 #define MENU_EHY_C 56 -void menu_ehy_h(struct mged_state *s); -void menu_ehy_r1(struct mged_state *s); -void menu_ehy_r2(struct mged_state *s); -void menu_ehy_c(struct mged_state *s); - #endif /* EDEHY_H */ /* diff --git a/src/mged/primitives/edell.c b/src/mged/primitives/edell.c index 976e07b754..5ded15c918 100644 --- a/src/mged/primitives/edell.c +++ b/src/mged/primitives/edell.c @@ -223,6 +223,48 @@ menu_ell_scale_abc(struct mged_state *s) VSCALE(ell->c, ell->c, ma/mb); } +static void +mged_ell_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_ELL_SCALE_A: + menu_ell_scale_a(s); + break; + case MENU_ELL_SCALE_B: + menu_ell_scale_b(s); + break; + case MENU_ELL_SCALE_C: + menu_ell_scale_c(s); + break; + case MENU_ELL_SCALE_ABC: + menu_ell_scale_abc(s); + break; + }; +} + +int +mged_ell_edit(struct mged_state *s, int edflag) +{ + switch (edflag) { + case SSCALE: + /* scale the solid uniformly about its vertex point */ + mged_generic_sscale(s, &s->edit_state.es_int); + break; + case STRANS: + /* translate solid */ + mged_generic_strans(s, &s->edit_state.es_int); + break; + case SROT: + /* rot solid about vertex */ + mged_generic_srot(s, &s->edit_state.es_int); + break; + case PSCALE: + mged_ell_pscale(s, es_menu); + break; + } + return 0; +} + /* * Local Variables: * mode: C diff --git a/src/mged/primitives/edell.h b/src/mged/primitives/edell.h index f60fa04483..d36e9002be 100644 --- a/src/mged/primitives/edell.h +++ b/src/mged/primitives/edell.h @@ -33,11 +33,6 @@ #define MENU_ELL_SCALE_C 41 #define MENU_ELL_SCALE_ABC 42 -void menu_ell_scale_a(struct mged_state *s); -void menu_ell_scale_b(struct mged_state *s); -void menu_ell_scale_c(struct mged_state *s); -void menu_ell_scale_abc(struct mged_state *s); - #endif /* EDELL_H */ /* diff --git a/src/mged/primitives/edepa.c b/src/mged/primitives/edepa.c index d8c0f85d99..c3f1c32c34 100644 --- a/src/mged/primitives/edepa.c +++ b/src/mged/primitives/edepa.c @@ -216,6 +216,45 @@ menu_epa_r2(struct mged_state *s) bu_log("pscale: semi-minor axis cannot be longer than semi-major axis!"); } +static void +mged_epa_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_EPA_H: + menu_epa_h(s); + break; + case MENU_EPA_R1: + menu_epa_r1(s); + break; + case MENU_EPA_R2: + menu_epa_r2(s); + break; + }; +} + +int +mged_epa_edit(struct mged_state *s, int edflag) +{ + switch (edflag) { + case SSCALE: + /* scale the solid uniformly about its vertex point */ + mged_generic_sscale(s, &s->edit_state.es_int); + break; + case STRANS: + /* translate solid */ + mged_generic_strans(s, &s->edit_state.es_int); + break; + case SROT: + /* rot solid about vertex */ + mged_generic_srot(s, &s->edit_state.es_int); + break; + case PSCALE: + mged_epa_pscale(s, es_menu); + break; + } + return 0; +} + /* * Local Variables: * mode: C diff --git a/src/mged/primitives/edepa.h b/src/mged/primitives/edepa.h index 81712429c4..3dc0c9991b 100644 --- a/src/mged/primitives/edepa.h +++ b/src/mged/primitives/edepa.h @@ -32,10 +32,6 @@ #define MENU_EPA_R1 51 #define MENU_EPA_R2 52 -void menu_epa_h(struct mged_state *s); -void menu_epa_r1(struct mged_state *s); -void menu_epa_r2(struct mged_state *s); - #endif /* EDEPA_H */ /* diff --git a/src/mged/primitives/edeto.c b/src/mged/primitives/edeto.c index 8dc619434e..32d987e849 100644 --- a/src/mged/primitives/edeto.c +++ b/src/mged/primitives/edeto.c @@ -309,6 +309,22 @@ ecmd_eto_rot_c(struct mged_state *s) MAT_IDN(incr_change); } +static void +mged_eto_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_ETO_R: + menu_eto_r(s); + break; + case MENU_ETO_RD: + menu_eto_rd(s); + break; + case MENU_ETO_SCALE_C: + menu_eto_scale_c(s); + break; + }; +} + int mged_eto_edit(struct mged_state *s, int edflag) { @@ -325,6 +341,9 @@ mged_eto_edit(struct mged_state *s, int edflag) /* rot solid about vertex */ mged_generic_srot(s, &s->edit_state.es_int); break; + case PSCALE: + mged_eto_pscale(s, es_menu); + break; case ECMD_ETO_ROT_C: ecmd_eto_rot_c(s); break; diff --git a/src/mged/primitives/edeto.h b/src/mged/primitives/edeto.h index 91eb670e6a..7fdd451387 100644 --- a/src/mged/primitives/edeto.h +++ b/src/mged/primitives/edeto.h @@ -35,10 +35,6 @@ #define MENU_ETO_SCALE_C 59 #define MENU_ETO_ROT_C 60 -void menu_eto_r(struct mged_state *s); -void menu_eto_rd(struct mged_state *s); -void menu_eto_scale_c(struct mged_state *s); - #endif /* EDETO_H */ /* diff --git a/src/mged/primitives/edhyp.c b/src/mged/primitives/edhyp.c index e546f84a7a..ad94c32e27 100644 --- a/src/mged/primitives/edhyp.c +++ b/src/mged/primitives/edhyp.c @@ -295,6 +295,25 @@ ecmd_hyp_rot_h(struct mged_state *s) MAT_IDN(incr_change); } +static void +mged_hyp_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_HYP_H: + menu_hyp_h(s); + break; + case MENU_HYP_SCALE_A: + menu_hyp_scale_a(s); + break; + case MENU_HYP_SCALE_B: + menu_hyp_scale_b(s); + break; + case MENU_HYP_C: + menu_hyp_c(s); + break; + }; +} + int mged_hyp_edit(struct mged_state *s, int edflag) { @@ -311,6 +330,9 @@ mged_hyp_edit(struct mged_state *s, int edflag) /* rot solid about vertex */ mged_generic_srot(s, &s->edit_state.es_int); break; + case PSCALE: + mged_hyp_pscale(s, es_menu); + break; case ECMD_HYP_ROT_H: ecmd_hyp_rot_h(s); break; diff --git a/src/mged/primitives/edhyp.h b/src/mged/primitives/edhyp.h index c97c214a49..4370ae91d2 100644 --- a/src/mged/primitives/edhyp.h +++ b/src/mged/primitives/edhyp.h @@ -37,11 +37,6 @@ #define MENU_HYP_C 130 #define MENU_HYP_ROT_H 131 -void menu_hyp_h(struct mged_state *s); -void menu_hyp_scale_a(struct mged_state *s); -void menu_hyp_scale_b(struct mged_state *s); -void menu_hyp_c(struct mged_state *s); - #endif /* EDHYP_H */ /* diff --git a/src/mged/primitives/edmetaball.c b/src/mged/primitives/edmetaball.c index 0c53486a36..ba489df088 100644 --- a/src/mged/primitives/edmetaball.c +++ b/src/mged/primitives/edmetaball.c @@ -364,6 +364,25 @@ ecmd_metaball_pt_add(struct mged_state *s) es_metaball_pnt = n; } +static void +mged_metaball_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_METABALL_SET_THRESHOLD: + menu_metaball_set_threshold(s); + break; + case MENU_METABALL_SET_METHOD: + menu_metaball_set_method(s); + break; + case MENU_METABALL_PT_SET_GOO: + menu_metaball_pt_set_goo(s); + break; + case MENU_METABALL_PT_FLDSTR: + menu_metaball_pt_fldstr(s); + break; + }; +} + void mged_metaball_edit(struct mged_state *s, int edflag) { @@ -383,6 +402,9 @@ mged_metaball_edit(struct mged_state *s, int edflag) es_metaball_pnt = (struct wdb_metaball_pnt *)NULL; /* Reset es_metaball_pnt */ mged_generic_srot(s, &s->edit_state.es_int); break; + case PSCALE: + mged_metaball_pscale(s, es_menu); + break; case ECMD_METABALL_PT_PICK: ecmd_metaball_pt_pick(s); break; diff --git a/src/mged/primitives/edmetaball.h b/src/mged/primitives/edmetaball.h index 6b2733a5bb..c28ef453e1 100644 --- a/src/mged/primitives/edmetaball.h +++ b/src/mged/primitives/edmetaball.h @@ -50,11 +50,6 @@ extern struct wdb_metaball_pnt *es_metaball_pnt; #define MENU_METABALL_DEL_PT 125 #define MENU_METABALL_ADD_PT 126 -void menu_metaball_set_threshold(struct mged_state *s); -void menu_metaball_set_method(struct mged_state *s); -void menu_metaball_pt_set_goo(struct mged_state *s); -void menu_metaball_pt_fldstr(struct mged_state *s); - #endif /* EDMETABALL_H */ /* diff --git a/src/mged/primitives/edpart.c b/src/mged/primitives/edpart.c index 851cfb6b6b..969d3f076f 100644 --- a/src/mged/primitives/edpart.c +++ b/src/mged/primitives/edpart.c @@ -206,6 +206,45 @@ menu_part_h_end_r(struct mged_state *s) part->part_hrad *= s->edit_state.es_scale; } +static void +mged_part_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_PART_H: + menu_part_h(s); + break; + case MENU_PART_v: + menu_part_v(s); + break; + case MENU_PART_h: + menu_part_h_end_r(s); + break; + }; +} + +int +mged_part_edit(struct mged_state *s, int edflag) +{ + switch (edflag) { + case SSCALE: + /* scale the solid uniformly about its vertex point */ + mged_generic_sscale(s, &s->edit_state.es_int); + break; + case STRANS: + /* translate solid */ + mged_generic_strans(s, &s->edit_state.es_int); + break; + case SROT: + /* rot solid about vertex */ + mged_generic_srot(s, &s->edit_state.es_int); + break; + case PSCALE: + mged_part_pscale(s, es_menu); + break; + } + return 0; +} + /* * Local Variables: * mode: C diff --git a/src/mged/primitives/edpart.h b/src/mged/primitives/edpart.h index 2f40d15eea..dc3cc6fb7c 100644 --- a/src/mged/primitives/edpart.h +++ b/src/mged/primitives/edpart.h @@ -32,11 +32,6 @@ #define MENU_PART_v 89 #define MENU_PART_h 90 -void menu_part_h(struct mged_state *s); -void menu_part_v(struct mged_state *s); -void menu_part_h_end_r(struct mged_state *s); - - #endif /* EDPART_H */ /* diff --git a/src/mged/primitives/edpipe.c b/src/mged/primitives/edpipe.c index 1c76be2e73..7bc11672cd 100644 --- a/src/mged/primitives/edpipe.c +++ b/src/mged/primitives/edpipe.c @@ -959,6 +959,31 @@ void ecmd_pipe_pt_del(struct mged_state *s) es_pipe_pnt = pipe_del_pnt(s, es_pipe_pnt); } +static void +mged_pipe_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_PIPE_PT_OD: /* scale OD of one pipe segment */ + menu_pipe_pt_od(s); + break; + case MENU_PIPE_PT_ID: /* scale ID of one pipe segment */ + menu_pipe_pt_od(s); + break; + case MENU_PIPE_PT_RADIUS: /* scale bend radius at selected point */ + menu_pipe_pt_radius(s); + break; + case MENU_PIPE_SCALE_OD: /* scale entire pipe OD */ + menu_pipe_scale_od(s); + break; + case MENU_PIPE_SCALE_ID: /* scale entire pipe ID */ + menu_pipe_scale_id(s); + break; + case MENU_PIPE_SCALE_RADIUS: /* scale entire pipr bend radius */ + menu_pipe_scale_radius(s); + break; + }; +} + int mged_pipe_edit(struct mged_state *s, int edflag) { @@ -978,6 +1003,9 @@ mged_pipe_edit(struct mged_state *s, int edflag) es_pipe_pnt = (struct wdb_pipe_pnt *)NULL; /* Reset es_pipe_pnt */ mged_generic_srot(s, &s->edit_state.es_int); break; + case PSCALE: + mged_pipe_pscale(s, es_menu); + break; case ECMD_PIPE_PICK: ecmd_pipe_pick(s); break; diff --git a/src/mged/primitives/edpipe.h b/src/mged/primitives/edpipe.h index 27d8b71a93..9813b9c1d6 100644 --- a/src/mged/primitives/edpipe.h +++ b/src/mged/primitives/edpipe.h @@ -67,13 +67,6 @@ void pipe_move_pnt(struct mged_state *s, struct rt_pipe_internal *, struct wdb_p void pipe_split_pnt(struct bu_list *, struct wdb_pipe_pnt *, point_t); struct wdb_pipe_pnt *pipe_add_pnt(struct rt_pipe_internal *, struct wdb_pipe_pnt *, const point_t); -void menu_pipe_pt_od(struct mged_state *s); -void menu_pipe_pt_id(struct mged_state *s); -void menu_pipe_pt_radius(struct mged_state *s); -void menu_pipe_scale_od(struct mged_state *s); -void menu_pipe_scale_id(struct mged_state *s); -void menu_pipe_scale_radius(struct mged_state *s); - #endif /* EDPIPE_H */ /* diff --git a/src/mged/primitives/edrhc.c b/src/mged/primitives/edrhc.c index d9831291f0..43e4455901 100644 --- a/src/mged/primitives/edrhc.c +++ b/src/mged/primitives/edrhc.c @@ -227,6 +227,48 @@ menu_rhc_c(struct mged_state *s) rhc->rhc_c *= s->edit_state.es_scale; } +static void +mged_rhc_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_RHC_B: + menu_rhc_b(s); + break; + case MENU_RHC_H: + menu_rhc_h(s); + break; + case MENU_RHC_R: + menu_rhc_r(s); + break; + case MENU_RHC_C: + menu_rhc_c(s); + break; + }; +} + +int +mged_rhc_edit(struct mged_state *s, int edflag) +{ + switch (edflag) { + case SSCALE: + /* scale the solid uniformly about its vertex point */ + mged_generic_sscale(s, &s->edit_state.es_int); + break; + case STRANS: + /* translate solid */ + mged_generic_strans(s, &s->edit_state.es_int); + break; + case SROT: + /* rot solid about vertex */ + mged_generic_srot(s, &s->edit_state.es_int); + break; + case PSCALE: + mged_rhc_pscale(s, es_menu); + break; + } + return 0; +} + /* * Local Variables: * mode: C diff --git a/src/mged/primitives/edrhc.h b/src/mged/primitives/edrhc.h index a6ebbd60d8..615dea6df5 100644 --- a/src/mged/primitives/edrhc.h +++ b/src/mged/primitives/edrhc.h @@ -33,11 +33,6 @@ #define MENU_RHC_R 48 #define MENU_RHC_C 49 -void menu_rhc_b(struct mged_state *s); -void menu_rhc_h(struct mged_state *s); -void menu_rhc_r(struct mged_state *s); -void menu_rhc_c(struct mged_state *s); - #endif /* EDRHC_H */ /* diff --git a/src/mged/primitives/edrpc.c b/src/mged/primitives/edrpc.c index 2c567c9c15..4e61693e2b 100644 --- a/src/mged/primitives/edrpc.c +++ b/src/mged/primitives/edrpc.c @@ -204,6 +204,45 @@ menu_rpc_r(struct mged_state *s) rpc->rpc_r *= s->edit_state.es_scale; } +static void +mged_rpc_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_RPC_B: + menu_rpc_b(s); + break; + case MENU_RPC_H: + menu_rpc_h(s); + break; + case MENU_RPC_R: + menu_rpc_r(s); + break; + }; +} + +int +mged_rpc_edit(struct mged_state *s, int edflag) +{ + switch (edflag) { + case SSCALE: + /* scale the solid uniformly about its vertex point */ + mged_generic_sscale(s, &s->edit_state.es_int); + break; + case STRANS: + /* translate solid */ + mged_generic_strans(s, &s->edit_state.es_int); + break; + case SROT: + /* rot solid about vertex */ + mged_generic_srot(s, &s->edit_state.es_int); + break; + case PSCALE: + mged_rpc_pscale(s, es_menu); + break; + } + return 0; +} + /* * Local Variables: * mode: C diff --git a/src/mged/primitives/edrpc.h b/src/mged/primitives/edrpc.h index c539603651..f440db4c3f 100644 --- a/src/mged/primitives/edrpc.h +++ b/src/mged/primitives/edrpc.h @@ -32,10 +32,6 @@ #define MENU_RPC_H 44 #define MENU_RPC_R 45 -void menu_rpc_b(struct mged_state *s); -void menu_rpc_h(struct mged_state *s); -void menu_rpc_r(struct mged_state *s); - #endif /* EDRPC_H */ /* diff --git a/src/mged/primitives/edsuperell.c b/src/mged/primitives/edsuperell.c index 11af74ee0b..eacad76baf 100644 --- a/src/mged/primitives/edsuperell.c +++ b/src/mged/primitives/edsuperell.c @@ -228,6 +228,48 @@ menu_superell_scale_abc(struct mged_state *s) VSCALE(superell->c, superell->c, ma/mb); } +static void +mged_superell_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_SUPERELL_SCALE_A: + menu_superell_scale_a(s); + break; + case MENU_SUPERELL_SCALE_B: + menu_superell_scale_b(s); + break; + case MENU_SUPERELL_SCALE_C: + menu_superell_scale_c(s); + break; + case MENU_SUPERELL_SCALE_ABC: + menu_superell_scale_abc(s); + break; + }; +} + +int +mged_superell_edit(struct mged_state *s, int edflag) +{ + switch (edflag) { + case SSCALE: + /* scale the solid uniformly about its vertex point */ + mged_generic_sscale(s, &s->edit_state.es_int); + break; + case STRANS: + /* translate solid */ + mged_generic_strans(s, &s->edit_state.es_int); + break; + case SROT: + /* rot solid about vertex */ + mged_generic_srot(s, &s->edit_state.es_int); + break; + case PSCALE: + mged_superell_pscale(s, es_menu); + break; + } + return 0; +} + /* * Local Variables: * mode: C diff --git a/src/mged/primitives/edsuperell.h b/src/mged/primitives/edsuperell.h index 09b79d3329..e7f21e5dc8 100644 --- a/src/mged/primitives/edsuperell.h +++ b/src/mged/primitives/edsuperell.h @@ -33,11 +33,6 @@ #define MENU_SUPERELL_SCALE_C 115 #define MENU_SUPERELL_SCALE_ABC 116 -void menu_superell_scale_a(struct mged_state *s); -void menu_superell_scale_b(struct mged_state *s); -void menu_superell_scale_c(struct mged_state *s); -void menu_superell_scale_abc(struct mged_state *s); - #endif /* EDSUPERELL_H */ /* diff --git a/src/mged/primitives/edtgc.c b/src/mged/primitives/edtgc.c index a37b8a4249..eeadbfd8eb 100644 --- a/src/mged/primitives/edtgc.c +++ b/src/mged/primitives/edtgc.c @@ -671,6 +671,46 @@ ecmd_tgc_mv_h_mousevec(struct mged_state *s, const vect_t mousevec) VSUB2(tgc->h, tr_temp, tgc->v); } +static void +mged_tgc_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_TGC_SCALE_H: + menu_tgc_scale_h(s); + break; + case MENU_TGC_SCALE_H_V: + menu_tgc_scale_h_v(s); + break; + case MENU_TGC_SCALE_H_CD: + menu_tgc_scale_h_cd(s); + break; + case MENU_TGC_SCALE_H_V_AB: + menu_tgc_scale_h_v_ab(s); + break; + case MENU_TGC_SCALE_A: + menu_tgc_scale_a(s); + break; + case MENU_TGC_SCALE_B: + menu_tgc_scale_b(s); + break; + case MENU_TGC_SCALE_C: + menu_tgc_scale_c(s); + break; + case MENU_TGC_SCALE_D: + menu_tgc_scale_d(s); + break; + case MENU_TGC_SCALE_AB: + menu_tgc_scale_ab(s); + break; + case MENU_TGC_SCALE_CD: + menu_tgc_scale_cd(s); + break; + case MENU_TGC_SCALE_ABCD: + menu_tgc_scale_abcd(s); + break; + }; +} + int mged_tgc_edit(struct mged_state *s, int edflag) { @@ -687,6 +727,9 @@ mged_tgc_edit(struct mged_state *s, int edflag) /* rot solid about vertex */ mged_generic_srot(s, &s->edit_state.es_int); break; + case PSCALE: + mged_tgc_pscale(s, es_menu); + break; case ECMD_TGC_MV_H: ecmd_tgc_mv_h(s); break; diff --git a/src/mged/primitives/edtgc.h b/src/mged/primitives/edtgc.h index 2844ea4444..599f300720 100644 --- a/src/mged/primitives/edtgc.h +++ b/src/mged/primitives/edtgc.h @@ -52,17 +52,6 @@ #define MENU_TGC_SCALE_H_CD 111 #define MENU_TGC_SCALE_H_V_AB 112 -void menu_tgc_scale_h(struct mged_state *s); -void menu_tgc_scale_h_v(struct mged_state *s); -void menu_tgc_scale_h_cd(struct mged_state *s); -void menu_tgc_scale_h_v_ab(struct mged_state *s); -void menu_tgc_scale_a(struct mged_state *s); -void menu_tgc_scale_b(struct mged_state *s); -void menu_tgc_scale_c(struct mged_state *s); -void menu_tgc_scale_d(struct mged_state *s); -void menu_tgc_scale_ab(struct mged_state *s); -void menu_tgc_scale_cd(struct mged_state *s); -void menu_tgc_scale_abcd(struct mged_state *s); void ecmd_tgc_mv_h_mousevec(struct mged_state *s, const vect_t mousevec); #endif /* EDTGC_H */ diff --git a/src/mged/primitives/edtor.c b/src/mged/primitives/edtor.c index 139964b539..b2390badd6 100644 --- a/src/mged/primitives/edtor.c +++ b/src/mged/primitives/edtor.c @@ -200,7 +200,41 @@ menu_tor_r2(struct mged_state *s) tor->r_h = newrad; } +static void +mged_tor_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_TOR_R1: + menu_tor_r1(s); + break; + case MENU_TOR_R2: + menu_tor_r2(s); + break; + }; +} +int +mged_tor_edit(struct mged_state *s, int edflag) +{ + switch (edflag) { + case SSCALE: + /* scale the solid uniformly about its vertex point */ + mged_generic_sscale(s, &s->edit_state.es_int); + break; + case STRANS: + /* translate solid */ + mged_generic_strans(s, &s->edit_state.es_int); + break; + case SROT: + /* rot solid about vertex */ + mged_generic_srot(s, &s->edit_state.es_int); + break; + case PSCALE: + mged_tor_pscale(s, es_menu); + break; + } + return 0; +} /* * Local Variables: diff --git a/src/mged/primitives/edtor.h b/src/mged/primitives/edtor.h index 148620578a..d93da73f8d 100644 --- a/src/mged/primitives/edtor.h +++ b/src/mged/primitives/edtor.h @@ -31,9 +31,6 @@ #define MENU_TOR_R1 21 #define MENU_TOR_R2 22 -void menu_tor_r1(struct mged_state *s); -void menu_tor_r2(struct mged_state *s); - #endif /* EDTOR_H */ /* diff --git a/src/mged/primitives/edvol.c b/src/mged/primitives/edvol.c index 746c2d8f56..1765930621 100644 --- a/src/mged/primitives/edvol.c +++ b/src/mged/primitives/edvol.c @@ -232,6 +232,16 @@ ecmd_vol_fname(struct mged_state *s) } } +static void +mged_vol_pscale(struct mged_state *s, int mode) +{ + switch (mode) { + case MENU_VOL_CSIZE: + menu_vol_csize(s); + break; + }; +} + int mged_vol_edit(struct mged_state *s, int edflag) { @@ -248,6 +258,9 @@ mged_vol_edit(struct mged_state *s, int edflag) /* rot solid about vertex */ mged_generic_srot(s, &s->edit_state.es_int); break; + case PSCALE: + mged_vol_pscale(s, es_menu); + break; case ECMD_VOL_CSIZE: ecmd_vol_csize(s); break; diff --git a/src/mged/primitives/edvol.h b/src/mged/primitives/edvol.h index d8b75b5400..f8240bec50 100644 --- a/src/mged/primitives/edvol.h +++ b/src/mged/primitives/edvol.h @@ -40,8 +40,6 @@ #define MENU_VOL_THRESH_LO 78 #define MENU_VOL_THRESH_HI 79 -void menu_vol_csize(struct mged_state *s); - #endif /* EDVOL_H */ /* diff --git a/src/mged/primitives/table.cpp b/src/mged/primitives/table.cpp index 1185465c52..e0331ab0c0 100644 --- a/src/mged/primitives/table.cpp +++ b/src/mged/primitives/table.cpp @@ -106,7 +106,7 @@ const struct mged_functab MGED_OBJ[] = { NULL, /* e_axes_pos */ MGEDFUNCTAB_FUNC_WRITE_PARAMS_CAST(mged_tor_write_params), /* write_params */ MGEDFUNCTAB_FUNC_READ_PARAMS_CAST(mged_tor_read_params), /* read_params */ - MGEDFUNCTAB_FUNC_EDIT_CAST(mged_generic_edit), /* edit */ + MGEDFUNCTAB_FUNC_EDIT_CAST(mged_tor_edit), /* edit */ MGEDFUNCTAB_FUNC_MENU_ITEM_CAST(mged_tor_menu_item) /* menu_item */ }, @@ -130,7 +130,7 @@ const struct mged_functab MGED_OBJ[] = { NULL, /* e_axes_pos */ MGEDFUNCTAB_FUNC_WRITE_PARAMS_CAST(mged_ell_write_params), /* write_params */ MGEDFUNCTAB_FUNC_READ_PARAMS_CAST(mged_ell_read_params), /* read_params */ - MGEDFUNCTAB_FUNC_EDIT_CAST(mged_generic_edit), /* edit */ + MGEDFUNCTAB_FUNC_EDIT_CAST(mged_ell_edit), /* edit */ MGEDFUNCTAB_FUNC_MENU_ITEM_CAST(mged_ell_menu_item) /* menu_item */ }, @@ -286,7 +286,7 @@ const struct mged_functab MGED_OBJ[] = { NULL, /* e_axes_pos */ MGEDFUNCTAB_FUNC_WRITE_PARAMS_CAST(mged_part_write_params), /* write_params */ MGEDFUNCTAB_FUNC_READ_PARAMS_CAST(mged_part_read_params), /* read_params */ - MGEDFUNCTAB_FUNC_EDIT_CAST(mged_generic_edit), /* edit */ + MGEDFUNCTAB_FUNC_EDIT_CAST(mged_part_edit), /* edit */ MGEDFUNCTAB_FUNC_MENU_ITEM_CAST(mged_part_menu_item) /* menu_item */ }, @@ -298,7 +298,7 @@ const struct mged_functab MGED_OBJ[] = { NULL, /* e_axes_pos */ MGEDFUNCTAB_FUNC_WRITE_PARAMS_CAST(mged_rpc_write_params), /* write_params */ MGEDFUNCTAB_FUNC_READ_PARAMS_CAST(mged_rpc_read_params), /* read_params */ - MGEDFUNCTAB_FUNC_EDIT_CAST(mged_generic_edit), /* edit */ + MGEDFUNCTAB_FUNC_EDIT_CAST(mged_rpc_edit), /* edit */ MGEDFUNCTAB_FUNC_MENU_ITEM_CAST(mged_rpc_menu_item) /* menu_item */ }, @@ -310,7 +310,7 @@ const struct mged_functab MGED_OBJ[] = { NULL, /* e_axes_pos */ MGEDFUNCTAB_FUNC_WRITE_PARAMS_CAST(mged_rhc_write_params), /* write_params */ MGEDFUNCTAB_FUNC_READ_PARAMS_CAST(mged_rhc_read_params), /* read_params */ - MGEDFUNCTAB_FUNC_EDIT_CAST(mged_generic_edit), /* edit */ + MGEDFUNCTAB_FUNC_EDIT_CAST(mged_rhc_edit), /* edit */ MGEDFUNCTAB_FUNC_MENU_ITEM_CAST(mged_rhc_menu_item) /* menu_item */ }, @@ -322,7 +322,7 @@ const struct mged_functab MGED_OBJ[] = { NULL, /* e_axes_pos */ MGEDFUNCTAB_FUNC_WRITE_PARAMS_CAST(mged_epa_write_params), /* write_params */ MGEDFUNCTAB_FUNC_READ_PARAMS_CAST(mged_epa_read_params), /* read_params */ - MGEDFUNCTAB_FUNC_EDIT_CAST(mged_generic_edit), /* edit */ + MGEDFUNCTAB_FUNC_EDIT_CAST(mged_epa_edit), /* edit */ MGEDFUNCTAB_FUNC_MENU_ITEM_CAST(mged_epa_menu_item) /* menu_item */ }, @@ -334,7 +334,7 @@ const struct mged_functab MGED_OBJ[] = { NULL, /* e_axes_pos */ MGEDFUNCTAB_FUNC_WRITE_PARAMS_CAST(mged_ehy_write_params), /* write_params */ MGEDFUNCTAB_FUNC_READ_PARAMS_CAST(mged_ehy_read_params), /* read_params */ - MGEDFUNCTAB_FUNC_EDIT_CAST(mged_generic_edit), /* edit */ + MGEDFUNCTAB_FUNC_EDIT_CAST(mged_ehy_edit), /* edit */ MGEDFUNCTAB_FUNC_MENU_ITEM_CAST(mged_ehy_menu_item) /* menu_item */ }, @@ -518,7 +518,7 @@ const struct mged_functab MGED_OBJ[] = { NULL, /* e_axes_pos */ MGEDFUNCTAB_FUNC_WRITE_PARAMS_CAST(mged_superell_write_params), /* write_params */ MGEDFUNCTAB_FUNC_READ_PARAMS_CAST(mged_superell_read_params), /* read_params */ - MGEDFUNCTAB_FUNC_EDIT_CAST(mged_generic_edit), /* edit */ + MGEDFUNCTAB_FUNC_EDIT_CAST(mged_superell_edit), /* edit */ MGEDFUNCTAB_FUNC_MENU_ITEM_CAST(mged_superell_menu_item) /* menu_item */ },