Changeset ef3013 for src/UIElements/Views
- Timestamp:
- Jun 23, 2015, 6:29:02 AM (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:
- 466934
- Parents:
- c13b91
- git-author:
- Frederik Heber <heber@…> (05/20/15 17:37:52)
- git-committer:
- Frederik Heber <heber@…> (06/23/15 06:29:02)
- Location:
- src/UIElements/Views/Qt4/Qt3D
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
rc13b91 ref3013 113 113 moliter++) { 114 114 // create molecule objects in scene 115 moleculeInserted( *moliter);115 moleculeInserted((*moliter)->getId()); 116 116 } 117 117 } … … 134 134 const bool mol_present = MoleculesinSceneMap.count(molid); 135 135 if (!mol_present) 136 moleculeInserted( *moliter);136 moleculeInserted((*moliter)->getId()); 137 137 } 138 138 } … … 260 260 * @param _mol molecule to insert 261 261 */ 262 void GLWorldScene::moleculeInserted(const molecule * _mol)263 { 264 LOG(3, "INFO: GLWorldScene: Received signal moleculeRemoved for molecule "+toString(_ mol->getId())+".");265 MoleculeNodeMap::const_iterator iter = MoleculesinSceneMap.find(_ mol->getId());262 void GLWorldScene::moleculeInserted(const moleculeId_t _id) 263 { 264 LOG(3, "INFO: GLWorldScene: Received signal moleculeRemoved for molecule "+toString(_id)+"."); 265 MoleculeNodeMap::const_iterator iter = MoleculesinSceneMap.find(_id); 266 266 ASSERT( iter == MoleculesinSceneMap.end(), 267 "GLWorldScene::moleculeInserted() - molecule's id "+toString(_ mol->getId())+" already present.");267 "GLWorldScene::moleculeInserted() - molecule's id "+toString(_id)+" already present."); 268 268 269 269 // add new object 270 GLMoleculeObject_molecule *molObject = new GLMoleculeObject_molecule(GLMoleculeObject::meshEmpty, this, _mol); 271 MoleculesinSceneMap.insert( make_pair(_mol->getId(), molObject) ); 272 connect (molObject, SIGNAL(changed()), this, SIGNAL(changed())); 273 connect (molObject, SIGNAL(changeOccured()), this, SIGNAL(changeOccured())); 274 connect (molObject, SIGNAL(atomClicked(atomId_t)), this, SLOT(atomClicked(atomId_t))); 275 connect (molObject, SIGNAL(moleculeClicked(moleculeId_t)), this, SLOT(moleculeClicked(moleculeId_t))); 276 connect (molObject, SIGNAL(changeAtomId(GLMoleculeObject_atom *, int, int)), this, SLOT(changeAtomId(GLMoleculeObject_atom *, int, int))); 277 connect (molObject, SIGNAL(selectionChanged()), this, SIGNAL(changed())); 278 connect (molObject, SIGNAL(selectionChanged()), this, SIGNAL(changed())); 279 connect (molObject, SIGNAL(hoverChanged(const atom &)), this, SIGNAL(hoverChanged(const atom &))); 280 connect (molObject, SIGNAL(hoverChanged(const molecule &, int)), this, SIGNAL(hoverChanged(const molecule &, int))); 281 emit changed(); 282 emit changeOccured(); 270 const molecule *_mol = World::getInstance().getMolecule(MoleculeById(_id)); 271 if (_mol != NULL) { 272 GLMoleculeObject_molecule *molObject = new GLMoleculeObject_molecule(GLMoleculeObject::meshEmpty, this, _mol); 273 MoleculesinSceneMap.insert( make_pair(_id, molObject) ); 274 connect (molObject, SIGNAL(changed()), this, SIGNAL(changed())); 275 connect (molObject, SIGNAL(changeOccured()), this, SIGNAL(changeOccured())); 276 connect (molObject, SIGNAL(atomClicked(atomId_t)), this, SLOT(atomClicked(atomId_t))); 277 connect (molObject, SIGNAL(moleculeClicked(moleculeId_t)), this, SLOT(moleculeClicked(moleculeId_t))); 278 connect (molObject, SIGNAL(changeAtomId(GLMoleculeObject_atom *, int, int)), this, SLOT(changeAtomId(GLMoleculeObject_atom *, int, int))); 279 connect (molObject, SIGNAL(selectionChanged()), this, SIGNAL(changed())); 280 connect (molObject, SIGNAL(selectionChanged()), this, SIGNAL(changed())); 281 connect (molObject, SIGNAL(hoverChanged(const atom &)), this, SIGNAL(hoverChanged(const atom &))); 282 connect (molObject, SIGNAL(hoverChanged(const molecule &, int)), this, SIGNAL(hoverChanged(const molecule &, int))); 283 emit changed(); 284 emit changeOccured(); 285 } else { 286 // the molecule is already gone, we add it nonetheless as null object as 287 // lateron moleculeRemoved wants to erase it. 288 ELOG(1, "GLWorldScene::moleculeInserted() - added null object for not present mol id " << _id); 289 GLMoleculeObject_molecule *molObject = NULL; 290 MoleculesinSceneMap.insert( make_pair(_id, molObject) ); 291 } 283 292 } 284 293 -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp
rc13b91 ref3013 84 84 void moleculeClicked(moleculeId_t no); 85 85 void moleculeRemoved(const moleculeId_t _id); 86 void moleculeInserted(const molecule * _mol);86 void moleculeInserted(const moleculeId_t _id); 87 87 void worldSelectionChanged(); 88 88 void bondInserted(const bond::ptr _bond, const GLMoleculeObject_bond::SideOfBond side); -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
rc13b91 ref3013 91 91 connect(this, SIGNAL(worldSelectionChanged()), worldscene, SLOT(worldSelectionChanged())); 92 92 connect(this, SIGNAL(moleculeRemoved(const moleculeId_t)), worldscene, SLOT(moleculeRemoved(const moleculeId_t))); 93 connect(this, SIGNAL(moleculeInserted(const molecule *)), worldscene, SLOT(moleculeInserted(const molecule *)));93 connect(this, SIGNAL(moleculeInserted(const moleculeId_t)), worldscene, SLOT(moleculeInserted(const moleculeId_t))); 94 94 //connect(this, SIGNAL(changed()), this, SLOT(updateGL())); 95 95 connect(this, SIGNAL(changed()), this, SLOT(sceneChangeSignalled())); … … 348 348 case World::MoleculeInserted: 349 349 { 350 const molecule * _mol = World::getInstance().lastChanged<molecule>();350 const moleculeId_t _id = World::getInstance().lastChanged<molecule>()->getId(); 351 351 #ifdef LOG_OBSERVER 352 observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that molecule "+toString(_ mol->getId())+" has been removed.";352 observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that molecule "+toString(_id)+" has been removed."; 353 353 #endif 354 emit moleculeInserted(_ mol);354 emit moleculeInserted(_id); 355 355 break; 356 356 } -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp
rc13b91 ref3013 59 59 void changed(); 60 60 void TimeChanged(); 61 void moleculeInserted(const molecule * _mol);61 void moleculeInserted(const moleculeId_t _id); 62 62 void moleculeRemoved(const moleculeId_t _id); 63 63 void worldSelectionChanged();
Note:
See TracChangeset
for help on using the changeset viewer.