Changes in src/World.cpp [46ce1c:4f2895]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/World.cpp
r46ce1c r4f2895 245 245 WorldTime::getInstance().setTime(_step); 246 246 247 // TODO: removed when BondGraph creates the adjacency248 // 3. remove all of World's molecules249 for (MoleculeIterator iter = getMoleculeIter();250 getMoleculeIter() != moleculeEnd();251 iter = getMoleculeIter()) {252 getMolecules()->erase(*iter);253 destroyMolecule(*iter);254 }255 256 247 // 4. scan for connected subgraphs => molecules 257 248 DepthFirstSearchAnalysis DFS; … … 304 295 305 296 void World::destroyMolecule(molecule* mol){ 306 OBSERVE;307 297 ASSERT(mol,"Molecule that was meant to be destroyed did not exist"); 308 298 destroyMolecule(mol->getId()); … … 319 309 } 320 310 mol->signOff(this); 311 // TODO: removed when depcreated MoleculeListClass is gone 312 molecules_deprecated->erase(mol); 321 313 DeleteMolecule(mol); 322 314 if (isMoleculeSelected(id)) … … 365 357 NOTIFY(AtomRemoved); 366 358 } 359 // check if it's the last atom 360 molecule *_mol = atom->getMolecule(); 361 if ((_mol == NULL) || (_mol->getAtomCount() > 1)) 362 _mol = NULL; 367 363 DeleteAtom(atom); 368 364 if (isAtomSelected(id)) … … 370 366 atoms.erase(id); 371 367 atomIdPool.releaseId(id); 368 // remove molecule if empty 369 if (_mol != NULL) 370 destroyMolecule(_mol); 372 371 } 373 372 … … 555 554 std::for_each(invertedSelection.begin(),invertedSelection.end(), 556 555 std::bind1st(std::mem_fun(selector),this)); // func is select... see above 556 } 557 558 void World::popAtomSelection(){ 559 OBSERVE; 560 NOTIFY(SelectionChanged); 561 selectedAtoms = selectedAtoms_Stack.top(); 562 selectedAtoms_Stack.pop(); 563 } 564 565 void World::pushAtomSelection(){ 566 OBSERVE; 567 NOTIFY(SelectionChanged); 568 selectedAtoms_Stack.push( selectedAtoms ); 569 selectedAtoms.clear(); 557 570 } 558 571 … … 685 698 std::for_each(invertedSelection.begin(),invertedSelection.end(), 686 699 std::bind1st(std::mem_fun(selector),this)); // func is select... see above 700 } 701 702 void World::popMoleculeSelection(){ 703 OBSERVE; 704 NOTIFY(SelectionChanged); 705 selectedMolecules = selectedMolecules_Stack.top(); 706 selectedMolecules_Stack.pop(); 707 } 708 709 void World::pushMoleculeSelection(){ 710 OBSERVE; 711 NOTIFY(SelectionChanged); 712 selectedMolecules_Stack.push( selectedMolecules ); 713 selectedMolecules.clear(); 687 714 } 688 715
Note:
See TracChangeset
for help on using the changeset viewer.