00001 /* 00002 ** --------------------------------------------------------------- 00003 ** prj.h - Project manager class definition. 00004 ** 00005 ** --------------------------------------------------------------- 00006 */ 00007 #ifndef _PRJ_H 00008 #define _PRJ_H 00009 00031 /* 00032 ** --------------------------------------------------------------- 00033 ** Used global definitions: 00034 ** 00035 */ 00036 #include <stdio.h> /* FILE */ 00037 #include "iup.h" 00038 #include "cd.h" 00039 #include "cdiup.h" 00040 #include "vgl/vglc/vglc.h" 00041 #include "vgl/vglc/vglciup.h" 00042 #include "vgl/vglc/vglcglut.h" 00043 00044 #include "prm.h" 00045 00046 class Prj 00047 { 00048 private: 00049 /* 00050 ** --------------------------------------------------------------- 00051 ** Private class variables and constants: 00052 ** 00053 */ 00056 static char *trab_info; 00057 00060 static double max_height; 00061 00065 static Prm* sel_prm; 00066 00069 static int list_updated; 00070 00073 static Ihandle* Ozbufferdialog; 00074 00077 static cdCanvas* Gzbuffercanvas; 00078 00079 public: 00080 /* 00081 ** --------------------------------------------------------------- 00082 ** Public class variables: 00083 */ 00086 static Ihandle* Odatascreen; 00087 00090 static VglCanvas* vglcanvas; 00091 00092 private: 00093 /* 00094 ** --------------------------------------------------------------- 00095 ** Private class functions: 00096 ** 00097 */ 00098 /* --------------------------------------------------------------- */ 00101 static inline double MAX( double a, double b ) 00102 { 00103 return( (a > b) ? a : b ); 00104 } 00105 00106 /* --------------------------------------------------------------- */ 00111 static void ResetLocalParams( void ); 00112 00113 /* --------------------------------------------------------------- */ 00117 static void BuildDisplayList( void ); 00118 00119 /* --------------------------------------------------------------- */ 00125 static Prm* PckPrm( double x, double y ); 00126 00127 /* --------------------------------------------------------------- */ 00132 static int DspZbufferCanvas( Ihandle* cv ); 00133 00134 public: 00135 /* 00136 ** --------------------------------------------------------------- 00137 ** Public class functions: 00138 ** 00139 */ 00140 /* --------------------------------------------------------------- */ 00146 static void Init( void ); 00147 00148 /* --------------------------------------------------------------- */ 00153 static void Quit( void ); 00154 00155 /* --------------------------------------------------------------- */ 00163 static void Resize( int width, int height ); 00164 00165 /* --------------------------------------------------------------- */ 00170 static void Redisplay( void ); 00171 00172 /* --------------------------------------------------------------- */ 00177 static void Info( void ); 00178 00179 /* --------------------------------------------------------------- */ 00184 static void Help( void ); 00185 00186 /* --------------------------------------------------------------- */ 00199 static int OpenModel( FILE* fd ); 00200 00201 /* --------------------------------------------------------------- */ 00210 static void ZbufferSnapShot( void ); 00211 00212 /* --------------------------------------------------------------- */ 00236 static int Raster2WorldXY( int x, int y, double* xw, double* yw ); 00237 00238 /* --------------------------------------------------------------- 00239 ** 00240 ** This function is used to select a primitive. The given 00241 ** location is used to select the target primitive. 00242 ** The selection searches a primitive starting from 00243 ** the front to the back of the list of primitives. 00244 ** It also rebuilds the display list of the entire model so 00245 ** that the selected primitive will appear highlighted. 00246 ** This function may also be used to unselect all the primitives, 00247 ** in case no primitive is selected at the given point location. 00248 ** 00249 ** @param x - x coord. of point on target primitive (in) 00250 ** @param y - y coord. of point on target primitive (in) 00251 ** 00252 ** @return 00253 ** It returns a true (1) status if a primitive is selected. 00254 ** Otherwise, it returns a false (0) status. 00255 */ 00256 static int SelectPrm( double x, double y ); 00257 00258 /* --------------------------------------------------------------- */ 00268 static void SetHeightFac( double fac ); 00269 00270 /* --------------------------------------------------------------- */ 00281 static double GetHeightFac( void ); 00282 00283 /* --------------------------------------------------------------- */ 00288 static void ResetView( void ); 00289 00290 /* --------------------------------------------------------------- */ 00297 static void Fit( void ); 00298 00299 /* --------------------------------------------------------------- */ 00304 static void Persp( void ); 00305 00306 /* --------------------------------------------------------------- */ 00310 static void Ortho( void ); 00311 00312 /* --------------------------------------------------------------- */ 00318 static void ProjX( void ); 00319 00320 /* --------------------------------------------------------------- */ 00326 static void ProjY( void ); 00327 00328 /* --------------------------------------------------------------- */ 00334 static void ProjZ( void ); 00335 00336 /* --------------------------------------------------------------- */ 00341 static void ManipMode( void ); 00342 00343 /* --------------------------------------------------------------- */ 00348 static void NavigMode( void ); 00349 00350 /* --------------------------------------------------------------- */ 00356 static void ZoomMode( void ); 00357 00358 }; 00359 00362 #endif
1.4.2-20050421