Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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-2014 UJF-Grenoble 1, 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 "ui_AnimationMotorDialog.h"
32 
33 //class used in this file
34 class LoadsSimulation;
35 class LoadsManager;
38 class QToolBar;
39 
46 class LoadsSimulation : public QDialog {
47  Q_OBJECT
48 
49 public:
51  LoadsSimulation(LoadsManager * myLoadsManager, QWidget* parent = 0);
53  virtual ~LoadsSimulation();
54 
56  double getTime() const;
57 
62  void updateTime(bool getMotorTime=false);
63 
65  void addTab(QWidget *);
66 
70  void updateDisplay(bool force);
71 
72 public slots :
73 
77  bool doOneStep();
78 
80  void pause();
81 
83  void simulate();
84 
86  void simulateOneStep();
87 
89  void rewind();
90 
92  virtual void reject();
93 
94  // other widget interaction slots:
95  virtual void dtChanged();
96  virtual void tMaxChanged();
97  virtual void dtModified();
98  virtual void tMaxModified();
99  virtual void refreshDtChanged();
100  virtual void refreshDtModified();
101  virtual void chooseOutputDir();
102  virtual void videoToggled(bool);
103 
105  virtual void addAnimationMotorAddon();
106 
108  void init();
109 
110 private :
111 
113  void enableButtons(bool enable);
114 
116  void loadAddon(QString);
117  QString addonFilename;
118 
121 
123  QColor bgColor;
124 
127 
130 
132  QToolBar *simulationToolBar;
133 
135  QLineEdit *tLineEditToolbar;
136 
138  QString outputDirName;
139 
141  QString outputDir;
142 
144  unsigned int imageId;
145 
147  QAction *rewindToolbar;
148  QAction *playToolbar;
150  QAction *pauseToolbar;
151 
153  bool video;
154 
156  bool output;
157 
159  double elapsed;
160 
163 
165  Ui::AnimationMotorDialog ui;
166 };
167 
168 
169 
170 #endif // LoadsSimulation_H
171 
172 
LoadsManager * myLM
the load manager
Definition: LoadsSimulation.h:120
void updateDisplay(bool force)
update the display (the boolean indicates if the scene3d has to be refresh or not) ...
double iterationCount
total nr of iteration computed (to calculate simulator frequency)
Definition: LoadsSimulation.h:162
void loadAddon(QString)
load a animation motor add-on using a filename (shared lib location)
void addTab(QWidget *)
add a tabulation (will be remove when the current animation motor add-on will be removed ...
QString outputDirName
the output directory name for making videos
Definition: LoadsSimulation.h:138
void pause()
Slot called when the button Pause is clicked.
virtual void chooseOutputDir()
bool doOneStep()
do one step of simulation
bool video
record video or not?
Definition: LoadsSimulation.h:153
void rewind()
Slot called when the button Rewind is clicked.
void simulate()
Slot called when the button Play is clicked.
QAction * rewindToolbar
toolbar buttons
Definition: LoadsSimulation.h:147
virtual void dtModified()
void init()
init display
QToolBar * simulationToolBar
the tool bar
Definition: LoadsSimulation.h:132
virtual void tMaxChanged()
void simulateOneStep()
Slot called when the next step is clicked.
virtual void reject()
dialog is closed
virtual void dtChanged()
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:144
QString addonFilename
Definition: LoadsSimulation.h:117
void enableButtons(bool enable)
set the rew,play,pause,step buttons enable or not
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:159
virtual void refreshDtChanged()
virtual void tMaxModified()
LoadsSimulationDriver * simDriver
the code core for the display of a loads
Definition: LoadsSimulation.h:126
Ui::AnimationMotorDialog ui
the ui dialog designed in qtdesigner
Definition: LoadsSimulation.h:165
virtual ~LoadsSimulation()
Destructor.
bool output
if there is no output directory we can't make video
Definition: LoadsSimulation.h:156
QAction * pauseToolbar
Definition: LoadsSimulation.h:150
LoadsSimulation(LoadsManager *myLoadsManager, QWidget *parent=0)
Default Constructor.
The Animation Motor addon class.
Definition: AnimationMotorAddon.h:52
QAction * playToolbar
Definition: LoadsSimulation.h:148
virtual void addAnimationMotorAddon()
adding a animation motor add-on (in the 2nd tab)
double getTime() const
get the actual time
QString outputDir
the output directory name for making videos
Definition: LoadsSimulation.h:141
This dialog allows to run a simulation using a simulation motor.
Definition: LoadsSimulation.h:46
QLineEdit * tLineEditToolbar
toolbar t line edit
Definition: LoadsSimulation.h:135
void updateTime(bool getMotorTime=false)
update time display
QColor bgColor
the initial bg color
Definition: LoadsSimulation.h:123
virtual void videoToggled(bool)
AnimationMotorAddon * myMotor
the motor
Definition: LoadsSimulation.h:129
virtual void refreshDtModified()
QAction * playOneStepToolbar
Definition: LoadsSimulation.h:149