Changeset 8819d2 for src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
- Timestamp:
- Apr 11, 2018, 6:29:57 AM (7 years ago)
- Branches:
- Candidate_v1.6.1, ChemicalSpaceEvaluator, Gui_displays_atomic_force_velocity, PythonUI_with_named_parameters, TremoloParser_IncreasedPrecision
- Children:
- e7ad08
- Parents:
- 2c97ad
- git-author:
- Frederik Heber <frederik.heber@…> (08/09/17 18:00:22)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/11/18 06:29:57)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
r2c97ad r8819d2 93 93 // connect(this, SIGNAL(TimeChanged()), worldscene, SIGNAL(updated())); 94 94 connect(worldscene, SIGNAL(changeOccured()), this, SLOT(changeSignalled())); 95 connect( worldscene, SIGNAL(changed()), this, SIGNAL(changed()));95 connect(this, SIGNAL(changed()), this, SLOT(changeSignalled())); 96 96 connect(worldscene, SIGNAL(hoverChanged(const atomId_t)), this, SLOT(sceneHoverSignalled(const atomId_t))); 97 97 connect(worldscene, SIGNAL(hoverChanged(const moleculeId_t, int)), this, SLOT(sceneHoverSignalled(const moleculeId_t, int))); 98 98 //connect(this, SIGNAL(changed()), this, SLOT(updateGL())); 99 connect( this, SIGNAL(changed()), this, SLOT(sceneChangeSignalled()));99 connect(worldscene, SIGNAL(changed()), this, SLOT(sceneChangeSignalled())); 100 100 connect(this, SIGNAL(moleculesVisibilityChanged(ObservedValue_Index_t,bool)), 101 101 worldscene, SLOT(moleculesVisibilityChanged(ObservedValue_Index_t,bool))); … … 104 104 WorldTime::getInstance().signOn(this, WorldTime::TimeChanged); 105 105 AtomObserver::getInstance().signOn(this, AtomObservable::PositionChanged); 106 AtomObserver::getInstance().signOn(this, AtomObservable::VelocityChanged); 107 AtomObserver::getInstance().signOn(this, AtomObservable::ForceChanged); 106 108 107 109 ShapeRegistry::getInstance().signOn(this); … … 124 126 WorldTime::getInstance().signOff(this, WorldTime::TimeChanged); 125 127 AtomObserver::getInstance().signOff(this, AtomObservable::PositionChanged); 128 AtomObserver::getInstance().signOff(this, AtomObservable::VelocityChanged); 129 AtomObserver::getInstance().signOff(this, AtomObservable::ForceChanged); 126 130 ShapeRegistry::getInstance().signOff(this); 127 131 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::ShapeInserted); … … 341 345 observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that WorldTime's time has changed."; 342 346 #endif 347 needsRedraw = false; 343 348 emit changed(); 344 349 emit TimeChanged(); … … 353 358 case ShapeRegistry::ShapeInserted: 354 359 { 360 needsRedraw = false; 355 361 emit ShapeAdded(ShapeRegistry::getInstance().lastChanged()->getName()); 356 362 break; … … 358 364 case ShapeRegistry::ShapeRemoved: 359 365 { 366 needsRedraw = false; 360 367 emit ShapeRemoved(ShapeRegistry::getInstance().lastChanged()->getName()); 361 368 break; … … 363 370 case ShapeRegistry::SelectionChanged: 364 371 { 372 needsRedraw = false; 365 373 worldscene->updateSelectedShapes(); 366 374 break; … … 375 383 void GLWorldView::checkChanges() 376 384 { 385 needsRedraw = false; 377 386 updateGL(); 378 needsRedraw = false;379 387 } 380 388 … … 385 393 setdreiBeinStatus(!status); 386 394 // realize 387 updateGL();388 395 needsRedraw = true; 396 emit changed(); 389 397 } 390 398 … … 403 411 setDomainStatus(!status); 404 412 // realize 405 updateGL();406 413 needsRedraw = true; 414 emit changed(); 407 415 } 408 416 … … 417 425 void GLWorldView::sceneChangeSignalled() 418 426 { 419 if ( !needsRedraw){427 if (needsRedraw){ 420 428 redrawTimer->singleShot(0, this, SLOT(checkChanges())); 421 429 needsRedraw = true; … … 432 440 void GLWorldView::paintGL(QGLPainter *painter) 433 441 { 434 if (changesPresent) {442 if (changesPresent) 435 443 initializeGL(painter); 436 changesPresent = false;437 }438 444 439 445 QVector3D cameraDir = camera()->center() - camera()->eye(); … … 492 498 { 493 499 changesPresent = true; 500 updateGL(); 494 501 } 495 502 … … 548 555 setStereoType(QGLView::Hardware); 549 556 camera()->setEyeSeparation(0.0); 550 updateGL();557 emit changed(); 551 558 } 552 559 … … 555 562 setStereoType(QGLView::Hardware); 556 563 camera()->setEyeSeparation(defaultEyeSeparation); 557 updateGL();564 emit changed(); 558 565 } 559 566 … … 562 569 setStereoType(QGLView::LeftRight); 563 570 camera()->setEyeSeparation(defaultEyeSeparation); 564 updateGL();571 emit changed(); 565 572 } 566 573 … … 569 576 setStereoType(QGLView::RightLeft); 570 577 camera()->setEyeSeparation(defaultEyeSeparation); 571 updateGL();578 emit changed(); 572 579 } 573 580 … … 576 583 setStereoType(QGLView::TopBottom); 577 584 camera()->setEyeSeparation(defaultEyeSeparation); 578 updateGL();585 emit changed(); 579 586 } 580 587 … … 583 590 setStereoType(QGLView::BottomTop); 584 591 camera()->setEyeSeparation(defaultEyeSeparation); 585 updateGL();592 emit changed(); 586 593 } 587 594 … … 590 597 setStereoType(QGLView::RedCyanAnaglyph); 591 598 camera()->setEyeSeparation(defaultEyeSeparation); 592 updateGL();599 emit changed(); 593 600 } 594 601 … … 714 721 void GLWorldView::sceneHoverSignalled(const atomId_t _id) 715 722 { 723 needsRedraw = true; 724 emit changed(); 716 725 emit hoverChanged(_id); 717 726 } … … 719 728 void GLWorldView::sceneHoverSignalled(const moleculeId_t _id, int _i) 720 729 { 730 needsRedraw = true; 731 emit changed(); 721 732 emit hoverChanged(_id, _i); 722 733 }
Note:
See TracChangeset
for help on using the changeset viewer.