Changeset 1259df for src/UIElements


Ignore:
Timestamp:
Jul 24, 2015, 4:44:34 PM (10 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:
f01769
Parents:
63fb7a
git-author:
Frederik Heber <heber@…> (06/01/15 08:56:36)
git-committer:
Frederik Heber <heber@…> (07/24/15 16:44:34)
Message:

Replaced World::getAllMolecules() wherever possible by const version.

Location:
src/UIElements
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Qt4/Query/MoleculeQtQuery.cpp

    r63fb7a r1259df  
    5555  inputBox = new QComboBox();
    5656  // add all molecules to the combo box
    57   vector<molecule*> molecules = World::getInstance().getAllMolecules();
    58   for(vector<molecule*>::iterator iter  = molecules.begin();
     57  vector<const molecule*> molecules =
     58      const_cast<const World &>(World::getInstance()).getAllMolecules();
     59  for(vector<const molecule*>::const_iterator iter  = molecules.begin();
    5960      iter != molecules.end();
    6061      ++iter) {
  • src/UIElements/Views/Qt4/MoleculeList/QtMoleculeList.cpp

    r63fb7a r1259df  
    273273  changing = true;
    274274
    275   const std::vector<molecule*> &molecules = World::getInstance().getAllMolecules();
     275  const std::vector<const molecule*> &molecules =
     276      const_cast<const World &>(World::getInstance()).getAllMolecules();
    276277
    277278  clear();
     
    288289  toBeSetVisibilityItems.clear();
    289290
    290   for (std::vector<molecule*>::const_iterator iter = molecules.begin();
     291  for (std::vector<const molecule*>::const_iterator iter = molecules.begin();
    291292      iter != molecules.end();
    292293      iter++)
  • src/UIElements/Views/Qt4/MoleculeList/QtMoleculeListView.cpp

    r63fb7a r1259df  
    106106      if ((index.column() == 0) && (selectionModel()->isSelected(index))) {
    107107        const moleculeId_t mol_id = moleculelist->IndexToMoleculeId(index);
    108         const molecule * const mol = World::getInstance().getMolecule(MoleculeById(mol_id));
     108        const molecule * const mol = const_cast<const World &>(World::getInstance()).
     109            getMolecule(MoleculeById(mol_id));
    109110        // check for invalid molecule
    110111        if (mol_id < 0)
     
    129130      if ((index.column() == 0) && (!selectionModel()->isSelected(index))) {
    130131        const moleculeId_t mol_id = moleculelist->IndexToMoleculeId(index);
    131         const molecule * const mol = World::getInstance().getMolecule(MoleculeById(mol_id));
     132        const molecule * const mol = const_cast<const World &>(World::getInstance()).
     133            getMolecule(MoleculeById(mol_id));
    132134        // check for invalid molecule
    133135        if (mol_id < 0)
  • src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp

    r63fb7a r1259df  
    107107void GLWorldScene::init()
    108108{
    109   const std::vector<molecule *> &molecules = World::getInstance().getAllMolecules();
    110 
    111   for (std::vector<molecule*>::const_iterator moliter = molecules.begin();
     109  const std::vector<const molecule *> &molecules =
     110      const_cast<const World &>(World::getInstance()).getAllMolecules();
     111
     112  for (std::vector<const molecule*>::const_iterator moliter = molecules.begin();
    112113      moliter != molecules.end();
    113114      moliter++) {
     
    125126void GLWorldScene::update()
    126127{
    127   const std::vector<molecule *> &molecules = World::getInstance().getAllMolecules();
    128 
    129   for (std::vector<molecule*>::const_iterator moliter = molecules.begin();
     128  const std::vector<const molecule *> &molecules =
     129      const_cast<const World &>(World::getInstance()).getAllMolecules();
     130
     131  for (std::vector<const molecule*>::const_iterator moliter = molecules.begin();
    130132      moliter != molecules.end();
    131133      moliter++) {
     
    243245  LOG(3, "INFO: GLWorldScene: Received signal selectionChanged.");
    244246
    245   const std::vector<molecule*> &molecules = World::getInstance().getAllMolecules();
     247  const std::vector<const molecule*> &molecules =
     248      const_cast<const World &>(World::getInstance()).getAllMolecules();
    246249
    247250  if (molecules.size() > 0) {
    248     for (std::vector<molecule*>::const_iterator Runner = molecules.begin();
     251    for (std::vector<const molecule*>::const_iterator Runner = molecules.begin();
    249252        Runner != molecules.end();
    250253        Runner++) {
    251254
    252255      // molecule selected but not in scene?
    253       const bool isSelected = World::getInstance().isSelected(*Runner);
     256      const bool isSelected =
     257          const_cast<const World &>(World::getInstance()).isSelected(*Runner);
    254258      if (isSelected){
    255259        MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find((*Runner)->getId());
Note: See TracChangeset for help on using the changeset viewer.