GlobeEngine
OrbitJob.h
Go to the documentation of this file.
1 #ifndef ExoViewer_OrbitJob_h
2 #define ExoViewer_OrbitJob_h
3 
4 #include <QThreadPool>
5 #include <QRunnable>
6 #include <iostream>
7 #include <stdio.h>
8 
9 namespace geAstro{
10  class Body;
11 
12  class OrbitJob : public QRunnable
13  {
14 
15  public:
16  std::vector<std::shared_ptr<Body>>* bodies;
17  double currentDate;
18  double daysPerUpdate;
19 
20  void run()
21  {
22  //std::cout << "started thread: " << QThread::currentThread() << " " << bodies->at(0)->getName() << std::endl;
23 
24  for (int i = 0; i < bodies->size(); i++){
25  //std::cout << QThread::currentThread() << " Name of Bodeye: " << bodies->at(i)->getName() << std::endl;
26 
27  if (bodies->at(i)->hasOrbit()){
28  bodies->at(i)->updateOrbit(currentDate);
29  }
30  bodies->at(i)->updateRotation(daysPerUpdate);
31 
32  }
33  //std::cout << "done thread: " << QThread::currentThread() << " " << bodies->at(0)->getName() << std::endl;
34  }
35  };
36 }
37 
38 #endif
Definition: OrbitJob.h:12
void run()
Definition: OrbitJob.h:20
double daysPerUpdate
Definition: OrbitJob.h:18
Definition: AstroCommon.h:18
std::vector< std::shared_ptr< Body > > * bodies
Definition: OrbitJob.h:16
double currentDate
Definition: OrbitJob.h:17