Changeset e472eab for src/World.cpp
- Timestamp:
- Jul 25, 2010, 9:41:34 PM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 521bbf
- Parents:
- 8d4aa1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/World.cpp
r8d4aa1 re472eab 558 558 } 559 559 560 size_t World::countSelectedAtoms() {560 size_t World::countSelectedAtoms() const { 561 561 size_t count = 0; 562 for ( internal_AtomIterator iter = getAtomIter_internal(AllAtoms()); iter != atomEnd_internal(); ++iter)562 for (AtomSet::const_iterator iter = selectedAtoms.begin(); iter != selectedAtoms.end(); ++iter) 563 563 count++; 564 564 return count; 565 565 } 566 566 567 bool World::isSelected(atom *atom) {567 bool World::isSelected(atom *atom) const { 568 568 return selectedAtoms.find(atom->getId()) != selectedAtoms.end(); 569 569 } 570 571 const std::vector<atom *> World::getSelectedAtoms() const { 572 std::vector<atom *> returnAtoms; 573 returnAtoms.resize(countSelectedAtoms()); 574 int count = 0; 575 for (AtomSet::const_iterator iter = selectedAtoms.begin(); iter != selectedAtoms.end(); ++iter) 576 returnAtoms[count++] = iter->second; 577 return returnAtoms; 578 } 579 570 580 571 581 // Molecules … … 585 595 } 586 596 587 void World::selectAllMolecules s(MoleculeDescriptor descr){597 void World::selectAllMolecules(MoleculeDescriptor descr){ 588 598 internal_MoleculeIterator begin = getMoleculeIter_internal(descr); 589 599 internal_MoleculeIterator end = moleculeEnd_internal(); … … 616 626 } 617 627 618 void World::unselectAllMolecules s(MoleculeDescriptor descr){628 void World::unselectAllMolecules(MoleculeDescriptor descr){ 619 629 internal_MoleculeIterator begin = getMoleculeIter_internal(descr); 620 630 internal_MoleculeIterator end = moleculeEnd_internal(); … … 637 647 } 638 648 639 size_t World::countSelectedMolecules() {649 size_t World::countSelectedMolecules() const { 640 650 size_t count = 0; 641 for ( internal_MoleculeIterator iter = getMoleculeIter_internal(AllMolecules()); iter != moleculeEnd_internal(); ++iter)651 for (MoleculeSet::const_iterator iter = selectedMolecules.begin(); iter != selectedMolecules.end(); ++iter) 642 652 count++; 643 653 return count; 644 654 } 645 655 646 bool World::isSelected(molecule *mol) {656 bool World::isSelected(molecule *mol) const { 647 657 return selectedMolecules.find(mol->getId()) != selectedMolecules.end(); 658 } 659 660 const std::vector<molecule *> World::getSelectedMolecules() const { 661 std::vector<molecule *> returnMolecules; 662 returnMolecules.resize(countSelectedMolecules()); 663 int count = 0; 664 for (MoleculeSet::const_iterator iter = selectedMolecules.begin(); iter != selectedMolecules.end(); ++iter) 665 returnMolecules[count++] = iter->second; 666 return returnMolecules; 648 667 } 649 668
Note:
See TracChangeset
for help on using the changeset viewer.