Changeset 96e145 for src/UIElements
- Timestamp:
- Feb 26, 2016, 9:46:18 AM (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:
- 92af1b
- Parents:
- bcf9cd
- git-author:
- Frederik Heber <heber@…> (01/27/16 21:29:01)
- git-committer:
- Frederik Heber <heber@…> (02/26/16 09:46:18)
- Location:
- src/UIElements
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.cpp
rbcf9cd r96e145 227 227 QtObservedAtom::ptr _atom = board.getObservedAtom(_id); 228 228 emit atomcountChanged(); 229 emit atomInserted(_atom );229 emit atomInserted(_atom, this); 230 230 emit bondcountChanged(); 231 231 emit boundingboxChanged(); … … 245 245 const atomId_t _id = _molecule->lastChangedAtomId(); 246 246 emit atomcountChanged(); 247 emit atomRemoved(_id );247 emit atomRemoved(_id, this); 248 248 emit bondcountChanged(); 249 249 emit boundingboxChanged(); -
src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp
rbcf9cd r96e145 149 149 void tesselationhullChanged(); 150 150 void boundingboxChanged(); 151 void atomInserted(QtObservedAtom::ptr );152 void atomRemoved(const atomId_t );151 void atomInserted(QtObservedAtom::ptr, QtObservedMolecule *); 152 void atomRemoved(const atomId_t, QtObservedMolecule *); 153 153 void moleculeRemoved(); 154 154 void selectedChanged(); -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
rbcf9cd r96e145 194 194 * @param _atom atom to insert 195 195 */ 196 void GLWorldScene::moleculesAtomInserted(QtObservedAtom::ptr _atom )196 void GLWorldScene::moleculesAtomInserted(QtObservedAtom::ptr _atom, QtObservedMolecule * _mol) 197 197 { 198 198 const atomId_t atomid = _atom->getAtomIndex(); … … 202 202 // check of molecule is already present 203 203 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 204 MoleculeNodeMap::iterator moliter = MoleculesinSceneMap.find(molid);204 const MoleculeNodeMap::iterator moliter = MoleculesinSceneMap.find(molid); 205 205 if (moliter != MoleculesinSceneMap.end()) { 206 LOG(3, "INFO: GLWorldScene: Sending signal moleculesAtomInserted for atom "+toString(atomid)+"."); 207 QMetaObject::invokeMethod(moliter->second, // pointer to a QObject 208 "atomInserted", // member name (no parameters here) 209 Qt::QueuedConnection, // connection type 210 Q_ARG(QtObservedAtom::ptr, _atom)); // parameters 206 // check that it is the right molecule 207 QtObservedMolecule::ptr &checkmol = moliter->second->ObservedMolecule; 208 if (checkmol.get() == _mol) { 209 LOG(3, "INFO: GLWorldScene: Sending signal moleculesAtomInserted for atom "+toString(atomid)+"."); 210 QMetaObject::invokeMethod(moliter->second, // pointer to a QObject 211 "atomInserted", // member name (no parameters here) 212 Qt::QueuedConnection, // connection type 213 Q_ARG(QtObservedAtom::ptr, _atom)); // parameters 214 } else { 215 // relay atomRemoved to GLMoleculeObject_molecule in RemovedMolecules 216 // LOG(3, "INFO: GLWorldScene: Sending signal moleculesAtomInserted for atom "+toString(_atomid) 217 // +" to molecule in RemovedMolecules."); 218 // const MoleculeNodeMap::iterator removedmoliter = RemovedMolecules.find(molid); 219 // ASSERT( removedmoliter != RemovedMolecules.end(), 220 // "GLWorldScene::moleculesAtomInserted() - signal from old mol " 221 // +toString(molid)+", but not present in RemovedMolecules"); 222 // QMetaObject::invokeMethod(removedmoliter->second, // pointer to a QObject 223 // "atomInserted ", // member name (no parameters here) 224 // Qt::QueuedConnection, // connection type 225 // Q_ARG(QtObservedAtom::ptr, _atom)); // parameters 226 ASSERT( 0, 227 "GLWorldScene::moleculesAtomInserted() - would need to send atomInserted to already removed molecule."); 228 } 211 229 } else { 212 230 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex); … … 231 249 * @param _atomid atom to remove 232 250 */ 233 void GLWorldScene::moleculesAtomRemoved(const atomId_t _atomid )251 void GLWorldScene::moleculesAtomRemoved(const atomId_t _atomid, QtObservedMolecule * _mol) 234 252 { 235 253 LOG(3, "INFO: GLWorldScene: Received signal atomRemoved for atom "+toString(_atomid)+"."); … … 241 259 // check of molecule is already present 242 260 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 243 MoleculeNodeMap::iterator moliter = MoleculesinSceneMap.find(molid);261 const MoleculeNodeMap::iterator moliter = MoleculesinSceneMap.find(molid); 244 262 if (moliter != MoleculesinSceneMap.end()) { 245 LOG(3, "INFO: GLWorldScene: Sending signal moleculesAtomRemoved for atom "+toString(_atomid)+"."); 246 QMetaObject::invokeMethod(moliter->second, // pointer to a QObject 247 "atomRemoved", // member name (no parameters here) 248 Qt::QueuedConnection, // connection type 249 Q_ARG(const atomId_t, _atomid)); // parameters 263 QtObservedMolecule::ptr &checkmol = moliter->second->ObservedMolecule; 264 if (checkmol.get() == _mol) { 265 LOG(3, "INFO: GLWorldScene: Sending signal moleculesAtomRemoved for atom "+toString(_atomid)+"."); 266 QMetaObject::invokeMethod(moliter->second, // pointer to a QObject 267 "atomRemoved", // member name (no parameters here) 268 Qt::QueuedConnection, // connection type 269 Q_ARG(const atomId_t, _atomid)); // parameters 270 } else { 271 // relay atomRemoved to GLMoleculeObject_molecule in RemovedMolecules 272 LOG(3, "INFO: GLWorldScene: Sending signal moleculesAtomRemoved for atom "+toString(_atomid) 273 +" to molecule in RemovedMolecules."); 274 const MoleculeNodeMap::iterator removedmoliter = RemovedMolecules.find(molid); 275 ASSERT( removedmoliter != RemovedMolecules.end(), 276 "GLWorldScene::moleculesAtomRemoved() - signal from old mol " 277 +toString(molid)+", but not present in RemovedMolecules"); 278 QMetaObject::invokeMethod(removedmoliter->second, // pointer to a QObject 279 "atomRemoved", // member name (no parameters here) 280 Qt::QueuedConnection, // connection type 281 Q_ARG(const atomId_t, _atomid)); // parameters 282 } 250 283 } else { 251 284 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex); … … 267 300 // sign on to QtObservedMolecule to get atomInserted/..Removed signals from same 268 301 // source as GLMoleculeObject_molecule would 269 connect(_mol.get(), SIGNAL(atomInserted(QtObservedAtom::ptr )),270 this, SLOT(moleculesAtomInserted(QtObservedAtom::ptr )) );271 connect(_mol.get(), SIGNAL(atomRemoved(const atomId_t )),272 this, SLOT(moleculesAtomRemoved(const atomId_t )) );302 connect(_mol.get(), SIGNAL(atomInserted(QtObservedAtom::ptr, QtObservedMolecule *)), 303 this, SLOT(moleculesAtomInserted(QtObservedAtom::ptr, QtObservedMolecule *)) ); 304 connect(_mol.get(), SIGNAL(atomRemoved(const atomId_t, QtObservedMolecule *)), 305 this, SLOT(moleculesAtomRemoved(const atomId_t, QtObservedMolecule *)) ); 273 306 const moleculeId_t molid = _mol->getMolIndex(); 274 307 ASSERT( QtObservedMoleculeMap.find(molid) == QtObservedMoleculeMap.end(), -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp
rbcf9cd r96e145 96 96 void moleculeSignOn(QtObservedMolecule::ptr); 97 97 void moleculeIndexChanged(const moleculeId_t _oldid, const moleculeId_t _newid); 98 void moleculesAtomRemoved(const atomId_t _atomid );99 void moleculesAtomInserted(QtObservedAtom::ptr );98 void moleculesAtomRemoved(const atomId_t _atomid, QtObservedMolecule * _mol); 99 void moleculesAtomInserted(QtObservedAtom::ptr, QtObservedMolecule *_mol); 100 100 void atomRemoved(const atomId_t _atomid); 101 101 void atomInserted(QtObservedAtom::ptr);
Note:
See TracChangeset
for help on using the changeset viewer.