Ignore:
Timestamp:
Apr 11, 2012, 4:52:37 PM (14 years ago)
Author:
Frederik Heber <heber@…>
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:
3e93332
Parents:
c0ed1e (diff), 3927ef (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Frederik Heber <heber@…> (04/06/12 11:59:28)
git-committer:
Frederik Heber <heber@…> (04/11/12 16:52:37)
Message:

Merge branch 'michi-track-molecules' into stable

Conflicts:

src/World.hpp

File:
1 edited

Legend:

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

    rc0ed1e r53059e  
    4141{
    4242  QGLBuilder builder;
    43   builder << QGLSphere(0.5);
     43  builder << QGLSphere(2.0);
    4444  QGLSceneNode *n = builder.finalizedSceneNode();
    4545  n->setParent(parent);
     
    5757  atomref->signOn(this, AtomObservable::ElementChanged);
    5858  atomref->signOn(this, AtomObservable::BondsAdded);
     59  World::getInstance().signOn(this, World::SelectionChanged);
    5960
    6061  // set the object's id
     
    7273  _atom->signOff(this, AtomObservable::ElementChanged);
    7374  _atom->signOff(this, AtomObservable::BondsAdded);
     75  World::getInstance().signOff(this, World::SelectionChanged);
    7476}
    7577
     
    104106      "GLMoleculeObject_atom::GLMoleculeObject_atom() - QGLMaterial ref from getter function is NULL.");
    105107  setMaterial(elementmaterial);
    106   QGLMaterial *hovermaterial = getMaterial(0); // 0 is the hover material
    107   ASSERT(hovermaterial != NULL,
    108       "GLMoleculeObject_atom::GLMoleculeObject_atom() - QGLMaterial ref from getter function for hover is NULL.");
    109   setHoverMaterial(hovermaterial);
    110108
    111109  // set scale
     
    116114    radius = 0.5;
    117115  }
    118   setScale( radius );
     116  setScale( radius / 4. );
    119117}
    120118
     
    136134  // set the object's id
    137135  resetIndex();
     136
     137  // selected?
     138  setSelected(World::getInstance().isSelected(_atom));
    138139}
    139140
     
    143144void GLMoleculeObject_atom::recieveNotification(Observable *publisher, Notification_ptr notification)
    144145{
     146  if (publisher == dynamic_cast<const Observable*>(_atom)){
     147    // notofication from atom
    145148#ifdef LOG_OBSERVER
    146   observerLog().addMessage() << "++ Update of Observer "<< observerLog().getName(this)
    147       << " received notification from atom " << _atom->getId() << " for channel "
    148       << notification->getChannelNo() << ".";
    149 #endif
    150   switch (notification->getChannelNo()) {
    151     case AtomObservable::ElementChanged:
    152       resetElement();
    153       break;
    154     case AtomObservable::IndexChanged:
    155       resetIndex();
    156       break;
    157     case AtomObservable::PositionChanged:
    158       resetPosition();
    159       break;
    160     case AtomObservable::BondsAdded:
     149    observerLog().addMessage() << "++ Update of Observer "<< observerLog().getName(this)
     150          << " received notification from atom " << _atom->getId() << " for channel "
     151          << notification->getChannelNo() << ".";
     152#endif
     153    switch (notification->getChannelNo()) {
     154      case AtomObservable::ElementChanged:
     155        resetElement();
     156        emit changed();
     157        break;
     158      case AtomObservable::IndexChanged:
     159        resetIndex();
     160        break;
     161      case AtomObservable::PositionChanged:
     162        resetPosition();
     163        emit changed();
     164        break;
     165      case AtomObservable::BondsAdded:
    161166      {
    162         ASSERT(!_atom->getListOfBonds().empty(),
    163             "GLMoleculeObject_atom::recieveNotification() - received BondsAdded but ListOfBonds is empty.");
    164         const bond * _bond = *(_atom->getListOfBonds().rbegin());
    165         const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == _atom) ?
    166             GLMoleculeObject_bond::left : GLMoleculeObject_bond::right;
    167         emit BondsInserted(_bond, side);
    168         break;
    169       }
    170     default:
    171       //setProperties();
    172       break;
     167          ASSERT(!_atom->getListOfBonds().empty(),
     168              "GLMoleculeObject_atom::recieveNotification() - received BondsAdded but ListOfBonds is empty.");
     169          const bond * _bond = *(_atom->getListOfBonds().rbegin());
     170          const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == _atom) ?
     171              GLMoleculeObject_bond::left : GLMoleculeObject_bond::right;
     172          emit BondsInserted(_bond, side);
     173          break;
     174        }
     175      default:
     176        //setProperties();
     177        break;
     178    }
     179  }else{
     180    // notification from world
     181#ifdef LOG_OBSERVER
     182    observerLog().addMessage() << "++ Update of Observer "<< observerLog().getName(this)
     183          << " received notification from world for channel "
     184          << notification->getChannelNo() << ".";
     185#endif
     186    switch (notification->getChannelNo()) {
     187      case World::SelectionChanged:
     188        setSelected(World::getInstance().isSelected(_atom));
     189        break;
     190      default:
     191        break;
     192    }
    173193  }
    174194}
Note: See TracChangeset for help on using the changeset viewer.