Constellation.hpp   Constellation.hpp 
/* /*
* Stellarium * Stellarium
* Copyright (C) 2002 Fabien Chereau * Copyright (C) 2002 Fabien Chereau
* Copyright (C) 2012 Timothy Reaves * Copyright (C) 2012 Timothy Reaves
* Copyright (C) 2014 Georg Zotti
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 29 skipping to change at line 30
*/ */
#ifndef _CONSTELLATION_HPP_ #ifndef _CONSTELLATION_HPP_
#define _CONSTELLATION_HPP_ #define _CONSTELLATION_HPP_
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelFader.hpp" #include "StelFader.hpp"
#include "StelTextureTypes.hpp" #include "StelTextureTypes.hpp"
#include "StelSphereGeometry.hpp" #include "StelSphereGeometry.hpp"
#include "ConstellationMgr.hpp"
#include <vector> #include <vector>
#include <QString> #include <QString>
#include <QFont> #include <QFont>
class StarMgr; class StarMgr;
class StelPainter; class StelPainter;
//! @class Constellation //! @class Constellation
//! The Constellation class models a grouping of stars in a Sky Culture. //! The Constellation class models a grouping of stars in a Sky Culture.
//! Each Constellation consists of a list of stars identified by their //! Each Constellation consists of a list of stars identified by their
//! Hipparcos catalogue numbers, a name and optionally an abbreviated name, //! @var abbreviation and Hipparcos catalogue numbers (taken from @file: co
//! boundary shape and an artistic pictorial representation. nstellationship.fab),
//! another entry in @file constellation_names.eng.fab with the defining ab
breviated name,
//! @var nativeName, and translatable @var englishName (translation goes in
to @var nameI18),
//! boundary shape from @file constellations_boundaries.dat and an (optiona
l) artistic pictorial representation.
//! GZ NEW: The @var nativeName should be accessible in a GUI option, so th
at e.g. original names as written in a
//! concrete book where a skyculture has been taken from can be assured eve
n when translation is available.
//! TODO: There should be a distinction between constellations and asterism
s, which are "inofficial" figures within a sky culture.
//! For example, Western sky culture has a "Big Dipper", "Coathanger", etc.
These would be nice to see, but in different style.
class Constellation : public StelObject class Constellation : public StelObject
{ {
friend class ConstellationMgr; friend class ConstellationMgr;
private: private:
Constellation(); Constellation();
~Constellation(); ~Constellation();
// StelObject method to override // StelObject method to override
//! Get a string with data about the Constellation. //! Get a string with data about the Constellation.
//! Constellations support the following InfoStringGroup flags: //! Constellations support the following InfoStringGroup flags:
//! - Name //! - Name
//! @param core the Stelore object //! @param core the StelCore object
//! @param flags a set of InfoStringGroup items to include in the re turn value. //! @param flags a set of InfoStringGroup items to include in the re turn value.
//! @return a QString a description of the Planet. //! @return a QString a description of the constellation.
virtual QString getInfoString(const StelCore*, const InfoStringGroup & flags) const virtual QString getInfoString(const StelCore*, const InfoStringGroup & flags) const
{ {
if (flags&Name) return getNameI18n() + "(" + getShortName() + ")"; if (flags&Name) return getNameI18n() + "(" + getShortName() + ")";
else return ""; else return "";
} }
//! Get the module/object type string. //! Get the module/object type string.
//! @return "Constellation" //! @return "Constellation"
virtual QString getType() const {return "Constellation";} virtual QString getType() const {return "Constellation";}
//! observer centered J2000 coordinates. //! observer centered J2000 coordinates.
virtual Vec3d getJ2000EquatorialPos(const StelCore*) const {return X YZname;} virtual Vec3d getJ2000EquatorialPos(const StelCore*) const {return X YZname;}
virtual double getAngularSize(const StelCore*) const {Q_ASSERT(0); r eturn 0;} // TODO virtual double getAngularSize(const StelCore*) const {Q_ASSERT(0); r eturn 0;} // TODO
//! @param record string containing the following whitespace //! @param record string containing the following whitespace
//! separated fields: abbreviation - a three character abbreviation //! separated fields: abbreviation - a three character abbreviation
//! for the constellation, a number of lines, and a list of Hipparco //! for the constellation, a number of lines (pairs), and a list of
s Hipparcos
//! catalogue numbers which, when connected form the lines of the //! catalogue numbers which, when connected pairwise, form the lines
of the
//! constellation. //! constellation.
//! @param starMgr a pointer to the StarManager object. //! @param starMgr a pointer to the StarManager object.
//! @return false if can't parse record, else true. //! @return false if can't parse record, else true.
bool read(const QString& record, StarMgr *starMgr); bool read(const QString& record, StarMgr *starMgr);
//! Draw the constellation name //! Draw the constellation name
void drawName(StelPainter& sPainter) const; void drawName(StelPainter& sPainter, ConstellationMgr::Constellation DisplayStyle style) const;
//! Draw the constellation art //! Draw the constellation art
void drawArt(StelPainter& sPainter) const; void drawArt(StelPainter& sPainter) const;
//! Draw the constellation boundary //! Draw the constellation boundary
void drawBoundaryOptim(StelPainter& sPainter) const; void drawBoundaryOptim(StelPainter& sPainter) const;
//! Test if a star is part of a Constellation. //! Test if a star is part of a Constellation.
//! This member tests to see if a star is one of those which make up //! This member tests to see if a star is one of those which make up
//! the lines of a Constellation. //! the lines of a Constellation.
//! @return a pointer to the constellation which the star is a part of, //! @return a pointer to the constellation which the star is a part of,
//! or NULL if the star is not part of a constellation //! or NULL if the star is not part of a constellation
skipping to change at line 107 skipping to change at line 115
//! @return a pointer to the brightest star //! @return a pointer to the brightest star
StelObjectP getBrightestStarInConstellation(void) const; StelObjectP getBrightestStarInConstellation(void) const;
//! Get the translated name for the Constellation. //! Get the translated name for the Constellation.
QString getNameI18n() const {return nameI18;} QString getNameI18n() const {return nameI18;}
//! Get the English name for the Constellation (returns the abbrevia tion). //! Get the English name for the Constellation (returns the abbrevia tion).
QString getEnglishName() const {return abbreviation;} QString getEnglishName() const {return abbreviation;}
//! Get the short name for the Constellation (returns the abbreviati on). //! Get the short name for the Constellation (returns the abbreviati on).
QString getShortName() const {return abbreviation;} QString getShortName() const {return abbreviation;}
//! Draw the lines for the Constellation. //! Draw the lines for the Constellation.
//! This method uses the coords of the stars (optimized for use thru //! This method uses the coords of the stars (optimized for use thro ugh
//! the class ConstellationMgr only). //! the class ConstellationMgr only).
void drawOptim(StelPainter& sPainter, const StelCore* core, const Sp hericalCap& viewportHalfspace) const; void drawOptim(StelPainter& sPainter, const StelCore* core, const Sp hericalCap& viewportHalfspace) const;
//! Draw the art texture, optimized function to be called thru a con stellation manager only. //! Draw the art texture, optimized function to be called through a constellation manager only.
void drawArtOptim(StelPainter& sPainter, const SphericalRegion& regi on) const; void drawArtOptim(StelPainter& sPainter, const SphericalRegion& regi on) const;
//! Update fade levels according to time since various events. //! Update fade levels according to time since various events.
void update(int deltaTime); void update(int deltaTime);
//! Turn on and off Constellation line rendering. //! Turn on and off Constellation line rendering.
//! @param b new state for line drawing. //! @param b new state for line drawing.
void setFlagLines(const bool b) {lineFader=b;} void setFlagLines(const bool b) {lineFader=b;}
//! Turn on and off Constellation boundary rendering. //! Turn on and off Constellation boundary rendering.
//! @param b new state for boundary drawing. //! @param b new state for boundary drawing.
void setFlagBoundaries(const bool b) {boundaryFader=b;} void setFlagBoundaries(const bool b) {boundaryFader=b;}
//! Turn on and off Constellation name label rendering. //! Turn on and off Constellation name label rendering.
skipping to change at line 145 skipping to change at line 153
//! Get the current state of Constellation art rendering. //! Get the current state of Constellation art rendering.
//! @return true if Constellation art rendering it turned on, else f alse. //! @return true if Constellation art rendering it turned on, else f alse.
bool getFlagArt() const {return artFader;} bool getFlagArt() const {return artFader;}
//! Check visibility of starlore elements (using for seasonal rules) //! Check visibility of starlore elements (using for seasonal rules)
//! @return true if starlore elements rendering it turned on, else f alse. //! @return true if starlore elements rendering it turned on, else f alse.
bool checkVisibility() const; bool checkVisibility() const;
//! International name (translated using gettext) //! International name (translated using gettext)
QString nameI18; QString nameI18;
//! Name in english //! Name in english (column 3 in constellation_names.eng.fab)
QString englishName; QString englishName;
//! Name in native language //! Name in native language (column 2 in constellation_names.eng.fab
).
//! According to practice as of V0.13.1, this may be an empty string
.
//! If empty, will be filled with englishName.
QString nativeName; QString nativeName;
//! Abbreviation (of the latin name for western constellations) //! Abbreviation (of the latin name for western constellations)
//! For non-western, a skyculture designer must invent it. (usually
2-5 letters)
//! This MUST be filled and be unique within a sky culture.
QString abbreviation; QString abbreviation;
//! Direction vector pointing on constellation name drawing position //! Direction vector pointing on constellation name drawing position
Vec3d XYZname; Vec3d XYZname;
Vec3d XYname; Vec3d XYname;
//! Number of segments in the lines //! Number of segments in the lines
unsigned int numberOfSegments; unsigned int numberOfSegments;
//! Month of start visibility of constellation (seasonal rules) //! Month of start visibility of constellation (seasonal rules)
int beginSeason; int beginSeason;
//! Month of end visibility of constellation (seasonal rules) //! Month of end visibility of constellation (seasonal rules)
int endSeason; int endSeason;
 End of changes. 12 change blocks. 
12 lines changed or deleted 36 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/