00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00020
00021 #ifndef ORBITALTHREAD_H
00022 #define ORBITALTHREAD_H
00023
00025
00026
00027 #include <vector>
00028
00029
00030 class QMutex;
00031 class QWidget;
00032
00033
00034 #include "point3d.h"
00035
00036
00037 #include <qthread.h>
00038
00040 class OrbitalThread : public QThread
00041 {
00042 public:
00044 OrbitalThread(QWidget* parentWidget, QMutex* sharedMutex, std::vector<Point3D<float> >* coordinates, const unsigned int type, const unsigned int atom, const unsigned int n, const unsigned int l, const int m, const float res, const float prob, const unsigned int dots);
00045 ~OrbitalThread();
00046
00048 enum Types{IsoProbability = 0, Density, AngularPart, AccumulatedProbability, RadialPart};
00049
00051 void stop();
00052 double boundingSphereRadius();
00053
00054 private:
00055
00056 enum Precision{PRECISION_UNKNOWN, PRECISION_FLOAT, PRECISION_DOUBLE, PRECISION_LONG_DOUBLE};
00057
00059 virtual void run();
00060 void calcIsoProbability();
00061 void calcAccumulatedProbability();
00062 void calcRandomDots();
00063 void calcRadialPart();
00064 void calcAngularPart();
00065 void updateList(std::vector<Point3D<float> >& newCoords, bool final = false);
00066 float associatedLegendre(const float x, const int m, const unsigned int l);
00067 float associatedLaguerre(const float x, const int m, const unsigned int n);
00068 template <class T> T factorial(const unsigned int number);
00069 float random(const float min, const float max);
00070 template <class T> T largestResult(const unsigned int n, const unsigned int l, const int m, const unsigned int Z);
00071
00073 QWidget* receiver;
00074 QMutex* mutex;
00075 std::vector<Point3D<float> >* coords;
00076 unsigned int atomNumber;
00077 unsigned int qnPrincipal;
00078 unsigned int qnOrbital;
00079 int qnMomentum;
00080 unsigned int calculationType;
00081 float probability;
00082 float resolution;
00083 unsigned int numDots;
00084 bool stopRequested;
00085 float maximumRadius;
00086 unsigned int progress;
00087
00088
00089 static const float abohr;
00090 static const unsigned int updateSize;
00091 };
00092
00093 #endif
00094