Changeset f01769 for src/UIElements
- Timestamp:
- Jul 24, 2015, 4:44:34 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:
- a58c16
- Parents:
- 1259df
- git-author:
- Frederik Heber <heber@…> (06/01/15 16:57:36)
- git-committer:
- Frederik Heber <heber@…> (07/24/15 16:44:34)
- Location:
- src/UIElements
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp
r1259df rf01769 64 64 return false; 65 65 } 66 temp = World::getInstance().getAtom(AtomById(IdxOfAtom));66 temp = const_cast<const World &>(World::getInstance()).getAtom(AtomById(IdxOfAtom)); 67 67 return true; 68 68 } -
src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp
r1259df rf01769 61 61 const atom *temp_element; 62 62 for (std::vector<int>::iterator iter = IdxOfAtom.begin(); iter != IdxOfAtom.end(); ++iter) { 63 temp_element = World::getInstance().getAtom(AtomById(*iter));63 temp_element = const_cast<const World &>(World::getInstance()).getAtom(AtomById(*iter)); 64 64 if (temp_element) 65 65 temp.push_back(temp_element); -
src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp
r1259df rf01769 59 59 return false; 60 60 } 61 temp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));61 temp = const_cast<const World &>(World::getInstance()).getMolecule(MoleculeById(IdxOfMol)); 62 62 return true; 63 63 } -
src/UIElements/Qt4/Query/AtomQtQuery.cpp
r1259df rf01769 73 73 QVariant data = inputBox->itemData(newIndex); 74 74 int idx = data.toInt(); 75 temp = World::getInstance().getAtom(AtomById(idx));75 temp = const_cast<const World &>(World::getInstance()).getAtom(AtomById(idx)); 76 76 dialog->update(); 77 77 } -
src/UIElements/Qt4/Query/MoleculeQtQuery.cpp
r1259df rf01769 78 78 QVariant data = inputBox->itemData(newIndex); 79 79 int idx = data.toInt(); 80 temp = World::getInstance().getMolecule(MoleculeById(idx));80 temp = const_cast<const World &>(World::getInstance()).getMolecule(MoleculeById(idx)); 81 81 dialog->update(); 82 82 } -
src/UIElements/TextUI/Query/AtomTextQuery.cpp
r1259df rf01769 66 66 } 67 67 68 temp = World::getInstance().getAtom(AtomById(idxOfAtom));68 temp = const_cast<const World &>(World::getInstance()).getAtom(AtomById(idxOfAtom)); 69 69 if(!temp && idxOfAtom!=-1){ 70 70 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl; -
src/UIElements/TextUI/Query/AtomsTextQuery.cpp
r1259df rf01769 64 64 std::istringstream stream(std::string(iter, olditer)); 65 65 stream >> idxOfAtom; 66 temp_element = World::getInstance().getAtom(AtomById(idxOfAtom));66 temp_element = const_cast<const World &>(World::getInstance()).getAtom(AtomById(idxOfAtom)); 67 67 if(!temp_element && idxOfAtom!=-1){ 68 68 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl; … … 76 76 std::istringstream stream(std::string(olditer, line.end())); 77 77 stream >> idxOfAtom; 78 temp_element = World::getInstance().getAtom(AtomById(idxOfAtom));78 temp_element = const_cast<const World &>(World::getInstance()).getAtom(AtomById(idxOfAtom)); 79 79 if(!temp_element && idxOfAtom!=-1) { 80 80 std::cout << "Invalid Atom Index" << idxOfAtom << std::endl; -
src/UIElements/TextUI/Query/MoleculeTextQuery.cpp
r1259df rf01769 67 67 } 68 68 69 temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));69 temp = const_cast<const World &>(World::getInstance()).getMolecule(MoleculeById(idxOfMol)); 70 70 if(!temp && idxOfMol!=-1){ 71 71 std::cout << "Invalid Molecule Index" << std::endl; -
src/UIElements/TextUI/Query/MoleculesTextQuery.cpp
r1259df rf01769 64 64 std::istringstream stream(std::string(iter, olditer)); 65 65 stream >> idxOfMol; 66 temp_element = World::getInstance().getMolecule(MoleculeById(idxOfMol));66 temp_element = const_cast<const World &>(World::getInstance()).getMolecule(MoleculeById(idxOfMol)); 67 67 if(!temp_element && idxOfMol!=-1){ 68 68 std::cout << "Invalid Molecule Index" << idxOfMol << std::endl; … … 76 76 std::istringstream stream(std::string(olditer, line.end())); 77 77 stream >> idxOfMol; 78 temp_element = World::getInstance().getMolecule(MoleculeById(idxOfMol));78 temp_element = const_cast<const World &>(World::getInstance()).getMolecule(MoleculeById(idxOfMol)); 79 79 if(!temp_element && idxOfMol!=-1){ 80 80 std::cout << "Invalid Molecule Index" << idxOfMol << std::endl; -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp
r1259df rf01769 61 61 { 62 62 // sign on as observer (obtain non-const instance before) 63 const atom *_atom = World::getInstance().getAtom(AtomById(atomicid)); 63 const atom * const _atom = const_cast<const World &>(World::getInstance()). 64 getAtom(AtomById(atomicid)); 64 65 if (_atom != NULL) { 65 66 _atom->signOn(this, AtomObservable::IndexChanged); … … 82 83 GLMoleculeObject_atom::~GLMoleculeObject_atom() 83 84 { 84 const atom *_atom = World::getInstance().getAtom(AtomById(atomicid)); 85 const atom * const _atom = const_cast<const World &>(World::getInstance()). 86 getAtom(AtomById(atomicid)); 85 87 if (_atom != NULL){ 86 88 _atom->signOff(this, AtomObservable::IndexChanged); … … 102 104 void GLMoleculeObject_atom::resetPosition() 103 105 { 104 const atom *_atom = World::getInstance().getAtom(AtomById(atomicid)); 106 const atom * const _atom = const_cast<const World &>(World::getInstance()). 107 getAtom(AtomById(atomicid)); 105 108 if (_atom != NULL) { 106 109 const Vector Position = _atom->getPosition(); … … 116 119 { 117 120 size_t elementno = 0; 118 const atom *_atom = World::getInstance().getAtom(AtomById(atomicid)); 121 const atom * const _atom = const_cast<const World &>(World::getInstance()). 122 getAtom(AtomById(atomicid)); 119 123 const element *_type = NULL; 120 124 if (_atom != NULL) { … … 192 196 void GLMoleculeObject_atom::recieveNotification(Observable *publisher, Notification_ptr notification) 193 197 { 194 const atom *_atom = World::getInstance().getAtom(AtomById(atomicid)); 198 const atom * const _atom = const_cast<const World &>(World::getInstance()). 199 getAtom(AtomById(atomicid)); 195 200 if (publisher == dynamic_cast<const Observable*>(_atom)){ 196 201 // notofication from atom … … 212 217 case AtomObservable::BondsAdded: 213 218 { 214 const atom *_atom = World::getInstance().getAtom(AtomById(atomicid)); 219 const atom * const _atom = const_cast<const World &>(World::getInstance()). 220 getAtom(AtomById(atomicid)); 215 221 if (_atom != NULL) { 216 222 // make sure position is up-to-date -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.cpp
r1259df rf01769 91 91 case left: 92 92 { 93 const atom *_rightatom = World::getInstance().getAtom(AtomById(rightatomId)); 93 const atom * const _rightatom = const_cast<const World &>(World::getInstance()). 94 getAtom(AtomById(rightatomId)); 94 95 if (_rightatom->getType() != NULL) { 95 96 elementno = _rightatom->getType()->getAtomicNumber(); … … 101 102 case right: 102 103 { 103 const atom *_leftatom = World::getInstance().getAtom(AtomById(leftatomId)); 104 const atom * const _leftatom = const_cast<const World &>(World::getInstance()). 105 getAtom(AtomById(leftatomId)); 104 106 if (_leftatom->getType() != NULL) { 105 107 elementno = _leftatom->getType()->getAtomicNumber(); … … 138 140 // from the AtomObservable itself 139 141 if (leftobservable_enabled) { 140 const atom *_leftatom = World::getInstance().getAtom(AtomById(leftatomId)); 142 const atom * const _leftatom = const_cast<const World &>(World::getInstance()). 143 getAtom(AtomById(leftatomId)); 141 144 if (_leftatom != NULL) { 142 145 _leftatom->signOff(this); … … 152 155 // from the AtomObservable itself 153 156 if (rightobservable_enabled) { 154 const atom *_rightatom = World::getInstance().getAtom(AtomById(rightatomId)); 157 const atom * const _rightatom = const_cast<const World &>(World::getInstance()). 158 getAtom(AtomById(rightatomId)); 155 159 if (_rightatom != NULL) { 156 160 _rightatom->signOff(this); … … 172 176 // from the AtomObservable itself 173 177 if (leftobservable_enabled) { 174 const atom *_leftatom = World::getInstance().getAtom(AtomById(leftatomId)); 178 const atom * const _leftatom = const_cast<const World &>(World::getInstance()). 179 getAtom(AtomById(leftatomId)); 175 180 if (_leftatom != NULL) { 176 181 _leftatom->signOff(this, AtomObservable::PositionChanged); … … 182 187 } 183 188 if (rightobservable_enabled) { 184 const atom *_rightatom = World::getInstance().getAtom(AtomById(rightatomId)); 189 const atom * const _rightatom = const_cast<const World &>(World::getInstance()). 190 getAtom(AtomById(rightatomId)); 185 191 if (_rightatom != NULL) { 186 192 _rightatom->signOff(this, AtomObservable::PositionChanged); … … 349 355 Vector Position; 350 356 Vector OtherPosition; 351 const atom *_leftatom = World::getInstance().getAtom(AtomById(leftatomId)); 357 const atom * const _leftatom = const_cast<const World &>(World::getInstance()). 358 getAtom(AtomById(leftatomId)); 352 359 Vector LeftPos = _leftatom->getPosition(); 353 const atom *_rightatom = World::getInstance().getAtom(AtomById(rightatomId)); 360 const atom * const _rightatom = const_cast<const World &>(World::getInstance()). 361 getAtom(AtomById(rightatomId)); 354 362 Vector RightPos = _rightatom->getPosition(); 355 363 switch (BondSide) { -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.cpp
r1259df rf01769 567 567 568 568 // add all bonds 569 const atom *Walker = World::getInstance().getAtom(AtomById(_id)); 569 const atom * const Walker = const_cast<const World &>(World::getInstance()). 570 getAtom(AtomById(_id)); 570 571 if (Walker != NULL) 571 572 addAtomBonds(Walker); -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
r1259df rf01769 143 143 { 144 144 LOG(3, "INFO: GLMoleculeObject_molecule - atom " << no << " has been clicked."); 145 const atom *Walker = World::getInstance().getAtom(AtomById(no)); 145 const atom * const Walker = const_cast<const World &>(World::getInstance()). 146 getAtom(AtomById(no)); 146 147 if (selectionMode == SelectAtom){ 147 148 if (!World::getInstance().isSelected(Walker)) … … 184 185 LOG(3, "INFO: GLWorldScene: Received signal atomInserted for atom "+toString(_id)+"."); 185 186 // find associated molecule 186 const atom *_atom = World::getInstance().getAtom(AtomById(_id)); 187 const atom * const _atom = const_cast<const World &>(World::getInstance()). 188 getAtom(AtomById(_id)); 187 189 if (_atom != NULL) { 188 190 const moleculeId_t molid = _atom->getMolecule()->getId(); -
src/UIElements/Views/Qt4/QtFragmentList.cpp
r1259df rf01769 133 133 indexiter != (*keyiter)->end(); 134 134 ++indexiter) { 135 const atom *_atom = World::getInstance().getAtom(AtomById(*indexiter)); 135 const atom * const _atom = const_cast<const World &>(World::getInstance()). 136 getAtom(AtomById(*indexiter)); 136 137 if (_atom != NULL) 137 138 formula.addElements(_atom->getElementNo(), 1);
Note:
See TracChangeset
for help on using the changeset viewer.