Changeset e472eab
- Timestamp:
- Jul 25, 2010, 9:41:34 PM (14 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
- Location:
- src
- Files:
-
- 8 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Makefile.am
r8d4aa1 re472eab 114 114 115 115 SELECTIONACTIONSOURCE = \ 116 SelectionAction/AllAtomsAction.cpp \ 117 SelectionAction/AllMoleculesAction.cpp \ 116 118 SelectionAction/AtomByIdAction.cpp \ 117 119 SelectionAction/MoleculeByIdAction.cpp \ 120 SelectionAction/NotAllAtomsAction.cpp \ 121 SelectionAction/NotAllMoleculesAction.cpp \ 118 122 SelectionAction/NotAtomByIdAction.cpp \ 119 123 SelectionAction/NotMoleculeByIdAction.cpp 120 124 SELECTIONACTIONHEADER = \ 125 SelectionAction/AllAtomsAction.hpp \ 126 SelectionAction/AllMoleculesAction.hpp \ 121 127 SelectionAction/AtomByIdAction.hpp \ 122 128 SelectionAction/MoleculeByIdAction.hpp \ 129 SelectionAction/NotAllAtomsAction.hpp \ 130 SelectionAction/NotAllMoleculesAction.hpp \ 123 131 SelectionAction/NotAtomByIdAction.hpp \ 124 132 SelectionAction/NotMoleculeByIdAction.hpp -
src/Actions/MapOfActions.cpp
r8d4aa1 re472eab 64 64 #include "Actions/ParserAction/LoadXyzAction.hpp" 65 65 #include "Actions/ParserAction/SaveXyzAction.hpp" 66 #include "Actions/SelectionAction/AllAtomsAction.hpp" 67 #include "Actions/SelectionAction/AllMoleculesAction.hpp" 66 68 #include "Actions/SelectionAction/AtomByIdAction.hpp" 67 69 #include "Actions/SelectionAction/MoleculeByIdAction.hpp" 70 #include "Actions/SelectionAction/NotAllAtomsAction.hpp" 71 #include "Actions/SelectionAction/NotAllMoleculesAction.hpp" 68 72 #include "Actions/SelectionAction/NotAtomByIdAction.hpp" 69 73 #include "Actions/SelectionAction/NotMoleculeByIdAction.hpp" … … 236 240 DescriptionMap["periodic"] = "system is constraint to periodic boundary conditions (y/n)"; 237 241 DescriptionMap["position"] = "position in R^3 space"; 242 DescriptionMap["select-all-atoms"] = "select all atoms"; 243 DescriptionMap["select-all-molecules"] = "select all molecules"; 238 244 DescriptionMap["select-atom-by-id"] = "select an atom by index"; 239 245 DescriptionMap["select-molecule-by-id"] = "select a molecule by index"; 240 246 DescriptionMap["start-step"] = "first or start step"; 247 DescriptionMap["unselect-all-atoms"] = "unselect all atoms"; 248 DescriptionMap["unselect-all-molecules"] = "unselect all molecules"; 241 249 DescriptionMap["unselect-atom-by-id"] = "unselect an atom by index"; 242 250 DescriptionMap["unselect-molecule-by-id"] = "unselect a molecule by index"; … … 343 351 TypeMap["periodic"] = &typeid(bool); 344 352 TypeMap["position"] = &typeid(VectorValue); 353 TypeMap["select-all-atoms"] = &typeid(void); 354 TypeMap["select-all-molecules"] = &typeid(void); 345 355 TypeMap["select-atom-by-id"] = &typeid(atom); 346 356 TypeMap["select-molecule-by-id"] = &typeid(molecule); 347 357 TypeMap["start-step"] = &typeid(int); 358 TypeMap["unselect-all-atoms"] = &typeid(void); 359 TypeMap["unselect-all-molecules"] = &typeid(void); 348 360 TypeMap["unselect-atom-by-id"] = &typeid(atom); 349 361 TypeMap["unselect-molecule-by-id"] = &typeid(molecule); … … 475 487 generic.insert("save-temperature"); 476 488 generic.insert("scale-box"); 489 generic.insert("select-all-atoms"); 490 generic.insert("select-all-molecules"); 491 generic.insert("select-atom-by-id"); 492 generic.insert("select-molecule-by-id"); 477 493 generic.insert("set-basis"); 478 494 generic.insert("set-output"); … … 480 496 generic.insert("suspend-in-water"); 481 497 generic.insert("translate-mol"); 498 generic.insert("unselect-all-atoms"); 499 generic.insert("unselect-all-molecules"); 500 generic.insert("unselect-atom-by-id"); 501 generic.insert("unselect-molecule-by-id"); 482 502 generic.insert("verbose"); 483 503 generic.insert("verlet-integrate"); … … 507 527 hidden.insert("periodic"); 508 528 hidden.insert("position"); 509 hidden.insert("select-atom-by-id");510 hidden.insert("select-molecule-by-id");511 529 hidden.insert("start-step"); 512 hidden.insert("unselect-atom-by-id");513 hidden.insert("unselect-molecule-by-id");514 530 } 515 531 … … 790 806 new ParserSaveXyzAction(); 791 807 808 new SelectionAllAtomsAction(); 809 new SelectionAllMoleculesAction(); 792 810 new SelectionAtomByIdAction(); 793 811 new SelectionMoleculeByIdAction(); 812 new SelectionNotAllAtomsAction(); 813 new SelectionNotAllMoleculesAction(); 794 814 new SelectionNotAtomByIdAction(); 795 815 new SelectionNotMoleculeByIdAction(); -
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 -
src/World.hpp
r8d4aa1 re472eab 264 264 void unselectAtomsOfMolecule(molecule*); 265 265 void unselectAtomsOfMolecule(moleculeId_t); 266 size_t countSelectedAtoms(); 267 bool isSelected(atom *_atom); 266 size_t countSelectedAtoms() const; 267 bool isSelected(atom *_atom) const; 268 const std::vector<atom *> getSelectedAtoms() const; 268 269 269 270 void clearMoleculeSelection(); 270 271 void selectMolecule(molecule*); 271 272 void selectMolecule(moleculeId_t); 272 void selectAllMolecules s(MoleculeDescriptor);273 void selectAllMolecules(MoleculeDescriptor); 273 274 void selectMoleculeOfAtom(atom*); 274 275 void selectMoleculeOfAtom(atomId_t); 275 276 void unselectMolecule(molecule*); 276 277 void unselectMolecule(moleculeId_t); 277 void unselectAllMolecules s(MoleculeDescriptor);278 void unselectAllMolecules(MoleculeDescriptor); 278 279 void unselectMoleculeOfAtom(atom*); 279 280 void unselectMoleculeOfAtom(atomId_t); 280 size_t countSelectedMolecules(); 281 bool isSelected(molecule *_mol); 281 size_t countSelectedMolecules() const; 282 bool isSelected(molecule *_mol) const; 283 const std::vector<molecule *> getSelectedMolecules() const; 282 284 283 285 /******************** Iterators to selections *****************/
Note:
See TracChangeset
for help on using the changeset viewer.