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