Computer Assited Medical Intervention Tool Kit  version 4.0
LoadsSimulation.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2016 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef LoadsSimulation_H
27 #define LoadsSimulation_H
28 
29 #include <QDialog>
30 
31 #include "PMComponentAPI.h"
32 
33 class QLineEdit;
34 
35 // forward declaration for the UI
36 namespace Ui {
37 class AnimationMotorDialog;
38 }
39 
40 //class used in this file
41 class LoadsSimulation;
42 class LoadsManager;
45 class QToolBar;
46 
54  Q_OBJECT
55 
56 public:
58  LoadsSimulation(LoadsManager * myLoadsManager, QWidget* parent = 0);
60  virtual ~LoadsSimulation();
61 
63  double getTime() const;
64 
69  void updateTime(bool getMotorTime=false);
70 
72  void addTab(QWidget *);
73 
77  void updateDisplay(bool force);
78 
80  void updateAtomData();
81 
82 public slots :
83 
87  bool doOneStep();
88 
90  void pause();
91 
93  void simulate();
94 
96  void simulateOneStep();
97 
99  void rewind();
100 
102  virtual void reject();
103 
104  // other widget interaction slots:
105  virtual void dtChanged();
106  virtual void tMaxChanged();
107  virtual void dtModified();
108  virtual void tMaxModified();
109  virtual void refreshDtChanged();
110  virtual void refreshDtModified();
111  virtual void chooseOutputDir();
112  virtual void videoToggled(bool);
113 
115  virtual void addAnimationMotorAddon();
116 
118  void init();
119 
120 private :
121 
123  void enableButtons(bool enable);
124 
126  void loadAddon(QString);
127  QString addonFilename;
128 
131 
133  QColor bgColor;
134 
137 
140 
142  QToolBar *simulationToolBar;
143 
145  QLineEdit *tLineEditToolbar;
146 
148  QString outputDirName;
149 
151  QString outputDir;
152 
154  unsigned int imageId;
155 
157  QAction *rewindToolbar;
158  QAction *playToolbar;
160  QAction *pauseToolbar;
161 
163  bool video;
164 
166  bool output;
167 
169  double elapsed;
170 
173 
175  Ui::AnimationMotorDialog *ui;
176 };
177 
178 
179 
180 #endif // LoadsSimulation_H
181 
182 
LoadsManager * myLM
the load manager
Definition: LoadsSimulation.h:130
double iterationCount
total nr of iteration computed (to calculate simulator frequency)
Definition: LoadsSimulation.h:172
Definition: SettingsDialog.h:31
#define PHYSICALMODEL_COMPONENT_API
Definition: PMComponentAPI.h:54
QString outputDirName
the output directory name for making videos
Definition: LoadsSimulation.h:148
bool video
record video or not?
Definition: LoadsSimulation.h:163
QAction * rewindToolbar
toolbar buttons
Definition: LoadsSimulation.h:157
QToolBar * simulationToolBar
the tool bar
Definition: LoadsSimulation.h:142
This class manages the applied all loads (see LML), deformation add-on, atom data monitoring and atom...
Definition: LoadsManager.h:69
unsigned int imageId
the number of screenshots
Definition: LoadsSimulation.h:154
QString addonFilename
Definition: LoadsSimulation.h:127
This class manages the display of a simulation (either an already made simulation opened in a single ...
Definition: LoadsSimulationDriver.h:47
double elapsed
total elapsed time (to calculate simulator frequency)
Definition: LoadsSimulation.h:169
LoadsSimulationDriver * simDriver
the code core for the display of a loads
Definition: LoadsSimulation.h:136
bool output
if there is no output directory we can&#39;t make video
Definition: LoadsSimulation.h:166
QAction * pauseToolbar
Definition: LoadsSimulation.h:160
The Animation Motor addon class.
Definition: AnimationMotorAddon.h:52
QAction * playToolbar
Definition: LoadsSimulation.h:158
QString outputDir
the output directory name for making videos
Definition: LoadsSimulation.h:151
Ui::AnimationMotorDialog * ui
the ui dialog designed in qtdesigner
Definition: LoadsSimulation.h:175
This dialog allows one to run a simulation using a simulation motor.
Definition: LoadsSimulation.h:53
QLineEdit * tLineEditToolbar
toolbar t line edit
Definition: LoadsSimulation.h:145
QColor bgColor
the initial bg color
Definition: LoadsSimulation.h:133
AnimationMotorAddon * myMotor
the motor
Definition: LoadsSimulation.h:139
QAction * playOneStepToolbar
Definition: LoadsSimulation.h:159