GlobeEngine
Planet.h
Go to the documentation of this file.
1 #ifndef ExoViewer_Planet_h
2 #define ExoViewer_Planet_h
3 
4 #include "Body.h"
5 
6 namespace geAstro{
7  struct PlanetInfo
8  {
9  std::string description;
10  std::string lastupdate;
11  std::string discoverymethod;
13  double istransiting;
14  double discoveryyear;
15  int isInHZ; // 0: not in HZ, 1: in optimistic range of HZ, 2: in conservative range of HZ
16 
18  spinorbitalignment = -1;
19  istransiting = -1;
20  discoveryyear = -1;
21  description = "";
22  lastupdate = "";
23  discoverymethod = "";
24  isInHZ = -1;
25  }
26 
27  PlanetInfo(double _spinorbitalignment, double _istransiting, double _discoveryyear,
28  std::string _description, std::string _lastupdate, std::string _discoverymethod, int _isInHZ) :
29  spinorbitalignment(_spinorbitalignment), istransiting(_istransiting), discoveryyear(_discoveryyear),
30  description(_description), lastupdate(_lastupdate), discoverymethod(_discoverymethod), isInHZ(_isInHZ)
31  {}
32  };
33 
34  class Planet : public ge::Sphere {
35  public:
36  enum PlanetType{
39  };
40 
41  Planet();
42  ~Planet();
43  void clear();
44  void update();
45  void createPlanet(PlanetInfo _info, BodyInfo _bodyinfo, vmml::Vector3d _position, PlanetType _planetType,
46  std::shared_ptr<ge::Shader> _programForSpheres, std::shared_ptr<ge::Texture2Drgba> _tex, bool _hasCoreView);
47 
48  void resetPlanetTexture(std::shared_ptr<ge::Texture2Drgba> _texHandle);
49  //void hasSpecialTexture(bool _in);
50 
51  void setPlanetInHZ(int _idx);
52  int isPlanetInHZIndex();
53 
54  Planet::PlanetType getEnumFromString(std::string _s);
55  std::string getEnumAsString();
56 
57  const PlanetInfo& getInfo() const;
58  void drawOrbit(std::shared_ptr<ge::Camera> _cam);
59  void setParent(std::shared_ptr<Body> _parent);
60  const std::shared_ptr<Body> getBody() const;
61 
62  private:
63  PlanetType planetTypeEnum;
64  PlanetInfo info;
65  std::shared_ptr<Body> planetBody;
66  std::shared_ptr<ge::Texture2Drgba> planetTex;
67  //bool specialTexture;
68  };
69 
70 }
71 
72 #endif
std::string getEnumAsString()
Definition: Planet.cpp:102
void setParent(std::shared_ptr< Body > _parent)
Definition: Planet.cpp:67
Definition: Planet.h:37
PlanetInfo()
Definition: Planet.h:17
double istransiting
Definition: Planet.h:13
void setPlanetInHZ(int _idx)
Definition: Planet.cpp:82
Definition: Planet.h:34
Planet::PlanetType getEnumFromString(std::string _s)
Definition: Planet.cpp:94
Definition: Planet.h:38
int isInHZ
Definition: Planet.h:15
PlanetInfo(double _spinorbitalignment, double _istransiting, double _discoveryyear, std::string _description, std::string _lastupdate, std::string _discoverymethod, int _isInHZ)
Definition: Planet.h:27
const PlanetInfo & getInfo() const
Definition: Planet.cpp:54
void resetPlanetTexture(std::shared_ptr< ge::Texture2Drgba > _texHandle)
Planet()
Definition: Planet.cpp:5
Definition: Planet.h:37
Definition: Sphere.h:18
std::string discoverymethod
Definition: Planet.h:11
double spinorbitalignment
Definition: Planet.h:12
Definition: Planet.h:37
Definition: AstroCommon.h:18
void drawOrbit(std::shared_ptr< ge::Camera > _cam)
Definition: Planet.cpp:63
double discoveryyear
Definition: Planet.h:14
std::string lastupdate
Definition: Planet.h:10
std::string description
Definition: Planet.h:9
void update()
Definition: Planet.cpp:58
~Planet()
Definition: Planet.cpp:10
void clear()
Definition: Planet.cpp:14
Definition: Planet.h:7
void createPlanet(PlanetInfo _info, BodyInfo _bodyinfo, vmml::Vector3d _position, PlanetType _planetType, std::shared_ptr< ge::Shader > _programForSpheres, std::shared_ptr< ge::Texture2Drgba > _tex, bool _hasCoreView)
Definition: Planet.cpp:19
Definition: Body.h:25
int isPlanetInHZIndex()
Definition: Planet.cpp:86
PlanetType
Definition: Planet.h:36
const std::shared_ptr< Body > getBody() const
Definition: Planet.cpp:71