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_execHardRemove(void)
00053 {
00054 int sn, op;
00055
00056 while (sscanf(restbuf, "%d %d", &sn, &op) != 2)
00057 {
00058 printf("hardsolidrm: Sid");
00059 if (!lineins("? "))
00060 {
00061 return;
00062 }
00063 }
00064 MSD_highHardRemove(sn);
00065 }
00066
00067 #endif
00068
00069 int MSD_highHardRemove(Id sn)
00070 {
00071 SPTYPE s;
00072
00073 if ((s = MSD_getSolid(sn)) == SNIL)
00074 {
00075 fprintf(stderr, MEN_NaoEncontrouSolido, NAM_HardRemove, sn);
00076 return(ERROR);
00077 }
00078 return(MSD_lowHardRemove(s));
00079 }
00080
00081 int MSD_lowHardRemove(SPTYPE s)
00082 {
00083 DPTYPE d;
00084 FPTYPE f;
00085 LPTYPE l;
00086 HPTYPE he;
00087 int SetOld;
00088
00089 SetOld = SetTrace;
00090 SetTrace = FALSE;
00091
00092 while ((d = SolSShells(s)) != DNIL)
00093 {
00094 while ((f = SheSFaces(d)) != FNIL)
00095 {
00096 while ((l = FacFLoops(f)) != LNIL)
00097 {
00098 he = LooLEdg(l);
00099 do
00100 {
00101 if (HalEdg(he) != ENIL)
00102 {
00103 if (EdgHe1(HalEdg(he)) == he)
00104 {
00105 MSD_lowDelElement(EDGE, (NPTYPE)HalEdg(he), (NPTYPE)s);
00106 }
00107 if (VerVEdge(HalVtx(he)) == he)
00108 {
00109 MSD_lowDelElement(VERTEX, (NPTYPE)HalVtx(he), (NPTYPE)s);
00110 }
00111 }
00112 else
00113 {
00114 MSD_lowDelElement(VERTEX, (NPTYPE)HalVtx(he), (NPTYPE)s);
00115 }
00116 MSD_lowDelElement(HALFEDGE, (NPTYPE)he, NNIL);
00117 } while ((he = HalNxt(he)) != LooLEdg(l));
00118 MSD_lowDelElement(LOOP, (NPTYPE)l, (NPTYPE)f);
00119 }
00120 MSD_lowDelElement(FACE, (NPTYPE)f, (NPTYPE)d);
00121 }
00122 MSD_lowDelElement(SHELL, (NPTYPE)d, (NPTYPE)s);
00123 }
00124 MSD_lowDelElement(SOLID, (NPTYPE)s, NNIL);
00125
00126 SetTrace = SetOld;
00127 return(SUCCESS);
00128 }
00129
00130 int MSD_execStructHardRemove(EulerOp *op)
00131 {
00132 Id sid;
00133
00134 sid = op->solidno;
00135 return(MSD_highHardRemove(sid));
00136 }
00137
00138 void MSD_printStructHardRemove(FILE *f, EulerOp *op)
00139 {
00140 Id sid;
00141 int com;
00142
00143 sid = op->solidno;
00144 com = op->CommandCount;
00145 fprintf(f, "hardrem %d %d \n", sid, com);
00146 }
00147
00148 int MSD_readStructHardRemove(FILE *f, EulerOp *op)
00149 {
00150 int solidno, com;
00151
00152 if (fscanf(f, "%d %d\n", &solidno, &com) != 2)
00153 {
00154 return(ERROR);
00155 }
00156 op->solidno = solidno;
00157 op->CommandCount = com;
00158 op->ip1 = 0;
00159 op->ip2 = 0;
00160 op->ip3 = 0;
00161 op->ip4 = 0;
00162 op->ip5 = 0;
00163 op->ip6 = 0;
00164 op->ip7 = 0;
00165 op->ip8 = 0;
00166 op->fp1 = 0.0;
00167 op->fp2 = 0.0;
00168 op->fp3 = 0.0;
00169 op->fp4 = 0.0;
00170 return(SUCCESS);
00171 }
00172
00173 int MSD_modifyStructHardRemove(EulerOp *op)
00174 {
00175 int solidno;
00176
00177 solidno = MSD_lowCheckTranslatorTable(op->solidno, SOLID);
00178 op->solidno = solidno;
00179 return(SUCCESS);
00180 }