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 
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 
105 
107  void output_(const String& string, bool important = false);
108 
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 
211 
213  void finish_();
214 
217  };
218 
219 
222  : public SimulationThread
223  {
224  public:
225 
228 
231 
233  virtual void run();
234 
237 
238  protected:
240  };
241 
242 
245  : public SimulationThread
246  {
247  public:
248 
251 
254 
256  virtual void run();
257 
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:
281 
283  virtual ~DockingThread();
284 
287  const DockingThread& operator =(const DockingThread& dock_thread);
288 
291 
293  virtual void run();
294 
295  protected:
297  };
298 
299  }
300 }
301 #endif //BALL_VIEW_KERNEL_THREADS_H
Definition: constants.h:13
@ MESSAGE_EVENT
An event with a contained VIEW message.
MessageEvent(Message *msg=0)
Definition: threads.h:37
void setMessage(Message *msg)
Definition: threads.h:43
Message * getMessage()
Definition: threads.h:46
void sendMessage_(Message *msg)
Composite * getComposite()
Definition: threads.h:85
MainControl * main_control_
Definition: threads.h:115
Composite * composite_
Definition: threads.h:116
void output_(const String &string, bool important=false)
Sends the string as outout to Log.info.
void waitForUpdateOfRepresentations_()
void setMainControl(MainControl *mf)
Definition: threads.h:79
void setComposite(Composite *composite)
Definition: threads.h:82
virtual void run()
Definition: threads.h:89
void setFDPBDialog(FDPBDialog *dialog)
Definition: threads.h:132
void setCrystalDialog(GenerateCrystalDialog *dialog)
Definition: threads.h:152
GenerateCrystalDialog * dialog_
Definition: threads.h:155
Representation * getRepresentation()
Definition: threads.h:175
void setRepresentation(Representation &rep)
Definition: threads.h:171
void setNumberOfStepsBetweenUpdates(Size steps)
Definition: threads.h:198
TrajectoryFile * getTrajectoryFile()
Definition: threads.h:205
void exportSceneToPNG_()
Notify the MainControl to export an PNG.
TrajectoryFile * trajectory_file_
Definition: threads.h:216
void setTrajectoryFile(TrajectoryFile *file)
Definition: threads.h:202
void finish_()
Notifies the main thread to delete the simulating thread.
Thread for EnergyMinimization.
Definition: threads.h:223
EnergyMinimizer * minimizer_
Definition: threads.h:239
void setEnergyMinimizer(EnergyMinimizer *minimizer)
Thread for MDSimulation.
Definition: threads.h:246
void setMolecularDynamics(MolecularDynamics *md)
void setNumberOfSteps(Size steps)
Definition: threads.h:262
void setSaveImages(bool state)
Definition: threads.h:265
MolecularDynamics * md_
Definition: threads.h:268
Thread for Docking.
Definition: threads.h:277
void setDockingAlgorithm(DockingAlgorithm *dock_alg)
DockingAlgorithm * dock_alg_
Definition: threads.h:296
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52