00001
00010
00011
00012
00013 #pragma once
00014
00015 #if !defined(WIN32) || defined(__CYGWIN__)
00016 #pragma interface
00017 #endif // WIN32
00018
00019
00020 #include <GL/glui.h>
00021
00022
00023 #define OCTREE_SWITCH 4
00024
00025
00026
00027 #ifdef OCTREE_SWITCH
00028 # if OCTREE_SWITCH==0
00029 # define OCTREE_PTR 1
00030 # elif OCTREE_SWITCH==1
00031 # define OCTREE_HASH 1
00032 # elif OCTREE_SWITCH==2
00033 # define OCTREE_OPT 1
00034 # elif OCTREE_SWITCH==3
00035 # define OCTREE_LEAF 1
00036 # elif OCTREE_SWITCH==4
00037 # define OCTREE_MEM 1
00038 # endif // OCTREE_SWITCH
00039 #endif // OCTREE_SWITCH
00040
00041
00042
00043 #if !OCTREE_PTR && !OCTREE_HASH && !OCTREE_OPT && !OCTREE_LEAF && !OCTREE_MEM
00044
00045
00046 # define OCTREE_OPT 1
00047
00048
00049 #endif // !OCTREE_PTR && !OCTREE_HASH && !OCTREE_OPT && !OCTREE_LEAF && !OCTREE_MEM
00050
00051
00052 #ifdef OCTREE_PTR
00053 # undef OCTREE_HASH
00054 # undef OCTREE_OPT
00055 # undef OCTREE_LEAF
00056 # undef OCTREE_MEM
00057 # define OCTREE_STRING "pointer octree"
00058 # include "ptr_octree.h"
00060 typedef PtrOctree Octree ;
00061 #endif //OCTREE_PTR
00062
00063
00064 #ifdef OCTREE_HASH
00065 # undef OCTREE_PTR
00066 # undef OCTREE_OPT
00067 # undef OCTREE_LEAF
00068 # undef OCTREE_MEM
00069 # define OCTREE_STRING "hash octree"
00070 # include "hash_octree.h"
00072 typedef HashOctree Octree ;
00073 #endif //OCTREE_HASH
00074
00075
00076 #ifdef OCTREE_OPT
00077 # undef OCTREE_PTR
00078 # undef OCTREE_HASH
00079 # undef OCTREE_LEAF
00080 # undef OCTREE_MEM
00081 # define OCTREE_STRING "optimized octree"
00082 # include "opt_octree.h"
00084 typedef OptOctree Octree ;
00085 #endif //OCTREE_OPT
00086
00087
00088 #ifdef OCTREE_LEAF
00089 # undef OCTREE_PTR
00090 # undef OCTREE_HASH
00091 # undef OCTREE_OPT
00092 # undef OCTREE_MEM
00093 # define OCTREE_STRING "leaf octree"
00094 # include "leaf_octree.h"
00096 typedef LeafOctree Octree ;
00097 #endif //OCTREE_LEAF
00098
00099
00100 #ifdef OCTREE_MEM
00101 # undef OCTREE_PTR
00102 # undef OCTREE_HASH
00103 # undef OCTREE_OPT
00104 # undef OCTREE_LEAF
00105 # define OCTREE_STRING "mem octree"
00106 # include "mem_octree.h"
00108 typedef MemOctree Octree ;
00109 #endif //OCTREE_MEM
00110
00111
00112
00113 #ifdef _DEBUG
00114 #define PRINT_GL_DEBUG { if( ::glGetError() != GL_NO_ERROR ) printf( "openGL watch at line %d: %s\n", __LINE__, ::gluErrorString( ::glGetError() ) ) ; }
00115 #else // _DEBUG
00116 #define PRINT_GL_DEBUG {}
00117 #endif // _DEBUG
00118
00119
00120
00121
00122
00123
00125 extern Octree octree ;
00126
00128 extern int impl_data ;
00129
00131 enum { SWITCH_IMPL = 0, SWITCH_DATA = 1 } ;
00132
00134 extern data_func *dat_func ;
00135
00137 extern data_file *dat_data ;
00138
00140 extern int max_level ;
00141
00143 extern float iso_val ;
00144
00145
00146
00147
00148
00150 extern int show_octree ;
00152 extern int show_nodes ;
00154 extern int show_dual ;
00156 extern int show_iso ;
00158 extern int show_direct_iso ;
00160 extern int show_direct_iso_wire ;
00161
00162
00163
00164
00165
00167 extern int main_window ;
00168
00170 extern GLUI *glui_side ;
00171
00173 extern GLUI *glui_bottom ;
00174
00175
00177 void create_side_panel() ;
00178
00180 void create_bottom_panel() ;
00181
00183 void control_cb( int control ) ;
00184
00186 bool parse_command_line(int argc, char* argv[]) ;
00187
00188
00189
00190
00191
00193 extern int light0_enabled ;
00194
00196 extern int light1_enabled ;
00197
00199 extern int light0_intensity ;
00200
00202 extern int light1_intensity ;
00203
00205 extern int light0_intensity2 ;
00206
00208 extern int light1_intensity2 ;
00209
00211 extern float light0_diffuse[4] ;
00212
00214 extern float light1_diffuse[4] ;
00215
00217 extern float light0_rotation[16] ;
00218
00220 extern float light1_rotation[16] ;
00221
00222
00223
00224
00225
00227 extern int motion_type ;
00228
00230 extern GLUI_Rotation mouse_rot ;
00232 extern GLUI_Rotation *objects_rot ;
00234 extern GLUI_Translation mouse_mv ;
00236 extern GLUI_Translation *objects_mv ;
00238 extern GLUI_Translation mouse_zm ;
00240 extern GLUI_Translation *objects_zm ;
00241
00243 extern int ncalls ;
00244
00246 extern int export_movie ;
00247
00249 extern int auto_rotate ;
00250
00252 extern int auto_translate_x ;
00253
00255 extern int auto_translate_y ;
00256
00258 extern int auto_zoom ;
00259
00261 extern int auto_translate_d ;
00262
00264 extern int mouse_x ;
00265
00267 extern int mouse_y ;
00268
00270 void init_trackballs() ;
00271
00273 void mouse(int button, int button_state, int x, int y ) ;
00274
00276 void motion(int x, int y ) ;
00277
00279 void keyboard(unsigned char key, int x, int y);
00280
00281
00282
00283
00285 extern GLUI_String impl_fun ;
00286
00287
00288
00289
00290
00292 extern GLUI_String filename ;
00293
00295 extern GLUI_FileBrowser *file_browser ;
00296
00297
00298
00299
00300
00301
00303 extern int ortho ;
00305 extern float view_rotate[16] ;
00307 extern float obj_pos [3 ] ;
00308
00310 extern int point_size;
00311
00313 void project( int o, float sx, float sy, int &tx, int &ty, int &tw, int &th ) ;
00314
00316 void reshape( int x, int y ) ;
00317
00319 void display() ;
00320
00322 void export_png() ;
00323
00325 void load_viewport() ;
00327 void save_viewport() ;
00328
00329
00330
00331
00332
00333
00334
00335
00337 enum
00338 {
00339 SET_IMPL_DATA_ID ,
00340 SET_VAL_ID ,
00341 REFINE_ID ,
00342 ADAPT_ID ,
00343 ISO_BUILD_ID ,
00344 SEARCH_ID ,
00345 FUN_ID ,
00346
00347 SAVE_VIEWPORT_ID ,
00348 LOAD_VIEWPORT_ID ,
00349
00350 RESET_ROTATION_ID ,
00351 RESET_TRANSLATION_ID ,
00352 RESET_ZOOM_ID ,
00353
00354 REDRAW_ID ,
00355 FILENAME_ID ,
00356 PROJ_ID ,
00357
00358 EXIT_ID
00359 };
00360
00361