MorphoGraphX  2.0-1-227
MiscProcessAnimate.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef MISC_PROCESS_ANIMATE_HPP
12 #define MISC_PROCESS_ANIMATE_HPP
13 
14 #include <Quaternion.hpp>
15 #include <Process.hpp>
16 
17 namespace mgx
18 {
19  typedef std::vector<Quaternion> QuaternionVec;
22 
28  class mgxBase_EXPORT AnimationAddKeyFrame : public Process
29  {
30  public:
31  AnimationAddKeyFrame(const Process& process) : Process(process)
32  {
33  setName("Misc/Animate/Add Key Frame");
34  setDesc("Add a key frame to the animation");
35  setIcon(QIcon(":/images/AverageStacks.png"));
36 
37  addParm("Steps", "Steps from previous frame", "100");
38  }
39  bool run() { return run(parm("Steps").toInt()); }
40  bool run(int steps);
41  };
42 
48  class mgxBase_EXPORT AnimationPlay : public Process
49  {
50  public:
51  AnimationPlay(const Process& process) : Process(process)
52  {
53  setName("Misc/Animate/Play");
54  setDesc("Add a key frame to the animation");
55  setIcon(QIcon(":/images/Process.png"));
56 
57  addParm("Loop", "Loop animation", "No", booleanChoice());
58  }
59  bool run() { return run(stringToBool(parm("Loop"))); }
60  bool run(bool loop);
61  };
62 
68  class mgxBase_EXPORT AnimationClear : public Process
69  {
70  public:
71  AnimationClear(const Process& process) : Process(process)
72  {
73  setName("Misc/Animate/Clear");
74  setDesc("Add a key frame to the animation");
75  setIcon(QIcon(":/images/Clear.png"));
76  }
77  bool run();
78  };
79 
85  class mgxBase_EXPORT AnimationSave : public Process
86  {
87  public:
88  AnimationSave(const Process& process) : Process(process)
89  {
90  setName("Misc/Animate/Save");
91  setDesc("Save the key frames to a file");
92  setIcon(QIcon(":/images/save.png"));
93 
94  addParm("File Name", "File name to save key frames", "Animation.txt");
95  }
96  bool run() { return run(parm("File Name")); }
97  bool run(const QString &fileName);
98  };
99 
105  class mgxBase_EXPORT AnimationLoad : public Process
106  {
107  public:
108  AnimationLoad(const Process& process) : Process(process)
109  {
110  setName("Misc/Animate/Load");
111  setDesc("Load the key frames to a file");
112  setIcon(QIcon(":/images/open.png"));
113 
114  addParm("File Name", "File name to load key frames", "Animation.txt");
115  }
116  bool run() { return run(parm("File Name")); }
117  bool run(const QString &fileName);
118  };
120 }
121 
122 #endif
mgx::AnimationSave
Definition: MiscProcessAnimate.hpp:85
mgx::AnimationAddKeyFrame::run
bool run()
Runs the process.
Definition: MiscProcessAnimate.hpp:39
Process.hpp
mgx::AnimationAddKeyFrame
Definition: MiscProcessAnimate.hpp:28
mgx::AnimationSave::run
bool run()
Runs the process.
Definition: MiscProcessAnimate.hpp:96
Quaternion.hpp
mgx::AnimationAddKeyFrame::AnimationAddKeyFrame
AnimationAddKeyFrame(const Process &process)
Definition: MiscProcessAnimate.hpp:31
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::AnimationClear
Definition: MiscProcessAnimate.hpp:68
mgx::Process
Definition: Process.hpp:219
mgx::AnimationClear::AnimationClear
AnimationClear(const Process &process)
Definition: MiscProcessAnimate.hpp:71
mgx::stringToBool
mgx_EXPORT bool stringToBool(const QString &string)
Helper function converting a string into a boolean.
mgx::AnimationPlay
Definition: MiscProcessAnimate.hpp:48
mgx::AnimationLoad::run
bool run()
Runs the process.
Definition: MiscProcessAnimate.hpp:116
mgx::AnimationLoad::AnimationLoad
AnimationLoad(const Process &process)
Definition: MiscProcessAnimate.hpp:108
mgx::QuaternionVec
std::vector< Quaternion > QuaternionVec
Definition: MiscProcessAnimate.hpp:19
mgx::AnimationSave::AnimationSave
AnimationSave(const Process &process)
Definition: MiscProcessAnimate.hpp:88
mgx::AnimationPlay::run
bool run()
Runs the process.
Definition: MiscProcessAnimate.hpp:59
mgx::AnimationLoad
Definition: MiscProcessAnimate.hpp:105
mgx::AnimationPlay::AnimationPlay
AnimationPlay(const Process &process)
Definition: MiscProcessAnimate.hpp:51