Skip to content
Snippets Groups Projects
Select Git revision
  • 52a3466415ac2740b0ab742c863bd3621b51e086
  • master default protected
  • CLFFT_NO_MAD_ENABLE
  • BRP_build_fixes
  • override_cl_compile_options
  • improve_Makefile
  • HSA
  • clmathfft
  • longer_dft_support
  • current_brp_apps
  • current_fgrp_apps
11 results

procs.h

Blame
  • Starsphere.cpp 23.02 KiB
    #include "Starsphere.h"
    
    Starsphere::Starsphere() : AbstractGraphicsEngine()
    {
    	Axes=0, Stars=0, Constellations=0, Pulsars=0;
    	LLOmarker=0, LHOmarker=0, GEOmarker=0;
    	sphGrid=0, SNRs=0, SearchMarker=0;
    
    	/**
    	 * Parameters and State info
    	 */
    	sphRadius = 5.5;
    	featureFlags = 0;
    
    	/**
    	 * Viewpoint (can be changed with mouse)
    	 */
    	viewpt_azimuth = 30.0;
    	viewpt_elev = 23.6;
    	viewpt_radius = 7.6;
    
    	wobble_amp = 37.0;
    	wobble_period = 17.0;
    	zoom_amp = 0.00;
    	zoom_period = 29.0;
    
    	rotation_offset = 0.0;
    	rotation_speed = 180.0;
    	
    	m_RefreshSearchMarker = true;
    }
    
    Starsphere::~Starsphere()
    {
    	if(m_PolygonFont) delete m_PolygonFont;
    }
    
    /**
     * sphVertex3D() creates a GL vertex in 3D sky sphere coordinates
     * sphVertex() creates a GL vertex on the surface of the sky sphere.
     * Use either like glVertex().
     */
    void Starsphere::sphVertex3D(GLfloat RAdeg, GLfloat DEdeg, GLfloat radius)
    {
    	GLfloat x, y, z;
    
    	x = radius * COS(DEdeg) * COS(RAdeg);
    	z = -radius * COS(DEdeg) * SIN(RAdeg);
    	y = radius * SIN(DEdeg);
    	glVertex3f(x, y, z);
    	return;
    }
    
    void Starsphere::sphVertex(GLfloat RAdeg, GLfloat DEdeg)
    {
    	sphVertex3D(RAdeg, DEdeg, sphRadius);
    }
    
    /**
     * Star Marker:
     * Makes a marker for one star at a given position and angular size.  
     */
    void Starsphere::star_marker(float RAdeg, float DEdeg, float size)
    {
    	glPointSize((GLfloat) size);
    	glBegin(GL_POINTS);
    	sphVertex((GLfloat) RAdeg, (GLfloat) DEdeg);
    	glEnd();
    	return;
    }