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 "hiegroup.h"
00049 #include "disdispl.h"
00050 #include "mancommd.h"
00051 #include "vectorop.h"
00052
00053 void MSD_execMonitor(void)
00054 {
00055 char name1[15];
00056
00057 while (1 != sscanf(restbuf, "%s", name1))
00058 {
00059 printf("%s: Nome da camera/ON/OFF\n", NAM_Monitor);
00060 if (!lineins("? "))
00061 {
00062 return;
00063 }
00064 }
00065 MSD_highMonitor(name1);
00066 }
00067
00068 int MSD_highMonitor(char *name)
00069 {
00070 CTYPE *cptr;
00071
00072 strlower((unsigned char *)name);
00073 if (!strcmp(name, "on"))
00074 {
00075 return(MSD_lowMonitor((CTYPE *)NIL, -1));
00076 }
00077 if (!strcmp(name, "off"))
00078 {
00079 return(MSD_lowMonitor((CTYPE *)NIL, -2));
00080 }
00081 if ((cptr = MSD_lowFindCameraByName(name)) != (CTYPE *)NIL)
00082 {
00083 return(MSD_lowMonitor(cptr, -3));
00084 }
00085 fprintf(stderr, MEN_ParametrosIncorretos, NAM_Monitor);
00086 return(FALSE);
00087 }
00088
00089 int MSD_lowMonitor(CTYPE *cptr, int flag)
00090 {
00091 switch (flag)
00092 {
00093 case - 1:
00094 if (monicptr == (CTYPE *)NIL)
00095 {
00096 fprintf(stderr, MEN_NenhumaCamaraMonitora,
00097 NAM_Monitor);
00098 return(FALSE);
00099 }
00100 monisw = TRUE;
00101 break;
00102
00103 case - 2:
00104 if (monicptr == (CTYPE *)NIL)
00105 {
00106 fprintf(stderr, MEN_NenhumaCamaraMonitora,
00107 NAM_Monitor);
00108 return(FALSE);
00109 }
00110 monisw = FALSE;
00111 break;
00112
00113 case - 3:
00114 monicptr = camptr = cptr;
00115 monisw = TRUE;
00116 break;
00117 }
00118 return(TRUE);
00119 }
00120
00121 void MSD_lowDisplayMonitor(int t, SPTYPE optr, GPTYPE gptr)
00122 {
00123 if (monisw)
00124 {
00125 camptr = monicptr;
00126 switch (t)
00127 {
00128 case 'a':
00129 MSD_lowDisplayMonitorAxis();
00130 break;
00131
00132 case 'o':
00133 MSD_lowDisplayMonitorSolid(optr);
00134 break;
00135
00136 case 'g':
00137 MSD_lowDisplayMonitorGroup(gptr);
00138 break;
00139 }
00140 }
00141 }
00142
00143 void MSD_lowDisplayMonitorSolid(SPTYPE op)
00144 {
00145 SPTYPE optr;
00146
00147 for (AllSolids(optr))
00148 {
00149 SolDsp(optr) = (op == optr);
00150 }
00151
00152 #if !defined (__UNIX) && !defined (_Windows)
00153 MSD_lowSetBreakInterruption();
00154 #endif
00155
00156 switch (monicptr->hid)
00157 {
00158 case 0:
00159 MSD_highDisplayAllEdges();
00160 break;
00161
00162 case 1:
00163 MSD_highDisplayLocalHidden();
00164 break;
00165
00166 case 2:
00167 MSD_lowCameraDisplayHidden();
00168 break;
00169
00170 case 3:
00171 MSD_lowCameraDisplayIntersection();
00172 break;
00173 }
00174
00175 #if !defined (__UNIX) && !defined (_Windows)
00176 MSD_lowSetBreakResident();
00177 #endif
00178 }
00179
00180 void MSD_lowDisplayMonitorGroup(GPTYPE gptr)
00181 {
00182 SPTYPE optr;
00183
00184 for (AllSolids(optr))
00185 {
00186 SolDsp(optr) = MSD_lowIsAncestorGroup(gptr, SolGroup(optr));
00187 }
00188
00189 #if !defined (__UNIX) && !defined (_Windows)
00190 MSD_lowSetBreakInterruption();
00191 #endif
00192
00193 switch (monicptr->hid)
00194 {
00195 case 0:
00196 MSD_highDisplayAllEdges();
00197 break;
00198
00199 case 1:
00200 MSD_highDisplayLocalHidden();
00201 break;
00202
00203 case 2:
00204 MSD_lowCameraDisplayHidden();
00205 break;
00206
00207 case 3:
00208 MSD_lowCameraDisplayIntersection();
00209 break;
00210 }
00211
00212 #if !defined (__UNIX) && !defined (_Windows)
00213 MSD_lowSetBreakResident();
00214 #endif
00215 }
00216
00217 void MSD_lowDisplayMonitorAxis(void)
00218 {
00219 #if !defined (__UNIX) && !defined (_Windows)
00220 MSD_lowSetBreakInterruption();
00221 #endif
00222
00223 switch (monicptr->hid)
00224 {
00225 case 0:
00226 MSD_highDisplayAllEdges();
00227 break;
00228
00229 case 1:
00230 MSD_highDisplayLocalHidden();
00231 break;
00232
00233 case 2:
00234 MSD_lowCameraDisplayHidden();
00235 break;
00236
00237 case 3:
00238 MSD_lowCameraDisplayIntersection();
00239 break;
00240 }
00241
00242 #if !defined (__UNIX) && !defined (_Windows)
00243 MSD_lowSetBreakResident();
00244 #endif
00245 }