Changeset 1211 for applications/robust
- Timestamp:
- 10/04/10 15:09:42 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/robustlib.h
r1208 r1211 58 58 vector<polyhedron*> neutralchildren; 59 59 60 vector<polyhedron*> totallyneutralgrandchildren; 61 62 vector<polyhedron*> totallyneutralchildren; 63 60 64 bool totally_neutral; 61 65 … … 261 265 262 266 void send_state_message(polyhedron* sender, bool shouldsplit, bool shouldmerge, int level) 263 { 267 { 268 264 269 if(shouldsplit||shouldmerge) 265 270 { … … 332 337 if(shouldsplit) 333 338 { 339 current_parent->totallyneutralgrandchildren.insert(current_parent->totallyneutralgrandchildren.end(),sender->totallyneutralchildren.begin(),sender->totallyneutralchildren.end()); 340 334 341 switch(sender->get_state(SPLIT)) 335 342 { … … 348 355 current_parent->totally_neutral = current_parent->totally_neutral && sender->totally_neutral; 349 356 } 357 358 if(sender->totally_neutral) 359 { 360 current_parent->totallyneutralchildren.push_back(sender); 361 } 350 362 351 363 break; … … 357 369 if(is_last) 358 370 { 371 unique(current_parent->totallyneutralgrandchildren.begin(),current_parent->totallyneutralgrandchildren.end()); 372 359 373 if((current_parent->negativechildren.size()>0&¤t_parent->positivechildren.size()>0)|| 360 374 (current_parent->neutralchildren.size()>0&¤t_parent->totally_neutral==false)) … … 365 379 current_parent->set_state(0, SPLIT); 366 380 } 367 else if(current_parent->negativechildren.size()>0)381 else 368 382 { 369 current_parent->set_state(-1, SPLIT); 370 383 if(current_parent->negativechildren.size()>0) 384 { 385 current_parent->set_state(-1, SPLIT); 386 } 387 else if(current_parent->positivechildren.size()>0) 388 { 389 current_parent->set_state(1, SPLIT); 390 } 391 else 392 { 393 current_parent->raise_multiplicity(); 394 } 395 396 current_parent->positivechildren.clear(); 371 397 current_parent->negativechildren.clear(); 372 398 current_parent->neutralchildren.clear(); 373 374 } 375 else if(current_parent->positivechildren.size()>0) 376 { 377 current_parent->set_state(1, SPLIT); 378 379 current_parent->positivechildren.clear(); 380 current_parent->neutralchildren.clear(); 381 } 382 else 383 { 384 current_parent->raise_multiplicity(); 385 386 current_parent->neutralchildren.clear(); 399 current_parent->totallyneutralchildren.clear(); 400 current_parent->totallyneutralgrandchildren.clear(); 401 current_parent->totally_neutral = NULL; 387 402 } 388 403 } … … 508 523 if(should_add) 509 524 { 510 current_vertex->set_state(toadd*appended_vec,SPLIT); 525 double local_condition = toadd*appended_vec; 526 527 current_vertex->set_state(local_condition,SPLIT); 528 529 if(local_condition == 0) 530 { 531 current_vertex->totally_neutral = true; 532 533 current_vertex->multiplicity++; 534 } 511 535 } 512 536 513 537 if(should_remove) 514 538 { 515 current_vertex->set_state(toremove*current_vertex->get_coordinates(),MERGE); 516 } 517 518 if(current_vertex->get_state(MERGE) == 0) 519 { 520 for_merging[0].push_back(current_vertex); 521 } 539 double local_condition = toremove*appended_vec; 540 541 current_vertex->set_state(local_condition,MERGE); 542 543 if(local_condition == 0) 544 { 545 for_merging[0].push_back(current_vertex); 546 } 547 } 522 548 } 523 549 … … 533 559 polyhedron* current_polyhedron = (*vert_ref)[original_size-1-split_counter]; 534 560 535 561 536 562 } 537 563 }