Changeset 76c238 for src/UIElements
- Timestamp:
- Apr 20, 2016, 8:52:04 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:
- 4690a7
- Parents:
- 1d9b6dd
- git-author:
- Frederik Heber <heber@…> (03/21/16 23:32:47)
- git-committer:
- Frederik Heber <heber@…> (04/20/16 08:52:04)
- Location:
- src/UIElements/Views/Qt4/Qt3D
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.cpp
r1d9b6dd r76c238 183 183 184 184 // we need at least three points for tesselation 185 if ( getPresentAtoms().size() >= 3) {185 if (AtomsinSceneMap.size() >= 3) { 186 186 // Tesselate the points. 187 187 Tesselation T; … … 258 258 LOG(4, "INFO: GLMoleculeObject_molecule: new index is "+toString(newId)+"."); 259 259 setObjectId(newId); 260 261 emit indexChanged(this, oldId, newId);262 260 } 263 261 … … 361 359 void GLMoleculeObject_molecule::atomInserted(QtObservedAtom::ptr _atom) 362 360 { 363 const atomId_t atomid = _atom->getAtomIndex(); 364 LOG(3, "INFO: GLMoleculeObject_molecule: Received signal atomInserted for atom "+toString(atomid)+"."); 361 const ObservedValue_Index_t atomid = _atom->getIndex(); 362 LOG(3, "INFO: GLMoleculeObject_molecule: Received signal atomInserted for atom " 363 << _atom->getAtomIndex()); 365 364 366 365 if (_atom) { … … 371 370 _atom); 372 371 ASSERT( atomObject != NULL, 373 "GLMoleculeObject_molecule::atomInserted - could not create atom object for "+toString(atomid)); 372 "GLMoleculeObject_molecule::atomInserted - could not create atom object for " 373 +toString(_atom->getAtomIndex())); 374 374 AtomNodeMap::iterator iter = AtomsinSceneMap.find(atomid); 375 375 ASSERT(iter == AtomsinSceneMap.end(), 376 "GLMoleculeObject_molecule::atomInserted - same atom with id "+toString(atomid)+" added again."); 376 "GLMoleculeObject_molecule::atomInserted - same atom with id " 377 +toString(_atom->getAtomIndex())+" added again."); 377 378 AtomsinSceneMap.insert( make_pair(atomid, atomObject) ); 378 379 … … 389 390 390 391 if (m_objectId == -1) 391 setObjectId( atomid);392 setObjectId(_atom->getAtomIndex()); 392 393 393 394 // first reset bonds when signals connections have been made … … 405 406 * @param _id id of atom to remove 406 407 */ 407 void GLMoleculeObject_molecule::atomRemoved( const atomId_t _id)408 void GLMoleculeObject_molecule::atomRemoved(ObservedValue_Index_t _id) 408 409 { 409 410 LOG(3, "INFO: GLMoleculeObject_molecule: Received signal atomRemoved for atom "+toString(_id)+"."); 410 411 // bonds are removed by signal coming from ~bond 411 412 if ((unsigned int)m_objectId == _id)413 setObjectId(-1);414 412 415 413 // remove atoms … … 437 435 for (AtomNodeMap::iterator iter = AtomsinSceneMap.begin();iter != AtomsinSceneMap.end(); ++ iter){ 438 436 if (iter->second == atomObject) 439 hoverAtomId = iter-> first;437 hoverAtomId = iter->second->objectId(); 440 438 } 441 439 … … 554 552 emit moleculeClicked(ObservedMolecule->getMolIndex()); 555 553 } 556 557 void GLMoleculeObject_molecule::changeAtomId(558 GLMoleculeObject_atom *ob,559 const atomId_t oldId,560 const atomId_t newId)561 {562 LOG(3, "INFO: GLMoleculeObject_molecule - change atom id " << oldId << " to " << newId << ".");563 564 // Remove from map.565 AtomNodeMap::iterator iter = AtomsinSceneMap.find(oldId);566 ASSERT(iter != AtomsinSceneMap.end(),567 "GLMoleculeObject_molecule::changeAtomId() - atom with old id "+toString(oldId)+" not on display.");568 ASSERT(iter->second == ob,569 "GLMoleculeObject_molecule::changeAtomId() - atom with id "570 +toString(oldId)+" does not match with object in AtomsinSceneMap.");571 AtomsinSceneMap.erase(iter);572 573 // Reinsert with new id.574 {575 AtomNodeMap::iterator iter = AtomsinSceneMap.find(newId);576 ASSERT(iter == AtomsinSceneMap.end(),577 "GLMoleculeObject_molecule::changeAtomId() - atom with new id "+toString(newId)+" already known.");578 }579 AtomsinSceneMap.insert( make_pair(newId, ob) );580 }581 582 583 GLMoleculeObject_molecule::atoms_t GLMoleculeObject_molecule::getPresentAtoms() const584 {585 atoms_t returnAtomIds;586 returnAtomIds.insert(587 MapKeyConstIterator<AtomNodeMap::const_iterator>(const_cast<const AtomNodeMap &>(AtomsinSceneMap).begin()),588 MapKeyConstIterator<AtomNodeMap::const_iterator>(const_cast<const AtomNodeMap &>(AtomsinSceneMap).end()));589 return returnAtomIds;590 } -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.hpp
r1d9b6dd r76c238 68 68 void hoverChanged(const atomId_t); 69 69 void hoverChanged(const moleculeId_t, int); 70 void indexChanged(GLMoleculeObject_molecule *, const moleculeId_t, const moleculeId_t);71 70 void atomClicked(atomId_t); 72 71 void moleculeClicked(moleculeId_t); … … 80 79 void wasClicked(); 81 80 void atomInserted(QtObservedAtom::ptr _atom); 82 void atomRemoved( const atomId_t _id);81 void atomRemoved(ObservedValue_Index_t _id); 83 82 void bondInserted(const atomId_t, const atomId_t, const GLMoleculeObject_bond::SideOfBond side); 84 83 void bondRemoved(const atomId_t leftnr, const atomId_t rightnr); 85 84 void hoverChangedSignalled(GLMoleculeObject *ob); 86 void changeAtomId(GLMoleculeObject_atom *, const atomId_t, const atomId_t);87 85 88 86 void setVisible(bool value); … … 100 98 101 99 void init(const moleculeId_t _molid); 102 103 //!> typedef for the internal set of atoms104 typedef std::set<atomId_t> atoms_t;105 106 /** Getter to contained atoms contained in \a ObservedValues.107 *108 * \return molecule's contained atoms109 */110 atoms_t getPresentAtoms() const;111 100 112 101 private: … … 126 115 QGeometryData TesselationHull; 127 116 128 //!> contains the set of atoms displayed 129 atoms_t DisplayedAtoms; 130 131 typedef std::map< atomId_t, GLMoleculeObject_atom* > AtomNodeMap; 117 typedef std::map< ObservedValue_Index_t, GLMoleculeObject_atom* > AtomNodeMap; 132 118 typedef std::map< BondIds , GLMoleculeObject_bond* > BondNodeMap; 133 119 AtomNodeMap AtomsinSceneMap;
Note:
See TracChangeset
for help on using the changeset viewer.