- Timestamp:
- Sep 21, 2011, 8:04:30 PM (13 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:
- 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)
- Location:
- src
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Action.cpp
rcaeeb8 re69c87 25 25 26 26 #include "Actions/Action.hpp" 27 #include "Actions/ActionExceptions.hpp" 27 28 #include "Actions/ActionRegistry.hpp" 28 29 #include "Actions/ActionHistory.hpp" … … 171 172 } 172 173 } 174 175 // throw an exception that can be caught in case of failure 176 if (state == Action::failure) 177 throw ActionFailureException() << ActionNameString(getName()); 173 178 } 174 179 Action::state_ptr Action::undo(state_ptr _state) { -
src/Actions/ActionHistory.cpp
rcaeeb8 re69c87 22 22 #include "Actions/ActionHistory.hpp" 23 23 24 #include "Actions/ActionExceptions.hpp" 25 24 26 #include <iostream> 25 27 … … 38 40 history.pop_back(); 39 41 Action::state_ptr newState = elem.action->undo(elem.state); 42 if (newState == Action::failure) 43 throw ActionFailureException() << ActionNameString(elem.action->getName()); 40 44 yrotsih.push_back(HistoryElement(elem.action,newState)); 41 45 } … … 45 49 yrotsih.pop_back(); 46 50 Action::state_ptr oldState = elem.action->redo(elem.state); 51 if (oldState == Action::failure) 52 throw ActionFailureException() << ActionNameString(elem.action->getName()); 47 53 history.push_back(HistoryElement(elem.action,oldState)); 48 54 } -
src/Actions/CommandAction/VerboseAction.cpp
rcaeeb8 re69c87 40 40 getParametersfromValueStorage(); 41 41 42 42 43 if (oldverbosity != params.verbosity) { 44 // prepare undo state 43 45 CommandVerboseState *UndoState = new CommandVerboseState(oldverbosity, params); 46 // set new verbosity 44 47 setVerbosity(params.verbosity); 45 48 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << oldverbosity << " to " << params.verbosity << "." << endl); … … 47 50 } else { 48 51 DoLog(0) && (Log() << Verbose(0) << "Verbosity remains unchanged at " << oldverbosity << "." << endl); 49 return Action:: failure;52 return Action::success; 50 53 } 51 54 } -
src/Actions/Makefile.am
rcaeeb8 re69c87 20 20 ACTIONSHEADER = \ 21 21 Actions/Action.hpp \ 22 Actions/ActionExceptions.hpp \ 22 23 Actions/Action_impl_header.hpp \ 23 24 Actions/Action_impl_pre.hpp \ -
src/Actions/MoleculeAction/BondFileAction.cpp
rcaeeb8 re69c87 69 69 70 70 Action::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; 73 72 } 74 73 75 74 bool MoleculeBondFileAction::canUndo() { 76 return false;75 return true; 77 76 } 78 77 79 78 bool MoleculeBondFileAction::shouldUndo() { 80 return false;79 return true; 81 80 } 82 81 /** =========== end of function ====================== */ -
src/Actions/MoleculeAction/LoadAction.cpp
rcaeeb8 re69c87 90 90 91 91 bool MoleculeLoadAction::canUndo() { 92 return false;92 return true; 93 93 } 94 94 95 95 bool MoleculeLoadAction::shouldUndo() { 96 return false;96 return true; 97 97 } 98 98 /** =========== end of function ====================== */ -
src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp
rcaeeb8 re69c87 60 60 // Creation Line that is the rotation axis 61 61 Vector *CenterOfGravity = mol->DetermineCenterOfGravity(); 62 DoLog(0) && (Log() << Verbose(0) << "Center of gravity is " << *CenterOfGravity << "." << std::endl); 62 63 Line RotationAxis(*CenterOfGravity, params.Axis); 63 64 delete(CenterOfGravity); … … 78 79 BOOST_FOREACH(molecule *mol, state->selectedMolecules) { 79 80 Vector *CenterOfGravity = mol->DetermineCenterOfGravity(); 81 DoLog(0) && (Log() << Verbose(0) << "Center of gravity is " << *CenterOfGravity << "." << std::endl); 80 82 Line RotationAxis(*CenterOfGravity, state->params.Axis); 81 83 delete(CenterOfGravity); 84 DoLog(0) && (Log() << Verbose(0) << "Rotate " << mol->getName() << " around self by " << -state->params.angle << " radian around axis " << RotationAxis << "." << endl); 82 85 83 86 for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) { … … 94 97 BOOST_FOREACH(molecule *mol, state->selectedMolecules) { 95 98 Vector *CenterOfGravity = mol->DetermineCenterOfGravity(); 99 DoLog(0) && (Log() << Verbose(0) << "Center of gravity is " << *CenterOfGravity << "." << std::endl); 96 100 Line RotationAxis(*CenterOfGravity, state->params.Axis); 97 101 delete(CenterOfGravity); 102 DoLog(0) && (Log() << Verbose(0) << "Rotate " << mol->getName() << " around self by " << state->params.angle << " radian around axis " << RotationAxis << "." << endl); 98 103 99 104 for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) { -
src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp
rcaeeb8 re69c87 71 71 72 72 Action::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; 75 74 } 76 75 77 76 bool MoleculeRotateToPrincipalAxisSystemAction::canUndo() { 78 return false;77 return true; 79 78 } 80 79 81 80 bool MoleculeRotateToPrincipalAxisSystemAction::shouldUndo() { 82 return false;81 return true; 83 82 } 84 83 /** =========== end of function ====================== */ -
src/Actions/MoleculeAction/VerletIntegrationAction.cpp
rcaeeb8 re69c87 72 72 73 73 Action::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; 76 75 } 77 76 78 77 bool MoleculeVerletIntegrationAction::canUndo() { 79 return false;78 return true; 80 79 } 81 80 82 81 bool MoleculeVerletIntegrationAction::shouldUndo() { 83 return false;82 return true; 84 83 } 85 84 /** =========== end of function ====================== */ -
src/boundary.cpp
rcaeeb8 re69c87 1345 1345 // TesselStruct->CorrectAllDegeneratedPolygons(); 1346 1346 // 1347 //// check envelope for consistency1348 //status = CheckListOfBaselines(TesselStruct);1347 // check envelope for consistency 1348 status = CheckListOfBaselines(TesselStruct); 1349 1349 1350 1350 // write final envelope -
src/builder_init.cpp
rcaeeb8 re69c87 42 42 #include "World.hpp" 43 43 44 #include "Actions/ActionExceptions.hpp" 45 #include "Actions/ActionHistory.hpp" 44 46 #include "Actions/ActionRegistry.hpp" 45 #include "Actions/ActionHistory.hpp"46 47 47 48 #include "RandomNumbers/RandomNumberDistributionFactory.hpp" … … 144 145 { 145 146 MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow(); 146 mainWindow->display(); 147 try { 148 mainWindow->display(); 149 } catch(ActionFailureException &e) { 150 std::cerr << "Action " << *boost::get_error_info<ActionNameString>(e) << " has failed." << std::endl; 151 World::getInstance().setExitFlag(5); 152 } 147 153 delete mainWindow; 148 154 }
Note:
See TracChangeset
for help on using the changeset viewer.