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 "lowmacro.h"
00047 #include "lowsolid.h"
00048 #include "mancommd.h"
00049 #include "disdispl.h"
00050 #include "vectorop.h"
00051
00052 int MSD_highNameAlteraCamera(char opt, char *name, real Ex, real Ey,
00053 real Ez, real Rx, real Ry, real Rz,
00054 real scale, int mode, int hidtype, int dash,
00055 int smooth)
00056 {
00057 int cn;
00058
00059 if ((cn = MSD_getCameraIdFromName(name)) == -1)
00060 {
00061 fprintf(stderr, MEN_CamaraNomeNaoEncontrada,
00062 NAM_AlteraCamara, name);
00063 return(ERROR);
00064 }
00065 return(MSD_highAlteraCamera(opt, cn, Ex, Ey, Ez, Rx, Ry, Rz, scale,
00066 mode, hidtype, dash, smooth));
00067 }
00068
00069 int MSD_highAlteraCamera(char opt, Id cn, real Ex, real Ey, real Ez,
00070 real Rx, real Ry, real Rz, real scale,
00071 int mode, int hidtype, int dash, int smooth)
00072 {
00073 CTYPE *cptr;
00074
00075 if ((cptr = MSD_getCamera(cn)) == (CTYPE *)NIL)
00076 {
00077 fprintf(stderr, MEN_CamaraIdNaoEncontrada,
00078 NAM_AlteraCamara, cn);
00079 return(ERROR);
00080 }
00081 return(MSD_lowAlteraCamera(opt, cptr, Ex, Ey, Ez, Rx, Ry, Rz, scale,
00082 mode, hidtype, dash, smooth));
00083 }
00084
00085 int MSD_lowAlteraCamera(char opt, CTYPE *cptr, real Ex, real Ey,
00086 real Ez, real Rx, real Ry, real Rz,
00087 real scale, int mode, int hidtype, int dash,
00088 int smooth)
00089 {
00090 int xmode, xhidtype, xdash, xsmooth;
00091 vector xeye, xref;
00092 real xscale;
00093
00094 veccopy(xeye, cptr->eye);
00095 veccopy(xref, cptr->ref);
00096 xscale = cptr->scale;
00097 xmode = cptr->mode;
00098 xhidtype = cptr->hid;
00099 xdash = cptr->dash;
00100 xsmooth = cptr->smooth;
00101 switch (opt)
00102 {
00103 case 'e':
00104 makevec(xeye, Ex, Ey, Ez, 1.0);
00105 break;
00106
00107 case 'r':
00108 makevec(xref, Rx, Ry, Rz, 1.0);
00109 break;
00110
00111 case 's':
00112 xscale = scale;
00113 break;
00114
00115 case 'm':
00116 xmode = mode;
00117 break;
00118
00119 case 'h':
00120 xhidtype = hidtype;
00121 break;
00122
00123 case 'd':
00124 xdash = dash;
00125 break;
00126
00127 case 'f':
00128 xsmooth = smooth;
00129 break;
00130 }
00131 if (!MSD_lowCheckCamera(xeye, xref, xscale, xmode, xhidtype, xdash, xsmooth))
00132 {
00133 fprintf(stderr, MEN_CamaraParametroIncorreto,
00134 NAM_AlteraCamara);
00135 return(FALSE);
00136 }
00137 MSD_lowSetCamera(cptr, xeye, xref, xscale, xmode, xhidtype, xdash, xsmooth);
00138 return(TRUE);
00139 }