Oculars.cpp   Oculars.cpp 
skipping to change at line 130 skipping to change at line 130
magLimitDSOs(0.0), magLimitDSOs(0.0),
flagLimitPlanets(false), flagLimitPlanets(false),
magLimitPlanets(0.0), magLimitPlanets(0.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),
flagSemiTransporency(false),
ccdRotationSignalMapper(0), ccdRotationSignalMapper(0),
ccdsSignalMapper(0), ccdsSignalMapper(0),
ocularsSignalMapper(0), ocularsSignalMapper(0),
telescopesSignalMapper(0), telescopesSignalMapper(0),
lenseSignalMapper(0), lenseSignalMapper(0),
pxmapGlow(NULL), pxmapGlow(NULL),
pxmapOnIcon(NULL), pxmapOnIcon(NULL),
pxmapOffIcon(NULL), pxmapOffIcon(NULL),
toolbarButton(NULL), toolbarButton(NULL),
ocularDialog(NULL), ocularDialog(NULL),
skipping to change at line 585 skipping to change at line 586
initializeActivationActions(); initializeActivationActions();
determineMaxEyepieceAngle(); determineMaxEyepieceAngle();
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());
setFlagUseFlipForCCD(settings->value("use_ccd_flip", false). toBool()); setFlagUseFlipForCCD(settings->value("use_ccd_flip", false). toBool());
setFlagUseSemiTransparency(settings->value("use_semi_transpa rency", false).toBool());
} catch (std::runtime_error& e) { } catch (std::runtime_error& e) {
qWarning() << "WARNING: unable to locate ocular.ini file or create a default one for Ocular plugin: " << e.what(); qWarning() << "WARNING: unable to locate ocular.ini file or create a default one for Ocular plugin: " << e.what();
ready = false; ready = false;
} }
//Load the module's custom style sheets //Load the module's custom style sheets
QFile styleSheetFile; QFile styleSheetFile;
styleSheetFile.setFileName(":/ocular/normalStyle.css"); styleSheetFile.setFileName(":/ocular/normalStyle.css");
if(styleSheetFile.open(QFile::ReadOnly|QFile::Text)) { if(styleSheetFile.open(QFile::ReadOnly|QFile::Text)) {
normalStyleSheet = styleSheetFile.readAll(); normalStyleSheet = styleSheetFile.readAll();
skipping to change at line 1589 skipping to change at line 1591
StelProjector::StelProjectorParams params = core->getCurrentStelProj ectorParams(); StelProjector::StelProjectorParams params = core->getCurrentStelProj ectorParams();
double inner = 0.5 * params.viewportFovDiameter * params.devicePixel sPerPixel; double inner = 0.5 * params.viewportFovDiameter * params.devicePixel sPerPixel;
// See if we need to scale the mask // See if we need to scale the mask
if (useMaxEyepieceAngle if (useMaxEyepieceAngle
&& oculars[selectedOcularIndex]->appearentFOV() > 0.0 && oculars[selectedOcularIndex]->appearentFOV() > 0.0
&& !oculars[selectedOcularIndex]->isBinoculars()) { && !oculars[selectedOcularIndex]->isBinoculars()) {
inner = oculars[selectedOcularIndex]->appearentFOV() * inner / maxEyepieceAngle; inner = oculars[selectedOcularIndex]->appearentFOV() * inner / maxEyepieceAngle;
} }
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transpa
rency mode
// Paint the reticale, if needed // Paint the reticale, if needed
if (!reticleTexture.isNull()){ if (!reticleTexture.isNull())
glEnable(GL_BLEND); {
painter.enableTexture2d(true); painter.enableTexture2d(true);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
painter.setColor(0.77, 0.14, 0.16, 1.0); painter.setColor(0.77, 0.14, 0.16, 1.0);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode
reticleTexture->bind(); reticleTexture->bind();
int textureHeight; int textureHeight;
int textureWidth; int textureWidth;
reticleTexture->getDimensions(textureWidth, textureHeight); reticleTexture->getDimensions(textureWidth, textureHeight);
painter.drawSprite2dMode(params.viewportXywh[2] / 2 * params .devicePixelsPerPixel, painter.drawSprite2dMode(params.viewportXywh[2] / 2 * params .devicePixelsPerPixel,
params.viewportXywh[3] / 2 * params
params.viewportXywh[3] / 2 * params.devicePixelsPerPixel, .devicePixelsPerPixel,
inner, reticleRotation);
inner,
reticleRotation);
} }
if (oculars[selectedOcularIndex]->hasPermanentCrosshair()) { if (oculars[selectedOcularIndex]->hasPermanentCrosshair()) {
paintCrosshairs(); paintCrosshairs();
} }
painter.drawViewportShape(inner);
float alpha = 1.f;
if (getFlagUseSemiTransparency())
alpha = 0.85f;
painter.setColor(0.f,0.f,0.f,alpha);
GLfloat outerRadius = params.viewportXywh[2] * params.devicePixelsPe
rPixel + params.viewportXywh[3] * params.devicePixelsPerPixel;
GLint slices = 239;
GLfloat sinCache[240];
GLfloat cosCache[240];
GLfloat vertices[(240+1)*2][3];
GLfloat deltaRadius;
GLfloat radiusHigh;
/* Compute length (needed for normal calculations) */
deltaRadius=outerRadius-inner;
/* Cache is the vertex locations cache */
for (int i=0; i<=slices; i++)
{
GLfloat angle=(M_PI*2.0f)*i/slices;
sinCache[i]=(GLfloat)sin(angle);
cosCache[i]=(GLfloat)cos(angle);
}
sinCache[slices]=sinCache[0];
cosCache[slices]=cosCache[0];
/* Enable arrays */
painter.enableClientStates(true);
painter.setVertexPointer(3, GL_FLOAT, vertices);
radiusHigh=outerRadius-deltaRadius;
for (int i=0; i<=slices; i++)
{
vertices[i*2][0]= params.viewportCenter[0] + outerRadius*sin
Cache[i];
vertices[i*2][1]= params.viewportCenter[1] + outerRadius*cos
Cache[i];
vertices[i*2][2] = 0.0;
vertices[i*2+1][0]= params.viewportCenter[0] + radiusHigh*si
nCache[i];
vertices[i*2+1][1]= params.viewportCenter[1] + radiusHigh*co
sCache[i];
vertices[i*2+1][2] = 0.0;
}
painter.drawFromArray(StelPainter::TriangleStrip, (slices+1)*2, 0, f
alse);
painter.enableClientStates(false);
} }
void Oculars::paintText(const StelCore* core) void Oculars::paintText(const StelCore* core)
{ {
const StelProjectorP prj = core->getProjection(StelCore::FrameAltAz) ; const StelProjectorP prj = core->getProjection(StelCore::FrameAltAz) ;
StelPainter painter(prj); StelPainter painter(prj);
// Get the current instruments // Get the current instruments
CCD *ccd = NULL; CCD *ccd = NULL;
if(selectedCCDIndex != -1) { if(selectedCCDIndex != -1) {
skipping to change at line 1885 skipping to change at line 1933
skyManager->setCustomStarMagnitudeLimit(magLimitStars); skyManager->setCustomStarMagnitudeLimit(magLimitStars);
skyManager->setCustomPlanetMagnitudeLimit(magLimitPlanets); skyManager->setCustomPlanetMagnitudeLimit(magLimitPlanets);
skyManager->setCustomNebulaMagnitudeLimit(magLimitDSOs); skyManager->setCustomNebulaMagnitudeLimit(magLimitDSOs);
movementManager->setFlagTracking(false); movementManager->setFlagTracking(false);
movementManager->setFlagEnableZoomKeys(true); movementManager->setFlagEnableZoomKeys(true);
movementManager->setFlagEnableMouseNavigation(true); movementManager->setFlagEnableMouseNavigation(true);
GETSTELMODULE(SolarSystem)->setFlagMoonScale(flagMoonScale); GETSTELMODULE(SolarSystem)->setFlagMoonScale(flagMoonScale);
// Set the screen display // Set the screen display
core->setMaskType(StelProjector::MaskNone);
core->setFlipHorz(false); core->setFlipHorz(false);
core->setFlipVert(false); core->setFlipVert(false);
if (getFlagInitFovUsage()) if (getFlagInitFovUsage())
movementManager->zoomTo(movementManager->getInitFov()); movementManager->zoomTo(movementManager->getInitFov());
else else
movementManager->zoomTo(initialFOV); movementManager->zoomTo(initialFOV);
} }
void Oculars::zoom(bool zoomedIn) void Oculars::zoom(bool zoomedIn)
skipping to change at line 1979 skipping to change at line 2026
movementManager->setFlagEnableZoomKeys(false); movementManager->setFlagEnableZoomKeys(false);
movementManager->setFlagEnableMouseNavigation(false); movementManager->setFlagEnableMouseNavigation(false);
// We won't always have a selected object // We won't always have a selected object
if (StelApp::getInstance().getStelObjectMgr().getWasSelected()) { if (StelApp::getInstance().getStelObjectMgr().getWasSelected()) {
StelObjectP selectedObject = StelApp::getInstance().getStelO bjectMgr().getSelectedObject()[0]; StelObjectP selectedObject = StelApp::getInstance().getStelO bjectMgr().getSelectedObject()[0];
movementManager->moveToJ2000(selectedObject->getEquinoxEquat orialPos(core), 0.0, 1); movementManager->moveToJ2000(selectedObject->getEquinoxEquat orialPos(core), 0.0, 1);
} }
// Set the screen display // Set the screen display
core->setMaskType(StelProjector::MaskDisk);
Ocular * ocular = oculars[selectedOcularIndex]; Ocular * ocular = oculars[selectedOcularIndex];
Telescope * telescope = NULL; Telescope * telescope = NULL;
Lens * lens = NULL; Lens * lens = NULL;
// Only consider flip is we're not binoculars // Only consider flip is we're not binoculars
if (ocular->isBinoculars()) if (ocular->isBinoculars())
{ {
core->setFlipHorz(false); core->setFlipHorz(false);
core->setFlipVert(false); core->setFlipVert(false);
} }
else else
skipping to change at line 2148 skipping to change at line 2194
flagUseFlipForCCD = b; flagUseFlipForCCD = b;
settings->setValue("use_ccd_flip", b); settings->setValue("use_ccd_flip", b);
settings->sync(); settings->sync();
} }
bool Oculars::getFlagUseFlipForCCD() const bool Oculars::getFlagUseFlipForCCD() const
{ {
return flagUseFlipForCCD; return flagUseFlipForCCD;
} }
void Oculars::setFlagUseSemiTransparency(const bool b)
{
flagSemiTransporency = b;
settings->setValue("use_semi_transparency", b);
settings->sync();
}
bool Oculars::getFlagUseSemiTransparency() const
{
return flagSemiTransporency;
}
QString Oculars::getDimensionsString(double fovX, double fovY) const QString Oculars::getDimensionsString(double fovX, double fovY) const
{ {
QString stringFovX, stringFovY; QString stringFovX, stringFovY;
if (getFlagDecimalDegrees()) if (getFlagDecimalDegrees())
{ {
if (fovX >= 1.0) if (fovX >= 1.0)
{ {
int degrees = (int)fovX; int degrees = (int)fovX;
int minutes = (int)((fovX - degrees) * 60); int minutes = (int)((fovX - degrees) * 60);
stringFovX = QString::number(degrees) + QChar(0x00B0 ) + QString::number(minutes) + QChar(0x2032); stringFovX = QString::number(degrees) + QChar(0x00B0 ) + QString::number(minutes) + QChar(0x2032);
 End of changes. 11 change blocks. 
13 lines changed or deleted 76 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/