9#include "MdiCubeViewport.h"
10#include "Projection.h"
11#include "RingPlaneProjection.h"
12#include "SpecialPixel.h"
14#include "TProjection.h"
15#include "ViewportBuffer.h"
16#include "WarningWidget.h"
118 if(cvp == NULL)
return;
120 if(p.x() >= 0 && p.x() < cvp->width() &&
121 p.y() >= 0 && p.y() < cvp->height()) {
152 cvp->viewportToCube(p.x(), p.y(), sample, line);
153 if((sample < 0.5) || (line < 0.5) ||
154 (sample > cvp->cubeSamples() + 0.5) ||
155 (line > cvp->cubeLines() + 0.5)) {
159 int isamp = (int)(sample + 0.5);
165 int iline = (int)(line + 0.5);
172 if(cvp->projection() != NULL) {
178 if(cvp->projection()->SetWorld(sample, line)) {
182 double lon = tproj->Longitude();
183 if (cvp->projection()->IsSky()) {
184 p_latLabel->setText(QString(
"DEC %1").arg(lat));
185 p_lonLabel->setText(QString(
"RA %1").arg(lon));
188 p_latLabel->setText(QString(
"Lat %1").arg(lat));
189 p_lonLabel->setText(QString(
"Lon %1").arg(lon));
195 double lon = rproj->RingLongitude();
197 p_latLabel->setText(QString(
"Rad %1").arg(rad));
198 p_lonLabel->setText(QString(
"Lon %1").arg(lon));
207 else if(cvp->camera() != NULL) {
211 if(cvp->camera()->SetImage(sample, line)) {
212 if (cvp->camera()->target()->shape()->name() !=
"Plane") {
213 if (cvp->camera()->target()->isSky()) {
214 double dec = cvp->camera()->Declination();
215 double ra = cvp->camera()->RightAscension();
216 p_latLabel->setText(QString(
"DEC %1").arg(dec));
217 p_lonLabel->setText(QString(
"RA %1").arg(ra));
220 double lat = cvp->camera()->UniversalLatitude();
221 double lon = cvp->camera()->UniversalLongitude();
222 p_latLabel->setText(QString(
"Lat %1").arg(lat));
223 p_lonLabel->setText(QString(
"Lon %1").arg(lon));
227 double rad = cvp->camera()->LocalRadius().meters();
228 double lon = cvp->camera()->UniversalLongitude();
230 p_latLabel->setText(QString(
"Rad %1").arg(rad));
231 p_lonLabel->setText(QString(
"Lon %1").arg(lon));
253 QString pixelString = updateColorLabel(p, buf,
p_grayLabel);
264 QString pixelString = updateColorLabel(p, redBuf,
p_redLabel);
270 pixelString = updateColorLabel(p, greenBuf,
p_grnLabel);
276 pixelString = updateColorLabel(p, blueBuf,
p_bluLabel);
283 QString TrackTool::updateColorLabel(QPoint p,
ViewportBuffer *buf, QLabel *label) {
284 if(!buf->working()) {
285 const QRect rRect = buf->bufferXYRect();
287 if(p.x() >= rRect.left() && p.x() < rRect.right() &&
288 p.y() >= rRect.top() && p.y() < rRect.bottom()) {
289 const int rBufX = p.x() - rRect.left();
290 const int rBufY = p.y() - rRect.top();
320 QPoint p =
cubeViewport()->viewport()->mapFromGlobal(QCursor::pos());
321 if(p.x() < 0)
return;
322 if(p.y() < 0)
return;
323 if(p.x() >=
cubeViewport()->viewport()->width())
return;
324 if(p.y() >=
cubeViewport()->viewport()->height())
return;
353 QStatusBar *TrackTool::getStatusBar(
void) {
Adds specific functionality to C++ strings.
QString ToQt() const
Retuns the object string as a QString.
Cube display widget for certain Isis MDI applications.
ProjectionType
This enum defines the subclasses of Projection supported in Isis.
@ Triaxial
These projections are used to map triaxial and irregular-shaped bodies.
Base class for Map Projections of plane shapes.
double RingRadius() const
This returns a radius.
Base class for Map TProjections.
virtual double Latitude() const
This returns a latitude with correct latitude type as specified in the label object.
Reads and stores visible DN values.
This is free and unencumbered software released into the public domain.
QString PixelToString(double d, double precision=8)
Takes a double pixel value and returns the name of the pixel type as a string.