Changeset 69643a


Ignore:
Timestamp:
Apr 6, 2012, 11:57:21 AM (13 years ago)
Author:
Frederik Heber <heber@…>
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:
8a77ac
Parents:
6e6b90
git-author:
Michael Ankele <ankele@…> (03/29/12 11:11:02)
git-committer:
Frederik Heber <heber@…> (04/06/12 11:57:21)
Message:

World: made selection changes observable

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/World.cpp

    r6e6b90 r69643a  
    414414
    415415void World::clearAtomSelection(){
     416  OBSERVE;
     417  NOTIFY(SelectionChanged);
    416418  selectedAtoms.clear();
    417419}
     
    433435
    434436void World::selectAtom(const atom *_atom){
     437  OBSERVE;
     438  NOTIFY(SelectionChanged);
    435439  // atom * is unchanged in this function, but we do store entity as changeable
    436440  ASSERT(_atom,"Invalid pointer in selection of atom");
     
    439443
    440444void World::selectAtom(const atomId_t id){
     445  OBSERVE;
     446  NOTIFY(SelectionChanged);
    441447  ASSERT(atoms.count(id),"Atom Id selected that was not in the world");
    442448  selectedAtoms[id]=atoms[id];
     
    444450
    445451void World::selectAllAtoms(AtomDescriptor descr){
     452  OBSERVE;
     453  NOTIFY(SelectionChanged);
    446454  internal_AtomIterator begin = getAtomIter_internal(descr);
    447455  internal_AtomIterator end = atomEnd_internal();
     
    451459
    452460void World::selectAtomsOfMolecule(const molecule *_mol){
     461  OBSERVE;
     462  NOTIFY(SelectionChanged);
    453463  ASSERT(_mol,"Invalid pointer to molecule in selection of Atoms of Molecule");
    454464  // need to make it const to get the fast iterators
     
    459469
    460470void World::selectAtomsOfMolecule(const moleculeId_t id){
     471  OBSERVE;
     472  NOTIFY(SelectionChanged);
    461473  ASSERT(molecules.count(id),"No molecule with the given id upon Selection of atoms from molecule");
    462474  selectAtomsOfMolecule(molecules[id]);
     
    464476
    465477void World::unselectAtom(const atom *_atom){
     478  OBSERVE;
     479  NOTIFY(SelectionChanged);
    466480  ASSERT(_atom,"Invalid pointer in unselection of atom");
    467481  unselectAtom(_atom->getId());
     
    469483
    470484void World::unselectAtom(const atomId_t id){
     485  OBSERVE;
     486  NOTIFY(SelectionChanged);
    471487  ASSERT(atoms.count(id),"Atom Id unselected that was not in the world");
    472488  selectedAtoms.erase(id);
     
    474490
    475491void World::unselectAllAtoms(AtomDescriptor descr){
     492  OBSERVE;
     493  NOTIFY(SelectionChanged);
    476494  internal_AtomIterator begin = getAtomIter_internal(descr);
    477495  internal_AtomIterator end = atomEnd_internal();
     
    481499
    482500void World::unselectAtomsOfMolecule(const molecule *_mol){
     501  OBSERVE;
     502  NOTIFY(SelectionChanged);
    483503  ASSERT(_mol,"Invalid pointer to molecule in selection of Atoms of Molecule");
    484504  // need to make it const to get the fast iterators
     
    489509
    490510void World::unselectAtomsOfMolecule(const moleculeId_t id){
     511  OBSERVE;
     512  NOTIFY(SelectionChanged);
    491513  ASSERT(molecules.count(id),"No molecule with the given id upon Selection of atoms from molecule");
    492514  unselectAtomsOfMolecule(molecules[id]);
     
    521543
    522544void World::clearMoleculeSelection(){
     545  OBSERVE;
     546  NOTIFY(SelectionChanged);
    523547  selectedMolecules.clear();
    524548}
     
    541565
    542566void World::selectMolecule(const molecule *_mol){
     567  OBSERVE;
     568  NOTIFY(SelectionChanged);
    543569  // molecule * is unchanged in this function, but we do store entity as changeable
    544570  ASSERT(_mol,"Invalid pointer to molecule in selection");
     
    547573
    548574void World::selectMolecule(const moleculeId_t id){
     575  OBSERVE;
     576  NOTIFY(SelectionChanged);
    549577  ASSERT(molecules.count(id),"Molecule Id selected that was not in the world");
    550578  selectedMolecules[id]=molecules[id];
     
    552580
    553581void World::selectAllMolecules(MoleculeDescriptor descr){
     582  OBSERVE;
     583  NOTIFY(SelectionChanged);
    554584  internal_MoleculeIterator begin = getMoleculeIter_internal(descr);
    555585  internal_MoleculeIterator end = moleculeEnd_internal();
     
    559589
    560590void World::selectMoleculeOfAtom(const atom *_atom){
     591  OBSERVE;
     592  NOTIFY(SelectionChanged);
    561593  ASSERT(_atom,"Invalid atom pointer in selection of MoleculeOfAtom");
    562594  molecule *mol=_atom->getMolecule();
     
    568600
    569601void World::selectMoleculeOfAtom(const atomId_t id){
     602  OBSERVE;
     603  NOTIFY(SelectionChanged);
    570604  ASSERT(atoms.count(id),"No such atom with given ID in selection of Molecules of Atom");\
    571605  selectMoleculeOfAtom(atoms[id]);
     
    573607
    574608void World::unselectMolecule(const molecule *_mol){
     609  OBSERVE;
     610  NOTIFY(SelectionChanged);
    575611  ASSERT(_mol,"invalid pointer in unselection of molecule");
    576612  unselectMolecule(_mol->getId());
     
    578614
    579615void World::unselectMolecule(const moleculeId_t id){
     616  OBSERVE;
     617  NOTIFY(SelectionChanged);
    580618  ASSERT(molecules.count(id),"No such molecule with ID in unselection");
    581619  selectedMolecules.erase(id);
     
    583621
    584622void World::unselectAllMolecules(MoleculeDescriptor descr){
     623  OBSERVE;
     624  NOTIFY(SelectionChanged);
    585625  internal_MoleculeIterator begin = getMoleculeIter_internal(descr);
    586626  internal_MoleculeIterator end = moleculeEnd_internal();
     
    590630
    591631void World::unselectMoleculeOfAtom(const atom *_atom){
     632  OBSERVE;
     633  NOTIFY(SelectionChanged);
    592634  ASSERT(_atom,"Invalid atom pointer in selection of MoleculeOfAtom");
    593635  molecule *mol=_atom->getMolecule();
     
    599641
    600642void World::unselectMoleculeOfAtom(const atomId_t id){
     643  OBSERVE;
     644  NOTIFY(SelectionChanged);
    601645  ASSERT(atoms.count(id),"No such atom with given ID in selection of Molecules of Atom");\
    602646  unselectMoleculeOfAtom(atoms[id]);
  • TabularUnified src/World.hpp

    r6e6b90 r69643a  
    118118    MoleculeRemoved,
    119119    MoleculeChanged,
     120    SelectionChanged,
    120121    NotificationType_MAX
    121122  };
Note: See TracChangeset for help on using the changeset viewer.