Changeset 7c7c4a for src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
- Timestamp:
- Feb 12, 2016, 11:15:04 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:
- 2831b3
- Parents:
- e25448
- git-author:
- Frederik Heber <heber@…> (10/16/15 11:51:16)
- git-committer:
- Frederik Heber <heber@…> (02/12/16 23:15:04)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
re25448 r7c7c4a 91 91 } 92 92 connect(this, SIGNAL(moleculePreparedInserted(const moleculeId_t)), this, SLOT(moleculeInserted(const moleculeId_t))); 93 connect(this, SIGNAL(moleculePreparedRemoved(const moleculeId_t)), this, SLOT(moleculeRemoved(const moleculeId_t)));94 93 95 94 // connect(this, SIGNAL(updated()), this, SLOT(update())); … … 116 115 // moliter != molecules.end(); 117 116 // moliter++) { 117 // boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 118 118 // // check whether molecule already exists 119 119 // const moleculeId_t molid = (*moliter)->getId(); … … 123 123 // } 124 124 // 125 // boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 125 126 // MoleculeNodeMap::iterator iter = MoleculesinSceneMap.begin(); 126 127 // for (;iter != MoleculesinSceneMap.end();) { … … 182 183 void GLWorldScene::atomInserted(const moleculeId_t _molid, const atomId_t _atomid) 183 184 { 185 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex); 186 184 187 LOG(3, "INFO: GLWorldScene: Received signal atomInserted for atom "+toString(_atomid)+"."); 185 186 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex);187 188 188 189 // check of molecule is already present … … 268 269 269 270 // add new object 271 LOG(1, "DEBUG: Adding GLMoleculeObject_molecule to id " << _id); 270 272 GLMoleculeObject_molecule *molObject = 271 273 new GLMoleculeObject_molecule(GLMoleculeObject::meshEmpty, this, _id); … … 344 346 connect (molObject, SIGNAL(hoverChanged(const atomId_t)), this, SIGNAL(hoverChanged(const atomId_t))); 345 347 connect (molObject, SIGNAL(hoverChanged(const moleculeId_t, int)), this, SIGNAL(hoverChanged(const moleculeId_t, int))); 346 connect (molObject, SIGNAL(indexChanged(GLMoleculeObject_molecule *, const moleculeId_t, const moleculeId_t)), this, SLOT(changeMoleculeId(GLMoleculeObject_molecule *, const moleculeId_t, const moleculeId_t))); 348 connect (molObject, SIGNAL(hoverChanged(const moleculeId_t, int)), this, SIGNAL(hoverChanged(const moleculeId_t, int))); 349 connect (molObject, SIGNAL(InstanceRemoved(const moleculeId_t)), this, SLOT(moleculeRemoved(const moleculeId_t))); 347 350 348 351 emit changed(); … … 350 353 } 351 354 352 /** Prepares removinga molecule from the scene.353 * 354 * \sa moleculePrepareInserted()355 /** Removes a molecule from the scene. 356 * 357 * * \sa moleculePrepareRemoved() 355 358 * 356 359 * @param _id id of molecule to remove 357 360 */ 358 void GLWorldScene::molecule PrepareRemoved(const moleculeId_t _id)361 void GLWorldScene::moleculeRemoved(const moleculeId_t _id) 359 362 { 360 363 LOG(3, "INFO: GLWorldScene: Received signal moleculePrepareRemoved for molecule "+toString(_id)+"."); … … 363 366 364 367 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_id); 365 if ( iter == MoleculesinSceneMap.end()) 368 if ( iter == MoleculesinSceneMap.end()) { 366 369 RemovalMolecules.insert(_id); 367 368 emit moleculePreparedRemoved(_id); 369 } 370 371 /** Removes a molecule from the scene. 372 * 373 * * \sa moleculePrepareRemoved() 374 * 375 * @param _id id of molecule to remove 376 */ 377 void GLWorldScene::moleculeRemoved(const moleculeId_t _id) 378 { 379 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 380 381 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_id); 382 GLMoleculeObject_molecule *molObject = iter->second; 383 molObject->disconnect(); 384 MoleculesinSceneMap.erase(iter); 385 delete molObject; 370 } else { 371 LOG(1, "DEBUG: Removing GLMoleculeObject_molecule to id " << _id); 372 GLMoleculeObject_molecule *molObject = iter->second; 373 molObject->disconnect(); 374 MoleculesinSceneMap.erase(iter); 375 delete molObject; 376 } 386 377 387 378 // remove any possible state changes left … … 397 388 void GLWorldScene::moleculesVisibilityChanged(const moleculeId_t _id, bool _visible) 398 389 { 390 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 399 391 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_id); 400 392 ASSERT( iter != MoleculesinSceneMap.end(), … … 506 498 507 499 { 500 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 508 501 // Remove from map. 509 502 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(oldId); … … 525 518 526 519 { 520 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex); 527 521 // Remove and re-insert from map if present. 528 522 MoleculeMissedStateMap_t::iterator iter = MoleculeMissedStateMap.find(oldId); … … 537 531 void GLWorldScene::AtomSelected(const moleculeId_t _molid, const atomId_t _id) 538 532 { 533 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 539 534 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 540 535 if (iter != MoleculesinSceneMap.end()) … … 550 545 void GLWorldScene::AtomUnselected(const moleculeId_t _molid, const atomId_t _id) 551 546 { 547 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 552 548 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 553 549 if (iter != MoleculesinSceneMap.end()) … … 563 559 void GLWorldScene::MoleculeSelected(const moleculeId_t _molid) 564 560 { 565 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 561 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 562 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 566 563 if (iter != MoleculesinSceneMap.end()) 567 564 QMetaObject::invokeMethod(iter->second, // pointer to a QObject … … 575 572 void GLWorldScene::MoleculeUnselected(const moleculeId_t _molid) 576 573 { 574 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 577 575 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 578 576 if (iter != MoleculesinSceneMap.end())
Note:
See TracChangeset
for help on using the changeset viewer.