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 <string.h>
00043 #include "mensagem.h"
00044 #include "memvirtu.h"
00045 #include "lowparam.h"
00046 #include "lowsolid.h"
00047 #include "mancommd.h"
00048 #include "shpshape.h"
00049 #include "disdispl.h"
00050 #include "eulerops.h"
00051
00052 void MSD_execNameMakeRevolve(void)
00053 {
00054 XY *listvtx;
00055 char name1[15];
00056 int m, n;
00057
00058 while (3 != sscanf(restbuf, "%s %d %d", name1, &m, &n))
00059 {
00060 printf("Objeto N_div N_pontos\n");
00061 if (!lineins("? "))
00062 {
00063 return;
00064 }
00065 }
00066 if ((n > 2) && setvtpi(&listvtx, n))
00067 {
00068 MSD_highNameMakeRevolve(name1, m, n, listvtx);
00069 }
00070 }
00071
00072 void MSD_highNameMakeRevolve(char *name, int m, int n, XY *listvtx)
00073 {
00074 Id sn;
00075
00076 if (MSD_getSolidIdFromName(name) != -1)
00077 {
00078 fprintf(stderr, MEN_SolidoJaExiste, NAM_MakeRevolve, name);
00079 return;
00080 }
00081 if ((sn = MSD_highMakeRevolve(m, n, listvtx)) != -1)
00082 {
00083 MSD_highName(sn, name, SOLID);
00084 }
00085 }
00086
00087 #ifdef __Extended_Version
00088 void MSD_execMakeRevolve(void)
00089 {
00090 XY *listvtx;
00091 int m, n;
00092
00093 while (2 != sscanf(restbuf, "%d %d", &m, &n))
00094 {
00095 printf("N_div N_pontos\n");
00096 if (!lineins("? "))
00097 {
00098 return;
00099 }
00100 }
00101 if ((n > 2) && setvtpi(&listvtx, n))
00102 {
00103 printf("Id = %d\n", MSD_highMakeRevolve(m, n, listvtx));
00104 }
00105 }
00106
00107 #endif
00108
00109 Id MSD_highMakeRevolve(int m, int n, XY *listvtx)
00110 {
00111 SPTYPE optr;
00112 Id sn;
00113
00114 sn = MSD_getMaxSolidId();
00115 if ((m > 2) && (n > 2))
00116 {
00117 if ((optr = MSD_lowMakeRevolve(sn, listvtx, m, n)) != SNIL)
00118 {
00119 MSD_lowDisplayMonitor('o', optr, GNIL);
00120 return(sn);
00121 }
00122 }
00123 fprintf(stderr, MEN_ParametrosIncorretos, NAM_MakeRevolve);
00124 return(-1);
00125 }