diff --git a/Starsphere.cpp b/Starsphere.cpp index 63ec9bc371f1fb346d5caa76f63a312ea0bff154..a59afb155de5a481e8893b98d0ee13866711e066 100644 --- a/Starsphere.cpp +++ b/Starsphere.cpp @@ -3,7 +3,7 @@ Starsphere::Starsphere() : AbstractGraphicsEngine() { Axes=0, Stars=0, Constellations=0, Pulsars=0; - LLOmarker=0, LHOmarker=0, GEOmarker=0; + LLOmarker=0, LHOmarker=0, GEOmarker=0, VIRGOmarker=0; sphGrid=0, SNRs=0, SearchMarker=0; /** @@ -252,16 +252,16 @@ void Starsphere::make_obs() glColor3f(0.0, 1.0, 0.0); glLineWidth(lineSize); glBegin(GL_LINE_STRIP); - // North/South arm: - sphVertex3D(RAdeg, DEdeg-arm_len_deg, radius); - sphVertex3D(RAdeg, DEdeg, radius); - // East/West arm: - sphVertex3D(RAdeg-arm_len_deg, DEdeg, radius); + // North/South arm: + sphVertex3D(RAdeg, DEdeg-arm_len_deg, radius); + sphVertex3D(RAdeg, DEdeg, radius); + // East/West arm: + sphVertex3D(RAdeg-arm_len_deg, DEdeg, radius); glEnd(); // arm joint H2 glPointSize((GLfloat) lineSize); glBegin(GL_POINTS); - sphVertex3D(RAdeg, DEdeg, radius); + sphVertex3D(RAdeg, DEdeg, radius); glEnd(); glEndList(); @@ -281,28 +281,28 @@ void Starsphere::make_obs() glColor3f(0.0, 0.0, 1.0); glLineWidth(lineSize); glBegin(GL_LINE_STRIP); - // North/South arm: - sphVertex3D(RAdeg, DEdeg+arm_len_deg, radius); - sphVertex3D(RAdeg, DEdeg, radius); - // East/West arm: - sphVertex3D(RAdeg-arm_len_deg, DEdeg, radius); + // North/South arm: + sphVertex3D(RAdeg, DEdeg+arm_len_deg, radius); + sphVertex3D(RAdeg, DEdeg, radius); + // East/West arm: + sphVertex3D(RAdeg-arm_len_deg, DEdeg, radius); glEnd(); glBegin(GL_LINE_STRIP); - // North/South arm, H2: - sphVertex3D(RAdeg-h2, DEdeg+arm_len_deg/2.0+h2/2.0, radius); - sphVertex3D(RAdeg-h2, DEdeg+h2/2.0, radius); - // East/West arm, H2; - sphVertex3D(RAdeg-arm_len_deg/2.0-h2, DEdeg+h2/2.0, radius); + // North/South arm, H2: + sphVertex3D(RAdeg-h2, DEdeg+arm_len_deg/2.0+h2/2.0, radius); + sphVertex3D(RAdeg-h2, DEdeg+h2/2.0, radius); + // East/West arm, H2; + sphVertex3D(RAdeg-arm_len_deg/2.0-h2, DEdeg+h2/2.0, radius); glEnd(); // arm joint H1 glPointSize((GLfloat) lineSize); glBegin(GL_POINTS); - sphVertex3D(RAdeg, DEdeg, radius); + sphVertex3D(RAdeg, DEdeg, radius); glEnd(); // arm joint H2 glPointSize((GLfloat) lineSize); glBegin(GL_POINTS); - sphVertex3D(RAdeg-h2, DEdeg+h2/2.0, radius); + sphVertex3D(RAdeg-h2, DEdeg+h2/2.0, radius); glEnd(); glEndList(); @@ -323,16 +323,46 @@ void Starsphere::make_obs() glColor3f(1.0, 0.0, 0.0); glLineWidth(lineSize); glBegin(GL_LINE_STRIP); - // North/South arm: - sphVertex3D(RAdeg, DEdeg+arm_len_deg, radius); - sphVertex3D(RAdeg, DEdeg, radius); - // West/East arm: - sphVertex3D(RAdeg+arm_len_deg, DEdeg, radius); + // North/South arm: + sphVertex3D(RAdeg, DEdeg+arm_len_deg, radius); + sphVertex3D(RAdeg, DEdeg, radius); + // West/East arm: + sphVertex3D(RAdeg+arm_len_deg, DEdeg, radius); glEnd(); // arm joint glPointSize((GLfloat) lineSize); glBegin(GL_POINTS); - sphVertex3D(RAdeg, DEdeg, radius); + sphVertex3D(RAdeg, DEdeg, radius); + glEnd(); + glEndList(); + + /** + * VIRGO Interferometer: + */ + + Lat= 43.63139; + Lon= -10.505; + arm_len_deg=3.000; // not to scale + + RAdeg= RAofZenith(observatoryDrawTimeGMT, Lon); + DEdeg= Lat; + + if (!VIRGOmarker) + VIRGOmarker = glGenLists(1); + glNewList(VIRGOmarker, GL_COMPILE); + glColor3f(1.0, 1.0, 1.0); + glLineWidth(lineSize); + glBegin(GL_LINE_STRIP); + // North/South arm: + sphVertex3D(RAdeg, DEdeg+arm_len_deg, radius); + sphVertex3D(RAdeg, DEdeg, radius); + // West/East arm: + sphVertex3D(RAdeg-arm_len_deg, DEdeg, radius); + glEnd(); + // arm joint + glPointSize((GLfloat) lineSize); + glBegin(GL_POINTS); + sphVertex3D(RAdeg, DEdeg, radius); glEnd(); glEndList(); @@ -704,6 +734,7 @@ void Starsphere::render(const double timeOfDay) glCallList(LLOmarker); glCallList(LHOmarker); glCallList(GEOmarker); + glCallList(VIRGOmarker); glPopMatrix(); } diff --git a/Starsphere.h b/Starsphere.h index d3a7d97005d06626f0416af48dbda66d0a0b5833..a41e875998f70a0858577601b83c27490e652146 100644 --- a/Starsphere.h +++ b/Starsphere.h @@ -35,13 +35,51 @@ using namespace std; + +/** + * \brief %Starsphere rendering engine for \b Einstein\@Home + * + * This class comprises the generic parts of the %Starsphere rendering engine. + * %Starsphere displays the celestial sphere indicating a fixed set of stars with + * their constellations as well as known pulsars and supernova remnants. Apart from + * that the four main gravitational wave observatory locations are shown at their actual + * real-time position. Furthermore a head-up display (HUD) shows relevant BOINC + * statistics as well as information on the current workunit (WU) being processed. + * + * For more details please refer to http://einstein.phys.uwm.edu/starsphere.php + * + * Note: all science run specific parts are implemented in specialized subclasses + * of this engine. + * + * \todo The code of this implementaion is based on the former version of %Starsphere + * by Bruce Allen, David Hammer and Eric Myers. Due to this there's still + * some refactoring and code cleanup left to be done. + * + * \author Oliver Bock\n + * Max-Planck-Institute for Gravitational Physics\n + * Hannover, Germany + */ class Starsphere : public AbstractGraphicsEngine { public: + /// Destructor virtual ~Starsphere(); - // core methods + /** + * \brief This method is called to initialize the engine + * + * \param width The current width of the display surface + * \param height The current height of the display surface + * \param font A pointer to a Resource object containing TTF font faces for text rendering + */ virtual void initialize(const int width, const int height, const Resource *font); + + /** + * \brief This method is called when the windowing system encounters a window resize event + * + * \param width The new width of the display surface + * \param height The new height of the display surface + */ virtual void resize(const int width, const int height); void render(const double timeOfDay); @@ -52,13 +90,30 @@ public: const AbstractGraphicsEngine::MouseButton buttonPressed); void keyboardPressEvent(const AbstractGraphicsEngine::KeyBoardKey keyPressed); - // update HUD content + /** + * \brief This method is called when the BOINC client information should be updated + */ virtual void refreshBOINCInformation(); protected: - /// Contructor (protected since this an abstract class) + /** + * \brief Default contructor + * + * The constructor is protected since this an abstract class. + */ Starsphere(); + /** + * \brief Render science run specific search information + * + * This abtract method is to be defined by derived classes implementing + * the science run specific search information handling and rendering. + * + * Note: for this engine this also includes the "BOINC Statistics" + * as it is top-aligned to the "Search Information". + */ + virtual void renderSearchInformation() = 0; + // resource handling OGLFT::TranslucentTexture* m_FontLogo1; @@ -107,7 +162,7 @@ private: * (someday the keyboard can be used to turn display of items on/off) */ GLuint Axes, Stars, Constellations, Pulsars; - GLuint LLOmarker, LHOmarker, GEOmarker; + GLuint LLOmarker, LHOmarker, GEOmarker, VIRGOmarker; GLuint sphGrid, SNRs, SearchMarker; /** @@ -133,9 +188,6 @@ private: //------------ new clean members ----- - // application specific rendering - virtual void renderSearchInformation() = 0; - // view control void rotateSphere(const int relativeRotation, const int relativeElevation); void zoomSphere(const int relativeZoom);