@@ -55,6 +55,8 @@ class StelCore : public QObject
5555 Q_PROPERTY (bool flagUseNutation READ getUseNutation WRITE setUseNutation NOTIFY flagUseNutationChanged)
5656 Q_PROPERTY (bool flagUseAberration READ getUseAberration WRITE setUseAberration NOTIFY flagUseAberrationChanged)
5757 Q_PROPERTY (double aberrationFactor READ getAberrationFactor WRITE setAberrationFactor NOTIFY aberrationFactorChanged)
58+ Q_PROPERTY (bool flagUseParallax READ getUseParallax WRITE setUseParallax NOTIFY flagUseParallaxChanged)
59+ Q_PROPERTY (double parallaxFactor READ getParallaxFactor WRITE setParallaxFactor NOTIFY parallaxFactorChanged)
5860 Q_PROPERTY (bool flagUseTopocentricCoordinates READ getUseTopocentricCoordinates WRITE setUseTopocentricCoordinates NOTIFY flagUseTopocentricCoordinatesChanged)
5961 Q_PROPERTY (ProjectionType currentProjectionType READ getCurrentProjectionType WRITE setCurrentProjectionType NOTIFY currentProjectionTypeChanged)
6062 // ! This is just another way to access the projection type, by string instead of enum
@@ -551,6 +553,16 @@ public slots:
551553 QByteArray getAberrationShader () const ;
552554 void setAberrationUniforms (QOpenGLShaderProgram& program) const ;
553555
556+ // ! @return whether parallax effect is currently used.
557+ bool getUseParallax () const {return flagUseParallax;}
558+ // ! Set whether you want computation and simulation of parallax effect.
559+ void setUseParallax (bool use) { if (flagUseParallax != use) { flagUseParallax=use; StelApp::immediateSave (" astro/flag_parallax" , use); emit flagUseParallaxChanged (use); }}
560+
561+ // ! @return parallax factor. 1 is realistic simulation, but higher values may be useful for didactic purposes.
562+ double getParallaxFactor () const {return parallaxFactor;}
563+ // ! Set aberration factor. Values are clamped to 0...5. (Values above 5 cause graphical problems.)
564+ void setParallaxFactor (double factor) { if (!fuzzyEquals (parallaxFactor, factor)) { parallaxFactor=qBound (0 .,factor, 1000 .); StelApp::immediateSave (" astro/parallax_factor" , parallaxFactor); emit parallaxFactorChanged (factor); }}
565+
554566 // ! @return whether topocentric coordinates are currently used.
555567 bool getUseTopocentricCoordinates () const {return flagUseTopocentricCoordinates;}
556568 // ! Set whether you want topocentric or planetocentric data
@@ -862,6 +874,10 @@ public slots:
862874 void flagUseAberrationChanged (bool b);
863875 // ! This signal indicates a change in aberration exaggeration factor
864876 void aberrationFactorChanged (double val);
877+ // ! This signal indicates a switch in use of parallax
878+ void flagUseParallaxChanged (bool b);
879+ // ! This signal indicates a change in parallax exaggeration factor
880+ void parallaxFactorChanged (double val);
865881 // ! This signal indicates a switch in use of topocentric coordinates
866882 void flagUseTopocentricCoordinatesChanged (bool b);
867883 // ! Emitted whenever the projection type changes
@@ -943,6 +959,10 @@ private slots:
943959 bool flagUseAberration;
944960 // value to allow exaggerating aberration effects. 1 is natural value, stretching to e.g. 1000 may be useful for explanations.
945961 double aberrationFactor;
962+ // flag to indicate we want to include parallax effect
963+ bool flagUseParallax;
964+ // value to allow exaggerating parallax effects. 1 is natural value, stretching to e.g. 1000 may be useful for explanations.
965+ double parallaxFactor;
946966 // flag to indicate that we show topocentrically corrected coordinates. (Switching to false for planetocentric coordinates is new for 0.14)
947967 bool flagUseTopocentricCoordinates;
948968
0 commit comments