diff options
author | Alexander V. Wolf <alex.v.wolf@gmail.com> | 2022-11-15 18:31:46 +0700 |
---|---|---|
committer | Alexander V. Wolf <alex.v.wolf@gmail.com> | 2022-11-15 18:31:46 +0700 |
commit | cba1f8e7d7a671d42c91e71b4f6d988f4db3e689 (patch) | |
tree | 9fcbd5f85b7d4762e0965b7c3a527176e4fa6572 | |
parent | b280279705d29d12b643b6e06100e679ef605822 (diff) |
Added config option for scaling starsvisualisation/draw-point-source
-rw-r--r-- | src/core/StelSkyDrawer.cpp | 4 | ||||
-rw-r--r-- | src/core/StelSkyDrawer.hpp | 9 | ||||
-rw-r--r-- | src/gui/ConfigurationDialog.cpp | 1 | ||||
-rw-r--r-- | src/gui/ViewDialog.cpp | 1 | ||||
-rw-r--r-- | src/gui/viewDialog.ui | 224 |
5 files changed, 133 insertions, 106 deletions
diff --git a/src/core/StelSkyDrawer.cpp b/src/core/StelSkyDrawer.cpp index 386f25a4e9..68466c7d92 100644 --- a/src/core/StelSkyDrawer.cpp +++ b/src/core/StelSkyDrawer.cpp @@ -60,6 +60,7 @@ StelSkyDrawer::StelSkyDrawer(StelCore* acore) : twinkleAmount(0.0), flagDrawBigStarHalo(true), flagStarSpiky(false), + flagScaling(true), flagStarMagnitudeLimit(false), flagNebulaMagnitudeLimit(false), flagPlanetMagnitudeLimit(false), @@ -91,6 +92,7 @@ StelSkyDrawer::StelSkyDrawer(StelCore* acore) : setFlagTwinkle(conf->value("stars/flag_star_twinkle",true).toBool()); setFlagForcedTwinkle(conf->value("stars/flag_forced_twinkle",false).toBool()); setFlagDrawBigStarHalo(conf->value("stars/flag_star_halo",true).toBool()); + setFlagScaling(conf->value("stars/flag_scaling", true).toBool()); flagStarSpiky=(conf->value("stars/flag_star_spiky", false).toBool()); // too early to use the set method here! setMaxAdaptFov(conf->value("stars/mag_converter_max_fov",70.0).toFloat()); setMinAdaptFov(conf->value("stars/mag_converter_min_fov",0.1).toFloat()); @@ -478,7 +480,7 @@ bool StelSkyDrawer::drawPointSource(StelPainter* sPainter, const Vec3d& v, const if (!(checkInScreen ? sPainter->getProjector()->projectCheck(v, win) : sPainter->getProjector()->project(v, win))) return false; - const float radius = rcMag.radius*(static_cast<float>(sPainter->getProjector()->getDevicePixelsPerPixel())); + const float radius = flagScaling ? rcMag.radius*(static_cast<float>(sPainter->getProjector()->getDevicePixelsPerPixel())) : rcMag.radius; #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) const float frand=StelApp::getInstance().getRandF(); #else diff --git a/src/core/StelSkyDrawer.hpp b/src/core/StelSkyDrawer.hpp index 9d7675a02c..cde9cbd094 100644 --- a/src/core/StelSkyDrawer.hpp +++ b/src/core/StelSkyDrawer.hpp @@ -61,6 +61,7 @@ class StelSkyDrawer : public QObject, protected QOpenGLFunctions Q_PROPERTY(double lightPollutionLuminance READ getLightPollutionLuminance WRITE setLightPollutionLuminance NOTIFY lightPollutionLuminanceChanged) Q_PROPERTY(bool flagDrawBigStarHalo READ getFlagDrawBigStarHalo WRITE setFlagDrawBigStarHalo NOTIFY flagDrawBigStarHaloChanged) Q_PROPERTY(bool flagStarSpiky READ getFlagStarSpiky WRITE setFlagStarSpiky NOTIFY flagStarSpikyChanged) + Q_PROPERTY(bool flagScaling READ getFlagScaling WRITE setFlagScaling NOTIFY flagScalingChanged) Q_PROPERTY(bool flagStarMagnitudeLimit READ getFlagStarMagnitudeLimit WRITE setFlagStarMagnitudeLimit NOTIFY flagStarMagnitudeLimitChanged) Q_PROPERTY(bool flagNebulaMagnitudeLimit READ getFlagNebulaMagnitudeLimit WRITE setFlagNebulaMagnitudeLimit NOTIFY flagNebulaMagnitudeLimitChanged) @@ -197,6 +198,11 @@ public slots: //! @note option for planetariums bool getFlagForcedTwinkle() const {return flagForcedTwinkle;} + //! Set flag for source scaling. + void setFlagScaling(bool b) {if(b!=flagScaling){ flagScaling=b; emit flagScalingChanged(b);}} + //! Get flag for source scaling. + bool getFlagScaling() const {return flagScaling;} + //! Set the parameters so that the stars disappear at about the naked-eye limiting magnitude corresponding //! to the given zenith luminance at moonless night. //! The limit is valid only at a given zoom level (around 60 deg) @@ -354,6 +360,8 @@ signals: void flagDrawBigStarHaloChanged(bool b); //! Emitted on change of star texture void flagStarSpikyChanged(bool b); + //! Emitted whenever the scaling flag is toggled + void flagScalingChanged(bool b); //! Emitted whenever the star magnitude limit flag is toggled void flagStarMagnitudeLimitChanged(bool b); @@ -455,6 +463,7 @@ private: double twinkleAmount; bool flagDrawBigStarHalo; bool flagStarSpiky; + bool flagScaling; //! Informing the drawer whether atmosphere is displayed. //! This is used to avoid twinkling/simulate extinction/refraction. diff --git a/src/gui/ConfigurationDialog.cpp b/src/gui/ConfigurationDialog.cpp index e4702e5230..5b1bb10860 100644 --- a/src/gui/ConfigurationDialog.cpp +++ b/src/gui/ConfigurationDialog.cpp @@ -855,6 +855,7 @@ void ConfigurationDialog::saveAllSettings() conf->setValue("stars/flag_star_twinkle", propMgr->getStelPropertyValue("StelSkyDrawer.flagStarTwinkle").toBool()); conf->setValue("stars/star_twinkle_amount", QString::number(propMgr->getStelPropertyValue("StelSkyDrawer.twinkleAmount").toDouble(), 'f', 2)); conf->setValue("stars/flag_star_spiky", propMgr->getStelPropertyValue("StelSkyDrawer.flagStarSpiky").toBool()); + conf->setValue("stars/flag_scaling", propMgr->getStelPropertyValue("StelSkyDrawer.flagScaling").toBool()); conf->setValue("astro/twilight_altitude", propMgr->getStelPropertyValue("SpecificTimeMgr.twilightAltitude").toDouble()); conf->setValue("astro/flag_star_magnitude_limit", propMgr->getStelPropertyValue("StelSkyDrawer.flagStarMagnitudeLimit").toBool()); conf->setValue("astro/star_magnitude_limit", QString::number(propMgr->getStelPropertyValue("StelSkyDrawer.customStarMagLimit").toDouble(), 'f', 2)); diff --git a/src/gui/ViewDialog.cpp b/src/gui/ViewDialog.cpp index 4fc5dc838f..616bd0b32a 100644 --- a/src/gui/ViewDialog.cpp +++ b/src/gui/ViewDialog.cpp @@ -174,6 +174,7 @@ void ViewDialog::createDialogContent() connectBoolProperty(ui->starLimitMagnitudeCheckBox,"StelSkyDrawer.flagStarMagnitudeLimit"); connectDoubleProperty(ui->starLimitMagnitudeDoubleSpinBox, "StelSkyDrawer.customStarMagLimit"); connectBoolProperty(ui->spikyStarsCheckBox, "StelSkyDrawer.flagStarSpiky"); + connectBoolProperty(ui->scalingStarsCheckBox, "StelSkyDrawer.flagScaling"); connectCheckBox(ui->starLabelCheckBox, "actionShow_Stars_Labels"); connectDoubleProperty(ui->starsLabelsHorizontalSlider,"StarMgr.labelsAmount",0.0,10.0); connectBoolProperty(ui->checkBoxAdditionalNamesStars, "StarMgr.flagAdditionalNamesDisplayed"); diff --git a/src/gui/viewDialog.ui b/src/gui/viewDialog.ui index ea40efc80a..8ebbb42bba 100644 --- a/src/gui/viewDialog.ui +++ b/src/gui/viewDialog.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>742</width> - <height>558</height> + <width>900</width> + <height>676</height> </rect> </property> <property name="font"> @@ -840,6 +840,52 @@ </item> </layout> </item> + <item row="2" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_starTwinkle"> + <item> + <widget class="QCheckBox" name="starTwinkleCheckBox"> + <property name="text"> + <string>Twinkle:</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QDoubleSpinBox" name="starTwinkleAmountDoubleSpinBox"> + <property name="maximumSize"> + <size> + <width>75</width> + <height>16777215</height> + </size> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="decimals"> + <number>2</number> + </property> + <property name="maximum"> + <double>1.500000000000000</double> + </property> + <property name="singleStep"> + <double>0.100000000000000</double> + </property> + </widget> + </item> + </layout> + </item> + <item row="7" column="0"> + <widget class="QCheckBox" name="checkBoxAdditionalNamesStars"> + <property name="toolTip"> + <string>Show all available proper names</string> + </property> + <property name="text"> + <string>Show additional star names</string> + </property> + </widget> + </item> <item row="3" column="0"> <layout class="QHBoxLayout" name="horizontalLayout_starLimitMag"> <item> @@ -900,88 +946,66 @@ </item> </layout> </item> - <item row="7" column="0"> - <widget class="QCheckBox" name="checkBoxStarDesignationsOnlyUsage"> - <property name="toolTip"> - <string>Use designations of stars instead of their common names for screen labels</string> - </property> - <property name="text"> - <string>Use designations for screen labels</string> + <item row="9" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_28"> + <property name="leftMargin"> + <number>22</number> </property> - </widget> - </item> - <item row="5" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout_starLabel"> <item> - <widget class="QCheckBox" name="starLabelCheckBox"> - <property name="enabled"> - <bool>true</bool> + <widget class="QCheckBox" name="dblStarsDesignationsCheckBox"> + <property name="toolTip"> + <string>Show traditional designations of double stars if proper name, Bayer or Flamsteed designations do not exist for the star.</string> </property> <property name="text"> - <string>Labels and Markers</string> + <string comment="double stars">Dbl. stars</string> </property> </widget> </item> <item> - <widget class="QSlider" name="starsLabelsHorizontalSlider"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>180</width> - <height>0</height> - </size> - </property> - <property name="value"> - <number>33</number> + <widget class="QCheckBox" name="varStarsDesignationsCheckBox"> + <property name="toolTip"> + <string>Show designations of variable stars if proper name, Bayer or Flamsteed designations, or designation of double star do not exist for the star.</string> </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <property name="text"> + <string comment="variable stars">Var. stars</string> </property> </widget> </item> - </layout> - </item> - <item row="2" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout_starTwinkle"> <item> - <widget class="QCheckBox" name="starTwinkleCheckBox"> - <property name="text"> - <string>Twinkle:</string> + <widget class="QCheckBox" name="hipDesignationsCheckBox"> + <property name="toolTip"> + <string>Show designations from Hipparcos catalog (HIP) if available and star doesn't have other traditional designations.</string> </property> - <property name="checked"> - <bool>true</bool> + <property name="text"> + <string notr="true">HIP</string> </property> </widget> </item> <item> - <widget class="QDoubleSpinBox" name="starTwinkleAmountDoubleSpinBox"> - <property name="maximumSize"> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> <size> - <width>75</width> - <height>16777215</height> + <width>40</width> + <height>20</height> </size> </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="decimals"> - <number>2</number> - </property> - <property name="maximum"> - <double>1.500000000000000</double> - </property> - <property name="singleStep"> - <double>0.100000000000000</double> - </property> - </widget> + </spacer> </item> </layout> </item> + <item row="8" column="0"> + <widget class="QCheckBox" name="checkBoxStarDesignationsOnlyUsage"> + <property name="toolTip"> + <string>Use designations of stars instead of their common names for screen labels</string> + </property> + <property name="text"> + <string>Use designations for screen labels</string> + </property> + </widget> + </item> <item row="0" column="0"> <layout class="QHBoxLayout" name="horizontalLayout_starScale"> <item> @@ -1045,73 +1069,63 @@ </item> </layout> </item> - <item row="4" column="0"> - <widget class="QCheckBox" name="spikyStarsCheckBox"> - <property name="toolTip"> - <string>Show stars with pointed rays</string> - </property> - <property name="text"> - <string>Spiky stars</string> - </property> - </widget> - </item> <item row="6" column="0"> - <widget class="QCheckBox" name="checkBoxAdditionalNamesStars"> - <property name="toolTip"> - <string>Show all available proper names</string> - </property> - <property name="text"> - <string>Show additional star names</string> - </property> - </widget> - </item> - <item row="8" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout_28"> - <property name="leftMargin"> - <number>22</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_starLabel"> <item> - <widget class="QCheckBox" name="dblStarsDesignationsCheckBox"> - <property name="toolTip"> - <string>Show traditional designations of double stars if proper name, Bayer or Flamsteed designations do not exist for the star.</string> + <widget class="QCheckBox" name="starLabelCheckBox"> + <property name="enabled"> + <bool>true</bool> </property> <property name="text"> - <string comment="double stars">Dbl. stars</string> + <string>Labels and Markers</string> </property> </widget> </item> <item> - <widget class="QCheckBox" name="varStarsDesignationsCheckBox"> - <property name="toolTip"> - <string>Show designations of variable stars if proper name, Bayer or Flamsteed designations, or designation of double star do not exist for the star.</string> + <widget class="QSlider" name="starsLabelsHorizontalSlider"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="text"> - <string comment="variable stars">Var. stars</string> + <property name="minimumSize"> + <size> + <width>180</width> + <height>0</height> + </size> + </property> + <property name="value"> + <number>33</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> </widget> </item> + </layout> + </item> + <item row="4" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QCheckBox" name="hipDesignationsCheckBox"> + <widget class="QCheckBox" name="spikyStarsCheckBox"> <property name="toolTip"> - <string>Show designations from Hipparcos catalog (HIP) if available and star doesn't have other traditional designations.</string> + <string>Show stars with pointed rays</string> </property> <property name="text"> - <string notr="true">HIP</string> + <string>Spiky stars</string> </property> </widget> </item> <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <widget class="QCheckBox" name="scalingStarsCheckBox"> + <property name="toolTip"> + <string>Enable scaling the stars on HiDPI devices</string> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="text"> + <string>Scaling stars</string> </property> - </spacer> + </widget> </item> </layout> </item> |