Changeset f54cda for src/Actions
- Timestamp:
- Sep 19, 2013, 8:23:52 PM (11 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:
- 76096d
- Parents:
- c5177f
- git-author:
- Frederik Heber <heber@…> (08/21/13 09:27:08)
- git-committer:
- Frederik Heber <heber@…> (09/19/13 20:23:52)
- Location:
- src/Actions
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Action.hpp
rc5177f rf54cda 29 29 namespace MoleCuilder { 30 30 class ActionHistory; 31 class ActionQueue; 31 32 class ActionRegistry; 32 33 class ActionSequence; … … 83 84 class Action 84 85 { 86 //!> grant ActionQueue access to undo() and redo() 85 87 friend class ActionHistory; 88 //!> grant ActionQueue access to call() 89 friend class ActionQueue; 90 //!> grant ActionRegistry access to cstors (for ActionRegistry::fillRegistry()) 86 91 friend class ActionRegistry; 92 //!> grant ActionSequence access to Action's private stuff 87 93 friend class ActionSequence; 94 //!> grant all Registry templates access to cstor and dstor (for Registry<T>::cleanup()) 88 95 template <typename T> friend class ::Registry; 89 96 //!> TextMenu needs to instantiate some specific Actions, grant access to cstor … … 112 119 virtual ~Action(); 113 120 114 public:115 121 /** 116 122 * This method is used to call an action. The basic operations for the Action … … 128 134 void call(enum QueryOptions state = Interactive); 129 135 136 public: 130 137 /** 131 138 * This method provides a flag that indicates if an undo mechanism is implemented -
src/Actions/ActionQueue.cpp
rc5177f rf54cda 60 60 } 61 61 62 void ActionQueue::queueAction(const std::string &name )62 void ActionQueue::queueAction(const std::string &name, enum Action::QueryOptions state) 63 63 { 64 64 Action* _action = AR->getActionByName(name); 65 65 queue.push_back(_action); 66 _action->call(); 66 _action->call(state); 67 } 68 69 void ActionQueue::queueAction(Action *_action, enum Action::QueryOptions state) 70 { 71 queue.push_back(_action); 72 _action->call(state); 67 73 } 68 74 -
src/Actions/ActionQueue.hpp
rc5177f rf54cda 19 19 #include <vector> 20 20 21 #include "Actions/Action.hpp" 21 22 #include "Actions/ActionState.hpp" 22 23 23 24 namespace MoleCuilder { 24 25 25 class Action;26 26 class ActionHistory; 27 27 class ActionRegistry; … … 42 42 /** Queues the Action with \a name to be called. 43 43 * 44 * \param name token of Action to queue 45 * \param state whether Actions needs to be filled via a Dialog or not 44 46 */ 45 void queueAction(const std::string &name); 47 void queueAction(const std::string &name, enum Action::QueryOptions state = Action::Interactive); 48 49 /** Queues the Action with \a name to be called. 50 * 51 * \param _action action to add 52 * \param state whether Actions needs to be filled via a Dialog or not 53 */ 54 void queueAction(Action *_action, enum Action::QueryOptions state = Action::Interactive); 46 55 47 56 /** Returns the spawned action by token \a name. -
src/Actions/Action_impl_pre.hpp
rc5177f rf54cda 296 296 #include BOOST_PP_LOCAL_ITERATE() 297 297 #endif 298 ToCall->call(Action::NonInteractive);298 ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive); 299 299 }; 300 300 … … 313 313 #include BOOST_PP_LOCAL_ITERATE() 314 314 #endif 315 ToCall->call(MoleCuilder::Action::NonInteractive);315 ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive); 316 316 }; 317 317 -
src/Actions/GraphAction/SubgraphDissectionAction.cpp
rc5177f rf54cda 159 159 #include BOOST_PP_LOCAL_ITERATE() 160 160 #endif 161 ToCall->call(Action::NonInteractive);161 ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive); 162 162 }; 163 163 … … 176 176 #include BOOST_PP_LOCAL_ITERATE() 177 177 #endif 178 ToCall->call(MoleCuilder::Action::NonInteractive);178 ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive); 179 179 }; 180 180 -
src/Actions/MakroAction_impl_pre.hpp
rc5177f rf54cda 297 297 #include BOOST_PP_LOCAL_ITERATE() 298 298 #endif 299 ToCall->call(Action::NonInteractive);299 ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive); 300 300 }; 301 301 … … 314 314 #include BOOST_PP_LOCAL_ITERATE() 315 315 #endif 316 ToCall->call(MoleCuilder::Action::NonInteractive);316 ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive); 317 317 }; 318 318 -
src/Actions/ManipulateAtomsProcess.hpp
rc5177f rf54cda 21 21 #include "Descriptors/AtomDescriptor.hpp" 22 22 23 class manipulateAtomsTest; 23 24 class World; 24 25 … … 29 30 class ManipulateAtomsProcess : public Process 30 31 { 32 friend class ::manipulateAtomsTest; 31 33 public: 32 34 ManipulateAtomsProcess(boost::function<void(atom*)> _operation, AtomDescriptor descr,const ActionTrait &_trait); … … 37 39 38 40 virtual void doManipulate(World *); 41 42 private: 43 /** Wrap function Action::call() to allow manipulateAtomsTest access. 44 * 45 */ 46 void call(enum QueryOptions state = Interactive) 47 { Process::call(state); } 39 48 40 49 protected: -
src/Actions/Reaction_impl_pre.hpp
rc5177f rf54cda 201 201 #include BOOST_PP_LOCAL_ITERATE() 202 202 #endif 203 ToCall->call(Action::NonInteractive); 204 205 return static_cast<Reaction< RETURNTYPE > *>(ToCall)->getResult(); 203 ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive); 204 Reaction< RETURNTYPE > * resultaction = static_cast<Reaction< RETURNTYPE > *>(ToCall); 205 ASSERT( resultaction != NULL, 206 " COMMAND - static cast to Reaction type failed."); 207 ASSERT( resultaction->hasResult (), 208 " _COMMAND - result is not done yet?"); 209 return resultaction->getResult(); 206 210 }; 207 211 … … 220 224 #include BOOST_PP_LOCAL_ITERATE() 221 225 #endif 222 ToCall->call(MoleCuilder::Action::NonInteractive); 223 224 return static_cast<Reaction< RETURNTYPE > *>(ToCall)->getResult(); 226 ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive); 227 Reaction< RETURNTYPE > * resultaction = static_cast<Reaction< RETURNTYPE > *>(ToCall); 228 ASSERT( resultaction != NULL, 229 " COMMAND - static cast to Reaction type failed."); 230 ASSERT( resultaction->hasResult (), 231 " _COMMAND - result is not done yet?"); 232 return resultaction->getResult(); 225 233 }; 226 234
Note:
See TracChangeset
for help on using the changeset viewer.