Loading...
Searching...
No Matches
threads.h
Go to the documentation of this file.
#ifndef BALL_VIEW_KERNEL_THREADS_H
#define BALL_VIEW_KERNEL_THREADS_H
#ifndef BALL_VIEW_KERNEL_COMMON_H_
#include <BALL/VIEW/KERNEL/common.h>
#endif
#include <QtCore/QThread>
#include <QtCore/QEvent>
namespace BALL
{
class EnergyMinimizer;
class MolecularDynamics;
class Composite;
class DockingAlgorithm;
class TrajectoryFile;
namespace VIEW
{
class MainControl;
class FDPBDialog;
class Message;
class Representation;
class GenerateCrystalDialog;
class BALL_VIEW_EXPORT MessageEvent
: public QEvent
{
public:
MessageEvent(Message* msg = 0)
: QEvent((QEvent::Type)MESSAGE_EVENT),
message_(msg)
{}
void setMessage(Message* msg) { message_ = msg; }
Message* getMessage() { return message_; }
protected:
Message* message_;
};
class BALL_VIEW_EXPORT BALLThread
: public virtual QThread
{
public:
BALLThread();
void setMainControl(MainControl* mf) {main_control_ = mf;}
void setComposite(Composite* composite) {composite_ = composite;}
Composite* getComposite() { return composite_;}
virtual void run() {};
protected:
void sendMessage_(Message* msg);
void updateStructure_();
void output_(const String& string, bool important = false);
void waitForUpdateOfRepresentations_();
MainControl* main_control_;
Composite* composite_;
};
class BALL_VIEW_EXPORT CalculateFDPBThread
: public BALLThread
{
public:
CalculateFDPBThread();
virtual void run();
void setFDPBDialog(FDPBDialog* dialog) {dialog_ = dialog;}
protected:
FDPBDialog* dialog_;
};
class BALL_VIEW_EXPORT GenerateCrystalThread
: public BALLThread
{
public:
GenerateCrystalThread();
virtual void run();
void setCrystalDialog(GenerateCrystalDialog* dialog) {dialog_ = dialog;}
protected:
GenerateCrystalDialog* dialog_;
};
class BALL_VIEW_EXPORT UpdateRepresentationThread
: public BALLThread
{
public:
UpdateRepresentationThread();
virtual void run();
void setRepresentation(Representation& rep)
{ rep_ = &rep;}
Representation* getRepresentation()
{ return rep_; }
protected:
Representation* rep_;
};
class BALL_VIEW_EXPORT SimulationThread
: public BALLThread
{
public:
SimulationThread();
void setNumberOfStepsBetweenUpdates(Size steps)
{ steps_between_updates_ = steps;}
void setTrajectoryFile(TrajectoryFile* file) {trajectory_file_ = file;}
TrajectoryFile* getTrajectoryFile() { return trajectory_file_;}
protected:
void exportSceneToPNG_();
void finish_();
Size steps_between_updates_;
TrajectoryFile* trajectory_file_;
};
class BALL_VIEW_EXPORT EnergyMinimizerThread
: public SimulationThread
{
public:
EnergyMinimizerThread();
virtual ~EnergyMinimizerThread();
virtual void run();
void setEnergyMinimizer(EnergyMinimizer* minimizer);
protected:
EnergyMinimizer* minimizer_;
};
class BALL_VIEW_EXPORT MDSimulationThread
: public SimulationThread
{
public:
MDSimulationThread();
virtual ~MDSimulationThread();
virtual void run();
void setMolecularDynamics(MolecularDynamics* md);
void setNumberOfSteps(Size steps) { steps_ = steps;}
void setSaveImages(bool state) { save_images_ = state;}
protected:
MolecularDynamics* md_;
Size steps_;
bool save_images_;
};
class BALL_VIEW_EXPORT DockingThread
: public BALLThread
{
public:
DockingThread();
virtual ~DockingThread();
const DockingThread& operator =(const DockingThread& dock_thread);
void setDockingAlgorithm(DockingAlgorithm* dock_alg);
virtual void run();
protected:
DockingAlgorithm* dock_alg_;
};
}
}
#endif //BALL_VIEW_KERNEL_THREADS_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
common.h
BALL::Composite
Definition composite.h:74
BALL::DockingAlgorithm
Definition dockingAlgorithm.h:46
BALL::EnergyMinimizer
Definition energyMinimizer.h:30
BALL::MolecularDynamics
Definition molecularDynamics.h:43
BALL::String
Definition string.h:57
BALL::TrajectoryFile
Definition trajectoryFile.h:30
BALL::VIEW::BALLThread::sendMessage_
void sendMessage_(Message *msg)
BALL::VIEW::BALLThread::main_control_
MainControl * main_control_
Definition threads.h:115
BALL::VIEW::BALLThread::getComposite
Composite * getComposite()
Definition threads.h:85
BALL::VIEW::BALLThread::composite_
Composite * composite_
Definition threads.h:116
BALL::VIEW::BALLThread::updateStructure_
void updateStructure_()
BALL::VIEW::BALLThread::output_
void output_(const String &string, bool important=false)
Sends the string as outout to Log.info.
BALL::VIEW::BALLThread::BALLThread
BALLThread()
BALL::VIEW::BALLThread::waitForUpdateOfRepresentations_
void waitForUpdateOfRepresentations_()
BALL::VIEW::BALLThread::setMainControl
void setMainControl(MainControl *mf)
Definition threads.h:79
BALL::VIEW::BALLThread::setComposite
void setComposite(Composite *composite)
Definition threads.h:82
BALL::VIEW::BALLThread::run
virtual void run()
Definition threads.h:89
BALL::VIEW::CalculateFDPBThread::setFDPBDialog
void setFDPBDialog(FDPBDialog *dialog)
Definition threads.h:132
BALL::VIEW::CalculateFDPBThread::run
virtual void run()
BALL::VIEW::CalculateFDPBThread::CalculateFDPBThread
CalculateFDPBThread()
BALL::VIEW::CalculateFDPBThread::dialog_
FDPBDialog * dialog_
Definition threads.h:135
BALL::VIEW::DockingThread::setDockingAlgorithm
void setDockingAlgorithm(DockingAlgorithm *dock_alg)
BALL::VIEW::DockingThread::dock_alg_
DockingAlgorithm * dock_alg_
Definition threads.h:296
BALL::VIEW::DockingThread::~DockingThread
virtual ~DockingThread()
BALL::VIEW::DockingThread::run
virtual void run()
BALL::VIEW::DockingThread::DockingThread
DockingThread()
BALL::VIEW::EnergyMinimizerThread::minimizer_
EnergyMinimizer * minimizer_
Definition threads.h:239
BALL::VIEW::EnergyMinimizerThread::setEnergyMinimizer
void setEnergyMinimizer(EnergyMinimizer *minimizer)
BALL::VIEW::EnergyMinimizerThread::~EnergyMinimizerThread
virtual ~EnergyMinimizerThread()
BALL::VIEW::EnergyMinimizerThread::EnergyMinimizerThread
EnergyMinimizerThread()
BALL::VIEW::EnergyMinimizerThread::run
virtual void run()
BALL::VIEW::FDPBDialog
Definition FDPBDialog.h:54
BALL::VIEW::GenerateCrystalDialog
Definition generateCrystalDialog.h:49
BALL::VIEW::GenerateCrystalThread::run
virtual void run()
BALL::VIEW::GenerateCrystalThread::setCrystalDialog
void setCrystalDialog(GenerateCrystalDialog *dialog)
Definition threads.h:152
BALL::VIEW::GenerateCrystalThread::GenerateCrystalThread
GenerateCrystalThread()
BALL::VIEW::GenerateCrystalThread::dialog_
GenerateCrystalDialog * dialog_
Definition threads.h:155
BALL::VIEW::MDSimulationThread::save_images_
bool save_images_
Definition threads.h:270
BALL::VIEW::MDSimulationThread::steps_
Size steps_
Definition threads.h:269
BALL::VIEW::MDSimulationThread::setMolecularDynamics
void setMolecularDynamics(MolecularDynamics *md)
BALL::VIEW::MDSimulationThread::MDSimulationThread
MDSimulationThread()
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::MDSimulationThread::run
virtual void run()
BALL::VIEW::MDSimulationThread::~MDSimulationThread
virtual ~MDSimulationThread()
BALL::VIEW::MDSimulationThread::md_
MolecularDynamics * md_
Definition threads.h:268
BALL::VIEW::MainControl
Definition mainControl.h:118
BALL::VIEW::MessageEvent::MessageEvent
MessageEvent(Message *msg=0)
Definition threads.h:37
BALL::VIEW::MessageEvent::message_
Message * message_
Definition threads.h:50
BALL::VIEW::MessageEvent::setMessage
void setMessage(Message *msg)
Definition threads.h:43
BALL::VIEW::MessageEvent::getMessage
Message * getMessage()
Definition threads.h:46
BALL::VIEW::Message
Definition message.h:53
BALL::VIEW::Representation
Definition representation.h:59
BALL::VIEW::SimulationThread::steps_between_updates_
Size steps_between_updates_
Definition threads.h:215
BALL::VIEW::SimulationThread::setNumberOfStepsBetweenUpdates
void setNumberOfStepsBetweenUpdates(Size steps)
Definition threads.h:198
BALL::VIEW::SimulationThread::getTrajectoryFile
TrajectoryFile * getTrajectoryFile()
Definition threads.h:205
BALL::VIEW::SimulationThread::exportSceneToPNG_
void exportSceneToPNG_()
Notify the MainControl to export an PNG.
BALL::VIEW::SimulationThread::trajectory_file_
TrajectoryFile * trajectory_file_
Definition threads.h:216
BALL::VIEW::SimulationThread::setTrajectoryFile
void setTrajectoryFile(TrajectoryFile *file)
Definition threads.h:202
BALL::VIEW::SimulationThread::finish_
void finish_()
Notifies the main thread to delete the simulating thread.
BALL::VIEW::SimulationThread::SimulationThread
SimulationThread()
BALL::VIEW::UpdateRepresentationThread::UpdateRepresentationThread
UpdateRepresentationThread()
BALL::VIEW::UpdateRepresentationThread::setRepresentation
void setRepresentation(Representation &rep)
Definition threads.h:171
BALL::VIEW::UpdateRepresentationThread::run
virtual void run()
BALL::VIEW::UpdateRepresentationThread::rep_
Representation * rep_
Definition threads.h:180
BALL::VIEW::UpdateRepresentationThread::getRepresentation
Representation * getRepresentation()
Definition threads.h:175
QEvent
QThread
BALL::VIEW
Definition constraints.h:35
BALL::VIEW::MESSAGE_EVENT
@ MESSAGE_EVENT
An event with a contained VIEW message.
Definition VIEW/KERNEL/common.h:74
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114