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 "eulerops.h"
00048 #include "vectorop.h"
00049 #include "mancommd.h"
00050 #include "shpshape.h"
00051 #include "basrov__.h"
00052
00053 void MSD_highNameMakePiramide(char *name, int n, real h, XY *listvtx);
00054
00055 void MSD_execNameMakePiramide(void)
00056 {
00057 XY *listvtx;
00058 char name[30];
00059 float h;
00060 int n;
00061
00062 while (3 != sscanf(restbuf, "%s %d %f", name, &n, &h))
00063 {
00064 printf("ROV.piramide nome n h \n");
00065 if (!lineins("? "))
00066 {
00067 return;
00068 }
00069 }
00070 if ((n > 2) && setvtpi(&listvtx, n))
00071 {
00072 MSD_highNameMakePiramide(name, n, h, listvtx);
00073 }
00074 }
00075
00076 void MSD_highNameMakePiramide(char *name, int n, real h, XY *listvtx)
00077 {
00078 SPTYPE optr;
00079 Id sn;
00080
00081 if (MSD_getSolidIdFromName(name) != -1)
00082 {
00083 fprintf(stderr, MEN_SolidoJaExiste, NAM_RovPiramide, name);
00084 return;
00085 }
00086 if ((sn = MSD_highMakePyramid(n, h, listvtx)) != -1)
00087 {
00088 optr = MSD_getSolid(sn);
00089 strcpy(SolName(optr), name);
00090 SolType(optr) = SOLIDO_TIPO_SOLID;
00091 SolGeometria(optr) = SOLIDO_GEOM_PIRAMIDE;
00092 SolFronteira(optr) = FRONTEIRA_CV;
00093 SolParam1(optr) = h;
00094 makevec(SolPrincDir(optr), 0.0, 0.0, 1.0, 0.0);
00095 }
00096 }