Skip to content
Snippets Groups Projects
Select Git revision
  • 59705e025258e1a17e32e71dcef4c9ff4fcfe7df
  • master default protected
  • antenna-patterns
  • qt5-qopenglwidget
  • license-demo
  • isolated
  • isolated-fixedprofile
  • release_1.1
  • press-conference
  • rim-only
  • release_1.0
11 results

preset.cpp

Blame
  • Starsphere.h 3.80 KiB
    #ifndef STARSPHERE_H_
    #define STARSPHERE_H_
    
    #include <cmath>
    #include <cstdio>
    #include <ctime>
    #include <string>
    #include <iostream>
    #include <iomanip>
    #include <sstream>
    
    #include <SDL.h>
    #include <SDL_opengl.h>
    #include <FTGLPolygonFont.h>
    
    #include <util.h>
    
    #include "AbstractGraphicsEngine.h"
    
    /* SIN and COS take arguments in DEGREES */
    #define PI 3.14159265
    #define PI2 (2*PI)
    #define COS(X)   cos( (X) * PI2/360.0 )
    #define SIN(X)   sin( (X) * PI2/360.0 )
    
    /* search marker status */
    #define MARKER_NONE 0
    #define MARKER_SHOW 1
    #define MARKER_NEW  2
    
    // needed to find OpenGL 1.4 prototypes in glext.h (alternatives?)
    #define GL_GLEXT_PROTOTYPES
    
    using namespace std;
    
    class Starsphere : public AbstractGraphicsEngine
    {
    public:
    	Starsphere();
    	virtual ~Starsphere();
    
    	// core methods
    	void initialize(const int width, const int height, const Resource *font);
    	void resize(const int width, const int height);
    	void render(const double timeOfDay);
    
    	// event handling
    	void mouseButtonEvent(const int positionX, const int positionY, const int buttonPressed);
    	void mouseMoveEvent(const int deltaX, const int deltaY, const int buttonPressed);
    	void keyboardPressEvent(const int keyPressed);
    	
    	// update HUD content
    	void refreshBOINCInformation();
    	
    private:
    	void make_stars();
    	void make_pulsars();
    	void make_snrs();
    	void make_constellations();
    	void make_obs();
    	void make_axes();
    	void make_globe();
    	void make_search_marker(GLfloat RAdeg, GLfloat DEdeg, GLfloat size);
    
    	GLfloat RAofZenith(double T, GLfloat LONdeg);
    	void sphVertex3D(GLfloat RAdeg, GLfloat DEdeg, GLfloat radius);
    	void sphVertex(GLfloat RAdeg, GLfloat DEdeg);
    	void star_marker(float RAdeg, float DEdeg, float size);
    
    	/**