Oculars.cpp   Oculars.cpp 
skipping to change at line 25 skipping to change at line 25
* 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "Oculars.hpp" #include "Oculars.hpp"
#include "OcularsGuiPanel.hpp" #include "OcularsGuiPanel.hpp"
#include "GridLinesMgr.hpp" #include "GridLinesMgr.hpp"
#include "LabelMgr.hpp" #include "LabelMgr.hpp"
#include "ConstellationMgr.hpp"
#include "AsterismMgr.hpp"
#include "SkyGui.hpp" #include "SkyGui.hpp"
#include "StelActionMgr.hpp" #include "StelActionMgr.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelGuiItems.hpp" #include "StelGuiItems.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelMainView.hpp" #include "StelMainView.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
skipping to change at line 87 skipping to change at line 89
// Allow to load the resources when used as a static plugin // Allow to load the resources when used as a static plugin
Q_INIT_RESOURCE(Oculars); Q_INIT_RESOURCE(Oculars);
StelPluginInfo info; StelPluginInfo info;
info.id = "Oculars"; info.id = "Oculars";
info.displayedName = N_("Oculars"); info.displayedName = N_("Oculars");
info.authors = "Timothy Reaves"; info.authors = "Timothy Reaves";
info.contact = "treaves@silverfieldstech.com"; info.contact = "treaves@silverfieldstech.com";
info.description = N_("Shows the sky as if looking through a telesco pe eyepiece. (Only magnification and field of view are simulated.) It can a lso show a sensor frame and a Telrad sight."); info.description = N_("Shows the sky as if looking through a telesco pe eyepiece. (Only magnification and field of view are simulated.) It can a lso show a sensor frame and a Telrad sight.");
info.version = OCULARS_PLUGIN_VERSION; info.version = OCULARS_PLUGIN_VERSION;
info.license = OCULARS_PLUGIN_LICENSE;
return info; return info;
} }
/* ************************************************************************ ****************************************** */ /* ************************************************************************ ****************************************** */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Instance Methods #pragma mark Instance Methods
#endif #endif
/* ************************************************************************ ****************************************** */ /* ************************************************************************ ****************************************** */
Oculars::Oculars(): Oculars::Oculars():
skipping to change at line 129 skipping to change at line 132
absoluteStarScaleCCD(1.0), absoluteStarScaleCCD(1.0),
flagMoonScale(false), flagMoonScale(false),
maxEyepieceAngle(0.0), maxEyepieceAngle(0.0),
requireSelection(true), requireSelection(true),
flagLimitMagnitude(false), flagLimitMagnitude(false),
useMaxEyepieceAngle(true), useMaxEyepieceAngle(true),
guiPanelEnabled(false), guiPanelEnabled(false),
flagDecimalDegrees(false), flagDecimalDegrees(false),
flagSemiTransparency(false), flagSemiTransparency(false),
flagHideGridsLines(false), flagHideGridsLines(false),
flagGridlinesDisplayedMain(true), flagGridLinesDisplayedMain(true),
flagConstellationLines(true),
flagAsterismLines(true),
flipVert(false), flipVert(false),
flipHorz(false), flipHorz(false),
ccdRotationSignalMapper(Q_NULLPTR), ccdRotationSignalMapper(Q_NULLPTR),
ccdsSignalMapper(Q_NULLPTR), ccdsSignalMapper(Q_NULLPTR),
ocularsSignalMapper(Q_NULLPTR), ocularsSignalMapper(Q_NULLPTR),
telescopesSignalMapper(Q_NULLPTR), telescopesSignalMapper(Q_NULLPTR),
lensesSignalMapper(Q_NULLPTR), lensesSignalMapper(Q_NULLPTR),
pxmapGlow(Q_NULLPTR), pxmapGlow(Q_NULLPTR),
pxmapOnIcon(Q_NULLPTR), pxmapOnIcon(Q_NULLPTR),
pxmapOffIcon(Q_NULLPTR), pxmapOffIcon(Q_NULLPTR),
skipping to change at line 159 skipping to change at line 164
actionTelescopeIncrement(Q_NULLPTR), actionTelescopeIncrement(Q_NULLPTR),
actionTelescopeDecrement(Q_NULLPTR), actionTelescopeDecrement(Q_NULLPTR),
actionOcularIncrement(Q_NULLPTR), actionOcularIncrement(Q_NULLPTR),
actionOcularDecrement(Q_NULLPTR), actionOcularDecrement(Q_NULLPTR),
guiPanel(Q_NULLPTR), guiPanel(Q_NULLPTR),
actualFOV(0.), actualFOV(0.),
initialFOV(0.), initialFOV(0.),
flagInitFOVUsage(false), flagInitFOVUsage(false),
flagInitDirectionUsage(false), flagInitDirectionUsage(false),
flagAutosetMountForCCD(false), flagAutosetMountForCCD(false),
flagShowResolutionCriterions(false),
equatorialMountEnabled(false), equatorialMountEnabled(false),
reticleRotation(0.) reticleRotation(0.)
{ {
// Font size is 14 // Font size is 14
font.setPixelSize(StelApp::getInstance().getBaseFontSize()+1); font.setPixelSize(StelApp::getInstance().getBaseFontSize()+1);
ccds = QList<CCD *>(); ccds = QList<CCD *>();
oculars = QList<Ocular *>(); oculars = QList<Ocular *>();
telescopes = QList<Telescope *>(); telescopes = QList<Telescope *>();
lenses = QList<Lens *> (); lenses = QList<Lens *> ();
skipping to change at line 357 skipping to change at line 363
{ {
// Paint the information in the upper-right hand cor ner // Paint the information in the upper-right hand cor ner
paintText(core); paintText(core);
} }
} }
} }
//! Determine which "layer" the plugin's drawing will happen on. //! Determine which "layer" the plugin's drawing will happen on.
double Oculars::getCallOrder(StelModuleActionName actionName) const double Oculars::getCallOrder(StelModuleActionName actionName) const
{ {
// TODO; this really doesn't seem to have any effect. I've tried ev double order = 1000.0; // Very low priority, unless we interact.
erything from -100 to +100,
// and a calculated value. It all seems to work the sa if (actionName==StelModule::ActionHandleKeys ||
me regardless. actionName==StelModule::ActionHandleMouseMoves ||
double order = 1000.0; actionName==StelModule::ActionHandleMouseClicks)
if (actionName==StelModule::ActionHandleKeys || actionName==StelModu
le::ActionHandleMouseMoves)
{ {
// Make sure we are called before MovementMgr (we need to ev en call it once!)
order = StelApp::getInstance().getModuleMgr().getModule("Ste lMovementMgr")->getCallOrder(actionName) - 1.0; order = StelApp::getInstance().getModuleMgr().getModule("Ste lMovementMgr")->getCallOrder(actionName) - 1.0;
} }
else if (actionName==StelModule::ActionDraw) else if (actionName==StelModule::ActionDraw)
{ {
order = GETSTELMODULE(LabelMgr)->getCallOrder(actionName) + 100.0; order = GETSTELMODULE(LabelMgr)->getCallOrder(actionName) + 100.0;
} }
return order; return order;
} }
void Oculars::handleMouseClicks(class QMouseEvent* event) void Oculars::handleMouseClicks(class QMouseEvent* event)
{ {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
// In case we show oculars with black circle, ignore mouse presses o
utside image circle:
// https://sourceforge.net/p/stellarium/discussion/278769/thread/578
93bb3/?limit=25#75c0
if ((flagShowOculars) ) //&& !getFlagUseSemiTransparency()) // Not s
ure: ignore or allow selection of semi-hidden stars?
{
const StelProjectorP prj = core->getProjection(StelCore::Fra
meJ2000, StelCore::RefractionAuto);
StelProjector::StelProjectorParams params = core->getCurrent
StelProjectorParams();
float ppx = params.devicePixelsPerPixel;
float wh = prj->getViewportWidth()/2.; // get half of width
of the screen
float hh = prj->getViewportHeight()/2.; // get half of heigh
t of the screen
float mx = event->x()*ppx-wh; // point 0 in center of the sc
reen, axis X directed to right
float my = event->y()*ppx-hh; // point 0 in center of the sc
reen, axis Y directed to bottom
double inner = 0.5 * params.viewportFovDiameter * ppx;
// See if we need to scale the mask
if (useMaxEyepieceAngle && oculars[selectedOcularIndex]->app
earentFOV() > 0.0 && !oculars[selectedOcularIndex]->isBinoculars())
{
inner = oculars[selectedOcularIndex]->appearentFOV()
* inner / maxEyepieceAngle;
}
if (mx*mx+my*my>inner*inner) // click outside ocular circle?
Gobble event.
{
event->setAccepted(true);
return;
}
}
StelMovementMgr *movementManager = core->getMovementMgr(); StelMovementMgr *movementManager = core->getMovementMgr();
if (flagShowOculars)
movementManager->handleMouseClicks(event); // force it here
for selection!
if (StelApp::getInstance().getStelObjectMgr().getWasSelected()) if (StelApp::getInstance().getStelObjectMgr().getWasSelected())
{ {
if (flagShowOculars) if (flagShowOculars)
{ {
// center the selected object in the ocular, and tra ck. // center the selected object in the ocular, and tra ck.
movementManager->setFlagTracking(true); movementManager->setFlagTracking(true);
} }
else else
{ {
// remove the usage label if it is being displayed. // remove the usage label if it is being displayed.
skipping to change at line 652 skipping to change at line 692
guiPanelEnabled = settings->value("enable_control_panel", tr ue).toBool(); guiPanelEnabled = settings->value("enable_control_panel", tr ue).toBool();
enableGuiPanel(guiPanelEnabled); enableGuiPanel(guiPanelEnabled);
setFlagDecimalDegrees(settings->value("use_decimal_degrees", false).toBool()); setFlagDecimalDegrees(settings->value("use_decimal_degrees", false).toBool());
setFlagLimitMagnitude(settings->value("limit_stellar_magnitu de", true).toBool()); setFlagLimitMagnitude(settings->value("limit_stellar_magnitu de", true).toBool());
setFlagInitFovUsage(settings->value("use_initial_fov", false ).toBool()); setFlagInitFovUsage(settings->value("use_initial_fov", false ).toBool());
setFlagInitDirectionUsage(settings->value("use_initial_direc tion", false).toBool()); setFlagInitDirectionUsage(settings->value("use_initial_direc tion", false).toBool());
setFlagUseSemiTransparency(settings->value("use_semi_transpa rency", false).toBool()); setFlagUseSemiTransparency(settings->value("use_semi_transpa rency", false).toBool());
setFlagHideGridsLines(settings->value("hide_grids_and_lines" , true).toBool()); setFlagHideGridsLines(settings->value("hide_grids_and_lines" , true).toBool());
setFlagAutosetMountForCCD(settings->value("use_mount_autoset ", false).toBool()); setFlagAutosetMountForCCD(settings->value("use_mount_autoset ", false).toBool());
setFlagShowResolutionCriterions(settings->value("show_resolu tion_criterions", false).toBool());
relativeStarScaleOculars=settings->value("stars_scale_relati ve", 1.0).toDouble(); relativeStarScaleOculars=settings->value("stars_scale_relati ve", 1.0).toDouble();
absoluteStarScaleOculars=settings->value("stars_scale_absolu te", 1.0).toDouble(); absoluteStarScaleOculars=settings->value("stars_scale_absolu te", 1.0).toDouble();
relativeStarScaleCCD=settings->value("stars_scale_relative_c cd", 1.0).toDouble(); relativeStarScaleCCD=settings->value("stars_scale_relative_c cd", 1.0).toDouble();
absoluteStarScaleCCD=settings->value("stars_scale_absolute_c cd", 1.0).toDouble(); absoluteStarScaleCCD=settings->value("stars_scale_absolute_c cd", 1.0).toDouble();
StelPropertyMgr* propMgr=StelApp::getInstance().getStelPrope rtyManager(); StelPropertyMgr* propMgr=StelApp::getInstance().getStelPrope rtyManager();
equatorialMountEnabled = propMgr->getStelPropertyValue("acti onSwitch_Equatorial_Mount").toBool(); equatorialMountEnabled = propMgr->getStelPropertyValue("acti onSwitch_Equatorial_Mount").toBool();
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
skipping to change at line 1735 skipping to change at line 1776
if (!reticleTexture.isNull()) if (!reticleTexture.isNull())
{ {
painter.setColor(0.77f, 0.14f, 0.16f, 1.f); painter.setColor(0.77f, 0.14f, 0.16f, 1.f);
reticleTexture->bind(); reticleTexture->bind();
int textureHeight; int textureHeight;
int textureWidth; int textureWidth;
reticleTexture->getDimensions(textureWidth, textureHeight); reticleTexture->getDimensions(textureWidth, textureHeight);
painter.drawSprite2dMode(centerScreen[0], centerScreen[1], i nner, reticleRotation); painter.drawSprite2dMode(centerScreen[0], centerScreen[1], i nner / params.devicePixelsPerPixel, reticleRotation);
} }
if (oculars[selectedOcularIndex]->hasPermanentCrosshair()) if (oculars[selectedOcularIndex]->hasPermanentCrosshair())
{ {
paintCrosshairs(); paintCrosshairs();
} }
float alpha = 1.f; float alpha = 1.f;
if (getFlagUseSemiTransparency()) if (getFlagUseSemiTransparency())
alpha = 0.85f; alpha = 0.85f;
skipping to change at line 1833 skipping to change at line 1874
xPosition -= insetFromRHS; xPosition -= insetFromRHS;
int yPosition = projectorParams.viewportXywh[3] - projectorParams.vi ewportCenterOffset[1]; int yPosition = projectorParams.viewportXywh[3] - projectorParams.vi ewportCenterOffset[1];
yPosition -= 40; yPosition -= 40;
const int lineHeight = painter.getFontMetrics().height(); const int lineHeight = painter.getFontMetrics().height();
// The Ocular // The Ocular
if (flagShowOculars && ocular!=Q_NULLPTR) if (flagShowOculars && ocular!=Q_NULLPTR)
{ {
QString ocularNumberLabel; QString ocularNumberLabel;
QString name = ocular->name(); QString name = ocular->name();
QString ocularI18n = q_("Ocular");
if (ocular->isBinoculars())
ocularI18n = q_("Binocular");
if (name.isEmpty()) if (name.isEmpty())
{ {
ocularNumberLabel = QString(q_("Ocular #%1")).arg(se lectedOcularIndex); ocularNumberLabel = QString("%1 #%2").arg(ocularI18n ).arg(selectedOcularIndex);
} }
else else
{ {
ocularNumberLabel = QString(q_("Ocular #%1: %2")).ar g(selectedOcularIndex).arg(name); ocularNumberLabel = QString("%1 #%2: %3").arg(ocular I18n).arg(selectedOcularIndex).arg(name);
} }
// The name of the ocular could be really long. // The name of the ocular could be really long.
if (name.length() > widthString.length()) if (name.length() > widthString.length())
{ {
xPosition -= (insetFromRHS / 2.0); xPosition -= (insetFromRHS / 2.0);
} }
painter.drawText(xPosition, yPosition, ocularNumberLabel); painter.drawText(xPosition, yPosition, ocularNumberLabel);
yPosition-=lineHeight; yPosition-=lineHeight;
if (!ocular->isBinoculars()) if (!ocular->isBinoculars())
skipping to change at line 2049 skipping to change at line 2093
} }
void Oculars::unzoomOcular() void Oculars::unzoomOcular()
{ {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
StelMovementMgr *movementManager = core->getMovementMgr(); StelMovementMgr *movementManager = core->getMovementMgr();
StelSkyDrawer *skyDrawer = core->getSkyDrawer(); StelSkyDrawer *skyDrawer = core->getSkyDrawer();
if (flagHideGridsLines) if (flagHideGridsLines)
{ {
GETSTELMODULE(GridLinesMgr)->setFlagGridlines(flagGridlinesD isplayedMain); GETSTELMODULE(GridLinesMgr)->setFlagGridlines(flagGridLinesD isplayedMain);
GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints(flagCard inalPoints); GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints(flagCard inalPoints);
GETSTELMODULE(ConstellationMgr)->setFlagLines(flagConstellat
ionLines);
GETSTELMODULE(AsterismMgr)->setFlagLines(flagAsterismLines);
} }
skyDrawer->setFlagLuminanceAdaptation(flagAdaptation); skyDrawer->setFlagLuminanceAdaptation(flagAdaptation);
skyDrawer->setFlagStarMagnitudeLimit(flagLimitStars); skyDrawer->setFlagStarMagnitudeLimit(flagLimitStars);
skyDrawer->setFlagPlanetMagnitudeLimit(flagLimitPlanets); skyDrawer->setFlagPlanetMagnitudeLimit(flagLimitPlanets);
skyDrawer->setFlagNebulaMagnitudeLimit(flagLimitDSOs); skyDrawer->setFlagNebulaMagnitudeLimit(flagLimitDSOs);
skyDrawer->setCustomStarMagnitudeLimit(magLimitStars); skyDrawer->setCustomStarMagnitudeLimit(magLimitStars);
skyDrawer->setCustomPlanetMagnitudeLimit(magLimitPlanets); skyDrawer->setCustomPlanetMagnitudeLimit(magLimitPlanets);
skyDrawer->setCustomNebulaMagnitudeLimit(magLimitDSOs); skyDrawer->setCustomNebulaMagnitudeLimit(magLimitDSOs);
// restore values, but keep current to enable toggling // restore values, but keep current to enable toggling
skipping to change at line 2101 skipping to change at line 2147
if (flagShowOculars) if (flagShowOculars)
{ {
if (!zoomedIn) if (!zoomedIn)
{ {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
if (flagHideGridsLines) if (flagHideGridsLines)
{ {
// Store current state for later resetting // Store current state for later resetting
flagGridlinesDisplayedMain=GETSTELMODULE(Gri dLinesMgr)->getFlagGridlines(); flagGridLinesDisplayedMain=GETSTELMODULE(Gri dLinesMgr)->getFlagGridlines();
flagCardinalPoints = GETSTELMODULE(Landscape Mgr)->getFlagCardinalsPoints(); flagCardinalPoints = GETSTELMODULE(Landscape Mgr)->getFlagCardinalsPoints();
flagConstellationLines = GETSTELMODULE(Const
ellationMgr)->getFlagLines();
flagAsterismLines = GETSTELMODULE(AsterismMg
r)->getFlagLines();
} }
StelSkyDrawer *skyDrawer = core->getSkyDrawer(); StelSkyDrawer *skyDrawer = core->getSkyDrawer();
// Current state // Current state
flagAdaptation = skyDrawer->getFlagLuminanceAdaptati on(); flagAdaptation = skyDrawer->getFlagLuminanceAdaptati on();
flagLimitStars = skyDrawer->getFlagStarMagnitudeLimi t(); flagLimitStars = skyDrawer->getFlagStarMagnitudeLimi t();
flagLimitPlanets = skyDrawer->getFlagPlanetMagnitude Limit(); flagLimitPlanets = skyDrawer->getFlagPlanetMagnitude Limit();
flagLimitDSOs = skyDrawer->getFlagNebulaMagnitudeLim it(); flagLimitDSOs = skyDrawer->getFlagNebulaMagnitudeLim it();
magLimitStars = skyDrawer->getCustomStarMagnitudeLim it(); magLimitStars = skyDrawer->getCustomStarMagnitudeLim it();
magLimitPlanets = skyDrawer->getCustomPlanetMagnitud eLimit(); magLimitPlanets = skyDrawer->getCustomPlanetMagnitud eLimit();
skipping to change at line 2146 skipping to change at line 2194
void Oculars::zoomOcular() void Oculars::zoomOcular()
{ {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
StelMovementMgr *movementManager = core->getMovementMgr(); StelMovementMgr *movementManager = core->getMovementMgr();
StelSkyDrawer *skyDrawer = core->getSkyDrawer(); StelSkyDrawer *skyDrawer = core->getSkyDrawer();
if (flagHideGridsLines) if (flagHideGridsLines)
{ {
GETSTELMODULE(GridLinesMgr)->setFlagGridlines(false); GETSTELMODULE(GridLinesMgr)->setFlagGridlines(false);
GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints(false); GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints(false);
GETSTELMODULE(ConstellationMgr)->setFlagLines(false);
GETSTELMODULE(AsterismMgr)->setFlagLines(false);
} }
skyDrawer->setFlagLuminanceAdaptation(false); skyDrawer->setFlagLuminanceAdaptation(false);
GETSTELMODULE(SolarSystem)->setFlagMoonScale(false); GETSTELMODULE(SolarSystem)->setFlagMoonScale(false);
movementManager->setFlagTracking(true); movementManager->setFlagTracking(true);
movementManager->setFlagEnableZoomKeys(false); movementManager->setFlagEnableZoomKeys(false);
movementManager->setFlagEnableMouseNavigation(false); movementManager->setFlagEnableMouseNavigation(false);
skipping to change at line 2199 skipping to change at line 2249
// Limit stars and DSOs if enabled and it's telescope + eyepiece com bination // Limit stars and DSOs if enabled and it's telescope + eyepiece com bination
if (getFlagLimitMagnitude()) if (getFlagLimitMagnitude())
{ {
// Simplified calculation of the penetrating power of the te lescope // Simplified calculation of the penetrating power of the te lescope
double diameter = 0.; double diameter = 0.;
if (ocular->isBinoculars()) if (ocular->isBinoculars())
diameter = ocular->fieldStop(); diameter = ocular->fieldStop();
else else
diameter = telescope!=Q_NULLPTR ? telescope->diamete r() : 0.; // Avoid a potential call of null pointer diameter = telescope!=Q_NULLPTR ? telescope->diamete r() : 0.; // Avoid a potential call of null pointer
double limitMag = 2.1 + 5*std::log10(diameter); // TODO: doc
ument source of this formula! // A better formula for telescopic limiting magnitudes?
// North, G.; Journal of the British Astronomical Associatio
n, vol.107, no.2, p.82
// http://adsabs.harvard.edu/abs/1997JBAA..107...82N
double limitMag = 4.5 + 4.4*std::log10(diameter);
skyDrawer->setFlagStarMagnitudeLimit(true); skyDrawer->setFlagStarMagnitudeLimit(true);
skyDrawer->setFlagNebulaMagnitudeLimit(true); skyDrawer->setFlagNebulaMagnitudeLimit(true);
skyDrawer->setCustomStarMagnitudeLimit(limitMag); skyDrawer->setCustomStarMagnitudeLimit(limitMag);
skyDrawer->setCustomNebulaMagnitudeLimit(limitMag); skyDrawer->setCustomNebulaMagnitudeLimit(limitMag);
} }
actualFOV = ocular->actualFOV(telescope, lens); actualFOV = ocular->actualFOV(telescope, lens);
// See if the mask was scaled; if so, correct the actualFOV. // See if the mask was scaled; if so, correct the actualFOV.
if (useMaxEyepieceAngle && ocular->appearentFOV() > 0.0 && !ocular-> isBinoculars()) if (useMaxEyepieceAngle && ocular->appearentFOV() > 0.0 && !ocular-> isBinoculars())
skipping to change at line 2377 skipping to change at line 2431
flagSemiTransparency = b; flagSemiTransparency = b;
settings->setValue("use_semi_transparency", b); settings->setValue("use_semi_transparency", b);
settings->sync(); settings->sync();
} }
bool Oculars::getFlagUseSemiTransparency() const bool Oculars::getFlagUseSemiTransparency() const
{ {
return flagSemiTransparency; return flagSemiTransparency;
} }
void Oculars::setFlagShowResolutionCriterions(const bool b)
{
flagShowResolutionCriterions = b;
settings->setValue("show_resolution_criterions", b);
settings->sync();
}
bool Oculars::getFlagShowResolutionCriterions() const
{
return flagShowResolutionCriterions;
}
void Oculars::setFlagHideGridsLines(const bool b) void Oculars::setFlagHideGridsLines(const bool b)
{ {
if (b != flagHideGridsLines) if (b != flagHideGridsLines)
{ {
flagHideGridsLines = b; flagHideGridsLines = b;
settings->setValue("hide_grids_and_lines", b); settings->setValue("hide_grids_and_lines", b);
settings->sync(); settings->sync();
emit hideGridsLinesChanged(b); emit hideGridsLinesChanged(b);
if (b && flagShowOculars) if (b && flagShowOculars)
{ {
// Store current state for later resetting // Store current state for later resetting
flagGridlinesDisplayedMain=GETSTELMODULE(GridLinesMg r)->getFlagGridlines(); flagGridLinesDisplayedMain=GETSTELMODULE(GridLinesMg r)->getFlagGridlines();
flagCardinalPoints = GETSTELMODULE(LandscapeMgr)->ge tFlagCardinalsPoints(); flagCardinalPoints = GETSTELMODULE(LandscapeMgr)->ge tFlagCardinalsPoints();
flagConstellationLines = GETSTELMODULE(Constellation
Mgr)->getFlagLines();
flagAsterismLines = GETSTELMODULE(AsterismMgr)->getF
lagLines();
GETSTELMODULE(GridLinesMgr)->setFlagGridlines(false) ; GETSTELMODULE(GridLinesMgr)->setFlagGridlines(false) ;
GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints( false); GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints( false);
GETSTELMODULE(ConstellationMgr)->setFlagLines(false)
;
GETSTELMODULE(AsterismMgr)->setFlagLines(false);
} }
else if (!b && flagShowOculars) else if (!b && flagShowOculars)
{ {
// Restore main program state // Restore main program state
GETSTELMODULE(GridLinesMgr)->setFlagGridlines(flagGr idlinesDisplayedMain); GETSTELMODULE(GridLinesMgr)->setFlagGridlines(flagGr idLinesDisplayedMain);
GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints( flagCardinalPoints); GETSTELMODULE(LandscapeMgr)->setFlagCardinalsPoints( flagCardinalPoints);
GETSTELMODULE(ConstellationMgr)->setFlagLines(flagCo
nstellationLines);
GETSTELMODULE(AsterismMgr)->setFlagLines(flagAsteris
mLines);
} }
} }
} }
bool Oculars::getFlagHideGridsLines() const bool Oculars::getFlagHideGridsLines() const
{ {
return flagHideGridsLines; return flagHideGridsLines;
} }
QString Oculars::getDimensionsString(double fovX, double fovY) const QString Oculars::getDimensionsString(double fovX, double fovY) const
 End of changes. 25 change blocks. 
17 lines changed or deleted 107 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/