00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <stdio.h>
00042 #include "mensagem.h"
00043 #include "memvirtu.h"
00044 #include "lowparam.h"
00045 #include "lowmacro.h"
00046 #include "lowsolid.h"
00047 #include "eulerops.h"
00048 #include "mancommd.h"
00049
00050
00051 #ifdef __Extended_Version
00052 void MSD_execModifyIds(void)
00053 {
00054 int sn, snew, op;
00055
00056 while (sscanf(restbuf, "%d %d %d", &sn, &op, &snew) != 3)
00057 {
00058 printf("ModifyIds: Sid Snew");
00059 if (!lineins("? "))
00060 {
00061 return;
00062 }
00063 }
00064 MSD_highModifyIds(sn, snew);
00065 }
00066
00067 #endif
00068
00069 int MSD_highModifyIds(Id sn, Id snew)
00070 {
00071 SPTYPE s;
00072
00073 if ((s = MSD_getSolid(sn)) == SNIL)
00074 {
00075 fprintf(stderr, MEN_NaoEncontrouSolido, NAM_ModifyIds, sn);
00076 return(ERROR);
00077 }
00078 MSD_lowModifyIds(s, snew);
00079 return(SUCCESS);
00080 }
00081
00082 void MSD_lowModifyIds(SPTYPE s, int sn)
00083 {
00084 Id sno;
00085
00086 sno = SolSolidNo(s);
00087 if (Gdoinversion)
00088 {
00089 MSD_lowAddEulerOp(s, MODIFYNAMES, sn, sno, 0, 0, 0, 0, 0, 0,
00090 0.0, 0.0, 0.0, 0.0);
00091 }
00092 if (Gdodirect)
00093 {
00094 MSD_lowAddEulerOpRedo(s, MODIFYNAMES, sno, sn, 0, 0, 0, 0, 0, 0,
00095 0.0, 0.0, 0.0, 0.0);
00096 }
00097 SolSolidNo(s) = sn;
00098 }
00099
00100 int MSD_execStructModifyIds(EulerOp *op)
00101 {
00102 Id sid, id1, id2;
00103
00104 sid = op->solidno;
00105 id1 = op->ip1;
00106 id2 = op->ip2;
00107 return(MSD_highModifyIds(id1, id2));
00108 }
00109
00110 void MSD_printStructModifyIds(FILE *f, EulerOp *op)
00111 {
00112 Id sid, id2;
00113 int com;
00114
00115 sid = op->ip1;
00116 id2 = op->ip2;
00117 com = op->CommandCount;
00118 fprintf(f, "modifynames %d %d %d\n", sid, com, id2);
00119 }
00120
00121 int MSD_readStructModifyIds(FILE *f, EulerOp *op)
00122 {
00123 int solidno, ip2, com;
00124
00125 if (fscanf(f, "%d %d %d\n", &solidno, &com, &ip2) != 3)
00126 {
00127 return(ERROR);
00128 }
00129 op->solidno = solidno;
00130 op->CommandCount = com;
00131 op->ip1 = solidno;
00132 op->ip2 = ip2;
00133 op->ip3 = 0;
00134 op->ip4 = 0;
00135 op->ip5 = 0;
00136 op->ip6 = 0;
00137 op->ip7 = 0;
00138 op->ip8 = 0;
00139 op->fp1 = 0.0;
00140 op->fp2 = 0.0;
00141 op->fp3 = 0.0;
00142 op->fp4 = 0.0;
00143 return(SUCCESS);
00144 }
00145
00146 int MSD_modifyStructModifyIds(EulerOp *op)
00147 {
00148 int solidno;
00149
00150 solidno = MSD_lowCheckTranslatorTable(op->solidno, SOLID);
00151 op->solidno = solidno;
00152 return(SUCCESS);
00153 }