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
00051 #ifdef __Extended_Version
00052 void MSD_execGetCurrentCameraParameters(void)
00053 {
00054 real Ex, Ey, Ez, Rx, Ry, Rz, ampl;
00055 int mode, elim, hash, edge;
00056
00057 if (MSD_getCurrentCameraParameters(&Ex, &Ey, &Ez, &Rx, &Ry, &Rz,
00058 &l, &mode, &elim, &hash, &edge))
00059 {
00060 printf("Ex = %10.4f Ey = %10.4f Ez = %10.4f\n", Ex, Ey, Ez);
00061 printf("Rx = %10.4f Ry = %10.4f Rz = %10.4f\n", Rx, Ry, Rz);
00062 printf("mode = %s\n", mode == 1 ? "a" : mode == 2 ? "b" : "c");
00063 printf("elim = %s\n", elim == 0 ? "nenhum processamento" :
00064 elim == 1 ? "processamento local" :
00065 elim == 2 ? "processamento global" :
00066 "global + interseccao");
00067 printf("hash = %s\n", hash == 1 ? "exibe linhas escondidas" :
00068 "nao exibe linhas escondidas");
00069 printf("edge = %s\n", edge == 1 ? "exibe edges paralelos" :
00070 "nao exibe edges paralelos");
00071 }
00072 else
00073 {
00074 printf(MEN_NenhumaCamaraCorrente, NAM_GetCamaraCorrenteParametros);
00075 }
00076 }
00077
00078 #endif
00079
00080 int MSD_getCurrentCameraParameters(real *Ex, real *Ey, real *Ez,
00081 real *Rx, real *Ry, real *Rz,
00082 real *ampl, int *mode, int *elim,
00083 int *hash, int *edge)
00084 {
00085 *Ex = *Ey = *Ez = *Rx = *Ry = *Rz = *ampl = 0.0;
00086 *elim = *hash = *edge = *mode = 0;
00087 if (camptr == (CTYPE *)NIL)
00088 {
00089 return(FALSE);
00090 }
00091
00092 *Ex = camptr->eye[0];
00093 *Ey = camptr->eye[1];
00094 *Ez = camptr->eye[2];
00095 *Rx = camptr->ref[0];
00096 *Ry = camptr->ref[1];
00097 *Rz = camptr->ref[2];
00098 *ampl = camptr->scale;
00099 *mode = camptr->mode;
00100 *elim = camptr->hid;
00101 *hash = camptr->dash;
00102 *edge = camptr->smooth;
00103 return(TRUE);
00104 }