Changeset 76c238 for src/UIElements


Ignore:
Timestamp:
Apr 20, 2016, 8:52:04 AM (9 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

Removed GLMoleculeObject_molecule::getPresentAtoms() and changed atomRemoved slot of GLMoleculeObject_molecule.

Location:
src/UIElements/Views/Qt4/Qt3D
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.cpp

    r1d9b6dd r76c238  
    183183
    184184  // we need at least three points for tesselation
    185   if (getPresentAtoms().size() >= 3) {
     185  if (AtomsinSceneMap.size() >= 3) {
    186186    // Tesselate the points.
    187187    Tesselation T;
     
    258258  LOG(4, "INFO: GLMoleculeObject_molecule: new index is "+toString(newId)+".");
    259259  setObjectId(newId);
    260 
    261   emit indexChanged(this, oldId, newId);
    262260}
    263261
     
    361359void GLMoleculeObject_molecule::atomInserted(QtObservedAtom::ptr _atom)
    362360{
    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());
    365364
    366365  if (_atom) {
     
    371370            _atom);
    372371    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()));
    374374    AtomNodeMap::iterator iter = AtomsinSceneMap.find(atomid);
    375375    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.");
    377378    AtomsinSceneMap.insert( make_pair(atomid, atomObject) );
    378379
     
    389390
    390391    if (m_objectId  == -1)
    391       setObjectId(atomid);
     392      setObjectId(_atom->getAtomIndex());
    392393
    393394    // first reset bonds when signals connections have been made
     
    405406 * @param _id id of atom to remove
    406407 */
    407 void GLMoleculeObject_molecule::atomRemoved(const atomId_t _id)
     408void GLMoleculeObject_molecule::atomRemoved(ObservedValue_Index_t _id)
    408409{
    409410  LOG(3, "INFO: GLMoleculeObject_molecule: Received signal atomRemoved for atom "+toString(_id)+".");
    410411  // bonds are removed by signal coming from ~bond
    411 
    412   if ((unsigned int)m_objectId == _id)
    413     setObjectId(-1);
    414412
    415413  // remove atoms
     
    437435    for (AtomNodeMap::iterator iter = AtomsinSceneMap.begin();iter != AtomsinSceneMap.end(); ++ iter){
    438436      if (iter->second == atomObject)
    439         hoverAtomId = iter->first;
     437        hoverAtomId = iter->second->objectId();
    440438    }
    441439
     
    554552  emit moleculeClicked(ObservedMolecule->getMolIndex());
    555553}
    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() const
    584 {
    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  
    6868  void hoverChanged(const atomId_t);
    6969  void hoverChanged(const moleculeId_t, int);
    70   void indexChanged(GLMoleculeObject_molecule *, const moleculeId_t, const moleculeId_t);
    7170  void atomClicked(atomId_t);
    7271  void moleculeClicked(moleculeId_t);
     
    8079  void wasClicked();
    8180  void atomInserted(QtObservedAtom::ptr _atom);
    82   void atomRemoved(const atomId_t _id);
     81  void atomRemoved(ObservedValue_Index_t _id);
    8382  void bondInserted(const atomId_t, const atomId_t, const GLMoleculeObject_bond::SideOfBond side);
    8483  void bondRemoved(const atomId_t leftnr, const atomId_t rightnr);
    8584  void hoverChangedSignalled(GLMoleculeObject *ob);
    86   void changeAtomId(GLMoleculeObject_atom *, const atomId_t, const atomId_t);
    8785
    8886  void setVisible(bool value);
     
    10098
    10199  void init(const moleculeId_t _molid);
    102 
    103   //!> typedef for the internal set of atoms
    104   typedef std::set<atomId_t> atoms_t;
    105 
    106   /** Getter to contained atoms contained in \a ObservedValues.
    107    *
    108    * \return molecule's contained atoms
    109    */
    110   atoms_t getPresentAtoms() const;
    111100
    112101private:
     
    126115  QGeometryData TesselationHull;
    127116
    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;
    132118  typedef std::map< BondIds , GLMoleculeObject_bond* > BondNodeMap;
    133119  AtomNodeMap AtomsinSceneMap;
Note: See TracChangeset for help on using the changeset viewer.