- Timestamp:
- Aug 5, 2015, 5:32:11 PM (10 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:
- a39d72
- Parents:
- e5a477
- git-author:
- Frederik Heber <heber@…> (07/19/15 07:08:38)
- git-committer:
- Frederik Heber <heber@…> (08/05/15 17:32:11)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.cpp
re5a477 r015f8c 28 28 * Author: ankele 29 29 */ 30 31 32 33 30 34 31 … … 114 111 TesselationHullUpdater( 115 112 boost::bind(&GLMoleculeObject_molecule::updateTesselationHull, this) 116 ),117 IsSelectedUpdater(118 boost::bind(&GLMoleculeObject_molecule::updateIsSelected, this)119 113 ), 120 114 BoundingBoxUpdater( … … 135 129 "MoleculeTesselationHull_"+toString(_molid), 136 130 HullChannels), 137 isSelected(138 const_cast<const World * const>(World::getPointer()),139 IsSelectedUpdater,140 "MoleculeBoundingBox_"+toString(_molid),141 updateIsSelected(),142 BoundingBoxChannels),143 131 BoundingBox( 144 132 molref, … … 189 177 TesselationHullUpdater( 190 178 boost::bind(&GLMoleculeObject_molecule::updateTesselationHull, this) 191 ),192 IsSelectedUpdater(193 boost::bind(&GLMoleculeObject_molecule::updateIsSelected, this)194 179 ), 195 180 BoundingBoxUpdater( … … 210 195 "MoleculeTesselationHull_"+toString(_molid), 211 196 HullChannels), 212 isSelected(213 const_cast<const World * const>(World::getPointer()),214 IsSelectedUpdater,215 "MoleculeBoundingBox_"+toString(_molid),216 updateIsSelected(),217 BoundingBoxChannels),218 197 BoundingBox( 219 198 molref, … … 240 219 connect (this, SIGNAL(TesselationHullChanged()), this, SLOT(resetTesselationHull()), Qt::QueuedConnection); 241 220 connect (this, SIGNAL(BoundingBoxChanged()), this, SLOT(resetBoundingBox()), Qt::QueuedConnection); 242 connect (this, SIGNAL(IsSelectedChanged()), this, SLOT(resetIsSelected()), Qt::QueuedConnection);243 221 connect (this, SIGNAL(IdChanged()), this, SLOT(resetIndex()), Qt::QueuedConnection); 244 222 connect (this, SIGNAL(AtomInserted(const atomId_t)), this, SLOT(atomInserted(const atomId_t)), Qt::QueuedConnection); … … 262 240 owner->signOff(this, molecule::AtomMoved); 263 241 owner->signOff(this, molecule::IndexChanged); 264 /*_atom->signOff(this, AtomObservable::IndexChanged);265 _atom->signOff(this, AtomObservable::PositionChanged);266 _atom->signOff(this, AtomObservable::ElementChanged);267 _atom->signOff(this, AtomObservable::BondsAdded);*/268 World::getInstance().signOff(this, World::SelectionChanged);269 242 owner = NULL; 270 243 } … … 281 254 owner->signOn(this, molecule::AtomMoved); 282 255 owner->signOn(this, molecule::IndexChanged); 283 /*molref->signOn(this, AtomObservable::IndexChanged);284 molref->signOn(this, AtomObservable::PositionChanged);285 molref->signOn(this, AtomObservable::ElementChanged);286 molref->signOn(this, AtomObservable::BondsAdded);*/287 World::getInstance().signOn(this, World::SelectionChanged);288 256 } else { 289 257 ELOG(1, "GLMoleculeObject_molecule() - added null object for not present mol id " << MolIndex.get()); … … 407 375 } 408 376 409 bool GLMoleculeObject_molecule::updateIsSelected() const410 {411 return const_cast<const World &>(World::getInstance()).isMoleculeSelected(MolIndex.get());412 }413 414 377 GLMoleculeObject_molecule::BoundingBoxInfo GLMoleculeObject_molecule::updateBoundingBox() const 415 378 { … … 448 411 if (!TesselationHull.isValid()) 449 412 updateMesh(createMoleculeMesh(*TesselationHull)); 450 }451 452 void GLMoleculeObject_molecule::resetIsSelected()453 {454 setSelected(isSelected.get());455 413 } 456 414 … … 496 454 497 455 emit indexChanged(this, oldId, newId); 456 } 457 458 void GLMoleculeObject_molecule::AtomSelected(const atomId_t _id) 459 { 460 AtomNodeMap::iterator iter = AtomsinSceneMap.find(_id); 461 ASSERT( iter != AtomsinSceneMap.end(), 462 "GLMoleculeObject_molecule::AtomSelected() - atom "+toString(_id) 463 +" unknown to GLMoleculeObject_molecule."); 464 QMetaObject::invokeMethod(iter->second, // pointer to a QObject 465 "Selected", // member name (no parameters here) 466 Qt::QueuedConnection); // connection type 467 } 468 469 void GLMoleculeObject_molecule::AtomUnselected(const atomId_t _id) 470 { 471 AtomNodeMap::iterator iter = AtomsinSceneMap.find(_id); 472 ASSERT( iter != AtomsinSceneMap.end(), 473 "GLMoleculeObject_molecule::AtomUnselected() - atom "+toString(_id) 474 +" unknown to GLMoleculeObject_molecule."); 475 QMetaObject::invokeMethod(iter->second, // pointer to a QObject 476 "Unselected", // member name (no parameters here) 477 Qt::QueuedConnection); // connection type 478 } 479 480 void GLMoleculeObject_molecule::Selected() 481 { 482 ASSERT( !m_selected, 483 "GLMoleculeObject_molecule::Selected() - 3D rep of molecule is already selected."); 484 m_selected = true; 485 486 emit changed(); 487 } 488 489 void GLMoleculeObject_molecule::Unselected() 490 { 491 ASSERT( m_selected, 492 "GLMoleculeObject_molecule::Unselected() - 3D rep of molecule is already unselected."); 493 m_selected = false; 494 495 emit changed(); 498 496 } 499 497 … … 569 567 break; 570 568 } 571 }else{ 572 // notification from world 573 #ifdef LOG_OBSERVER 574 observerLog().addMessage() << "++ Update of Observer "<< observerLog().getName(static_cast<Observer *>(this)) 575 << " received notification from world for channel " 576 << notification->getChannelNo() << "."; 577 #endif 578 switch (notification->getChannelNo()) { 579 case World::SelectionChanged: 580 emit IsSelectedChanged(); 581 break; 582 default: 583 break; 584 } 585 } 569 } else 570 ASSERT(0, "GLMoleculeObject_molecule::recieveNotification() - received notification from unexpected source."); 586 571 } 587 572 … … 694 679 connect (atomObject, SIGNAL(hoverChanged(GLMoleculeObject *)), this, SIGNAL(changed())); 695 680 connect (atomObject, SIGNAL(hoverChanged(GLMoleculeObject *)), this, SLOT(hoverChangedSignalled(GLMoleculeObject *))); 696 connect (atomObject, SIGNAL(selectionChanged()), this, SIGNAL(changed()));697 681 // connect (atomObject, SIGNAL(bondsChanged()), this, SLOT(bondInserted(const atomId_t, const atomId_t, const GLMoleculeObject_bond::SideOfBond))); 698 connect (atomObject, SIGNAL(Bonds Inserted(const atomId_t, const atomId_t, const GLMoleculeObject_bond::SideOfBond)), this, SLOT(bondInserted(const atomId_t, const atomId_t, const GLMoleculeObject_bond::SideOfBond)));682 connect (atomObject, SIGNAL(BondsAdded(const atomId_t, const atomId_t, const GLMoleculeObject_bond::SideOfBond)), this, SLOT(bondInserted(const atomId_t, const atomId_t, const GLMoleculeObject_bond::SideOfBond))); 699 683 connect (atomObject, SIGNAL(BondsRemoved(const atomId_t, const atomId_t)), this, SLOT(bondRemoved(const atomId_t, const atomId_t))); 700 684 connect (atomObject, SIGNAL(indexChanged(GLMoleculeObject_atom*, const atomId_t, const atomId_t)), this, SLOT(changeAtomId(GLMoleculeObject_atom*, const atomId_t, const atomId_t)));
Note:
See TracChangeset
for help on using the changeset viewer.