BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  throw(Exception::NullPointer);
258 
260  void setMolecularDynamics(MolecularDynamics* md);
261 
263  void setNumberOfSteps(Size steps) { steps_ = steps;}
264 
266  void setSaveImages(bool state) { save_images_ = state;}
267 
268  protected:
272  };
273 
274 
277  : public BALLThread
278  {
279  public:
281  DockingThread();
282 
284  virtual ~DockingThread();
285 
288  const DockingThread& operator =(const DockingThread& dock_thread);
289 
291  void setDockingAlgorithm(DockingAlgorithm* dock_alg);
292 
294  virtual void run()
295  throw(Exception::NullPointer);
296 
297  protected:
299  };
300 
301  }
302 }
303 #endif //BALL_VIEW_KERNEL_THREADS_H
Message * getMessage()
Definition: threads.h:46
MessageEvent(Message *msg=0)
Definition: threads.h:37
TrajectoryFile * trajectory_file_
Definition: threads.h:216
void setRepresentation(Representation &rep)
Definition: threads.h:171
Composite * getComposite()
Definition: threads.h:85
Thread for MDSimulation.
Definition: threads.h:244
EnergyMinimizer * minimizer_
Definition: threads.h:239
void setMainControl(MainControl *mf)
Definition: threads.h:79
Thread for Docking.
Definition: threads.h:276
GenerateCrystalDialog * dialog_
Definition: threads.h:155
void setNumberOfSteps(Size steps)
Definition: threads.h:263
MainControl * main_control_
Definition: threads.h:115
Composite * composite_
Definition: threads.h:116
void setMessage(Message *msg)
Definition: threads.h:43
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
An event with a contained VIEW message.
MolecularDynamics * md_
Definition: threads.h:269
DockingAlgorithm * dock_alg_
Definition: threads.h:298
void setComposite(Composite *composite)
Definition: threads.h:82
void setCrystalDialog(GenerateCrystalDialog *dialog)
Definition: threads.h:152
void setNumberOfStepsBetweenUpdates(Size steps)
Definition: threads.h:198
void setSaveImages(bool state)
Definition: threads.h:266
void setTrajectoryFile(TrajectoryFile *file)
Definition: threads.h:202
Representation * getRepresentation()
Definition: threads.h:175
void setFDPBDialog(FDPBDialog *dialog)
Definition: threads.h:132
Thread for EnergyMinimization.
Definition: threads.h:221
TrajectoryFile * getTrajectoryFile()
Definition: threads.h:205
virtual void run()
Definition: threads.h:89