Changeset 65487f for src


Ignore:
Timestamp:
Oct 6, 2011, 4:06:10 PM (13 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:
838cd0
Parents:
a099d3
git-author:
Frederik Heber <heber@…> (09/02/11 08:42:34)
git-committer:
Frederik Heber <heber@…> (10/06/11 16:06:10)
Message:

FIX: hoverChanged() and ..Clicked() now also works for loaded molecules.

  • introduced signal WorldScene::changeOccured() which triggers a private flag changesPresent in GLWorldView to call initialize() on next paintGL() event.
Location:
src/UIElements/Views/Qt4/Qt3D
Files:
4 edited

Legend:

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

    ra099d3 r65487f  
    9292  connect (atomObject, SIGNAL(BondsChanged(const atom *)), this, SLOT(bondsChanged(const atom *)));
    9393  bondsChanged(_atom);
    94   emit changed();
     94  emit changeOccured();
    9595}
    9696
     
    116116  AtomsinSceneMap.erase(iter);
    117117  delete atomObject;
    118   emit changed();
     118  emit changeOccured();
    119119}
    120120
     
    205205    BondIdsinSceneMap.insert( Rightids );
    206206  }
    207   emit changed();
     207  emit changeOccured();
    208208}
    209209
     
    239239      "GLWorldScene::bondRemoved() - could not find ("
    240240      +toString(leftnr)+"-"+toString(rightnr)+" in BondIdsinSceneMap.");
    241   emit changed();
     241  emit changeOccured();
    242242}
    243243
  • src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp

    ra099d3 r65487f  
    5353signals:
    5454  void changed();
     55  void changeOccured();
    5556  void pressed();
    5657  void released();
  • src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp

    ra099d3 r65487f  
    3131
    3232GLWorldView::GLWorldView(QWidget *parent)
    33    : QGLView(parent), Observer("GLWorldView"), worldscene(NULL)
     33  : QGLView(parent), Observer("GLWorldView"), worldscene(NULL), changesPresent(false)
    3434{
    35    worldscene = new GLWorldScene(this);
    36 
    37    setOption(QGLView::ObjectPicking, true);
    38 
    39    connect(worldscene, SIGNAL(changed()), this, SLOT(updateGL()));
    40    connect(this, SIGNAL(atomInserted(const atom *)), worldscene, SLOT(atomInserted(const atom *)));
    41    connect(this, SIGNAL(atomRemoved(const atom *)), worldscene, SLOT(atomRemoved(const atom *)));
    42    connect(this, SIGNAL(changed()), this, SLOT(updateGL()));
    43 
    44    // sign on to changes in the world
    45    World::getInstance().signOn(this);
    46    World::getInstance().signOn(this, World::getInstance().getChannel(World::AtomInserted));
    47    World::getInstance().signOn(this, World::getInstance().getChannel(World::AtomRemoved));
     35  worldscene = new GLWorldScene(this);
     36
     37  setOption(QGLView::ObjectPicking, true);
     38
     39  connect(worldscene, SIGNAL(changeOccured()), this, SLOT(changeSignalled()));
     40  connect(worldscene, SIGNAL(changed()), this, SIGNAL(changed()));
     41  connect(this, SIGNAL(atomInserted(const atom *)), worldscene, SLOT(atomInserted(const atom *)));
     42  connect(this, SIGNAL(atomRemoved(const atom *)), worldscene, SLOT(atomRemoved(const atom *)));
     43  connect(this, SIGNAL(changed()), this, SLOT(updateGL()));
     44
     45  // sign on to changes in the world
     46  World::getInstance().signOn(this);
     47  World::getInstance().signOn(this, World::getInstance().getChannel(World::AtomInserted));
     48  World::getInstance().signOn(this, World::getInstance().getChannel(World::AtomRemoved));
    4849}
    4950
     
    100101void GLWorldView::initializeGL(QGLPainter *painter)
    101102{
    102    worldscene->initialize(this, painter);
     103  worldscene->initialize(this, painter);
     104  changesPresent = false;
    103105}
    104106
    105107void GLWorldView::paintGL(QGLPainter *painter)
    106108{
    107    worldscene->draw(painter);
     109  if (changesPresent) {
     110    initializeGL(painter);
     111    changesPresent = false;
     112  }
     113  worldscene->draw(painter);
    108114}
    109115
    110116void GLWorldView::keyPressEvent(QKeyEvent *e)
    111117{
    112    if (e->key() == Qt::Key_Tab) {
    113        // The Tab key turns the ShowPicking option on and off,
    114        // which helps show what the pick buffer looks like.
    115        setOption(QGLView::ShowPicking, ((options() & QGLView::ShowPicking) == 0));
    116        updateGL();
    117    }
    118    QGLView::keyPressEvent(e);
     118  if (e->key() == Qt::Key_Tab) {
     119    // The Tab key turns the ShowPicking option on and off,
     120    // which helps show what the pick buffer looks like.
     121    setOption(QGLView::ShowPicking, ((options() & QGLView::ShowPicking) == 0));
     122    updateGL();
     123  }
     124  QGLView::keyPressEvent(e);
     125}
     126
     127void GLWorldView::changeSignalled()
     128{
     129  changesPresent = true;
    119130}
    120131
  • src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp

    ra099d3 r65487f  
    4141
    4242public slots:
     43  void changeSignalled();
    4344
    4445signals:
     
    5455private:
    5556  GLWorldScene *worldscene;
     57
     58  bool changesPresent;
    5659};
    5760
Note: See TracChangeset for help on using the changeset viewer.