Changeset e3ce0e for src/Actions


Ignore:
Timestamp:
Jun 20, 2018, 8:20:43 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, StoppableMakroAction
Children:
4b2adf
Parents:
559293
git-author:
Frederik Heber <frederik.heber@…> (09/13/17 17:20:35)
git-committer:
Frederik Heber <frederik.heber@…> (06/20/18 08:20:43)
Message:

MakroAction allows getting the internal ActionSequence's current step.

Location:
src/Actions
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/ActionSequence.cpp

    r559293 re3ce0e  
    4747
    4848ActionSequence::ActionSequence() :
    49     loop(1)
     49    loop(1),
     50    step(0)
    5051{}
    5152
    5253ActionSequence::ActionSequence(const ActionSequence &_other) :
    53     loop(1)
     54    loop(1),
     55    step(0)
    5456{
    5557  // we need to override copy cstor as we have pointer referenced objects
     
    114116void ActionSequence::callAll()
    115117{
    116   for (size_t i=0;i<loop;++i)
     118  for (step=0;step<loop;++step)
    117119    for(actionSet::iterator it=actions.begin(); it!=actions.end(); it++){
    118120      // we want to have a global bookkeeping for all actions in the sequence, so
     
    128130{
    129131  stateSet states;
    130   for (size_t i=0;i<loop;++i)
     132  for (step=0;step<loop;++step)
    131133    for(actionSet::iterator it=actions.begin(); it!=actions.end(); it++){
    132134      // we want to have a global bookkeeping for all actions in the sequence, so
  • src/Actions/ActionSequence.hpp

    r559293 re3ce0e  
    6767  void setLoop(unsigned int _loop)
    6868  { loop = _loop; }
     69
     70  unsigned int getStep() const
     71  { return step; }
     72
    6973private:
    7074  actionSet actions;
    7175  //!> how often the sequence is repeated
    7276  unsigned int loop;
     77  //!> current step (used in loops)
     78  unsigned int step;
    7379};
    7480
  • src/Actions/MakroAction.cpp

    r559293 re3ce0e  
    8888}
    8989
     90unsigned int MakroAction::getLoop() const
     91{
     92  return actions.getLoop();
     93}
     94
     95unsigned int MakroAction::getStep() const
     96{
     97  return actions.getStep();
     98}
     99
    90100bool MakroAction::removeAction(const std::string &name)
    91101{
  • src/Actions/MakroAction.hpp

    r559293 re3ce0e  
    5454  virtual void unprepare(ActionRegistry &AR);
    5555
     56  void setLoop(unsigned int _loop);
     57
     58  unsigned int getLoop() const;
     59
     60  unsigned int getStep() const;
     61
    5662protected:
    5763  virtual ~MakroAction();
     
    7884  virtual ActionState::ptr performRedo(ActionState::ptr);
    7985
    80   void setLoop(unsigned int _loop);
    81 
    8286private:
    8387  /** fillDialog is used to spawn sequence queries, hence must not be modified by
Note: See TracChangeset for help on using the changeset viewer.