- Timestamp:
- Feb 12, 2016, 11:15:06 PM (9 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:
- 15c8a9
- Parents:
- 099f67
- git-author:
- Frederik Heber <heber@…> (01/25/16 11:01:10)
- git-committer:
- Frederik Heber <heber@…> (02/12/16 23:15:06)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp
r099f67 r026bef 78 78 GLMoleculeObject_atom::AtomBondsChannels(getAtomBondsChannels()); 79 79 80 GLMoleculeObject_atom::GLMoleculeObject_atom(QGLSceneNode *mesh[], QObject *parent, const atomId_t _id) : 80 GLMoleculeObject_atom::GLMoleculeObject_atom( 81 QGLSceneNode *mesh[], 82 QObject *parent, 83 const atomId_t _id) : 81 84 GLMoleculeObject(mesh, parent), 82 85 Observer(std::string("GLMoleculeObject_atom")+toString(_id)), … … 86 89 owner(NULL) 87 90 { 88 boost::function<void( )> subjectKilled =89 boost::bind(&GLMoleculeObject_atom::countsubjectKilled, this );91 boost::function<void(const atomId_t)> subjectKilled = 92 boost::bind(&GLMoleculeObject_atom::countsubjectKilled, this, _id); 90 93 initObservedValues(ObservedValues, _id, atomref, subjectKilled); 91 94 95 init(_id); 96 } 97 98 GLMoleculeObject_atom::GLMoleculeObject_atom( 99 QGLSceneNode *mesh[], 100 QObject *parent, 101 const atomId_t _id, 102 std::vector<boost::any> _ObservedValues) : 103 GLMoleculeObject(mesh, parent), 104 Observer(std::string("GLMoleculeObject_atom")+toString(_id)), 105 atomref(getAtom(_id)), 106 ObservedValues(_ObservedValues), 107 subjectKilledCount(0), 108 owner(NULL) 109 { 110 init(_id); 111 } 112 113 void GLMoleculeObject_atom::init(const atomId_t _id) 114 { 92 115 setObjectId(_id); 93 116 resetPosition(); … … 317 340 deactivateObserver(); 318 341 319 countsubjectKilled( );342 countsubjectKilled(getAtomIndex()); 320 343 } 321 344 … … 348 371 } 349 372 350 void GLMoleculeObject_atom::countsubjectKilled( )373 void GLMoleculeObject_atom::countsubjectKilled(const atomId_t) 351 374 { 352 375 ++subjectKilledCount; … … 360 383 const atomId_t _id, 361 384 const atom * const _atomref, 362 const boost::function<void( )> &_subjectKilled)385 const boost::function<void(const atomId_t)> &_subjectKilled) 363 386 { 364 387 /* This is an old note from when the code was still part of cstor's initializer body. … … 399 422 boost::bind(&GLMoleculeObject_atom::updateBonds, AtomIndexGetter)); 400 423 401 _ObservedValues[AtomPosition] = new ObservedValue_wCallback<Vector >(424 _ObservedValues[AtomPosition] = new ObservedValue_wCallback<Vector, atomId_t>( 402 425 _atomref, 403 426 AtomPositionUpdater, … … 405 428 AtomPositionUpdater(), 406 429 AtomPositionChannels, 407 _subjectKilled); 408 _ObservedValues[AtomElement] = new ObservedValue_wCallback<atomicNumber_t>( 430 _subjectKilled, 431 AtomIndexGetter); 432 _ObservedValues[AtomElement] = new ObservedValue_wCallback<atomicNumber_t, atomId_t>( 409 433 _atomref, 410 434 AtomElementUpdater, … … 412 436 AtomElementUpdater(), 413 437 AtomElementChannels, 414 _subjectKilled); 415 _ObservedValues[AtomBonds] = new ObservedValue_wCallback<ListOfBonds_t>( 438 _subjectKilled, 439 AtomIndexGetter); 440 _ObservedValues[AtomBonds] = new ObservedValue_wCallback<ListOfBonds_t, atomId_t>( 416 441 _atomref, 417 442 AtomBondsUpdater, … … 419 444 AtomBondsUpdater(), 420 445 AtomBondsChannels, 421 _subjectKilled); 446 _subjectKilled, 447 AtomIndexGetter); 422 448 } 423 449 … … 426 452 { 427 453 delete boost::any_cast<ObservedValue_wCallback<atomId_t> *>(_ObservedValues[AtomIndex]); 428 delete boost::any_cast<ObservedValue_wCallback<Vector > *>(_ObservedValues[AtomPosition]);429 delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t > *>(_ObservedValues[AtomElement]);430 delete boost::any_cast<ObservedValue_wCallback<ListOfBonds_t > *>(_ObservedValues[AtomBonds]);454 delete boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(_ObservedValues[AtomPosition]); 455 delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t, atomId_t> *>(_ObservedValues[AtomElement]); 456 delete boost::any_cast<ObservedValue_wCallback<ListOfBonds_t, atomId_t> *>(_ObservedValues[AtomBonds]); 431 457 _ObservedValues.clear(); 432 458 } … … 439 465 Vector GLMoleculeObject_atom::getAtomPosition() const 440 466 { 441 return boost::any_cast<ObservedValue_wCallback<Vector > *>(ObservedValues[AtomPosition])->get();467 return boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(ObservedValues[AtomPosition])->get(); 442 468 } 443 469 444 470 atomicNumber_t GLMoleculeObject_atom::getAtomElement() const 445 471 { 446 return boost::any_cast<ObservedValue_wCallback<atomicNumber_t > *>(ObservedValues[AtomElement])->get();472 return boost::any_cast<ObservedValue_wCallback<atomicNumber_t, atomId_t> *>(ObservedValues[AtomElement])->get(); 447 473 } 448 474 449 475 GLMoleculeObject_atom::ListOfBonds_t GLMoleculeObject_atom::getAtomBonds() const 450 476 { 451 return boost::any_cast<ObservedValue_wCallback<ListOfBonds_t > *>(ObservedValues[AtomBonds])->get();452 } 477 return boost::any_cast<ObservedValue_wCallback<ListOfBonds_t, atomId_t> *>(ObservedValues[AtomBonds])->get(); 478 }
Note:
See TracChangeset
for help on using the changeset viewer.