00001 00010 //________________________________________________ 00011 00012 00013 #pragma once 00014 00015 #if !defined(WIN32) || defined(__CYGWIN__) 00016 #pragma interface 00017 #endif // WIN32 00018 00019 #include <map> 00020 #include "point.h" 00021 #include "data_access.h" 00022 00023 00024 //_____________________________________________________________________________ 00029 class MC_Draw 00030 //----------------------------------------------------------------------------- 00031 { 00032 // Constructors 00033 public : 00038 MC_Draw () : _originalMC(true) {} 00040 ~MC_Draw () {} 00041 00042 //----------------------------------------------------------------------------- 00043 // Accessors 00044 public : 00049 inline void set_method ( const bool originalMC = false ) { _originalMC = originalMC ; } 00050 00051 //----------------------------------------------------------------------------- 00052 // Algorithm 00053 public : 00055 real *cube () { return _cube ; } 00057 Point *space () { return _space; } 00059 data_access *&dat_access() { return _dat_access ; } 00060 00065 bool tesselate_cube( real iso ) ; 00066 00067 protected : 00069 bool process_cube () ; 00071 bool test_face ( schar face ) ; 00073 bool test_interior( schar s ) ; 00074 00075 00076 //----------------------------------------------------------------------------- 00077 // Operations 00078 protected : 00080 bool compute_intersection_points() ; 00081 00083 bool add_vertex( char i, char j ) ; 00084 00086 bool comp_c_vertex() ; 00087 00094 void draw_triangle ( const char* trig, char n, int v12 = -1 ) ; 00095 00097 void print_cube() ; 00098 00099 //----------------------------------------------------------------------------- 00100 // Elements 00101 protected : 00102 bool _originalMC ; 00104 real _cube[8] ; 00105 Point _space[8] ; 00106 Point _verts[8][8] ; 00107 Point _c_vert ; 00108 uchar _lut_entry ; 00109 uchar _case ; 00110 uchar _config ; 00111 uchar _subconfig ; 00112 data_access *_dat_access ; 00113 }; 00114 //_____________________________________________________________________________ 00115 00116