3
* Copyright (C) 2002 Fabien Chereau
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
#ifndef _CONSTELLATION_H_
21
#define _CONSTELLATION_H_
23
#include "stellarium.h"
24
#include "stel_object_base.h"
25
#include "stel_object.h"
26
#include "stel_utility.h"
33
class Constellation : public StelObjectBase
35
friend class ConstellationMgr;
40
// StelObject method to override
41
//! Write I18n information about the object in wstring.
42
wstring getInfoString(const Navigator * nav) const {return getNameI18n() + L"(" + StelUtility::stringToWstring(getShortName()) + L"°";}
43
//! The returned wstring can typically be used for object labeling in the sky
44
wstring getShortInfoString(const Navigator * nav) const {return getNameI18n();}
45
//! Return object's type
46
STEL_OBJECT_TYPE get_type(void) const {return STEL_OBJECT_CONSTELLATION;}
47
//! Get position in earth equatorial frame
48
Vec3d get_earth_equ_pos(const Navigator *nav) const {return XYZname;}
49
//! observer centered J2000 coordinates
50
Vec3d getObsJ2000Pos(const Navigator *nav) const {return XYZname;}
51
//! Return object's magnitude
52
float get_mag(const Navigator * nav) const {return 0.;}
54
bool read(const string& record, HipStarMgr * _VouteCeleste);
55
void draw_name(s_font * constfont, Projector* prj) const;
56
void draw_art(Projector* prj, Navigator* nav) const;
57
void draw_boundary_optim(Projector* prj) const;
58
const Constellation* is_star_in(const StelObject&) const;
59
StelObject getBrightestStarInConstellation(void) const;
61
wstring getNameI18n(void) const {return nameI18;}
62
string getEnglishName(void) const {return abbreviation;}
63
string getShortName(void) const {return abbreviation;}
65
void draw_optim(Projector* prj) const;
66
void draw_art_optim(Projector* prj, Navigator* nav) const;
67
void update(int delta_time);
69
void setFlagLines(bool b) {line_fader=b;}
70
void setFlagBoundaries(bool b) {boundary_fader=b;}
71
void setFlagName(bool b) {name_fader=b;}
72
void setFlagArt(bool b) {art_fader=b;}
73
bool getFlagLines(void) const {return line_fader;}
74
bool getFlagBoundaries(void) const {return boundary_fader;}
75
bool getFlagName(void) const {return name_fader;}
76
bool getFlagArt(void) const {return art_fader;}
78
/** International name (translated using gettext) */
81
/** Name in english */
84
/** Abbreviation (of the latin name for western constellations) */
87
/** Direction vector pointing on constellation name drawing position */
91
/** Number of segments in the lines */
92
unsigned int nb_segments;
94
/** List of stars forming the segments */
100
/** Define whether art, lines, names and boundary must be drawn */
101
LinearFader art_fader, line_fader, name_fader, boundary_fader;
103
vector<vector<Vec3f> *> isolatedBoundarySegments;
104
vector<vector<Vec3f> *> sharedBoundarySegments;
106
// Currently we only need one color for all constellations, this may change at some point
107
static Vec3f lineColor;
108
static Vec3f labelColor;
109
static Vec3f boundaryColor;
111
/** Whether labels are to be printed with gravity */
112
static bool gravityLabel;
113
static bool singleSelected;
116
#endif // _CONSTELLATION_H_