Ignore:
Timestamp:
Sep 21, 2011, 8:04:30 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:
520f93
Parents:
caeeb8
git-author:
Frederik Heber <heber@…> (04/27/11 12:06:33)
git-committer:
Frederik Heber <heber@…> (09/21/11 20:04:30)
Message:

Splitted off Undo and Redo parts into own tests (3-step rule).

  • this way tests are cleaner as there are no old files left.
  • added lots of Undos/Redos.

Corrected all failing regression tests (of these new Undos/Redos):

Location:
src/Actions/MoleculeAction
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MoleculeAction/BondFileAction.cpp

    rcaeeb8 re69c87  
    6969
    7070Action::state_ptr MoleculeBondFileAction::performRedo(Action::state_ptr _state){
    71   // Undo and redo have to do the same for this action
    72   return performUndo(_state);
     71  return Action::failure;
    7372}
    7473
    7574bool MoleculeBondFileAction::canUndo() {
    76   return false;
     75  return true;
    7776}
    7877
    7978bool MoleculeBondFileAction::shouldUndo() {
    80   return false;
     79  return true;
    8180}
    8281/** =========== end of function ====================== */
  • src/Actions/MoleculeAction/LoadAction.cpp

    rcaeeb8 re69c87  
    9090
    9191bool MoleculeLoadAction::canUndo() {
    92   return false;
     92  return true;
    9393}
    9494
    9595bool MoleculeLoadAction::shouldUndo() {
    96   return false;
     96  return true;
    9797}
    9898/** =========== end of function ====================== */
  • src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp

    rcaeeb8 re69c87  
    6060    // Creation Line that is the rotation axis
    6161    Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
     62    DoLog(0) && (Log() << Verbose(0) <<  "Center of gravity is " << *CenterOfGravity << "." << std::endl);
    6263    Line RotationAxis(*CenterOfGravity, params.Axis);
    6364    delete(CenterOfGravity);
     
    7879  BOOST_FOREACH(molecule *mol, state->selectedMolecules) {
    7980    Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
     81    DoLog(0) && (Log() << Verbose(0) <<  "Center of gravity is " << *CenterOfGravity << "." << std::endl);
    8082    Line RotationAxis(*CenterOfGravity, state->params.Axis);
    8183    delete(CenterOfGravity);
     84    DoLog(0) && (Log() << Verbose(0) << "Rotate " << mol->getName() << " around self by " << -state->params.angle << " radian around axis " << RotationAxis << "." << endl);
    8285
    8386    for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
     
    9497  BOOST_FOREACH(molecule *mol, state->selectedMolecules) {
    9598    Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
     99    DoLog(0) && (Log() << Verbose(0) <<  "Center of gravity is " << *CenterOfGravity << "." << std::endl);
    96100    Line RotationAxis(*CenterOfGravity, state->params.Axis);
    97101    delete(CenterOfGravity);
     102    DoLog(0) && (Log() << Verbose(0) << "Rotate " << mol->getName() << " around self by " << state->params.angle << " radian around axis " << RotationAxis << "." << endl);
    98103
    99104    for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
  • src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp

    rcaeeb8 re69c87  
    7171
    7272Action::state_ptr MoleculeRotateToPrincipalAxisSystemAction::performRedo(Action::state_ptr _state){
    73   // Undo and redo have to do the same for this action
    74   return performUndo(_state);
     73  return Action::failure;
    7574}
    7675
    7776bool MoleculeRotateToPrincipalAxisSystemAction::canUndo() {
    78   return false;
     77  return true;
    7978}
    8079
    8180bool MoleculeRotateToPrincipalAxisSystemAction::shouldUndo() {
    82   return false;
     81  return true;
    8382}
    8483/** =========== end of function ====================== */
  • src/Actions/MoleculeAction/VerletIntegrationAction.cpp

    rcaeeb8 re69c87  
    7272
    7373Action::state_ptr MoleculeVerletIntegrationAction::performRedo(Action::state_ptr _state){
    74   // Undo and redo have to do the same for this action
    75   return performUndo(_state);
     74  return Action::failure;
    7675}
    7776
    7877bool MoleculeVerletIntegrationAction::canUndo() {
    79   return false;
     78  return true;
    8079}
    8180
    8281bool MoleculeVerletIntegrationAction::shouldUndo() {
    83   return false;
     82  return true;
    8483}
    8584/** =========== end of function ====================== */
Note: See TracChangeset for help on using the changeset viewer.