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 "lowsolid.h"
00046 #include "curvgeom.h"
00047 #include "mancommd.h"
00048 #include "eulerops.h"
00049
00050 #ifdef __curved_env__
00051
00052 #ifdef __Extended_Version
00053 void MSD_execKillCurveLine(void)
00054 {
00055 int tagno, sn;
00056 char sname[20];
00057
00058 while (2 != sscanf(restbuf, "%d %s", &tagno, sname))
00059 {
00060 printf("KILL_LINE: CTag Sname \n");
00061 if (!lineins("? "))
00062 {
00063 return;
00064 }
00065 }
00066 if ((sn = MSD_getSolidIdFromName(sname)) == ERROR)
00067 {
00068 fprintf(stderr, MEN_NaoEncontrouSolidNome, NAM_KillCTag, sname);
00069 return;
00070 }
00071 MSD_highKillCurveLine(tagno, sn);
00072 }
00073
00074 #endif
00075
00076 int MSD_highKillCurveLine(Id tag, Id sn)
00077 {
00078 SPTYPE s;
00079 CURVE *curv;
00080
00081 if ((s = MSD_getSolid(sn)) == SNIL)
00082 {
00083 fprintf(stderr, MEN_NaoEncontrouSolido, NAM_KillCTag, sn);
00084 return(ERROR);
00085 }
00086 if ((curv = MSD_getCurve(s, tag)) == (CURVE *)NIL)
00087 {
00088 fprintf(stderr, MEN_NaoEncontrouTag, NAM_KillCTag, tag, sn);
00089 return(ERROR);
00090 }
00091 MSD_lowKillCurveLine(s, curv);
00092 return(SUCCESS);
00093 }
00094
00095 int MSD_lowKillCurveLine(SPTYPE s, CURVE *l)
00096 {
00097 assert(l != (CURVE *)NIL);
00098 assert(s != SNIL);
00099
00100 if (--l->times_used == 0)
00101 {
00102 if (Gdoinversion)
00103 {
00104 MSD_lowAddEulerOp(s, NEWLINE, l->tagno, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0);
00105 }
00106 if (Gdodirect)
00107 {
00108 MSD_lowAddEulerOpRedo(s, KILLLINE, l->tagno, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0);
00109 }
00110
00111 MSD_lowCurveDeleteElement(l, s);
00112 }
00113 return(SUCCESS);
00114 }
00115
00116 int MSD_execStructKILLLINE(EulerOp *op)
00117 {
00118 return(MSD_highKillCurveLine(op->ip1, op->solidno));
00119 }
00120
00121 void MSD_printStructKILLLINE(FILE *f, EulerOp *op)
00122 {
00123 int com;
00124
00125 com = op->CommandCount;
00126 fprintf(f, "killline %d %d %d\n", op->solidno, com, op->ip1);
00127 }
00128
00129 int MSD_readStructKILLLINE(FILE *f, EulerOp *op)
00130 {
00131 int solidno, ip1, com;
00132
00133 if (fscanf(f, "%d %d %d", &solidno, &com, &ip1) != 3)
00134 {
00135 return(ERROR);
00136 }
00137 op->solidno = solidno;
00138 op->CommandCount = com;
00139 op->ip1 = ip1;
00140 op->ip2 = 0;
00141 op->ip3 = 0;
00142 op->ip4 = 0;
00143 op->ip5 = 0;
00144 op->ip6 = 0;
00145 op->ip7 = 0;
00146 op->ip8 = 0;
00147 op->fp1 = 0.0;
00148 op->fp2 = 0.0;
00149 op->fp3 = 0.0;
00150 op->fp4 = 0.0;
00151 return(SUCCESS);
00152 }
00153
00154 int MSD_modifyStructKILLLINE(EulerOp *op)
00155 {
00156 return(SUCCESS);
00157 }
00158
00159 #endif