summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <[email protected]>2015-03-08 20:46:50 +0300
committerJasem Mutlaq <[email protected]>2015-03-08 20:46:50 +0300
commit74102b25893c31e23afdffbb7e4c989f177daf07 (patch)
tree37d7bba664186f4e19cdfb2c0e039abe3b2fcd1f
parent026395f2e2ecab7bf83329898c3764f85d4928e8 (diff)
Display HFR as tool tip for each star
-rw-r--r--kstars/fitsviewer/fitsdata.cpp16
-rw-r--r--kstars/fitsviewer/fitsdata.h1
-rw-r--r--kstars/fitsviewer/fitsview.cpp6
3 files changed, 23 insertions, 0 deletions
diff --git a/kstars/fitsviewer/fitsdata.cpp b/kstars/fitsviewer/fitsdata.cpp
index 9bcdfd9..624d8d4 100644
--- a/kstars/fitsviewer/fitsdata.cpp
+++ b/kstars/fitsviewer/fitsdata.cpp
@@ -973,6 +973,22 @@ double FITSData::getHFR(HFRType type)
}
+double FITSData::getHFR(int x, int y)
+{
+ if (starCenters.size() == 0)
+ return -1;
+
+ for (int i=0; i < starCenters.count() ; i++)
+ {
+ if (fabs(starCenters[i]->x-x) <= starCenters[i]->width/2 && fabs(starCenters[i]->y-y) <= starCenters[i]->width/2)
+ {
+ return starCenters[i]->HFR;
+ }
+ }
+
+ return -1;
+}
+
void FITSData::applyFilter(FITSScale type, float *image, double min, double max)
{
if (type == FITS_NONE /* || histogram == NULL*/)
diff --git a/kstars/fitsviewer/fitsdata.h b/kstars/fitsviewer/fitsdata.h
index 59f38f3..a4b867b 100644
--- a/kstars/fitsviewer/fitsdata.h
+++ b/kstars/fitsviewer/fitsdata.h
@@ -133,6 +133,7 @@ public:
// Half Flux Radius
Edge * getMaxHFRStar() { return maxHFRStar;}
double getHFR(HFRType type=HFR_AVERAGE);
+ double getHFR(int x, int y);
// FITS Mode (Normal, Guide, Focus..etc).
FITSMode getMode() { return mode;}
diff --git a/kstars/fitsviewer/fitsview.cpp b/kstars/fitsviewer/fitsview.cpp
index 9d3c66d..c8be77f 100644
--- a/kstars/fitsviewer/fitsview.cpp
+++ b/kstars/fitsviewer/fitsview.cpp
@@ -29,6 +29,7 @@
#include <QScrollArea>
#include <QFile>
#include <QCursor>
+#include <QToolTip>
#include <QProgressDialog>
#include <QDateTime>
#include <QPainter>
@@ -130,6 +131,11 @@ void FITSLabel::mousePressEvent(QMouseEvent *e)
emit pointSelected(x, y);
+ double HFR = image->getImageData()->getHFR(x, y);
+
+ if (HFR > 0)
+ QToolTip::showText(e->globalPos(), xi18nc("Half Flux Radius", "HFR: %1", QString::number(HFR, 'g' , 3)), this);
+
}
FITSView::FITSView(QWidget * parent, FITSMode fitsMode, FITSScale filterType) : QScrollArea(parent) , zoomFactor(1.2)