Skip to content

Commit

Permalink
Need to set the scale flag for other CSG param editing modes.
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Feb 11, 2025
1 parent 67c59c9 commit f6d5c54
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 25 deletions.
1 change: 0 additions & 1 deletion src/librt/primitives/cline/edcline.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ cline_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *U
s->solid_edit_scale = 1;
break;
default:
rt_solid_edit_set_edflag(s, arg);
break;
};

Expand Down
10 changes: 10 additions & 0 deletions src/librt/primitives/ehy/edehy.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ static void
ehy_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNUSED(data))
{
rt_solid_edit_set_edflag(s, arg);
switch (arg) {
case ECMD_EHY_H:
case ECMD_EHY_R1:
case ECMD_EHY_R2:
case ECMD_EHY_C:
s->solid_edit_scale = 1;
break;
default:
break;
};

bu_clbk_t f = NULL;
void *d = NULL;
Expand Down
11 changes: 11 additions & 0 deletions src/librt/primitives/ell/edell.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ ell_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNU
{
rt_solid_edit_set_edflag(s, arg);

switch (arg) {
case ECMD_ELL_SCALE_A:
case ECMD_ELL_SCALE_B:
case ECMD_ELL_SCALE_C:
case ECMD_ELL_SCALE_ABC:
s->solid_edit_scale = 1;
break;
default:
break;
};

bu_clbk_t f = NULL;
void *d = NULL;
int flag = 1;
Expand Down
11 changes: 11 additions & 0 deletions src/librt/primitives/epa/edepa.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ epa_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNU
{
rt_solid_edit_set_edflag(s, arg);

switch (arg) {
case ECMD_EPA_H:
case ECMD_EPA_R1:
case ECMD_EPA_R2:
s->solid_edit_scale = 1;
break;
default:
break;
};


bu_clbk_t f = NULL;
void *d = NULL;
int flag = 1;
Expand Down
14 changes: 12 additions & 2 deletions src/librt/primitives/eto/edeto.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,18 @@ static void
eto_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNUSED(data))
{
rt_solid_edit_set_edflag(s, arg);
if (arg == ECMD_ETO_ROT_C)
s->solid_edit_rotate = 1;

switch (arg) {
case ECMD_ETO_R:
case ECMD_ETO_RD:
case ECMD_ETO_SCALE_C:
s->solid_edit_scale = 1;
break;
case ECMD_ETO_ROT_C:
s->solid_edit_rotate = 1;
default:
break;
};

bu_clbk_t f = NULL;
void *d = NULL;
Expand Down
1 change: 0 additions & 1 deletion src/librt/primitives/extrude/edextrude.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ extr_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UN
s->solid_edit_translate = 1;
break;
default:
rt_solid_edit_set_edflag(s, arg);
break;
};

Expand Down
17 changes: 15 additions & 2 deletions src/librt/primitives/hyp/edhyp.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,21 @@ static void
hyp_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNUSED(data))
{
rt_solid_edit_set_edflag(s, arg);
if (arg == ECMD_HYP_ROT_H)
s->solid_edit_rotate = 1;

switch (arg) {
case ECMD_HYP_H:
case ECMD_HYP_SCALE_A:
case ECMD_HYP_SCALE_B:
case ECMD_HYP_C:
s->solid_edit_scale = 1;
break;
case ECMD_HYP_ROT_H:
case ECMD_HYP_ROT_A:
s->solid_edit_rotate = 1;
break;
default:
break;
};

bu_clbk_t f = NULL;
void *d = NULL;
Expand Down
6 changes: 5 additions & 1 deletion src/librt/primitives/metaball/edmetaball.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ metaball_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void
m->es_metaball_pnt = next;
rt_metaball_pnt_print(m->es_metaball_pnt, s->base2local);
rt_solid_edit_set_edflag(s, RT_SOLID_EDIT_IDLE);
// TODO - should we really be calling this here?
rt_solid_edit_process(s);
break;
case ECMD_METABALL_PT_PREV:
Expand All @@ -126,6 +127,7 @@ metaball_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void
m->es_metaball_pnt = prev;
rt_metaball_pnt_print(m->es_metaball_pnt, s->base2local);
rt_solid_edit_set_edflag(s, RT_SOLID_EDIT_IDLE);
// TODO - should we really be calling this here?
rt_solid_edit_process(s);
break;
case ECMD_METABALL_PT_MOV:
Expand All @@ -134,17 +136,19 @@ metaball_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void
rt_solid_edit_set_edflag(s, RT_SOLID_EDIT_IDLE);
return;
}
// TODO - should we really be calling this here?
rt_solid_edit_process(s);
break;
case ECMD_METABALL_PT_FLDSTR:
s->solid_edit_scale = 1;
if (!m->es_metaball_pnt) {
bu_vls_printf(s->log_str, "No Metaball Point selected\n");
rt_solid_edit_set_edflag(s, RT_SOLID_EDIT_IDLE);
return;
}
rt_solid_edit_set_edflag(s, RT_SOLID_EDIT_SCALE);
break;
case ECMD_METABALL_PT_DEL:
// TODO - should we really be calling this here?
rt_solid_edit_process(s);
break;
case ECMD_METABALL_PT_ADD:
Expand Down
26 changes: 11 additions & 15 deletions src/librt/primitives/nmg/ednmg.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,19 @@ nmg_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNU
bu_clbk_t f = NULL;
void *d = NULL;

rt_solid_edit_set_edflag(s, arg);

switch (arg) {
default:
bu_vls_printf(s->log_str, "nmg_ed: undefined menu event?\n");
return;
case ECMD_NMG_EPICK:
s->solid_edit_pick = 1;
break;
case ECMD_NMG_EMOVE:
case ECMD_NMG_ESPLIT:
s->solid_edit_translate = 1;
break;
case ECMD_NMG_EKILL:
break;
case ECMD_NMG_EDEBUG:
Expand Down Expand Up @@ -149,6 +155,7 @@ nmg_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNU
bu_vls_free(&tmp_vls);
}

// TODO - should we really be calling this here?
rt_solid_edit_process(s);
return;
case ECMD_NMG_BACK:
Expand All @@ -169,6 +176,7 @@ nmg_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNU
bu_vls_free(&tmp_vls);
}

// TODO - should we really be calling this here?
rt_solid_edit_process(s);
return;
case ECMD_NMG_RADIAL:
Expand All @@ -189,6 +197,7 @@ nmg_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNU
bu_vls_free(&tmp_vls);
}

// TODO - should we really be calling this here?
rt_solid_edit_process(s);
return;
case ECMD_NMG_LEXTRU:
Expand All @@ -201,6 +210,7 @@ nmg_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNU
struct edgeuse *eu;
fastf_t area;
int wire_loop_count = 0;
s->solid_edit_translate = 1;

m = (struct model *)s->es_int.idb_ptr;
NMG_CK_MODEL(m);
Expand Down Expand Up @@ -340,21 +350,7 @@ nmg_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNU
break;
}

rt_solid_edit_set_edflag(s, arg);

switch (arg) {
case ECMD_NMG_EMOVE:
case ECMD_NMG_ESPLIT:
case ECMD_NMG_LEXTRU:
s->solid_edit_translate = 1;
break;
case ECMD_NMG_EPICK:
s->solid_edit_pick = 1;
break;
default:
break;
};

// TODO - should we really be calling this here?
rt_solid_edit_process(s);
}
struct rt_solid_edit_menu_item nmg_menu[] = {
Expand Down
10 changes: 10 additions & 0 deletions src/librt/primitives/part/edpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ part_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UN
{
rt_solid_edit_set_edflag(s, arg);

switch (arg) {
case ECMD_PART_H:
case ECMD_PART_v:
case ECMD_PART_h:
s->solid_edit_scale = 1;
break;
default:
break;
};

bu_clbk_t f = NULL;
void *d = NULL;
int flag = 1;
Expand Down
6 changes: 4 additions & 2 deletions src/librt/primitives/pipe/edpipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ pipe_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UN
p->es_pipe_pnt = next;
rt_pipe_pnt_print(p->es_pipe_pnt, s->base2local);
rt_solid_edit_set_edflag(s, RT_SOLID_EDIT_IDLE);
// TODO - should we really be calling this here?
rt_solid_edit_process(s);
break;
case ECMD_PIPE_PREV_PT:
Expand All @@ -127,6 +128,7 @@ pipe_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UN
p->es_pipe_pnt = prev;
rt_pipe_pnt_print(p->es_pipe_pnt, s->base2local);
rt_solid_edit_set_edflag(s, RT_SOLID_EDIT_IDLE);
// TODO - should we really be calling this here?
rt_solid_edit_process(s);
break;
case ECMD_PIPE_PT_MOVE:
Expand All @@ -145,12 +147,12 @@ pipe_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UN
rt_solid_edit_set_edflag(s, RT_SOLID_EDIT_IDLE);
return;
}
rt_solid_edit_set_edflag(s, RT_SOLID_EDIT_SCALE);
s->solid_edit_scale = 1;
break;
case ECMD_PIPE_SCALE_OD:
case ECMD_PIPE_SCALE_ID:
case ECMD_PIPE_SCALE_RADIUS:
rt_solid_edit_set_edflag(s, RT_SOLID_EDIT_SCALE);
s->solid_edit_scale = 1;
break;
case ECMD_PIPE_PT_ADD:
s->solid_edit_translate = 1;
Expand Down
11 changes: 11 additions & 0 deletions src/librt/primitives/rhc/edrhc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ rhc_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNU
{
rt_solid_edit_set_edflag(s, arg);

switch (arg) {
case ECMD_RHC_B:
case ECMD_RHC_H:
case ECMD_RHC_R:
case ECMD_RHC_C:
s->solid_edit_scale = 1;
break;
default:
break;
};

bu_clbk_t f = NULL;
void *d = NULL;
int flag = 1;
Expand Down
10 changes: 10 additions & 0 deletions src/librt/primitives/rpc/edrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ rpc_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void *UNU
{
rt_solid_edit_set_edflag(s, arg);

switch (arg) {
case ECMD_RPC_B:
case ECMD_RPC_H:
case ECMD_RPC_R:
s->solid_edit_scale = 1;
break;
default:
break;
};

bu_clbk_t f = NULL;
void *d = NULL;
int flag = 1;
Expand Down
11 changes: 11 additions & 0 deletions src/librt/primitives/superell/edsuperell.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ superell_ed(struct rt_solid_edit *s, int arg, int UNUSED(a), int UNUSED(b), void
{
rt_solid_edit_set_edflag(s, arg);

switch (arg) {
case ECMD_SUPERELL_SCALE_A:
case ECMD_SUPERELL_SCALE_B:
case ECMD_SUPERELL_SCALE_C:
case ECMD_SUPERELL_SCALE_ABC:
s->solid_edit_scale = 1;
break;
default:
break;
};

bu_clbk_t f = NULL;
void *d = NULL;
int flag = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/librt/primitives/vol/edvol.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ ecmd_vol_csize(struct rt_solid_edit *s)
RT_VOL_CK_MAGIC(vol);

// Specified numerical input
if (s_>e_inpara) {
if (s->e_inpara) {
if (s->e_inpara != 3) {
bu_vls_printf(s->log_str, "x, y, and z cell sizes are required\n");
rt_solid_edit_map_clbk_get(&f, &d, s->m, ECMD_PRINT_RESULTS, BU_CLBK_DURING);
Expand Down

0 comments on commit f6d5c54

Please sign in to comment.