source: molecuilder/src/Actions/ManipulateAtomsProcess.cpp@ f2efcf

Last change on this file since f2efcf was 98a2987, checked in by Tillmann Crueger <crueger@…>, 16 years ago

Added -Wall flag and fixed several small hickups

  • Property mode set to 100644
File size: 950 bytes
Line 
1/*
2 * ManipulateAtomsProcess.cpp
3 *
4 * Created on: Feb 18, 2010
5 * Author: crueger
6 */
7
8#include "ManipulateAtomsProcess.hpp"
9
10#include <iostream>
11
12using namespace std;
13
14ManipulateAtomsProcess::ManipulateAtomsProcess(boost::function<void(atom*)> _operation, AtomDescriptor _descr,
15 std::string _name,bool _doRegister) :
16 Process(0,_name,_doRegister),
17 descr(_descr),
18 operation(_operation)
19{}
20
21ManipulateAtomsProcess::~ManipulateAtomsProcess()
22{}
23
24void ManipulateAtomsProcess::call(){
25 World::get()->doManipulate(this);
26}
27
28void ManipulateAtomsProcess::undo(){
29
30}
31
32bool ManipulateAtomsProcess::canUndo(){
33 return false;
34}
35
36void ManipulateAtomsProcess::doManipulate(World *world){
37 setMaxSteps(world->numAtoms());
38 start();
39 World::AtomIterator iter;
40 for(iter=world->getAtomIter(descr);iter!=world->atomEnd();++iter){
41 setCurrStep(iter.getCount());
42 operation(*iter);
43 }
44 stop();
45}
Note: See TracBrowser for help on using the repository browser.