Changeset 9e9100 for src/UIElements/Qt4/InstanceBoard/QtObservedAtom.cpp
- Timestamp:
- Feb 14, 2016, 12:33:42 PM (9 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:
- 5cd3a33
- Parents:
- 6d4925
- git-author:
- Frederik Heber <heber@…> (12/28/15 11:43:34)
- git-committer:
- Frederik Heber <heber@…> (02/14/16 12:33:42)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Qt4/InstanceBoard/QtObservedAtom.cpp
r6d4925 r9e9100 69 69 AtomObservable::NameChanged, 70 70 AtomObservable::ElementChanged, 71 AtomObservable::PositionChanged; 71 AtomObservable::PositionChanged, 72 AtomObservable::SelectionChanged; 72 73 return channels; 73 74 } … … 86 87 const Observable::channels_t 87 88 QtObservedAtom::AtomPositionChannels(1, AtomObservable::PositionChanged); 89 const Observable::channels_t 90 QtObservedAtom::AtomSelectedChannels(1, AtomObservable::SelectionChanged); 88 91 89 92 QtObservedAtom::QtObservedAtom( … … 112 115 boost::any_cast<ObservedValue_wCallback<std::string, atomId_t> *>(ObservedValues[AtomName])->noteCallBackIsGone(); 113 116 boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(ObservedValues[AtomPosition])->noteCallBackIsGone(); 117 boost::any_cast<ObservedValue_wCallback<bool, atomId_t> *>(ObservedValues[AtomSelected])->noteCallBackIsGone(); 114 118 115 119 deactivateObserver(); … … 196 200 } 197 201 202 bool QtObservedAtom::updateSelected( 203 const boost::function<const atomId_t ()> &_getAtomIndex) 204 { 205 const atom * const _atom = getAtomConst(_getAtomIndex()); 206 if (_atom != NULL) { 207 return _atom->getSelected(); 208 } else { 209 return false; 210 } 211 } 212 198 213 void QtObservedAtom::update(Observable *publisher) 199 214 { … … 240 255 case AtomObservable::PositionChanged: 241 256 emit positionChanged(); 257 break; 258 case AtomObservable::SelectionChanged: 259 emit selectedChanged(); 242 260 break; 243 261 default: … … 324 342 const boost::function<Vector ()> AtomPositionUpdater( 325 343 boost::bind(&QtObservedAtom::updatePosition, AtomIndexGetter)); 344 const boost::function<bool ()> AtomSelectedUpdater( 345 boost::bind(&QtObservedAtom::updateSelected, AtomIndexGetter)); 326 346 327 347 _ObservedValues[AtomBonds] = new ObservedValue_wCallback<ListOfBonds_t, atomId_t>( … … 363 383 AtomPositionUpdater(), 364 384 AtomPositionChannels, 385 _subjectKilled, 386 AtomIndexGetter); 387 _ObservedValues[AtomSelected] = new ObservedValue_wCallback<bool, atomId_t>( 388 _atomref, 389 AtomSelectedUpdater, 390 "AtomSelected_"+toString(_id), 391 AtomSelectedUpdater(), 392 AtomSelectedChannels, 365 393 _subjectKilled, 366 394 AtomIndexGetter); … … 376 404 delete boost::any_cast<ObservedValue_wCallback<std::string, atomId_t> *>(_ObservedValues[AtomName]); 377 405 delete boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(_ObservedValues[AtomPosition]); 406 delete boost::any_cast<ObservedValue_wCallback<bool, atomId_t> *>(_ObservedValues[AtomSelected]); 378 407 _ObservedValues.clear(); 379 408 } … … 408 437 return boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(ObservedValues[AtomPosition])->get(); 409 438 } 439 440 const bool QtObservedAtom::getAtomSelected() const 441 { 442 return boost::any_cast<ObservedValue_wCallback<bool, atomId_t> *>(ObservedValues[AtomSelected])->get(); 443 }
Note:
See TracChangeset
for help on using the changeset viewer.