#include <mesher2d.hpp>
Definition at line 61 of file mesher2d.hpp.
typedef topology<C,V>::BoundingBox BoundingBox |
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 69 of file mesher2d.hpp.
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 70 of file mesher2d.hpp.
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 71 of file mesher2d.hpp.
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 72 of file mesher2d.hpp.
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 67 of file mesher2d.hpp.
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 68 of file mesher2d.hpp.
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 75 of file mesher2d.hpp.
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 74 of file mesher2d.hpp.
Definition at line 73 of file mesher2d.hpp.
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 66 of file mesher2d.hpp.
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 65 of file mesher2d.hpp.
mesher2d | ( | void | ) | [inline] |
Definition at line 158 of file mesher2d.hpp.
00158 : m_smooth(0.1), m_prec(0.01) { 00159 m_tree = new Kdtree ; 00160 m_input_bbx = BoundingBox(0, 1, 0, 1); 00161 m_output = new Output; 00162 }
~mesher2d | ( | void | ) | [inline, virtual] |
Definition at line 165 of file mesher2d.hpp.
void add_input | ( | Shape * | s | ) | [inline] |
Definition at line 177 of file mesher2d.hpp.
References Seq< C, R >::push_back().
bcell< C, V > * get_input_cell | ( | ) | [inline] |
Definition at line 183 of file mesher2d.hpp.
References Seq< C, R >::size().
Referenced by mesher2d< C, V >::run().
Output* get_output | ( | void | ) | [inline] |
Definition at line 94 of file mesher2d.hpp.
Referenced by mesher2d< C, V >::insert_regular(), mesher2d< C, V >::insert_singular(), semialgebraic2d< C, V >::run(), mesher2d< C, V >::run(), and arrangement2d< C, V >::run().
double get_precision | ( | void | ) | [inline] |
Definition at line 86 of file mesher2d.hpp.
Referenced by mesher2d< C, V >::run().
double get_smoothness | ( | void | ) | [inline] |
Definition at line 85 of file mesher2d.hpp.
Referenced by mesher2d< C, V >::run().
bool insert_regular | ( | Cell * | bcell | ) | [inline, protected] |
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 294 of file mesher2d.hpp.
References mesher2d< C, V >::get_output(), and bcell< C, V >::insert_regular().
00294 { 00295 return cl->insert_regular(this->get_output()); 00296 }
bool insert_singular | ( | Cell * | bcell | ) | [inline, protected] |
Definition at line 299 of file mesher2d.hpp.
References mesher2d< C, V >::get_output(), and bcell< C, V >::insert_singular().
00299 { 00300 return cl->insert_singular(this->get_output()) ; 00301 }
void insert_singular | ( | Point * | p | ) | [inline, virtual] |
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 304 of file mesher2d.hpp.
References mesher2d< C, V >::m_specials.
Referenced by mesher2d< C, V >::run().
00304 { 00305 m_specials<<p; 00306 }
bool is_regular | ( | Cell * | bcell | ) | [inline, protected] |
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 289 of file mesher2d.hpp.
References cell< C, V >::is_regular().
Referenced by mesher2d< C, V >::run().
void run | ( | void | ) | [inline] |
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 190 of file mesher2d.hpp.
References mesher2d< C, V >::b_leaves, Seq< C, R >::clear(), Graph< T >::dfs(), bcell2d< C, V >::e_neighbors, node< _CELL >::get_cell(), mesher2d< C, V >::get_input_cell(), mesher2d< C, V >::get_output(), mesher2d< C, V >::get_precision(), mesher2d< C, V >::get_smoothness(), tpl3d< C, V >::insert_regular(), mesher2d< C, V >::insert_singular(), cell< C, V >::is_active(), bcell2d< C, V >::is_border(), mesher2d< C, V >::is_regular(), bcell2d< C, V >::m_gnode, mesher2d< C, V >::m_leaves, mesher2d< C, V >::m_nodes, Seq< C, R >::member(), bcell2d< C, V >::n_neighbors, Graph< T >::push_edge(), Graph< T >::push_vertex(), kdtree< CELL >::root(), bcell2d< C, V >::s_neighbors, node< _CELL >::set_cell(), Seq< C, R >::size(), bounding_box< C, V >::size(), mesher2d< C, V >::subdivide(), and bcell2d< C, V >::w_neighbors.
00190 { 00191 00192 Node* root = m_tree->root() ; 00193 00194 //std::cout<<"Running, objs="<<this->m_input_objects.size() << std::endl; 00195 00196 Cell* cl = this->get_input_cell(); 00197 // Cell2dFactory::instance()->create(this->m_objects,this->m_bbx); 00198 00199 root->set_cell( (Cell*)cl ) ; 00200 this->m_nodes.push_back(root) ; 00201 00202 //std::cout<<"RUNing "<< cl <<std::endl; 00203 00204 // double maxsz = this->m_maxprec*m_tree->root()->get_cell()->size(); 00205 // double minsz = this->m_minprec*m_tree->root()->get_cell()->size(); 00206 double maxsz = this->get_smoothness(); 00207 double minsz = this->get_precision(); 00208 00209 while(!m_nodes.empty() ) { // 00210 Node * node = m_nodes.front() ; 00211 Cell * cl = node->get_cell() ; 00212 Cell2d * cl2= dynamic_cast<Cell2d*>(cl); 00213 00214 //std::cout<<"node "<<cl->size()<<std::endl; 00215 00216 if(cl->is_active()) { 00217 00218 //std::cout<<"active.. "<<std::endl; 00219 00220 if(cl->size() > maxsz) 00221 { 00222 //std::cout<<"subdivide "<<cl->size()<<std::endl; 00223 this->subdivide(cl, node) ; 00224 } 00225 else if(this->is_regular(cl) )// && cl->is_intersected()) 00226 { 00227 //std::cout<<"ins regular "<<std::endl; 00228 this->get_output()->insert_regular(cl) ; 00229 //std::cout<<"ok "<<std::endl; 00230 cl2->m_gnode= 00231 this->m_leaves.push_vertex(cl2); 00232 if ( cl2->is_border() ) 00233 this->b_leaves.push_vertex(cl2); 00234 } 00235 else if(cl->size() > minsz) 00236 { 00237 //std::cout<<"subdivide "<<cl->size()<<std::endl; 00238 this->subdivide(cl, node) ; 00239 } 00240 else 00241 { 00242 this->insert_singular(cl) ; 00243 cl2->m_gnode= 00244 this->m_leaves.push_vertex(cl2); 00245 if ( cl2->is_border() ) 00246 this->b_leaves.push_vertex(cl2); 00247 } 00248 } 00249 else //inactive leaf -- end if 00250 { 00251 // cl2->m_gnode= 00252 // this->m_leaves.push_vertex(cl2); 00253 if ( cl2->is_border() ) 00254 this->b_leaves.push_vertex(cl2); 00255 } 00256 this->m_nodes.pop_front() ; 00257 } 00258 00259 /* add edges */ 00260 Seq<Cell2d*> nlist; 00261 00262 //std::cout<<"border " << std::endl; 00263 // Border graph 00264 this->b_leaves.dfs(nlist); 00265 foreach(Cell2d* cl2, nlist) 00266 { 00267 if (cl2->s_neighbors.size()==0) 00268 foreach(Cell2d* nb, cl2->e_neighbors ) 00269 if (nlist.member(nb) && nb->s_neighbors.size()==0) 00270 this->b_leaves.push_edge( cl2,nb ) ; 00271 if (cl2->e_neighbors.size()==0) 00272 foreach(Cell2d* nb, cl2->n_neighbors ) 00273 if (nlist.member(nb) && nb->e_neighbors.size()==0) 00274 this->b_leaves.push_edge( cl2,nb ) ; 00275 if (cl2->n_neighbors.size()==0) 00276 foreach(Cell2d* nb, cl2->w_neighbors ) 00277 if (nlist.member(nb)&& nb->n_neighbors.size()==0) 00278 this->b_leaves.push_edge( cl2,nb ) ; 00279 if (cl2->w_neighbors.size()==0) 00280 foreach(Cell2d* nb, cl2->s_neighbors ) 00281 if (nlist.member(nb)&& nb->w_neighbors.size()==0) 00282 this->b_leaves.push_edge( cl2,nb ) ; 00283 } 00284 nlist.clear(); 00285 }
void set_input_bbox | ( | const BoundingBox & | bx | ) | [inline] |
Definition at line 170 of file mesher2d.hpp.
References bounding_box< C, V >::set_zmax(), and bounding_box< C, V >::set_zmin().
void set_precision | ( | double | e | ) | [inline] |
Definition at line 83 of file mesher2d.hpp.
void set_smoothness | ( | double | e | ) | [inline] |
Definition at line 82 of file mesher2d.hpp.
typedef SHAPE_OF | ( | V | ) |
Reimplemented in arrangement2d< C, V >, and semialgebraic2d< C, V >.
Definition at line 309 of file mesher2d.hpp.
References node< _CELL >::LEFT, mmx::ssi::left(), node< _CELL >::m_left, mesher2d< C, V >::m_nodes, node< _CELL >::m_right, node< _CELL >::RIGHT, mmx::ssi::right(), and bcell< C, V >::subdivide().
Referenced by mesher2d< C, V >::run().
00309 { 00310 int v=0; 00311 00312 Cell* left, * right; 00313 v = cl->subdivide(left, right) ; 00314 00315 node->m_left = new Node(node, left, Node::LEFT, v); 00316 m_nodes << node->m_left ; 00317 node->m_right = new Node(node, right, Node::RIGHT, v); 00318 m_nodes << node->m_right; 00319 00320 return true ; 00321 }
Definition at line 130 of file mesher2d.hpp.
Referenced by semialgebraic2d< C, V >::run(), mesher2d< C, V >::run(), and arrangement2d< C, V >::run().
Definition at line 128 of file mesher2d.hpp.
Definition at line 129 of file mesher2d.hpp.
Referenced by semialgebraic2d< C, V >::run(), mesher2d< C, V >::run(), and arrangement2d< C, V >::run().
Definition at line 110 of file mesher2d.hpp.
Referenced by mesher2d< C, V >::run(), and mesher2d< C, V >::subdivide().
Definition at line 140 of file mesher2d.hpp.
Referenced by semialgebraic2d< C, V >::insert_singular(), mesher2d< C, V >::insert_singular(), and arrangement2d< C, V >::insert_singular().