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_highNameMakeQuadrado(char *name, real a, real h);
00054
00055 void MSD_execNameMakeQuadrado(void)
00056 {
00057 char name[30];
00058 float a, h;
00059
00060 while (3 != sscanf(restbuf, "%s %f %f", name, &a, &h))
00061 {
00062 printf("ROV.quadrado nome a h\n");
00063 if (!lineins("? "))
00064 {
00065 return;
00066 }
00067 }
00068 MSD_highNameMakeQuadrado(name, a, h);
00069 }
00070
00071 void MSD_highNameMakeQuadrado(char *name, real a, real h)
00072 {
00073 SPTYPE optr;
00074 Id sn;
00075
00076 if (MSD_getSolidIdFromName(name) != -1)
00077 {
00078 fprintf(stderr, MEN_SolidoJaExiste, NAM_RovQuadrado, name);
00079 return;
00080 }
00081
00082 if ((sn = MSD_highMakeCube(a, a, h)) != -1)
00083 {
00084 optr = MSD_getSolid(sn);
00085 strcpy(SolName(optr), name);
00086 SolType(optr) = SOLIDO_TIPO_BARRA;
00087 SolGeometria(optr) = BARRA_GEOM_QUADRADO;
00088 SolFronteira(optr) = FRONTEIRA_CV;
00089 SolParam1(optr) = a;
00090 SolParam2(optr) = h;
00091 makevec(SolPrincDir(optr), 0.0, 0.0, 1.0, 0.0);
00092 }
00093 if ((sn = MSD_highMakeCube(a, a, 0.0)) != -1)
00094 {
00095 SolPerfil(optr) = sn;
00096 strcpy(SolName(MSD_getSolid(sn)), "PerQuadrado");
00097 }
00098 }