Changeset 1b07b1 for src/UIElements/Qt4/InstanceBoard
- Timestamp:
- Feb 14, 2016, 12:34:28 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:
- 62a0ee
- Parents:
- e7ed12
- git-author:
- Frederik Heber <heber@…> (01/06/16 17:34:22)
- git-committer:
- Frederik Heber <heber@…> (02/14/16 12:34:28)
- Location:
- src/UIElements/Qt4/InstanceBoard
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.cpp
re7ed12 r1b07b1 75 75 _1)), 76 76 lastremovedatom((atomId_t)-1), 77 lastremovedatomsmolecule( std::make_pair((moleculeId_t)-1,(atomId_t)-1) ),78 77 lastremovedmolecule((moleculeId_t)-1) 79 78 { … … 169 168 MoleculeSignedOn.insert( static_cast<Observable *>(const_cast<molecule *>(_molecule)) ); 170 169 171 emit moleculeInserted( _id);170 emit moleculeInserted(observedmolecule); 172 171 } else { 173 172 ELOG(1, "QtObservedInstanceBoard got MoleculeInserted for unknown molecule id " << _id); … … 206 205 _atom->signOn(this, atom::IndexChanged); 207 206 AtomSignedOn.insert( static_cast<Observable *>(const_cast<atom *>(_atom)) ); 208 emit atomInserted(observedatom ->getAtomMoleculeIndex(), observedatom->getAtomIndex());207 emit atomInserted(observedatom); 209 208 } else { 210 209 ELOG(1, "QtObservedInstanceBoard got AtomInserted for unknown atom id " << _id); … … 227 226 const moleculeId_t molid = const_cast<const World &>(World::getInstance()).lastChangedMolId(); 228 227 switch (notification->getChannelNo()) { 229 case molecule::AtomInserted:230 {231 const molecule * const _molecule = const_cast<const World &>(World::getInstance()).232 getMolecule(MoleculeById(molid));233 if (_molecule != NULL) {234 const atomId_t atomid = const_cast<const molecule *>(_molecule)->lastChangedAtomId();235 LOG(3, "DEBUG: InformationBoard got AtomInserted signal for atom "236 << atomid << " from molecule " << molid);237 // check whether atom's observedvalues are present238 ASSERT( atomObservedValues.isPresent(atomid),239 "QtObservedInstanceBoard::recieveNotification() - ObservedValues for atom "240 +toString(atomid)+" are not present yet.");241 // and emit242 emit atomInserted(molid, atomid);243 } else {244 ELOG(2, "QtObservedInstanceBoard::recieveNotification() - molecule "245 << molid << " has disappeared.");246 }247 break;248 }249 case molecule::AtomRemoved:250 {251 const molecule * const _molecule = const_cast<const World &>(World::getInstance()).252 getMolecule(MoleculeById(molid));253 if (_molecule != NULL) {254 const atomId_t atomid = const_cast<const molecule *>(_molecule)->lastChangedAtomId();255 LOG(3, "DEBUG: InformationBoard got AtomRemoved signal for atom "256 << atomid << " from molecule " << molid);257 lastremovedatomsmolecule = std::make_pair(molid, atomid);258 }259 break;260 }261 228 case molecule::IndexChanged: 262 229 { … … 293 260 "QtObservedInstanceBoard::recieveNotification() - cannot change atom's id " 294 261 +toString(oldatomId)+" "+toString(newatomId)+" in atomObservedValues."); 295 // changed insertion delayed296 atomInsertionDelayed_t::iterator iter = atomInsertionDelayed.find(oldatomId);297 if (iter != atomInsertionDelayed.end()) {298 const moleculeId_t molid = iter->second;299 atomInsertionDelayed.erase(iter);300 #ifndef NDEBUG301 std::pair<atomInsertionDelayed_t::iterator, bool> inserter =302 #endif303 atomInsertionDelayed.insert( std::make_pair(newatomId, molid) );304 ASSERT( inserter.second,305 "QtObservedInstanceBoard::recieveNotification() - id "306 +toString(newatomId)+" already present in atomInsertionDelayed.");307 }308 262 // no need update SignedOn, ref does not change 309 263 emit atomIndexChanged(oldatomId, newatomId); … … 321 275 void QtObservedInstanceBoard::atomcountsubjectKilled(const atomId_t _atomid) 322 276 { 323 if ((_atomid == lastremovedatom smolecule.second) && (_atomid == lastremovedatom)) {277 if ((_atomid == lastremovedatom)) { 324 278 LOG(3, "DEBUG: InstanceBoard emits atomRemoved for " << _atomid); 325 emit atomRemoved(lastremovedatom smolecule.first, lastremovedatomsmolecule.second);279 emit atomRemoved(lastremovedatom); 326 280 } else 327 281 ELOG(2, "QtObservedInstanceBoard::atomcountsubjectKilled() - id " << _atomid 328 << " not fitting with " << lastremovedatom smolecule << " or " << lastremovedatom);282 << " not fitting with " << lastremovedatom); 329 283 } 330 284 -
src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp
re7ed12 r1b07b1 89 89 90 90 signals: 91 void atomInserted( const moleculeId_t _molid, const atomId_t _atomid);92 void atomRemoved(const moleculeId_t _molid, constatomId_t _atomid);91 void atomInserted(QtObservedAtom::ptr _atom); 92 void atomRemoved(const atomId_t _atomid); 93 93 void atomIndexChanged(const atomId_t _oldid, const atomId_t _newid); 94 void moleculeInserted( const moleculeId_t _molid);94 void moleculeInserted(QtObservedMolecule::ptr _mol); 95 95 void moleculeRemoved(const moleculeId_t _molid); 96 96 void moleculeIndexChanged(const moleculeId_t _oldid, const moleculeId_t _newid); … … 143 143 atomId_t lastremovedatom; 144 144 145 //!> note down atom id of last removed atom to drop its ObservedValues146 std::pair<moleculeId_t, atomId_t> lastremovedatomsmolecule;147 148 145 //!> note down molecule id of last removed molecule to drop its ObservedValues 149 146 moleculeId_t lastremovedmolecule; -
src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.cpp
re7ed12 r1b07b1 201 201 { 202 202 const atomId_t _id = _molecule->lastChangedAtomId(); 203 QtObservedAtom::ptr _atom = board.getObservedAtom(_id); 203 204 emit atomcountChanged(); 204 emit atomInserted(_ id);205 emit atomInserted(_atom); 205 206 emit bondcountChanged(); 206 207 emit boundingboxChanged(); -
src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp
re7ed12 r1b07b1 28 28 #include "UIElements/Qt4/InstanceBoard/ObservedValue_types.hpp" 29 29 #include "UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp" 30 #include "UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp" 30 31 #include "types.hpp" 31 32 … … 146 147 void tesselationhullChanged(); 147 148 void boundingboxChanged(); 148 void atomInserted( const atomId_t);149 void atomInserted(QtObservedAtom::ptr); 149 150 void atomRemoved(const atomId_t); 150 151 void moleculeRemoved();
Note:
See TracChangeset
for help on using the changeset viewer.