Changeset 7188b1 for src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
- Timestamp:
- Oct 6, 2011, 4:06:10 PM (14 years ago)
- 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:
- db7e6d
- Parents:
- e638f9
- git-author:
- Frederik Heber <heber@…> (09/01/11 13:49:14)
- git-committer:
- Frederik Heber <heber@…> (10/06/11 16:06:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
re638f9 r7188b1 26 26 #include "CodePatterns/MemDebug.hpp" 27 27 28 #include "CodePatterns/Log.hpp" 29 30 #include "World.hpp" 31 28 32 GLWorldView::GLWorldView(QWidget *parent) 29 : QGLView(parent), worldscene(NULL)33 : QGLView(parent), Observer("GLWorldView"), worldscene(NULL) 30 34 { 31 35 worldscene = new GLWorldScene(this); … … 34 38 35 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)); 36 48 } 37 49 … … 41 53 } 42 54 55 /** 56 * Update operation which can be invoked by the observable (which should be the 57 * change tracker here). 58 */ 59 void GLWorldView::update(Observable *publisher) 60 { 61 emit changed(); 62 } 63 64 /** 65 * The observable can tell when it dies. 66 */ 67 void GLWorldView::subjectKilled(Observable *publisher) {} 68 69 /** Listen to specific changes to the world. 70 * 71 * @param publisher ref to observable. 72 * @param notification type of notification 73 */ 74 void GLWorldView::recieveNotification(Observable *publisher, Notification_ptr notification) 75 { 76 switch (notification->getChannelNo()) { 77 case World::AtomInserted: 78 { 79 const atom *_atom = World::getInstance().lastChanged<atom>(); 80 LOG(0, "GLWorldView: Received notification that atom "+toString(_atom->getId())+" has been inserted."); 81 emit atomInserted(_atom); 82 break; 83 } 84 case World::AtomRemoved: 85 { 86 const atom *_atom = World::getInstance().lastChanged<atom>(); 87 LOG(0, "GLWorldView: Received notification that atom "+toString(_atom->getId())+" has been removed."); 88 emit atomRemoved(_atom); 89 break; 90 } 91 default: 92 ASSERT(0, "GLWorldView::recieveNotification() - we cannot get here."); 93 break; 94 } 95 } 43 96 44 97 void GLWorldView::initializeGL(QGLPainter *painter)
Note:
See TracChangeset
for help on using the changeset viewer.