StarMgr.hpp   StarMgr.hpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _STARMGR_HPP_ #ifndef _STARMGR_HPP_
#define _STARMGR_HPP_ #define _STARMGR_HPP_
#include <QFont>
#include <vector> #include <vector>
#include <map> #include <map>
#include <QVariantMap>
#include "StelFader.hpp" #include "StelFader.hpp"
#include "StelObjectModule.hpp" #include "StelObjectModule.hpp"
#include "StelTextureTypes.hpp" #include "StelTextureTypes.hpp"
#include "StelProjectorType.hpp" #include "StelProjectorType.hpp"
class StelObject; class StelObject;
class StelToneReproducer; class StelToneReproducer;
class StelProjector; class StelProjector;
class StelNavigator; class StelNavigator;
class StelLoadingBar; class StelLoadingBar;
class StelFont; class StelPainter;
class QSettings; class QSettings;
namespace BigStarCatalogExtension { namespace BigStarCatalogExtension {
class ZoneArray; class ZoneArray;
class HipIndexStruct; class HipIndexStruct;
} }
//! @class StarMgr //! @class StarMgr
//! Stores the star catalogue data. //! Stores the star catalogue data.
//! Used to render the stars themselves, as well as determine the color tab le //! Used to render the stars themselves, as well as determine the color tab le
skipping to change at line 159 skipping to change at line 161
//! @return the amount between 0 and 10. 0 is no labels, 10 is maxim um of labels //! @return the amount between 0 and 10. 0 is no labels, 10 is maxim um of labels
float getLabelsAmount(void) const {return labelsAmount;} float getLabelsAmount(void) const {return labelsAmount;}
//! Define font size to use for star names display. //! Define font size to use for star names display.
void setFontSize(double newFontSize); void setFontSize(double newFontSize);
//! Show scientific or catalog names on stars without common names. //! Show scientific or catalog names on stars without common names.
static void setFlagSciNames(bool f) {flagSciNames = f;} static void setFlagSciNames(bool f) {flagSciNames = f;}
static bool getFlagSciNames(void) {return flagSciNames;} static bool getFlagSciNames(void) {return flagSciNames;}
QSettings* getStarSettings(void) {return starSettings;}
public: public:
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Other methods // Other methods
//! Search by Hipparcos catalogue number. //! Search by Hipparcos catalogue number.
//! @param hip the Hipparcos catalogue number of the star which is r equired. //! @param hip the Hipparcos catalogue number of the star which is r equired.
//! @return the requested StelObjectP or an empty objecy if the requ ested //! @return the requested StelObjectP or an empty objecy if the requ ested
//! one was not found. //! one was not found.
StelObjectP searchHP(int hip) const; StelObjectP searchHP(int hip) const;
//! Get the (translated) common name for a star with a specified //! Get the (translated) common name for a star with a specified
//! Hipparcos catalogue number. //! Hipparcos catalogue number.
static QString getCommonName(int hip); static QString getCommonName(int hip);
//! Get the (translated) scientific name for a star with a specified //! Get the (translated) scientific name for a star with a specified
//! Hipparcos catalogue number. //! Hipparcos catalogue number.
static QString getSciName(int hip); static QString getSciName(int hip);
static QString convertToSpectralType(int index); static QString convertToSpectralType(int index);
static QString convertToComponentIds(int index); static QString convertToComponentIds(int index);
QVariantList getCatalogsDescription() const {return catalogsDescript
ion;}
//! Try to load the given catalog, even if it is marched as unchecke
d.
//! Mark it as checked if checksum is correct.
//! @return false in case of failure.
bool checkAndLoadCatalog(QVariantMap m, StelLoadingBar* lb=NULL);
private: private:
void setCheckFlag(const QString& catalogId, bool b);
void copyDefaultConfigFile();
//! Loads common names for stars from a file. //! Loads common names for stars from a file.
//! Called when the SkyCulture is updated. //! Called when the SkyCulture is updated.
//! @param the path to a file containing the common names for bright stars. //! @param the path to a file containing the common names for bright stars.
int loadCommonNames(const QString& commonNameFile); int loadCommonNames(const QString& commonNameFile);
//! Loads scientific names for stars from a file. //! Loads scientific names for stars from a file.
//! Called when the SkyCulture is updated. //! Called when the SkyCulture is updated.
//! @param the path to a file containing the scientific names for br ight stars. //! @param the path to a file containing the scientific names for br ight stars.
void loadSciNames(const QString& sciNameFile); void loadSciNames(const QString& sciNameFile);
//! Gets the maximum search level. //! Gets the maximum search level.
// TODO: add a non-lame description - what is the purpose of the max search level? // TODO: add a non-lame description - what is the purpose of the max search level?
int getMaxSearchLevel() const; int getMaxSearchLevel() const;
//! Load all the stars from the files. //! Load all the stars from the files.
void loadData(); void loadData(QVariantMap starsConfigFile);
//! Load config data from star.ini
void loadStarSettings(void);
//! Draw a nice animated pointer around the object. //! Draw a nice animated pointer around the object.
void drawPointer(const StelProjectorP& prj, const StelNavigator * na v); void drawPointer(StelPainter& sPainter, const StelNavigator * nav);
LinearFader labelsFader; LinearFader labelsFader;
LinearFader starsFader; LinearFader starsFader;
bool flagStarName; bool flagStarName;
float labelsAmount; float labelsAmount;
bool gravityLabel; bool gravityLabel;
int maxGeodesicGridLevel; int maxGeodesicGridLevel;
int lastMaxSearchLevel; int lastMaxSearchLevel;
typedef std::map<int,BigStarCatalogExtension::ZoneArray*> ZoneArrayM ap; typedef std::map<int,BigStarCatalogExtension::ZoneArray*> ZoneArrayM ap;
ZoneArrayMap zoneArrays; // index is the grid level ZoneArrayMap zoneArrays; // index is the grid level
static void initTriangleFunc(int lev, int index, static void initTriangleFunc(int lev, int index,
const Vec3d &c0, const Vec3d
const Vec3d &c1, &c0,
const Vec3d &c2, const Vec3d
void *context) &c1,
const Vec3d
&c2,
void *conte
xt)
{ {
reinterpret_cast<StarMgr*>(context)->initTriangle(lev, index , c0, c1, c2); reinterpret_cast<StarMgr*>(context)->initTriangle(lev, index , c0, c1, c2);
} }
void initTriangle(int lev, int index, void initTriangle(int lev, int index,
const Vec3d &c0, const Vec3d &c0,
const Vec3d &c1, const Vec3d &c1,
const Vec3d &c2); const Vec3d &c2);
BigStarCatalogExtension::HipIndexStruct *hipIndex; // array of hipar cos stars BigStarCatalogExtension::HipIndexStruct *hipIndex; // array of hipar cos stars
static std::map<int, QString> commonNamesMap; static std::map<int, QString> commonNamesMap;
static std::map<int, QString> commonNamesMapI18n; static std::map<int, QString> commonNamesMapI18n;
static std::map<QString, int> commonNamesIndex; static std::map<QString, int> commonNamesIndex;
static std::map<QString, int> commonNamesIndexI18n; static std::map<QString, int> commonNamesIndexI18n;
static std::map<int, QString> sciNamesMapI18n; static std::map<int, QString> sciNamesMapI18n;
static std::map<QString, int> sciNamesIndexI18n; static std::map<QString, int> sciNamesIndexI18n;
double fontSize; QFont starFont;
StelFont *starFont;
static bool flagSciNames; static bool flagSciNames;
Vec3f labelColor; Vec3f labelColor;
StelTextureSP texPointer; // The selection pointer tex ture StelTextureSP texPointer; // The selection pointer tex ture
QSettings* starSettings;
class StelObjectMgr* objectMgr; class StelObjectMgr* objectMgr;
QString starConfigFileFullPath;
QVariantMap starSettings;
QVariantList catalogsDescription;
}; };
#endif // _STARMGR_HPP_ #endif // _STARMGR_HPP_
 End of changes. 13 change blocks. 
18 lines changed or deleted 34 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/