ConstellationMgr.hpp   ConstellationMgr.hpp 
/* /*
* Stellarium * Stellarium
* Copyright (C) 2002 Fabien Chereau * Copyright (C) 2002 Fabien Chereau
* Copyright (C) 2012 Timothy Reaves
* *
* 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.
* *
* 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _CONSTELLATIONMGR_HPP_ #ifndef _CONSTELLATIONMGR_HPP_
#define _CONSTELLATIONMGR_HPP_ #define _CONSTELLATIONMGR_HPP_
#include <vector> #include <vector>
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QFont> #include <QFont>
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include "StelObjectModule.hpp" #include "StelObjectModule.hpp"
#include "StelProjectorType.hpp" #include "StelProjectorType.hpp"
class StelToneReproducer; class StelToneReproducer;
class StarMgr; class StarMgr;
class Constellation; class Constellation;
class StelProjector; class StelProjector;
class StelNavigator;
class StelPainter; class StelPainter;
//! @class ConstellationMgr //! @class ConstellationMgr
//! Display and manage the constellations. //! Display and manage the constellations.
//! It can display constellations lines, names, art textures and boundaries . //! It can display constellations lines, names, art textures and boundaries .
//! It also supports several different sky cultures. //! It also supports several different sky cultures.
class ConstellationMgr : public StelObjectModule class ConstellationMgr : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool artDisplayed
READ getFlagArt
WRITE setFlagArt
NOTIFY artDisplayedChanged)
Q_PROPERTY(bool artFadeDuration
READ getArtFadeDuration
WRITE setArtFadeDuration
NOTIFY artFadeDurationChanged)
Q_PROPERTY(bool artIntensity
READ getArtIntensity
WRITE setArtIntensity
NOTIFY artIntensityChanged)
Q_PROPERTY(bool boundariesColor
READ getBoundariesColor
WRITE setBoundariesColor
NOTIFY boundariesColorChanged)
Q_PROPERTY(bool boundariesDisplayed
READ getFlagBoundaries
WRITE setFlagBoundaries
NOTIFY boundariesDisplayedChanged)
Q_PROPERTY(bool fontSize
READ getFontSize
WRITE setFontSize
NOTIFY fontSizeChanged)
Q_PROPERTY(bool isolateSelected
READ getFlagIsolateSelected
WRITE setFlagIsolateSelected
NOTIFY isolateSelectedChanged)
Q_PROPERTY(bool linesColor
READ getLinesColor
WRITE setLinesColor
NOTIFY linesColorChanged)
Q_PROPERTY(bool linesDisplayed
READ getFlagLines
WRITE setFlagLines
NOTIFY linesDisplayedChanged)
Q_PROPERTY(bool namesColor
READ getLabelsColor
WRITE setLabelsColor
NOTIFY namesColorChanged)
Q_PROPERTY(bool namesDisplayed
READ getFlagLabels
WRITE setFlagLabels
NOTIFY namesDisplayedChanged)
public: public:
//! Constructor //! Constructor
ConstellationMgr(StarMgr *stars); ConstellationMgr(StarMgr *stars);
//! Destructor //! Destructor
virtual ~ConstellationMgr(); virtual ~ConstellationMgr();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
//! Initialize the ConstellationMgr. //! Initialize the ConstellationMgr.
skipping to change at line 92 skipping to change at line 136
//! Find and return the list of at most maxNbItem objects auto-compl eting the passed object I18n name. //! Find and return the list of at most maxNbItem objects auto-compl eting the passed object I18n name.
//! @param objPrefix the case insensitive first letters of the searc hed object //! @param objPrefix the case insensitive first letters of the searc hed object
//! @param maxNbItem the maximum number of returned object names //! @param maxNbItem the maximum number of returned object names
//! @return a vector of matching object name by order of relevance, or an empty vector if nothing match //! @return a vector of matching object name by order of relevance, or an empty vector if nothing match
virtual QStringList listMatchingObjectsI18n(const QString& objPrefix , int maxNbItem=5) const; virtual QStringList listMatchingObjectsI18n(const QString& objPrefix , int maxNbItem=5) const;
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Properties setters and getters // Properties setters and getters
public slots: public slots:
//! Set whether constellation art will be displayed
void setFlagArt(const bool displayed);
//! Get whether constellation art is displayed
bool getFlagArt(void) const;
//! Set constellation art fade duration in second //! Set constellation art fade duration in second
void setArtFadeDuration(float duration); void setArtFadeDuration(const float duration);
//! Get constellation art fade duration in second //! Get constellation art fade duration in second
float getArtFadeDuration() const {return artFadeDuration;} float getArtFadeDuration() const;
//! Set constellation maximum art intensity (between 0 and 1) //! Set constellation maximum art intensity (between 0 and 1)
void setArtIntensity(double d); void setArtIntensity(const double intensity);
//! Set constellation maximum art intensity (between 0 and 1) //! Set constellation maximum art intensity (between 0 and 1)
double getArtIntensity() const {return artMaxIntensity;} double getArtIntensity() const;
//! Set whether constellation art will be displayed
void setFlagArt(bool b);
//! Get whether constellation art is displayed
bool getFlagArt(void) const {return flagArt;}
//! Set whether constellation path lines will be displayed //! Define boundary color
void setFlagLines(bool b); void setBoundariesColor(const Vec3f& color);
//! Get whether constellation path lines are displayed //! Get current boundary color
bool getFlagLines(void) const {return flagLines;} Vec3f getBoundariesColor() const;
//! Set whether constellation boundaries lines will be displayed //! Set whether constellation boundaries lines will be displayed
void setFlagBoundaries(bool b); void setFlagBoundaries(const bool displayed);
//! Get whether constellation boundaries lines are displayed //! Get whether constellation boundaries lines are displayed
bool getFlagBoundaries(void) const {return flagBoundaries;} bool getFlagBoundaries(void) const;
//! Set whether constellation names will be displayed
void setFlagLabels(bool b);
//! Set whether constellation names are displayed
bool getFlagLabels(void) const {return flagNames;}
//! Set whether selected constellation must be displayed alone //! Set whether selected constellation must be displayed alone
void setFlagIsolateSelected(bool s); void setFlagIsolateSelected(const bool isolate);
//! Get whether selected constellation is displayed alone //! Get whether selected constellation is displayed alone
bool getFlagIsolateSelected(void) const { return isolateSelected;} bool getFlagIsolateSelected(void) const;
//! Define line color //! Define line color
void setLinesColor(const Vec3f& c); void setLinesColor(const Vec3f& color);
//! Get line color //! Get line color
Vec3f getLinesColor() const; Vec3f getLinesColor() const;
//! Define boundary color //! Set whether constellation path lines will be displayed
void setBoundariesColor(const Vec3f& c); void setFlagLines(const bool displayed);
//! Get current boundary color //! Get whether constellation path lines are displayed
Vec3f getBoundariesColor() const; bool getFlagLines(void) const;
//! Set label color for names //! Set label color for names
void setLabelsColor(const Vec3f& c); void setLabelsColor(const Vec3f& color);
//! Get label color for names //! Get label color for names
Vec3f getLabelsColor() const; Vec3f getLabelsColor() const;
//! Set whether constellation names will be displayed
void setFlagLabels(bool displayed);
//! Set whether constellation names are displayed
bool getFlagLabels(void) const;
//! Set the font size used for constellation names display //! Set the font size used for constellation names display
void setFontSize(float newFontSize); void setFontSize(const float newFontSize);
//! Get the font size used for constellation names display //! Get the font size used for constellation names display
float getFontSize() const; float getFontSize() const;
signals:
void artDisplayedChanged(const bool displayed) const;
void artFadeDurationChanged(const float duration) const;
void artIntensityChanged(const double intensity) const;
void boundariesColorChanged(const Vec3f & color) const;
void boundariesDisplayedChanged(const bool displayed) const;
void fontSizeChanged(const float newSize) const;
void isolateSelectedChanged(const bool isolate) const;
void linesColorChanged(const Vec3f & color) const;
void linesDisplayedChanged(const bool displayed) const;
void namesColorChanged(const Vec3f & color) const;
void namesDisplayedChanged(const bool displayed) const;
private slots: private slots:
//! Limit the number of constellations to draw based on selected sta rs. //! Limit the number of constellations to draw based on selected sta rs.
//! The selected objects changed, check if some stars are selected a nd display the //! The selected objects changed, check if some stars are selected a nd display the
//! matching constellations if isolateSelected mode is activated. //! matching constellations if isolateSelected mode is activated.
//! @param action define whether to add to, replace, or remove from the existing selection //! @param action define whether to add to, replace, or remove from the existing selection
void selectedObjectChange(StelModule::StelModuleSelectAction action) ; void selectedObjectChange(StelModule::StelModuleSelectAction action) ;
//! Load a color scheme //! Load a color scheme
void setStelStyle(const QString& section); void setStelStyle(const QString& section);
skipping to change at line 192 skipping to change at line 249
//! Each boundary may span multiple lines, and consists of the follo wing ordered //! Each boundary may span multiple lines, and consists of the follo wing ordered
//! data items: //! data items:
//! - The number of vertexes which make up in the boundary (integer ). //! - The number of vertexes which make up in the boundary (integer ).
//! - For each vertex, two floating point numbers describing the ra and dec //! - For each vertex, two floating point numbers describing the ra and dec
//! of the vertex. //! of the vertex.
//! - The number of constellations which this boundary separates (a lways 2). //! - The number of constellations which this boundary separates (a lways 2).
//! - Two constellation abbreviations representing the constellatio ns which //! - Two constellation abbreviations representing the constellatio ns which
//! the boundary separates. //! the boundary separates.
//! @param conCatFile the path to the file which contains the conste llation boundary data. //! @param conCatFile the path to the file which contains the conste llation boundary data.
bool loadBoundaries(const QString& conCatFile); bool loadBoundaries(const QString& conCatFile);
//! Draw the constellation lines at the epoch given by the StelNavig ator. //! Draw the constellation lines at the epoch given by the StelCore .
void drawLines(StelPainter& sPainter, const StelCore* core) const; void drawLines(StelPainter& sPainter, const StelCore* core) const;
//! Draw the constellation art. //! Draw the constellation art.
void drawArt(StelPainter& sPainter) const; void drawArt(StelPainter& sPainter) const;
//! Draw the constellation name labels. //! Draw the constellation name labels.
void drawNames(StelPainter& sPainter) const; void drawNames(StelPainter& sPainter) const;
//! Draw the constellation boundaries. //! Draw the constellation boundaries.
void drawBoundaries(StelPainter& sPainter) const; void drawBoundaries(StelPainter& sPainter) const;
//! Handle single and multi-constellation selections. //! Handle single and multi-constellation selections.
void setSelectedConst(Constellation* c); void setSelectedConst(Constellation* c);
//! Handle unselecting a single constellation. //! Handle unselecting a single constellation.
skipping to change at line 233 skipping to change at line 290
std::vector<Constellation*> asterisms; std::vector<Constellation*> asterisms;
QFont asterFont; QFont asterFont;
StarMgr* hipStarMgr; StarMgr* hipStarMgr;
bool isolateSelected; bool isolateSelected;
std::vector<std::vector<Vec3f> *> allBoundarySegments; std::vector<std::vector<Vec3f> *> allBoundarySegments;
QString lastLoadedSkyCulture; // Store the last loaded sky culture directory name QString lastLoadedSkyCulture; // Store the last loaded sky culture directory name
// These are THE master settings - individual constellation settings can vary based on selection status // These are THE master settings - individual constellation settings can vary based on selection status
bool flagNames;
bool flagLines;
bool flagArt;
bool flagBoundaries;
float artFadeDuration; float artFadeDuration;
float artMaxIntensity; float artIntensity;
bool artDisplayed;
bool boundariesDisplayed;
bool linesDisplayed;
bool namesDisplayed;
}; };
#endif // _CONSTELLATIONMGR_HPP_ #endif // _CONSTELLATIONMGR_HPP_
 End of changes. 23 change blocks. 
37 lines changed or deleted 94 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/