- 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_atom.cpp
re5a477 r015f8c 75 75 const Observable::channels_t 76 76 GLMoleculeObject_atom::AtomBondsChannels(getAtomBondsChannels()); 77 const Observable::channels_t78 GLMoleculeObject_atom::AtomSelectionStatusChannels(World::SelectionChanged);79 77 80 78 GLMoleculeObject_atom::GLMoleculeObject_atom(QGLSceneNode *mesh[], QObject *parent, const atomId_t _id) : … … 106 104 updateBonds(), 107 105 AtomBondsChannels), 108 AtomSelectionStatus(109 World::getPointer(),110 boost::bind(&GLMoleculeObject_atom::updateSelectionStatus, this),111 "AtomSelectionStatus_"+toString(_id),112 updateSelectionStatus(),113 AtomSelectionStatusChannels),114 106 owner(NULL) 115 107 { … … 129 121 connect( this, SIGNAL(positionChanged()), this, SLOT(resetPosition()), Qt::QueuedConnection); 130 122 connect( this, SIGNAL(bondsChanged()), this, SLOT(resetPosition()), Qt::QueuedConnection); 131 connect( this, SIGNAL(selectionstatusChanged()), this, SLOT(resetSelectionStatus()), Qt::QueuedConnection);132 123 } 133 124 … … 141 132 owner->signOn(this, AtomObservable::BondsAdded); 142 133 owner->signOn(this, AtomObservable::BondsRemoved); 143 World::getInstance().signOn(this, World::SelectionChanged);144 134 } 145 135 } … … 155 145 owner->signOff(this, AtomObservable::BondsAdded); 156 146 owner->signOff(this, AtomObservable::BondsRemoved); 157 World::getInstance().signOff(this, World::SelectionChanged);158 147 owner = NULL; 159 148 } … … 241 230 } 242 231 243 void GLMoleculeObject_atom::resetSelectionStatus() 244 { 245 setSelected(AtomSelectionStatus.get()); 246 } 232 void GLMoleculeObject_atom::Selected() 233 { 234 ASSERT( !m_selected, 235 "GLMoleculeObject_atom::Selected() - 3D rep of atom is already selected."); 236 m_selected = true; 237 238 emit changed(); 239 } 240 241 void GLMoleculeObject_atom::Unselected() 242 { 243 ASSERT( m_selected, 244 "GLMoleculeObject_atom::Unselected() - 3D rep of atom is already unselected."); 245 m_selected = false; 246 247 emit changed(); 248 } 249 247 250 248 251 void GLMoleculeObject_atom::draw(QGLPainter *painter, const QVector4D &cameraPlane) … … 315 318 } 316 319 317 bool GLMoleculeObject_atom::updateSelectionStatus() const318 {319 const atom * const _atom = getAtom(AtomIndex.get());320 if (_atom != NULL) {321 return const_cast<const World &>(World::getInstance()).isSelected(_atom);322 }323 return false;324 }325 326 320 void GLMoleculeObject_atom::update(Observable *publisher) 327 321 { … … 358 352 break; 359 353 } 360 } else if (publisher == static_cast<World *>(World::getPointer())) { 361 switch (notification->getChannelNo()) { 362 case World::SelectionChanged: 363 emit selectionstatusChanged(); 364 break; 365 default: 366 ASSERT(0, "GLMoleculeObject_atom::recieveNotification() - we are not signed on to channel " 367 +toString(notification->getChannelNo())+" of the World."); 368 break; 369 } 370 } 371 } 354 } else 355 ASSERT(0, "GLMoleculeObject_atom::recieveNotification() - received notification from unexpected source."); 356 }
Note:
See TracChangeset
for help on using the changeset viewer.