Changeset 98ad30


Ignore:
Timestamp:
Dec 19, 2025, 11:29:38 PM (9 days ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.1, stable
Children:
44d5d9
Parents:
25aa214
git-author:
Frederik Heber <frederik.heber@…> (11/16/25 12:48:52)
git-committer:
Frederik Heber <frederik.heber@…> (12/19/25 23:29:38)
Message:

QtView: SingleShort timer fires every 10ms.

  • moreover, we only fire it again if there are new changes before the last redraw (after 10ms) has started.
Location:
src/UIElements/Views/Qt4/Qt3D
Files:
2 edited

Legend:

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

    r25aa214 r98ad30  
    9494  connect(worldscene, SIGNAL(hoverEnd()), this, SLOT(triggerUpdateGL()));
    9595  connect(worldscene, SIGNAL(updated()), this, SLOT(triggerUpdateGL()));
    96   connect(this, SIGNAL(updated()), this, SLOT(triggerUpdateGL()));
     96  connect(this, SIGNAL(updated(const bool)), this, SLOT(triggerUpdateGL(const bool)));
    9797  connect(worldscene, SIGNAL(sceneChanged()), this, SLOT(sceneChangeSignalled()));
    9898  connect(this, SIGNAL(moleculesVisibilityChanged(ObservedValue_Index_t,bool)),
     
    322322void GLWorldView::update(Observable *publisher)
    323323{
    324 //  emit updated();
     324//  emit updated(true);
    325325}
    326326
     
    347347      observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that WorldTime's time has changed.";
    348348#endif
    349         needsRedraw = false;
    350         emit updated();
     349        emit updated(false);
    351350        emit TimeChanged();
    352351        break;
     
    389388  setdreiBeinStatus(!status);
    390389  // realize
    391   needsRedraw = true;
    392   emit updated();
     390  emit updated(true);
    393391}
    394392
     
    407405  setDomainStatus(!status);
    408406  // realize
    409   needsRedraw = true;
    410   emit updated();
     407  emit updated(true);
    411408}
    412409
     
    419416}
    420417
    421 void GLWorldView::triggerUpdateGL()
    422 {
    423   redrawTimer->singleShot(0, this, SLOT(updateGL()));
    424   redrawTimer->start();
     418void GLWorldView::triggerUpdateGL(const bool _needsRedraw)
     419{
     420  if ((!needsRedraw) && (_needsRedraw)) {
     421    // accumulate updates over 10ms
     422    needsRedraw = true;
     423    redrawTimer->singleShot(10, this, SLOT(updateGL()));
     424    redrawTimer->start();
     425  }
     426}
     427
     428void GLWorldView::updateGL()
     429{
     430  needsRedraw = false;
     431  QGLView::updateGL();
    425432}
    426433
     
    551558  setStereoType(QGLView::Hardware);
    552559  camera()->setEyeSeparation(0.0);
    553   emit updated();
     560  emit updated(true);
    554561}
    555562
     
    558565  setStereoType(QGLView::Hardware);
    559566  camera()->setEyeSeparation(defaultEyeSeparation);
    560   emit updated();
     567  emit updated(true);
    561568}
    562569
     
    565572  setStereoType(QGLView::LeftRight);
    566573  camera()->setEyeSeparation(defaultEyeSeparation);
    567   emit updated();
     574  emit updated(true);
    568575}
    569576
     
    572579  setStereoType(QGLView::RightLeft);
    573580  camera()->setEyeSeparation(defaultEyeSeparation);
    574   emit updated();
     581  emit updated(true);
    575582}
    576583
     
    579586  setStereoType(QGLView::TopBottom);
    580587  camera()->setEyeSeparation(defaultEyeSeparation);
    581   emit updated();
     588  emit updated(true);
    582589}
    583590
     
    586593  setStereoType(QGLView::BottomTop);
    587594  camera()->setEyeSeparation(defaultEyeSeparation);
    588   emit updated();
     595  emit updated(true);
    589596}
    590597
     
    593600  setStereoType(QGLView::RedCyanAnaglyph);
    594601  camera()->setEyeSeparation(defaultEyeSeparation);
    595   emit updated();
     602  emit updated(true);
    596603}
    597604
     
    726733{
    727734  emit hoverChanged(_id);
    728   emit updated();
     735  emit updated(true);
    729736}
    730737
     
    732739{
    733740  emit hoverChanged(_id, _i);
    734   emit updated();
    735 }
     741  emit updated(true);
     742}
  • src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp

    r25aa214 r98ad30  
    6060public slots:
    6161  void sceneChangeSignalled();
    62   void triggerUpdateGL();
     62  void triggerUpdateGL(const bool _needsRedraw = true);
    6363  void sceneHoverSignalled(const atomId_t _id);
    6464  void sceneHoverSignalled(const moleculeId_t _id, int);
     
    6767
    6868signals:
    69   void updated();
     69  void updated(const bool _needsRedraw);
    7070  void sceneUpdated();
    7171  void TimeChanged();
     
    8383  void drawDomainBox(QGLPainter *painter) const;
    8484  void drawDreiBein(QGLPainter *painter);
     85  void updateGL();
    8586
    8687  // input functions
Note: See TracChangeset for help on using the changeset viewer.