BALL  1.5.0
threads.h
Go to the documentation of this file.
1 #ifndef BALL_VIEW_KERNEL_THREADS_H
2 #define BALL_VIEW_KERNEL_THREADS_H
3 
4 #ifndef BALL_VIEW_KERNEL_COMMON_H_
6 #endif
7 
8 #include <QtCore/QThread>
9 #include <QtCore/QEvent>
10 
11 namespace BALL
12 {
13  class EnergyMinimizer;
14  class MolecularDynamics;
15  class Composite;
16  class DockingAlgorithm;
17  class TrajectoryFile;
18 
19 namespace VIEW
20 {
21  class MainControl;
22  class FDPBDialog;
23  class Message;
24  class Representation;
25  class GenerateCrystalDialog;
26 
32  : public QEvent
33  {
34  public:
35 
38  : QEvent((QEvent::Type)MESSAGE_EVENT),
39  message_(msg)
40  {}
41 
43  void setMessage(Message* msg) { message_ = msg; }
44 
46  Message* getMessage() { return message_; }
47 
48  protected:
49 
51  };
52 
53 
71  : public virtual QThread
72  {
73  public:
74 
76  BALLThread();
77 
79  void setMainControl(MainControl* mf) {main_control_ = mf;}
80 
82  void setComposite(Composite* composite) {composite_ = composite;}
83 
85  Composite* getComposite() { return composite_;}
86 
89  virtual void run() {};
90 
91  protected:
92 
96  void sendMessage_(Message* msg);
97 
104  void updateStructure_();
105 
107  void output_(const String& string, bool important = false);
108 
113  void waitForUpdateOfRepresentations_();
114 
117  };
118 
121  : public BALLThread
122  {
123  public:
124 
127 
129  virtual void run();
130 
132  void setFDPBDialog(FDPBDialog* dialog) {dialog_ = dialog;}
133 
134  protected:
136  };
137 
138 
141  : public BALLThread
142  {
143  public:
144 
147 
149  virtual void run();
150 
152  void setCrystalDialog(GenerateCrystalDialog* dialog) {dialog_ = dialog;}
153 
154  protected:
156  };
157 
160  : public BALLThread
161  {
162  public:
163 
166 
168  virtual void run();
169 
172  { rep_ = &rep;}
173 
176  { return rep_; }
177 
178  protected:
179 
181  };
182 
183 
190  : public BALLThread
191  {
192  public:
193 
196 
199  { steps_between_updates_ = steps;}
200 
202  void setTrajectoryFile(TrajectoryFile* file) {trajectory_file_ = file;}
203 
205  TrajectoryFile* getTrajectoryFile() { return trajectory_file_;}
206 
207  protected:
208 
210  void exportSceneToPNG_();
211 
213  void finish_();
214 
217  };
218 
219 
222  : public SimulationThread
223  {
224  public:
225 
228 
230  virtual ~EnergyMinimizerThread();
231 
233  virtual void run();
234 
236  void setEnergyMinimizer(EnergyMinimizer* minimizer);
237 
238  protected:
240  };
241 
242 
245  : public SimulationThread
246  {
247  public:
248 
251 
253  virtual ~MDSimulationThread();
254 
256  virtual void run();
257 
259  void setMolecularDynamics(MolecularDynamics* md);
260 
262  void setNumberOfSteps(Size steps) { steps_ = steps;}
263 
265  void setSaveImages(bool state) { save_images_ = state;}
266 
267  protected:
271  };
272 
273 
276  : public BALLThread
277  {
278  public:
280  DockingThread();
281 
283  virtual ~DockingThread();
284 
287  const DockingThread& operator =(const DockingThread& dock_thread);
288 
290  void setDockingAlgorithm(DockingAlgorithm* dock_alg);
291 
293  virtual void run();
294 
295  protected:
297  };
298 
299  }
300 }
301 #endif //BALL_VIEW_KERNEL_THREADS_H
virtual void run()
Definition: threads.h:89
void setNumberOfStepsBetweenUpdates(Size steps)
Definition: threads.h:198
MainControl * main_control_
Definition: threads.h:115
EnergyMinimizer * minimizer_
Definition: threads.h:239
Thread for MDSimulation.
Definition: threads.h:244
MessageEvent(Message *msg=0)
Definition: threads.h:37
void setCrystalDialog(GenerateCrystalDialog *dialog)
Definition: threads.h:152
void setComposite(Composite *composite)
Definition: threads.h:82
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
void setMainControl(MainControl *mf)
Definition: threads.h:79
void setFDPBDialog(FDPBDialog *dialog)
Definition: threads.h:132
Thread for EnergyMinimization.
Definition: threads.h:221
void setRepresentation(Representation &rep)
Definition: threads.h:171
Representation * getRepresentation()
Definition: threads.h:175
DockingAlgorithm * dock_alg_
Definition: threads.h:296
void setNumberOfSteps(Size steps)
Definition: threads.h:262
Composite * getComposite()
Definition: threads.h:85
TrajectoryFile * trajectory_file_
Definition: threads.h:216
MolecularDynamics * md_
Definition: threads.h:268
Message * getMessage()
Definition: threads.h:46
Definition: constants.h:12
GenerateCrystalDialog * dialog_
Definition: threads.h:155
void setTrajectoryFile(TrajectoryFile *file)
Definition: threads.h:202
Composite * composite_
Definition: threads.h:116
TrajectoryFile * getTrajectoryFile()
Definition: threads.h:205
Thread for Docking.
Definition: threads.h:275
void setMessage(Message *msg)
Definition: threads.h:43
void setSaveImages(bool state)
Definition: threads.h:265
An event with a contained VIEW message.