00001
00004 #ifndef __PYRAMID_HH__
00005 #define __PYRAMID_HH__
00006
00007 #include <tab_bool.hh>
00008 #include <image.hh>
00009
00010 #include "value_set.hh"
00011 #include "combinatorial_map.hh"
00012
00013 class combi_map_base;
00014 class combi_map_base_exp;
00015 class combi_map_base_imp;
00016 class kernel;
00017
00018
00020 class pyramid
00021 {
00022 private:
00023
00024 combi_map_base *base;
00025
00026 combi_map_priv map;
00027
00028 level_set l_set;
00029
00030 value_set *value;
00031
00032 public:
00034 typedef enum {implicit_base,explicit_base} construction;
00036 pyramid(int dimx, int dimy, value_set &val, construction c=explicit_base);
00038 pyramid(char *, construction c=explicit_base);
00040 pyramid(ifstream &, construction c=explicit_base);
00042 ~pyramid();
00044 void compute_level(kernel &);
00046 void compute_pyramid(kernel &);
00048 int save(const char*);
00050 void give_combinatorial_map(int,combinatorial_map &);
00052 int give_max_level();
00053
00055 dart give_alpha_base(dart d)
00056 {
00057 return base->alpha(d);
00058 }
00060 dart give_sigma_base(dart d)
00061 {
00062 return base->sigma(d);
00063 }
00065 move_type give_move_base(dart d)
00066 {
00067 return base->give_move(d);
00068 }
00070 int give_level(dart d)
00071 {
00072 return l_set.give_level(d);
00073 }
00075 void give_pointel(dart d,point &p)
00076 {
00077 base->give_pointel(d,p);
00078 }
00080 void give_pixel(dart d,point &p)
00081 {
00082 base->give_pixel(d,p);
00083 }
00084
00086 int compute_index_orientation(dart d1,dart d2)
00087 {
00088 return base->compute_index_orientation(d1, d2);
00089 }
00091 dart_iterator &first_dart(int l)
00092 {
00093 return l_set.first(l);
00094 }
00096 dart_iterator &begin_dart(int l)
00097 {
00098 return l_set.begin(l);
00099 }
00101 dart_iterator &end_dart(int l)
00102 {
00103 return l_set.end(l);
00104 }
00106 dart_iterator &last_dart(int l)
00107 {
00108 return l_set.last(l);
00109 }
00111 int give_width()
00112 {
00113 return base->give_width();
00114 }
00116 int give_height()
00117 {
00118 return base->give_height();
00119 }
00120
00122 dart give_next_border_dart(dart,int);
00123
00124 private:
00126 int load(ifstream &, construction);
00127
00128 void contract_edge(kernel &, list_label &);
00129
00130 void remove_empty_self_loops(list_label &);
00131
00132 void remove_double_edges(kernel &);
00133
00134 void update_vertex_set(kernel &);
00136 void update_sigma_double_edge(kernel &,list_label &,tab_sym_bool &,dart);
00138 dart compute_sigma_successor(kernel &kern, dart b);
00140 dart update_sigma_alpha(dart, dart &, int, dart &);
00142 dart update_next_dart(dart, dart &, int, bool &);
00143
00145 dart extract_update_sigma_alpha(dart,dart&,int,int&,tab_dart&);
00147 dart extract_update_next_dart(dart,dart&,int,tab_dart&);
00148 };
00149
00150
00151 #endif // __PYRAMID_HH__