Changeset b5c53d for src/Actions


Ignore:
Timestamp:
Aug 9, 2010, 6:33:29 PM (15 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:
353e82
Parents:
458447 (diff), e588312 (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.
Message:

Merge branch 'StructureRefactoring' into stable

Conflicts:

src/Actions/AtomAction/AddAction.cpp
src/Actions/AtomAction/ChangeElementAction.cpp
src/Parser/XyzParser.cpp
src/analysis_correlation.cpp
src/atom.cpp
src/config.cpp
src/molecule.cpp

  • AtomInfo::element were privatized in stable and element::symbol, ::name in StructureRefactoring (overlapped in various lines).
Location:
src/Actions
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AnalysisAction/PairCorrelationAction.cpp

    r458447 rb5c53d  
    7575  ofstream output;
    7676  ofstream binoutput;
    77   std::vector< element *> elements;
     77  std::vector<const element *> elements;
    7878  string type;
    7979  Vector Point;
  • src/Actions/AnalysisAction/PointCorrelationAction.cpp

    r458447 rb5c53d  
    7676  ofstream output;
    7777  ofstream binoutput;
    78   std::vector< element *> elements;
     78  std::vector<const element *> elements;
    7979  string type;
    8080  Vector Point;
     
    9696  cout << "Point to correlate to is  " << Point << endl;
    9797  CorrelationToPointMap *correlationmap = NULL;
    98   for(std::vector< element *>::iterator iter = elements.begin(); iter != elements.end(); ++iter)
    99     cout << "element is " << (*iter)->symbol << endl;
     98  for(std::vector<const element *>::iterator iter = elements.begin(); iter != elements.end(); ++iter)
     99    cout << "element is " << (*iter)->getSymbol() << endl;
    100100  std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules();
    101101  if (periodic)
  • src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp

    r458447 rb5c53d  
    7979  ofstream output;
    8080  ofstream binoutput;
    81   std::vector< element *> elements;
     81  std::vector<const element *> elements;
    8282  string type;
    8383  Vector Point;
  • src/Actions/AtomAction/AddAction.cpp

    r458447 rb5c53d  
    5252
    5353Action::state_ptr AtomAddAction::performCall() {
    54   element * elemental = NULL;
     54  const element * elemental = NULL;
    5555  Vector position;
    5656
     
    6363  first->setType(elemental);
    6464  first->setPosition(position);
    65   DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->getType()->name << " at " << (first->getPosition()) << "." << endl);
     65  DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->getType()->getName() << " at " << (first->getPosition()) << "." << endl);
    6666  // TODO: remove when all of World's atoms are stored.
    6767  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
  • src/Actions/AtomAction/ChangeElementAction.cpp

    r458447 rb5c53d  
    5151Action::state_ptr AtomChangeElementAction::performCall() {
    5252  atom *first = NULL;
    53   element *elemental = NULL;
     53  const element *elemental;
    5454  molecule *mol = NULL;
    5555
     
    5858  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    5959    first = iter->second;
    60     DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elemental->symbol << "." << endl);
     60    DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << *elemental << "." << endl);
    6161    mol = first->getMolecule();
    6262    first->removeFromMolecule(); // remove atom
  • src/Actions/MapOfActions.cpp

    r458447 rb5c53d  
    296296
    297297  // value types for the actions
    298   TypeMap["add-atom"] = &typeid(element);
     298  TypeMap["add-atom"] = &typeid(const element);
    299299  TypeMap["bond-file"] = &typeid(std::string);
    300300  TypeMap["bond-table"] = &typeid(std::string);
     
    302302  TypeMap["center-in-box"] = &typeid(BoxValue);
    303303  TypeMap["change-box"] = &typeid(BoxValue);
    304   TypeMap["change-element"] = &typeid(element);
     304  TypeMap["change-element"] = &typeid(const element);
    305305  TypeMap["change-molname"] = &typeid(std::string);
    306306  TypeMap["convex-envelope"] = &typeid(void);
     
    348348  TypeMap["distances"] = &typeid(VectorValue);
    349349  TypeMap["DoRotate"] = &typeid(bool);
    350   TypeMap["element"] = &typeid(element);
    351   TypeMap["elements"] = &typeid(std::vector<element *>);
     350  TypeMap["element"] = &typeid(const element);
     351  TypeMap["elements"] = &typeid(std::vector<const element *>);
    352352  TypeMap["end-step"] = &typeid(int);
    353353  TypeMap["id-mapping"] = &typeid(bool);
     
    386386  TypeEnumMap[&typeid(atom)] = Atom;
    387387  TypeEnumMap[&typeid(std::vector<atom *>)] = ListOfAtoms;
    388   TypeEnumMap[&typeid(element)] = Element;
    389   TypeEnumMap[&typeid(std::vector<element *>)] = ListOfElements;
     388  TypeEnumMap[&typeid(const element)] = Element;
     389  TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElements;
    390390
    391391  // default values for any action that needs one (always string!)
     
    568568}
    569569
    570 void MapOfActions::queryCurrentValue(const char * name, class element * &_T)  {
     570void MapOfActions::queryCurrentValue(const char * name, const element * &_T)  {
    571571  int Z = -1;
    572   if (typeid( element ) == *TypeMap[name]) {
     572  if (typeid(const element ) == *TypeMap[name]) {
    573573    if (CurrentValue.find(name) == CurrentValue.end())
    574574      throw MissingValueException(__FILE__, __LINE__);
     
    652652}
    653653
    654 void MapOfActions::queryCurrentValue(const char * name, std::vector<element *>&_T)
     654void MapOfActions::queryCurrentValue(const char * name, std::vector<const element *>&_T)
    655655{
    656656  int Z = -1;
    657   element *elemental = NULL;
    658   if (typeid( std::vector<element *> ) == *TypeMap[name]) {
     657  const element *elemental = NULL;
     658  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
    659659    if (CurrentValue.find(name) == CurrentValue.end())
    660660      throw MissingValueException(__FILE__, __LINE__);
     
    704704}
    705705
    706 void MapOfActions::setCurrentValue(const char * name, class element * &_T)
    707 {
    708   if (typeid( element ) == *TypeMap[name]) {
     706void MapOfActions::setCurrentValue(const char * name, const element * &_T)
     707{
     708  if (typeid(const element ) == *TypeMap[name]) {
    709709    std::ostringstream stream;
    710710    stream << _T->Z;
     
    764764}
    765765
    766 void MapOfActions::setCurrentValue(const char * name, std::vector<element *>&_T)
    767 {
    768   if (typeid( std::vector<element *> ) == *TypeMap[name]) {
     766void MapOfActions::setCurrentValue(const char * name, std::vector<const element *>&_T)
     767{
     768  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
    769769    std::ostringstream stream;
    770     for (std::vector<element *>::iterator iter = _T.begin(); iter != _T.end(); ++iter) {
     770    for (std::vector<const element *>::iterator iter = _T.begin(); iter != _T.end(); ++iter) {
    771771      stream << (*iter)->Z << " ";
    772772    }
  • src/Actions/MapOfActions.hpp

    r458447 rb5c53d  
    164164
    165165  void queryCurrentValue(const char * name, class atom * &_T);
    166   void queryCurrentValue(const char * name, class element * &_T);
     166  void queryCurrentValue(const char * name, const element * &_T);
    167167  void queryCurrentValue(const char * name, class molecule * &_T);
    168168  void queryCurrentValue(const char * name, class Box &_T);
    169169  void queryCurrentValue(const char * name, class Vector &_T);
    170170  void queryCurrentValue(const char * name, std::vector<atom *>&_T);
    171   void queryCurrentValue(const char * name, std::vector<element *>&_T);
     171  void queryCurrentValue(const char * name, std::vector<const element *>&_T);
    172172  void queryCurrentValue(const char * name, std::vector<molecule *>&_T);
    173173  template<typename T> void queryCurrentValue(const char * name, T &_T)
     
    198198
    199199  void setCurrentValue(const char * name, class atom * &_T);
    200   void setCurrentValue(const char * name, class element * &_T);
     200  void setCurrentValue(const char * name, const element * &_T);
    201201  void setCurrentValue(const char * name, class molecule * &_T);
    202202  void setCurrentValue(const char * name, class Box &_T);
    203203  void setCurrentValue(const char * name, class Vector &_T);
    204204  void setCurrentValue(const char * name, std::vector<atom *>&_T);
    205   void setCurrentValue(const char * name, std::vector<element *>&_T);
     205  void setCurrentValue(const char * name, std::vector<const element *>&_T);
    206206  void setCurrentValue(const char * name, std::vector<molecule *>&_T);
    207207  template<class T> void setCurrentValue(const char * name, T &_T)
Note: See TracChangeset for help on using the changeset viewer.