ArchaeoLines.hpp   ArchaeoLines.hpp 
skipping to change at line 83 skipping to change at line 83
*/ */
//! @class ArchaeoLine //! @class ArchaeoLine
//! Class which manages a line (small circle) to display around the sky lik e the solstices line. //! Class which manages a line (small circle) to display around the sky lik e the solstices line.
//! Modelled after @class SkyLine found in GridLinesMgr.cpp at V0.13.2, but with small-circle drawing. //! Modelled after @class SkyLine found in GridLinesMgr.cpp at V0.13.2, but with small-circle drawing.
//! @author Georg Zotti //! @author Georg Zotti
//! @ingroup archaeoLines //! @ingroup archaeoLines
class ArchaeoLine : QObject class ArchaeoLine : QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(Vec3f color READ getColor WRITE setColor) Q_PROPERTY(Vec3f color READ getColor WRITE setColor NOTIFY colorChan
Q_PROPERTY(bool flagLabel READ isLabelVisible WRITE setLabelVisible) ged)
Q_PROPERTY(bool flagLabel READ isLabelVisible WRITE setLabelVisible
NOTIFY flagLabelChanged)
Q_PROPERTY(double definingAngle READ getDefiningAngle WRITE setDefin
ingAngle NOTIFY definingAngleChanged)
//Need to register Enum with Qt to be able to use it as Q_PROPERTY //Need to register Enum with Qt to be able to use it as Q_PROPERTY
//or in signals/slots //or in signals/slots
Q_ENUMS(Line) Q_ENUMS(Line)
public: public:
enum Line { // we must start with the planet lines to allow proper h andling in the combobox. enum Line { // we must start with the planet lines to allow proper h andling in the combobox.
CurrentPlanetNone, // actually a placeholder for counting/te sting. By itself it makes no sense, i.e. deactivates the planet line CurrentPlanetNone, // actually a placeholder for counting/te sting. By itself it makes no sense, i.e. deactivates the planet line
CurrentPlanetMercury, CurrentPlanetMercury,
CurrentPlanetVenus, CurrentPlanetVenus,
CurrentPlanetMars, CurrentPlanetMars,
skipping to change at line 120 skipping to change at line 121
GeographicLocation2, GeographicLocation2,
CustomAzimuth1, CustomAzimuth1,
CustomAzimuth2 CustomAzimuth2
}; };
ArchaeoLine(ArchaeoLine::Line lineType, double definingAngle); ArchaeoLine(ArchaeoLine::Line lineType, double definingAngle);
virtual ~ArchaeoLine(){} virtual ~ArchaeoLine(){}
void draw(StelCore* core, float intensity=1.0f) const; void draw(StelCore* core, float intensity=1.0f) const;
const Vec3f& getColor() const {return color;} const Vec3f& getColor() const {return color;}
bool isDisplayed(void) const {return fader;} bool isDisplayed(void) const {return fader;}
signals:
void colorChanged(Vec3f c);
void flagLabelChanged(bool on);
void definingAngleChanged(double angle);
public slots: public slots:
void setColor(const Vec3f& c) {color = c;} void setColor(const Vec3f& c);
void update(double deltaTime) {fader.update((int)(deltaTime*1000));} void update(double deltaTime) {fader.update((int)(deltaTime*1000));}
void setFadeDuration(float duration) {fader.setDuration((int)(durati on*1000.f));} void setFadeDuration(float duration) {fader.setDuration((int)(durati on*1000.f));}
void setDisplayed(const bool displayed){fader = displayed;} void setDisplayed(const bool displayed){fader = displayed;}
void setFontSize(double newSize){font.setPixelSize(newSize);} void setFontSize(double newSize){font.setPixelSize(newSize);}
//! reset declination/azimuth angle (degrees) of this arc. //! reset declination/azimuth angle (degrees) of this arc.
void setDefiningAngle(double angle){definingAngle=angle;} void setDefiningAngle(double angle);
double getDefiningAngle(void) const {return definingAngle;} // retur ns declination for most, or azimuth. double getDefiningAngle(void) const {return definingAngle;} // retur ns declination for most, or azimuth.
//! Re-translates the label. //! Re-translates the label.
void updateLabel(); void updateLabel();
void setLabelVisible(bool b){flagLabel=b;} void setLabelVisible(bool b);
bool isLabelVisible() const{return flagLabel;} bool isLabelVisible() const{return flagLabel;}
void setLineType(ArchaeoLine::Line line) {lineType=line; updateLabel ();} // Meaningful only for CurrentPlanet... types void setLineType(ArchaeoLine::Line line) {lineType=line; updateLabel ();} // Meaningful only for CurrentPlanet... types
//! change label. Used only for selected-object line - the other lab els should not be changed! //! change label. Used only for selected-object line - the other lab els should not be changed!
void setLabel(const QString newLabel){label=newLabel;} void setLabel(const QString newLabel){label=newLabel;}
QString getLabel() const {return label;} QString getLabel() const {return label;}
private: private:
ArchaeoLine::Line lineType; ArchaeoLine::Line lineType;
double definingAngle; // degrees. This is declination for non-azimut h lines, azimuth for geographic locations and custom azimuths. double definingAngle; // degrees. This is declination for non-azimut h lines, azimuth for geographic locations and custom azimuths.
Vec3f color; Vec3f color;
skipping to change at line 280 skipping to change at line 284
// Note: following 2 are only "forwarding properties", no proper var iables! // Note: following 2 are only "forwarding properties", no proper var iables!
Q_PROPERTY(double customDeclination1 Q_PROPERTY(double customDeclination1
READ getCustomDeclination1 READ getCustomDeclination1
WRITE setCustomDeclination1 WRITE setCustomDeclination1
NOTIFY customDeclination1Changed) NOTIFY customDeclination1Changed)
Q_PROPERTY(double customDeclination2 Q_PROPERTY(double customDeclination2
READ getCustomDeclination2 READ getCustomDeclination2
WRITE setCustomDeclination2 WRITE setCustomDeclination2
NOTIFY customDeclination2Changed) NOTIFY customDeclination2Changed)
// TODO: Maybe add properties for geo locations and custom azimuths/ // More "forwarding properties" for geo locations and custom azimuth
declinations: labels. s/declination labels.
Q_PROPERTY(QString geographicLocation1Label READ getGeographicLocati
on1Label WRITE setGeographicLocation1Label NOTIFY geographicLocation1LabelC
hanged)
Q_PROPERTY(QString geographicLocation2Label READ getGeographicLocati
on2Label WRITE setGeographicLocation2Label NOTIFY geographicLocation2LabelC
hanged)
Q_PROPERTY(QString customAzimuth1Label READ getCustomAzimuth1Label W
RITE setCustomAzimuth1Label NOTIFY customAzimuth1LabelChanged)
Q_PROPERTY(QString customAzimuth2Label READ getCustomAzimuth2Label W
RITE setCustomAzimuth2Label NOTIFY customAzimuth2LabelChanged)
Q_PROPERTY(QString customDeclination1Label READ getCustomDeclination
1Label WRITE setCustomDeclination1Label NOTIFY customDeclination1LabelChang
ed)
Q_PROPERTY(QString customDeclination2Label READ getCustomDeclination
2Label WRITE setCustomDeclination2Label NOTIFY customDeclination2LabelChang
ed)
public: public:
ArchaeoLines(); ArchaeoLines();
virtual ~ArchaeoLines(); virtual ~ArchaeoLines();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
virtual void init(); virtual void init();
virtual void update(double deltaTime); virtual void update(double deltaTime);
virtual void draw(StelCore* core); virtual void draw(StelCore* core);
skipping to change at line 336 skipping to change at line 346
void geographicLocation2Changed(); void geographicLocation2Changed();
void showCustomAzimuth1Changed(bool on); void showCustomAzimuth1Changed(bool on);
void showCustomAzimuth2Changed(bool on); void showCustomAzimuth2Changed(bool on);
void customAzimuth1Changed(double az); void customAzimuth1Changed(double az);
void customAzimuth2Changed(double az); void customAzimuth2Changed(double az);
void showCustomDeclination1Changed(bool on); void showCustomDeclination1Changed(bool on);
void showCustomDeclination2Changed(bool on); void showCustomDeclination2Changed(bool on);
void customDeclination1Changed(double dec); void customDeclination1Changed(double dec);
void customDeclination2Changed(double dec); void customDeclination2Changed(double dec);
void currentPlanetChanged(ArchaeoLine::Line l); // meaningful only C urrentPlanetNone...CurrentPlanetSaturn. void currentPlanetChanged(ArchaeoLine::Line l); // meaningful only C urrentPlanetNone...CurrentPlanetSaturn.
void geographicLocation1LabelChanged(QString label);
void geographicLocation2LabelChanged(QString label);
void customAzimuth1LabelChanged(QString label);
void customAzimuth2LabelChanged(QString label);
void customDeclination1LabelChanged(QString label);
void customDeclination2LabelChanged(QString label);
public slots: public slots:
void enableArchaeoLines(bool b); void enableArchaeoLines(bool b);
//void useDmsFormat(bool b); //void useDmsFormat(bool b);
bool isEnabled() const {return flagShowArchaeoLines;} bool isEnabled() const {return flagShowArchaeoLines;}
bool isEquinoxDisplayed() const {return flagShowEquinox;} bool isEquinoxDisplayed() const {return flagShowEquinox;}
bool isSolsticesDisplayed() const {return flagShowSolstices;} bool isSolsticesDisplayed() const {return flagShowSolstices;}
bool isCrossquartersDisplayed() const {return flagShowCrossquarters; } bool isCrossquartersDisplayed() const {return flagShowCrossquarters; }
bool isMajorStandstillsDisplayed() const {return flagShowMajorStands tills;} bool isMajorStandstillsDisplayed() const {return flagShowMajorStands tills;}
skipping to change at line 380 skipping to change at line 396
void showCurrentPlanet(ArchaeoLine::Line l); // Allowed values for l : CurrentPlanetNone...CurrentPlanetSaturn. void showCurrentPlanet(ArchaeoLine::Line l); // Allowed values for l : CurrentPlanetNone...CurrentPlanetSaturn.
void showCurrentPlanetNamed(QString planet); // Allowed values for p lanet: "none", "Mercury", "Venus", "Mars", "Jupiter", "Saturn". void showCurrentPlanetNamed(QString planet); // Allowed values for p lanet: "none", "Mercury", "Venus", "Mars", "Jupiter", "Saturn".
void showGeographicLocation1(bool b); void showGeographicLocation1(bool b);
void showGeographicLocation2(bool b); void showGeographicLocation2(bool b);
void setGeographicLocation1Longitude(double lng); void setGeographicLocation1Longitude(double lng);
void setGeographicLocation1Latitude(double lat); void setGeographicLocation1Latitude(double lat);
void setGeographicLocation2Longitude(double lng); void setGeographicLocation2Longitude(double lng);
void setGeographicLocation2Latitude(double lat); void setGeographicLocation2Latitude(double lat);
void setGeographicLocation1Label(QString label); void setGeographicLocation1Label(QString label);
void setGeographicLocation2Label(QString label); void setGeographicLocation2Label(QString label);
QString getGeographicLocation1Label(){return geographicLocation1Line
->getLabel();}
QString getGeographicLocation2Label(){return geographicLocation2Line
->getLabel();}
double getGeographicLocation1Longitude() const {return geographicLoc ation1Longitude; } double getGeographicLocation1Longitude() const {return geographicLoc ation1Longitude; }
double getGeographicLocation1Latitude() const {return geographicLoc ation1Latitude; } double getGeographicLocation1Latitude() const {return geographicLoc ation1Latitude; }
double getGeographicLocation2Longitude() const {return geographicLoc ation2Longitude; } double getGeographicLocation2Longitude() const {return geographicLoc ation2Longitude; }
double getGeographicLocation2Latitude() const {return geographicLoc ation2Latitude; } double getGeographicLocation2Latitude() const {return geographicLoc ation2Latitude; }
void showCustomAzimuth1(bool b); void showCustomAzimuth1(bool b);
void showCustomAzimuth2(bool b); void showCustomAzimuth2(bool b);
void setCustomAzimuth1(double az); void setCustomAzimuth1(double az);
double getCustomAzimuth1() const { return customAzimuth1Line->getDef iningAngle(); } double getCustomAzimuth1() const { return customAzimuth1Line->getDef iningAngle(); }
void setCustomAzimuth2(double az); void setCustomAzimuth2(double az);
double getCustomAzimuth2() const { return customAzimuth2Line->getDef iningAngle(); } double getCustomAzimuth2() const { return customAzimuth2Line->getDef iningAngle(); }
void setCustomAzimuth1Label(QString label); void setCustomAzimuth1Label(QString label);
void setCustomAzimuth2Label(QString label); void setCustomAzimuth2Label(QString label);
QString getCustomAzimuth1Label(){return customAzimuth1Line->getLabel
();}
QString getCustomAzimuth2Label(){return customAzimuth2Line->getLabel
();}
void showCustomDeclination1(bool b); void showCustomDeclination1(bool b);
void showCustomDeclination2(bool b); void showCustomDeclination2(bool b);
void setCustomDeclination1(double dec); void setCustomDeclination1(double dec);
double getCustomDeclination1() const { return customDeclination1Line ->getDefiningAngle(); } double getCustomDeclination1() const { return customDeclination1Line ->getDefiningAngle(); }
void setCustomDeclination2(double dec); void setCustomDeclination2(double dec);
double getCustomDeclination2() const { return customDeclination2Line ->getDefiningAngle(); } double getCustomDeclination2() const { return customDeclination2Line ->getDefiningAngle(); }
void setCustomDeclination1Label(QString label); void setCustomDeclination1Label(QString label);
void setCustomDeclination2Label(QString label); void setCustomDeclination2Label(QString label);
QString getCustomDeclination1Label(){return customDeclination1Line->
getLabel();}
QString getCustomDeclination2Label(){return customDeclination2Line->
getLabel();}
// called by the dialog GUI, converts GUI's QColor (0..255) to Stell arium's Vec3f float color. // called by the dialog GUI, converts GUI's QColor (0..255) to Stell arium's Vec3f float color.
void setLineColor(ArchaeoLine::Line whichLine, QColor color); void setLineColor(ArchaeoLine::Line whichLine, QColor color);
// called by the dialog UI, converts Stellarium's Vec3f float color to QColor (0..255). // called by the dialog UI, converts Stellarium's Vec3f float color to QColor (0..255).
QColor getLineColor(ArchaeoLine::Line whichLine); QColor getLineColor(ArchaeoLine::Line whichLine) const;
//! query a line for its current defining angle. Returns declination or azimuth, respectively. //! query a line for its current defining angle. Returns declination or azimuth, respectively.
double getLineAngle(ArchaeoLine::Line whichLine); double getLineAngle(ArchaeoLine::Line whichLine) const;
QString getLineLabel(ArchaeoLine::Line whichLine); QString getLineLabel(ArchaeoLine::Line whichLine) const;
private slots: private slots:
//! a slot connected to core which cares for location changes, updat ing the geographicLocation lines. //! a slot connected to core which cares for location changes, updat ing the geographicLocation lines.
void updateObserverLocation(StelLocation loc); void updateObserverLocation(StelLocation loc);
//! Compute azimuth (from North) towards Target. All angles (args an d result) are in degrees. //! Compute azimuth (from North) towards Target. All angles (args an d result) are in degrees.
double getAzimuthForLocation(double longObs, double latObs, double l ongTarget, double latTarget) const; static double getAzimuthForLocation(double longObs, double latObs, d ouble longTarget, double latTarget);
private: private:
QFont font; QFont font;
bool flagShowArchaeoLines; bool flagShowArchaeoLines;
//bool withDecimalDegree; //bool withDecimalDegree;
//bool flagUseDmsFormat; //bool flagUseDmsFormat;
LinearFader lineFader; LinearFader lineFader;
Vec3f equinoxColor; Vec3f equinoxColor;
Vec3f solsticesColor; Vec3f solsticesColor;
skipping to change at line 511 skipping to change at line 533
//! This class is used by Qt to manage a plug-in interface //! This class is used by Qt to manage a plug-in interface
class ArchaeoLinesStelPluginInterface : public QObject, public StelPluginIn terface class ArchaeoLinesStelPluginInterface : public QObject, public StelPluginIn terface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID StelPluginInterface_iid) Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
Q_INTERFACES(StelPluginInterface) Q_INTERFACES(StelPluginInterface)
public: public:
virtual StelModule* getStelModule() const; virtual StelModule* getStelModule() const;
virtual StelPluginInfo getPluginInfo() const; virtual StelPluginInfo getPluginInfo() const;
virtual QObjectList getExtensionList() const { return QObjectList(); }
}; };
#endif /*ARCHAEOLINES_HPP_*/ #endif /*ARCHAEOLINES_HPP_*/
 End of changes. 14 change blocks. 
12 lines changed or deleted 54 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/