~ubuntu-branches/ubuntu/precise/stellarium/precise

« back to all changes in this revision

Viewing changes to src/modules/StarMgr.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Cédric Delfosse
  • Date: 2009-03-13 20:07:22 UTC
  • mfrom: (1.1.8 upstream) (4.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090313200722-l66s4zy2s3e8up0s
Tags: 0.10.2-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include <vector>
24
24
#include <map>
25
 
#include "Fader.hpp"
 
25
#include "StelFader.hpp"
26
26
#include "StelObjectModule.hpp"
27
 
#include "STextureTypes.hpp"
 
27
#include "StelTextureTypes.hpp"
 
28
#include "StelProjectorType.hpp"
28
29
 
29
30
class StelObject;
30
 
class ToneReproducer;
31
 
class Projector;
32
 
class Navigator;
33
 
class LoadingBar;
34
 
class SFont;
 
31
class StelToneReproducer;
 
32
class StelProjector;
 
33
class StelNavigator;
 
34
class StelLoadingBar;
 
35
class StelFont;
35
36
class QSettings;
36
37
 
37
38
namespace BigStarCatalogExtension {
64
65
//! to the position of the star as observed on the celestial sphere.
65
66
class StarMgr : public StelObjectModule
66
67
{       
67
 
        Q_OBJECT;
 
68
        Q_OBJECT
68
69
        
69
70
public:
70
71
        StarMgr(void);
93
94
        
94
95
        //! Called when the sky culture is updated.
95
96
        //! Loads common and scientific names of stars for a given sky culture.
96
 
        virtual void updateSkyCulture();
 
97
        //! @param skyCultureDir the name of the directory containing the sky culture to use.
 
98
        virtual void updateSkyCulture(const QString& skyCultureDir);
97
99
        
98
100
        //! Load a color scheme
99
101
        virtual void setStelStyle(const StelStyle& style);
108
110
        
109
111
        //! Return the matching Stars object's pointer if exists or NULL
110
112
        //! @param nameI18n The case in-sensistive star common name or HP
111
 
        //! catalog name (format can be HP1234 or HP 1234) or sci name
 
113
        //! catalog name (format can be HP1234 or HP 1234 or HIP 1234) or sci name
112
114
        virtual StelObjectP searchByNameI18n(const QString& nameI18n) const;    
113
115
 
114
116
        //! Return the matching star if exists or NULL
153
155
        //! Show scientific or catalog names on stars without common names.
154
156
        static void setFlagSciNames(bool f) {flagSciNames = f;}
155
157
        static bool getFlagSciNames(void) {return flagSciNames;}
 
158
        
 
159
        QSettings* getStarSettings(void) {return starSettings;}
156
160
 
157
161
public:
158
162
        ///////////////////////////////////////////////////////////////////////////
159
163
        // Other methods
160
 
        //! Search for the nearest star to some position.
161
 
        //! @param Pos the 3d vector representing the direction to search.
162
 
        //! @return the nearest star from the specified position, or an 
163
 
        //! empty StelObjectP if none were found close by.
164
 
        StelObjectP search(Vec3d Pos) const;
165
 
        
166
 
        //! Search for a star by catalogue number (including catalogue prefix).
167
 
        //! @param id the catalogue identifier for the required star.
168
 
        //! @return the requested StelObjectP or an empty objecy if the requested
169
 
        //! one was not found.
170
 
        StelObjectP search(const QString& id) const;
171
 
        
172
 
        //! Search bu Hipparcos catalogue number.
173
 
        //! @param num the Hipparcos catalogue number of the star which is required.
174
 
        //! @return the requested StelObjectP or an empty objecy if the requested
175
 
        //! one was not found.
176
 
        StelObjectP searchHP(int num) const;
 
164
        //! Search by Hipparcos catalogue number.
 
165
        //! @param hip the Hipparcos catalogue number of the star which is required.
 
166
        //! @return the requested StelObjectP or an empty objecy if the requested
 
167
        //! one was not found.
 
168
        StelObjectP searchHP(int hip) const;
177
169
        
178
170
        //! Get the (translated) common name for a star with a specified 
179
171
        //! Hipparcos catalogue number.
183
175
        //! Hipparcos catalogue number.
184
176
        static QString getSciName(int hip);
185
177
        
186
 
        // TODO: the StarMgr it self should call core()->getGeodesicGrid()->setMaxlevel etc..
187
 
        //! Get the maximum level of the geodesic sphere used.
188
 
        //! See the class description for a short introduction to the meaning of this value.
189
 
        int getMaxGridLevel(void) const {return maxGeodesicGridLevel;}
190
 
        //! Initializes each triangular face of the geodesic grid.
191
 
        void setGrid(class GeodesicGrid* grid);
192
 
        
193
 
        static double getCurrentJDay(void) {return currentJDay;}
194
 
        
195
178
        static QString convertToSpectralType(int index);
196
179
        static QString convertToComponentIds(int index);
197
180
        
214
197
        //! Load all the stars from the files.
215
198
        void loadData();
216
199
        
 
200
        //! Load config data from star.ini
 
201
        void loadStarSettings(void);
 
202
        
217
203
        //! Draw a nice animated pointer around the object.
218
 
        void drawPointer(const Projector* prj, const Navigator * nav);
 
204
        void drawPointer(const StelProjectorP& prj, const StelNavigator * nav);
219
205
        
220
206
        LinearFader labelsFader;
221
207
        LinearFader starsFader;
251
237
        
252
238
        static std::map<int, QString> sciNamesMapI18n;
253
239
        static std::map<QString, int> sciNamesIndexI18n;
254
 
 
255
 
        static double currentJDay;
256
240
        
257
241
        double fontSize;
258
 
        SFont *starFont;
 
242
        StelFont *starFont;
259
243
        static bool flagSciNames;
260
244
        Vec3f labelColor;
261
245
        
262
 
        STextureSP texPointer;          // The selection pointer texture
 
246
        StelTextureSP texPointer;               // The selection pointer texture
 
247
        
 
248
        QSettings* starSettings;
 
249
        class StelObjectMgr* objectMgr;
263
250
};
264
251
 
265
252