Changes in src/World.cpp [4f2895:46ce1c]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/World.cpp
r4f2895 r46ce1c 245 245 WorldTime::getInstance().setTime(_step); 246 246 247 // TODO: removed when BondGraph creates the adjacency 248 // 3. remove all of World's molecules 249 for (MoleculeIterator iter = getMoleculeIter(); 250 getMoleculeIter() != moleculeEnd(); 251 iter = getMoleculeIter()) { 252 getMolecules()->erase(*iter); 253 destroyMolecule(*iter); 254 } 255 247 256 // 4. scan for connected subgraphs => molecules 248 257 DepthFirstSearchAnalysis DFS; … … 295 304 296 305 void World::destroyMolecule(molecule* mol){ 306 OBSERVE; 297 307 ASSERT(mol,"Molecule that was meant to be destroyed did not exist"); 298 308 destroyMolecule(mol->getId()); … … 309 319 } 310 320 mol->signOff(this); 311 // TODO: removed when depcreated MoleculeListClass is gone312 molecules_deprecated->erase(mol);313 321 DeleteMolecule(mol); 314 322 if (isMoleculeSelected(id)) … … 357 365 NOTIFY(AtomRemoved); 358 366 } 359 // check if it's the last atom360 molecule *_mol = atom->getMolecule();361 if ((_mol == NULL) || (_mol->getAtomCount() > 1))362 _mol = NULL;363 367 DeleteAtom(atom); 364 368 if (isAtomSelected(id)) … … 366 370 atoms.erase(id); 367 371 atomIdPool.releaseId(id); 368 // remove molecule if empty369 if (_mol != NULL)370 destroyMolecule(_mol);371 372 } 372 373 … … 554 555 std::for_each(invertedSelection.begin(),invertedSelection.end(), 555 556 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();570 557 } 571 558 … … 698 685 std::for_each(invertedSelection.begin(),invertedSelection.end(), 699 686 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();714 687 } 715 688
Note:
See TracChangeset
for help on using the changeset viewer.