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
00052 int MSD_highNameDesloca(char *name, real dx, real dy, real dz);
00053 int MSD_highDesloca(Id sn, real dx, real dy, real dz);
00054
00055 void MSD_execNameDesloca(void)
00056 {
00057 char name[30];
00058 float dx, dy, dz;
00059
00060 while (4 != sscanf(restbuf, "%s %f %f %f", name, &dx, &dy, &dz))
00061 {
00062 printf("ROV.desloca nome dx dy dz\n");
00063 if (!lineins("? "))
00064 {
00065 return;
00066 }
00067 }
00068 MSD_highNameDesloca(name, dx, dy, dz);
00069 }
00070
00071 int MSD_highNameDesloca(char *name, real tx, real ty, real tz)
00072 {
00073 int sn;
00074
00075 if ((sn = MSD_getSolidIdFromName(name)) == -1)
00076 {
00077 fprintf(stderr, MEN_NaoEncontrouSolidNome, NAM_RovTranslate, name);
00078 return(ERROR);
00079 }
00080 return(MSD_highDesloca(sn, tx, ty, tz));
00081 }
00082
00083 int MSD_highDesloca(Id sn, real tx, real ty, real tz)
00084 {
00085 SPTYPE s;
00086
00087 if ((s = MSD_getSolid(sn)) == SNIL)
00088 {
00089 fprintf(stderr, MEN_NaoEncontrouSolido, NAM_RovTranslate, sn);
00090 return(ERROR);
00091 }
00092
00093 MSD_lowTranslate(s, tx, ty, tz);
00094 if (SolPerfil(s) != -1)
00095 {
00096 MSD_lowTranslate(MSD_getSolid(SolPerfil(s)), tx, ty, tz);
00097 }
00098
00099 return(SUCCESS);
00100 }