Changeset 73b13c for src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
- Timestamp:
- Jul 25, 2015, 1:01:44 PM (10 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:
- 9b56f0a
- Parents:
- 9737db
- git-author:
- Frederik Heber <heber@…> (06/17/15 16:59:19)
- git-committer:
- Frederik Heber <heber@…> (07/25/15 13:01:44)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
r9737db r73b13c 70 70 using namespace MoleCuilder; 71 71 72 GLWorldScene::GLWorldScene(QObject *parent) 73 : QObject(parent) 72 GLWorldScene::GLWorldScene(QObject *parent) : 73 QObject(parent), 74 selectionMode(SelectAtom) 74 75 { 75 76 int sphereDetails[] = {5, 3, 2, 0}; … … 228 229 LOG(3, "INFO: GLWorldScene: Received signal atomInserted for atom "+toString(_atomid)+"."); 229 230 231 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex); 232 230 233 // check of molecule is already present 231 234 if (MoleculesinSceneMap.count(_molid) != 0) { … … 248 251 LOG(3, "INFO: GLWorldScene: Received signal atomRemoved for atom "+toString(_atomid)+"."); 249 252 253 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex); 254 250 255 // check of molecule is already present 251 256 if (MoleculesinSceneMap.count(_molid) != 0) { … … 276 281 MoleculesinSceneMap.insert( make_pair(_id, molObject) ); 277 282 278 // now handle all state changes that came up before the instantiation 279 if(MoleculeMissedStateMap.count(_id) != 0) {283 // now handle all state changes that came up before the instantiation7 284 while (MoleculeMissedStateMap.count(_id) != 0) { 280 285 ASSERT( !MoleculeMissedStateMap[_id].empty(), 281 286 "GLWorldScene::moleculeInserted() - we have an empty state change map for molecule with id " 282 287 +toString(_id)); 288 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex); 283 289 for (StateChangeMap_t::iterator iter = MoleculeMissedStateMap[_id].begin(); 284 290 !MoleculeMissedStateMap[_id].empty(); … … 297 303 "GLWorldScene::moleculeInserted() - more atomRemoved states than atomInserted for atom " 298 304 +toString(iter->first)); 299 if (StateChangeAmounts[atomInsertedState] > StateChangeAmounts[atomRemovedState]) 305 if (StateChangeAmounts[atomInsertedState] > StateChangeAmounts[atomRemovedState]) { 306 LOG(1, "INFO: invoking atomInserted for atom " << iter->first); 300 307 QMetaObject::invokeMethod(molObject, // pointer to a QObject 301 308 "atomInserted", // member name (no parameters here) 302 309 Qt::DirectConnection, // connection type 303 310 Q_ARG(const atomId_t, iter->first)); // parameters 311 } else { 312 LOG(1, "INFO: Atom " << iter->first << " has been inserted and removed already."); 313 } 304 314 } else { 305 315 // can only be an insertion … … 311 321 break; 312 322 case atomInsertedState: 323 LOG(1, "INFO: invoking atomInserted for atom " << iter->first); 313 324 QMetaObject::invokeMethod(molObject, // pointer to a QObject 314 325 "atomInserted", // member name (no parameters here) … … 329 340 } 330 341 342 // now let the molObject sign on to molecule 343 molObject->activateObserver(); 344 331 345 connect (molObject, SIGNAL(changed()), this, SIGNAL(changed())); 332 346 connect (molObject, SIGNAL(changeOccured()), this, SIGNAL(changeOccured())); … … 359 373 360 374 // remove any possible state changes left 361 MoleculeMissedStateMap.erase(_id); 375 { 376 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex); 377 MoleculeMissedStateMap.erase(_id); 378 } 362 379 363 380 emit changed();
Note:
See TracChangeset
for help on using the changeset viewer.