Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter of showing named DSO only #4125

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions guide/app_config_ini.tex
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ \subsection{\big[astro\big]}
flag\_dso\_outlines\_usage & bool & false & If \emph{true}, use outlines for big deep-sky objects on the sky instead of their hints.\\%\midrule
flag\_dso\_additional\_names & bool & true & Set \emph{true} to use additional names (also known as) for deep-sky objects.\\\midrule
%
flag\_show\_only\_named\_dso & bool & false & If \emph{true}, only show deep-sky objects with names, hiding those with only designations.\\\midrule
alex-w marked this conversation as resolved.
Show resolved Hide resolved
%
grs\_longitude & int & 216 & Longitude (System II) of Great Red Spot on Jupiter in degrees.\\%\midrule
grs\_drift & float & 15.0 & Annual drift of Great Red Spot on Jupiter in degrees.\\%\midrule
grs\_jd & float & 2456901.5 & Initial JD for calculation of position of Great Red Spot on Jupiter.\\%\midrule
Expand Down
1 change: 1 addition & 0 deletions src/core/modules/Nebula.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ bool Nebula::flagUseArcsecSurfaceBrightness = false;
bool Nebula::flagUseShortNotationSurfaceBrightness = true;
bool Nebula::flagUseOutlines = false;
bool Nebula::flagShowAdditionalNames = true;
bool Nebula::flagShowOnlyNamedDSO = false;
bool Nebula::flagUseSizeLimits = false;
double Nebula::minSizeLimit = 1.0;
double Nebula::maxSizeLimit = 600.0;
Expand Down
1 change: 1 addition & 0 deletions src/core/modules/Nebula.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ friend class NebulaMgr;
static bool flagUseShortNotationSurfaceBrightness;
static bool flagUseOutlines;
static bool flagShowAdditionalNames;
static bool flagShowOnlyNamedDSO;

static bool flagUseSizeLimits;
static double minSizeLimit;
Expand Down
15 changes: 15 additions & 0 deletions src/core/modules/NebulaMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ void NebulaMgr::setFlagOutlines(const bool flag)
}
}

bool NebulaMgr::getFlagShowOnlyNamedDSO(void) const {return Nebula::flagShowOnlyNamedDSO; }
void NebulaMgr::setFlagShowOnlyNamedDSO(const bool flag)
{
if(Nebula::flagShowOnlyNamedDSO!=flag)
{
Nebula::flagShowOnlyNamedDSO=flag;
StelApp::immediateSave("astro/flag_show_only_named_dso", flag);
emit flagShowOnlyNamedDSOChanged(flag);
}
}

NebulaMgr::NebulaMgr(void) : StelObjectModule()
, nebGrid(200)
, hintsAmount(0)
Expand Down Expand Up @@ -228,6 +239,7 @@ void NebulaMgr::init()
setFlagSurfaceBrightnessUsage(conf->value("astro/flag_surface_brightness_usage", false).toBool());
setFlagSurfaceBrightnessArcsecUsage(conf->value("gui/flag_surface_brightness_arcsec", false).toBool());
setFlagSurfaceBrightnessShortNotationUsage(conf->value("gui/flag_surface_brightness_short", false).toBool());
setFlagShowOnlyNamedDSO(conf->value("astro/flag_show_only_named_dso", false).toBool());

setFlagSizeLimitsUsage(conf->value("astro/flag_size_limits_usage", false).toBool());
setMinSizeLimit(conf->value("astro/size_limit_min", 1.0).toDouble());
Expand Down Expand Up @@ -568,6 +580,9 @@ struct DrawNebulaFuncObject
if (!n->objectInDisplayedCatalog())
return;

if (n->flagShowOnlyNamedDSO && n->getEnglishName().isEmpty())
return;

if (!n->objectInAllowedSizeRangeLimits())
return;

Expand Down
11 changes: 11 additions & 0 deletions src/core/modules/NebulaMgr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ class NebulaMgr : public StelObjectModule
WRITE setDesignationUsage
NOTIFY designationUsageChanged
)
Q_PROPERTY(bool flagShowOnlyNamedDSO
READ getFlagShowOnlyNamedDSO
WRITE setFlagShowOnlyNamedDSO
NOTIFY flagShowOnlyNamedDSOChanged
)
Q_PROPERTY(bool flagUseSizeLimits
READ getFlagSizeLimitsUsage
WRITE setFlagSizeLimitsUsage
Expand Down Expand Up @@ -825,6 +830,11 @@ public slots:
//! Get value of flag used to turn on and off DSO type filtering.
bool getFlagUseTypeFilters(void) const;

//! Set flag used to turn on and off Named DSO Only.
void setFlagShowOnlyNamedDSO(const bool b);
//! Get value of flag used to turn on and off Named DSO Only.
bool getFlagShowOnlyNamedDSO(void) const;

//! Set the limit for min. angular size of displayed DSO.
//! @param s the angular size between 1 and 600 arcminutes
void setMinSizeLimit(double s);
Expand Down Expand Up @@ -893,6 +903,7 @@ public slots:
void flagOutlinesDisplayedChanged(bool b);
void flagAdditionalNamesDisplayedChanged(bool b);
void designationUsageChanged(bool b);
void flagShowOnlyNamedDSOChanged(bool b);
void flagSurfaceBrightnessUsageChanged(bool b);
void flagSurfaceBrightnessArcsecUsageChanged(bool b);
void flagSurfaceBrightnessShortNotationUsageChanged(bool b);
Expand Down
1 change: 1 addition & 0 deletions src/gui/ViewDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ void ViewDialog::createDialogContent()
connectBoolProperty(ui->checkBoxSurfaceBrightnessUsage, "NebulaMgr.flagSurfaceBrightnessUsage");
connectBoolProperty(ui->nebulaLimitMagnitudeCheckBox,"StelSkyDrawer.flagNebulaMagnitudeLimit");
connectBoolProperty(ui->checkBoxAdditionalNamesDSO, "NebulaMgr.flagAdditionalNamesDisplayed");
connectBoolProperty(ui->checkBoxShowOnlyNamedDSO, "NebulaMgr.flagShowOnlyNamedDSO");
connectDoubleProperty(ui->nebulaLimitMagnitudeDoubleSpinBox,"StelSkyDrawer.customNebulaMagLimit");
connectBoolProperty(ui->nebulaLimitSizeCheckBox, "NebulaMgr.flagUseSizeLimits");
connectDoubleProperty(ui->nebulaLimitSizeMinDoubleSpinBox, "NebulaMgr.minSizeLimit");
Expand Down
11 changes: 9 additions & 2 deletions src/gui/viewDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2583,6 +2583,13 @@
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="checkBoxShowOnlyNamedDSO">
<property name="text">
<string>Show only named DSO</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkBoxOutlines">
<property name="text">
Expand Down Expand Up @@ -2686,14 +2693,14 @@
</property>
</widget>
</item>
<item row="9" column="0">
<item row="10" column="0">
<widget class="QPushButton" name="pushButtonConfigureDSOColors">
<property name="text">
<string>Configure colors of markers</string>
</property>
</widget>
</item>
<item row="8" column="0">
<item row="9" column="0">
<layout class="QGridLayout" name="gridLayout_17">
<item row="1" column="0">
<widget class="QCheckBox" name="nebulaLimitSizeCheckBox">
Expand Down
Loading