Ignore:
Timestamp:
Jul 17, 2012, 12:17:27 PM (13 years ago)
Author:
Michael Ankele <ankele@…>
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:
7b6bcfe
Parents:
859a00
git-author:
Michael Ankele <ankele@…> (06/18/12 13:33:33)
git-committer:
Michael Ankele <ankele@…> (07/17/12 12:17:27)
Message:

GL: Qt signals rewired

  • GLWorldView now tells us, over which atom the mouse is hovering
Location:
src/UIElements/Views/Qt4/Qt3D
Files:
6 edited

Legend:

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

    r859a00 r407638e  
    189189   } else if (e->type() == QEvent::Enter) {
    190190       m_hovering = true;
    191        emit hoverChanged();
     191       emit hoverChanged(this);
    192192   } else if (e->type() == QEvent::Leave) {
    193193       m_hovering = false;
    194        emit hoverChanged();
     194       emit hoverChanged(NULL);
    195195   }
    196196   return QObject::event(e);
  • src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject.hpp

    r859a00 r407638e  
    7878   void clicked();
    7979   void doubleClicked();
    80    void hoverChanged();
     80   void hoverChanged(GLMoleculeObject *ob);
    8181   void selectionChanged();
    8282   void changed();
  • src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp

    r859a00 r407638e  
    5858
    5959GLWorldScene::GLWorldScene(QObject *parent)
    60    : QObject(parent)
     60   : QObject(parent),
     61     hoverAtom(NULL)
    6162{
    6263  QGLBuilder builder0;
     
    138139  connect (atomObject, SIGNAL(clicked(atomId_t)), this, SLOT(atomClicked(atomId_t)));
    139140  connect (atomObject, SIGNAL(changed()), this, SIGNAL(changed()));
    140   connect (atomObject, SIGNAL(hoverChanged()), this, SIGNAL(changed()));
     141  connect (atomObject, SIGNAL(hoverChanged(GLMoleculeObject *)), this, SIGNAL(changed()));
     142  connect (atomObject, SIGNAL(hoverChanged(GLMoleculeObject *)), this, SLOT(hoverChangedSignalled(GLMoleculeObject *)));
    141143  connect (atomObject, SIGNAL(selectionChanged()), this, SIGNAL(changed()));
    142144  connect (atomObject, SIGNAL(BondsInserted(const bond *, const GLMoleculeObject_bond::SideOfBond)), this, SLOT(bondInserted(const bond *, const GLMoleculeObject_bond::SideOfBond)));
     
    338340}
    339341
     342void GLWorldScene::hoverChangedSignalled(GLMoleculeObject *ob)
     343{
     344  // Find the atom, ob corresponds to.
     345  hoverAtom = NULL;
     346  GLMoleculeObject_atom *atomObject = dynamic_cast<GLMoleculeObject_atom *>(ob);
     347  if (atomObject){
     348    for (AtomNodeMap::iterator iter = AtomsinSceneMap.begin();iter != AtomsinSceneMap.end(); ++ iter){
     349      if (iter->second == atomObject)
     350        hoverAtom = World::getInstance().getAtom(AtomById(iter->first));
     351    }
     352  }
     353
     354  // Propagate signal.
     355  emit hoverChanged(hoverAtom);
     356}
     357
  • src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp

    r859a00 r407638e  
    7171  void clicked(atomId_t);
    7272  void doubleClicked();
    73   void hoverChanged();
     73  void hoverChanged(const atom*);
    7474
    7575private slots:
     
    8383  void setSelectionModeAtom();
    8484  void setSelectionModeMolecule();
     85  void hoverChangedSignalled(GLMoleculeObject *ob);
    8586
    8687private:
     
    105106
    106107  SelectionModeType selectionMode;
     108  const atom *hoverAtom;
    107109};
    108110
  • src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp

    r859a00 r407638e  
    5757  connect(worldscene, SIGNAL(changeOccured()), this, SLOT(changeSignalled()));
    5858  connect(worldscene, SIGNAL(changed()), this, SIGNAL(changed()));
     59  connect(worldscene, SIGNAL(hoverChanged(const atom *)), this, SLOT(sceneHoverSignalled(const atom *)));
    5960  connect(this, SIGNAL(atomInserted(const atom *)), worldscene, SLOT(atomInserted(const atom *)));
    6061  connect(this, SIGNAL(atomRemoved(const atom *)), worldscene, SLOT(atomRemoved(const atom *)));
     
    526527}
    527528
     529void GLWorldView::sceneHoverSignalled(const atom *_atom)
     530{
     531  emit hoverChanged(_atom);
     532}
     533
    528534
    529535//#include <GL/glu.h>
  • src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp

    r859a00 r407638e  
    5151  void checkChanges();
    5252  void sceneChangeSignalled();
     53  void sceneHoverSignalled(const atom *_atom);
    5354
    5455signals:
     
    5960  void moleculeRemoved(const molecule *_molecule);
    6061  void worldSelectionChanged();
     62  void hoverChanged(const atom *_atom);
    6163
    6264protected:
Note: See TracChangeset for help on using the changeset viewer.