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
BALL::VIEW::EnergyMinimizerThread
Thread for EnergyMinimization.
Definition: threads.h:221
BALL::VIEW::MessageEvent::MessageEvent
MessageEvent(Message *msg=0)
Definition: threads.h:37
BALL::VIEW::BALLThread::setComposite
void setComposite(Composite *composite)
Definition: threads.h:82
BALL::VIEW::DockingThread::dock_alg_
DockingAlgorithm * dock_alg_
Definition: threads.h:296
BALL::VIEW::MDSimulationThread::steps_
Size steps_
Definition: threads.h:269
BALL::VIEW::BALLThread::run
virtual void run()
Definition: threads.h:89
BALL::VIEW::UpdateRepresentationThread::getRepresentation
Representation * getRepresentation()
Definition: threads.h:175
BALL::VIEW::CalculateFDPBThread::setFDPBDialog
void setFDPBDialog(FDPBDialog *dialog)
Definition: threads.h:132
BALL::VIEW::GenerateCrystalThread::dialog_
GenerateCrystalDialog * dialog_
Definition: threads.h:155
BALL::VIEW::Message
Definition: message.h:52
BALL::VIEW::EnergyMinimizerThread::minimizer_
EnergyMinimizer * minimizer_
Definition: threads.h:239
BALL::VIEW::MDSimulationThread::setNumberOfSteps
void setNumberOfSteps(Size steps)
Definition: threads.h:262
BALL::VIEW::MDSimulationThread::setSaveImages
void setSaveImages(bool state)
Definition: threads.h:265
BALL::VIEW::Representation
Definition: representation.h:57
BALL::VIEW::MessageEvent::setMessage
void setMessage(Message *msg)
Definition: threads.h:43
QEvent
BALL::String
Definition: string.h:56
BALL::VIEW::GenerateCrystalThread::setCrystalDialog
void setCrystalDialog(GenerateCrystalDialog *dialog)
Definition: threads.h:152
BALL::VIEW::GenerateCrystalThread
Definition: threads.h:140
BALL::VIEW::BALLThread::main_control_
MainControl * main_control_
Definition: threads.h:115
BALL::VIEW::MainControl
Definition: mainControl.h:114
BALL::VIEW::GenerateCrystalDialog
Definition: generateCrystalDialog.h:45
BALL::VIEW::MessageEvent::message_
Message * message_
Definition: threads.h:50
BALL::VIEW::BALLThread::getComposite
Composite * getComposite()
Definition: threads.h:85
QThread
BALL
Definition: constants.h:12
BALL::VIEW::UpdateRepresentationThread::rep_
Representation * rep_
Definition: threads.h:180
BALL::VIEW::BALLThread::setMainControl
void setMainControl(MainControl *mf)
Definition: threads.h:79
BALL::VIEW::BALLThread
Definition: threads.h:70
BALL::VIEW::FDPBDialog
Definition: FDPBDialog.h:49
BALL::VIEW::SimulationThread::setTrajectoryFile
void setTrajectoryFile(TrajectoryFile *file)
Definition: threads.h:202
BALL::VIEW::MDSimulationThread
Thread for MDSimulation.
Definition: threads.h:244
BALL::VIEW::MESSAGE_EVENT
@ MESSAGE_EVENT
An event with a contained VIEW message.
Definition: VIEW/KERNEL/common.h:74
BALL::VIEW::SimulationThread::steps_between_updates_
Size steps_between_updates_
Definition: threads.h:215
BALL::VIEW::BALLThread::composite_
Composite * composite_
Definition: threads.h:116
common.h
BALL::VIEW::MessageEvent::getMessage
Message * getMessage()
Definition: threads.h:46
BALL::VIEW::MDSimulationThread::md_
MolecularDynamics * md_
Definition: threads.h:268
BALL::VIEW::UpdateRepresentationThread::setRepresentation
void setRepresentation(Representation &rep)
Definition: threads.h:171
BALL::Composite
Definition: composite.h:71
BALL::DockingAlgorithm
Definition: dockingAlgorithm.h:45
BALL_SIZE_TYPE
BALL::TrajectoryFile
Definition: trajectoryFile.h:28
BALL::VIEW::SimulationThread::trajectory_file_
TrajectoryFile * trajectory_file_
Definition: threads.h:216
BALL::VIEW::SimulationThread
Definition: threads.h:189
BALL::VIEW::MDSimulationThread::save_images_
bool save_images_
Definition: threads.h:270
BALL::VIEW::MessageEvent
Definition: threads.h:31
BALL::VIEW::SimulationThread::getTrajectoryFile
TrajectoryFile * getTrajectoryFile()
Definition: threads.h:205
BALL::EnergyMinimizer
Definition: energyMinimizer.h:29
BALL::VIEW::UpdateRepresentationThread
Definition: threads.h:159
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL::VIEW::CalculateFDPBThread
Definition: threads.h:120
BALL::VIEW::SimulationThread::setNumberOfStepsBetweenUpdates
void setNumberOfStepsBetweenUpdates(Size steps)
Definition: threads.h:198
BALL::VIEW::DockingThread
Thread for Docking.
Definition: threads.h:275
BALL::VIEW::CalculateFDPBThread::dialog_
FDPBDialog * dialog_
Definition: threads.h:135
BALL::MolecularDynamics
Definition: molecularDynamics.h:42