source:
src/Actions/ManipulateAtomsProcess.hpp@
5f869d7
| Last change on this file since 5f869d7 was a82f61, checked in by , 10 years ago | |
|---|---|
|
|
| File size: 1.5 KB | |
| Rev | Line | |
|---|---|---|
| [b2cfdb] | 1 | /* |
| 2 | * ManipulateAtomsProcess.hpp | |
| 3 | * | |
| 4 | * Created on: Feb 18, 2010 | |
| 5 | * Author: crueger | |
| 6 | */ | |
| 7 | ||
| 8 | #ifndef MANIPULATEATOMSPROCESS_HPP_ | |
| 9 | #define MANIPULATEATOMSPROCESS_HPP_ | |
| 10 | ||
| [56f73b] | 11 | // include config.h |
| 12 | #ifdef HAVE_CONFIG_H | |
| 13 | #include <config.h> | |
| 14 | #endif | |
| 15 | ||
| 16 | ||
| [b2cfdb] | 17 | #include "Actions/Process.hpp" |
| [6e97e5] | 18 | |
| 19 | #include<boost/function.hpp> | |
| 20 | ||
| [b2cfdb] | 21 | #include "Descriptors/AtomDescriptor.hpp" |
| 22 | ||
| [f54cda] | 23 | class manipulateAtomsTest; |
| [6e97e5] | 24 | class World; |
| 25 | ||
| [ce7fdc] | 26 | namespace MoleCuilder { |
| 27 | ||
| [0c8056] | 28 | class ActionRegistry; |
| 29 | ||
| [b2cfdb] | 30 | class ManipulateAtomsProcess : public Process |
| 31 | { | |
| [f54cda] | 32 | friend class ::manipulateAtomsTest; |
| [b2cfdb] | 33 | public: |
| [126867] | 34 | ManipulateAtomsProcess(boost::function<void(atom*)> _operation, AtomDescriptor descr,const ActionTrait &_trait); |
| [b2cfdb] | 35 | virtual ~ManipulateAtomsProcess(); |
| 36 | ||
| 37 | virtual bool canUndo(); | |
| [67e2b3] | 38 | virtual bool shouldUndo(); |
| [afb47f] | 39 | |
| [af5384] | 40 | Action* clone(enum QueryOptions flag = Interactive) const; |
| 41 | ||
| [46b181] | 42 | void outputAsCLI(std::ostream &ost) const; |
| [477012] | 43 | void outputAsPython(std::ostream &ost, const std::string &prefix) const; |
| [46b181] | 44 | |
| [a82f61] | 45 | void setOptionValue(const std::string &_token, const std::string &_value); |
| 46 | ||
| [afb47f] | 47 | virtual void doManipulate(World *); |
| [67e2b3] | 48 | |
| [f54cda] | 49 | private: |
| 50 | /** Wrap function Action::call() to allow manipulateAtomsTest access. | |
| 51 | * | |
| 52 | */ | |
| [af5384] | 53 | void call() |
| 54 | { Process::call(); } | |
| [f54cda] | 55 | |
| [047878] | 56 | protected: |
| 57 | virtual Dialog * fillDialog(Dialog*); | |
| 58 | private: | |
| [b5b01e] | 59 | virtual ActionState::ptr performCall(); |
| 60 | virtual ActionState::ptr performUndo(ActionState::ptr); | |
| 61 | virtual ActionState::ptr performRedo(ActionState::ptr); | |
| [67e2b3] | 62 | |
| [b2cfdb] | 63 | AtomDescriptor descr; |
| 64 | boost::function<void(atom*)> operation; | |
| 65 | }; | |
| 66 | ||
| [ce7fdc] | 67 | } |
| 68 | ||
| [b2cfdb] | 69 | #endif /* MANIPULATEATOMSPROCESS_HPP_ */ |
Note:
See TracBrowser
for help on using the repository browser.
