4 #include <QApplication>
10 #include <QScrollArea>
12 #include <QTableWidget>
13 #include <QTableWidgetItem>
15 #include <QVBoxLayout>
29 #include "TableMainWindow.h"
36 #define FLOAT_MIN -16777215
37 #define TABLE_MOSAIC_SRC "InputImages"
52 p_action->setShortcut(Qt::CTRL + Qt::Key_T);
53 p_action->setWhatsThis(
"<b>Function: </b> Opens the Advanced Tracking Tool \
54 window. This window will track sample/line positions,\
55 lat/lon positions, and many other pieces of \
56 information. All of the data in the window can be \
57 saved to a text file. <p><b>Shortcut: </b> Ctrl+T</p>");
66 Qt::Horizontal,
"Sample and Line");
76 Qt::Horizontal,
"X and Y values for a projected image");
79 "The X, Y, and Z of surface intersection in body-fixed coordinates");
81 "Right Ascension and Declination");
92 -1, Qt::Horizontal,
"The X, Y, and Z of the spacecraft position");
97 "Undistorted Focal Plane X:Y:Z");
113 for(
int r = 0; r < 10; r++) {
116 QTableWidgetItem *item =
new QTableWidgetItem(
"");
123 recordAction->setShortcut(Qt::Key_R);
124 parent->addAction(recordAction);
125 connect(recordAction, SIGNAL(triggered()),
this, SLOT(
record()));
127 " --- Double click on a cell to enable crtl+c (copy) and"
132 QMenu *helpMenu = menuBar->addMenu(
"&Help");
134 help->setText(
"&Tool Help");
135 help->setShortcut(Qt::CTRL + Qt::Key_H);
136 connect(help, SIGNAL(triggered()),
this, SLOT(
helpDialog()));
137 helpMenu->addAction(help);
154 if(e->type() == QEvent::Show) {
162 else if(e->type() == QEvent::Hide) {
165 return Tool::eventFilter(o, e);
255 int isample = int (sample + 0.5);
256 int iline = int (line + 0.5);
273 QTableWidgetItem *item =
new QTableWidgetItem(
"");
285 if(sample < 0.5)
return;
286 if(line < 0.5)
return;
288 if(line > cvp->
cubeLines() + 0.5)
return;
305 QString fnamePath = fname.
path();
306 QString fnameName = fname.name();
312 if((sample < 0.5) || (line < 0.5) ||
321 QString p = grayPixel;
326 QString p = redPixel;
331 if(cvp->
camera() != NULL) {
348 while(lon < 0.0) lon += 360.0;
387 Angle phaseAngle, incidenceAngle, emissionAngle;
392 setText(QString::number(incidenceAngle.
degrees()));
394 setText(QString::number(emissionAngle.
degrees()));
446 double distortedFocalPlaneX = focalPlaneMap->
FocalPlaneX();
448 double distortedFocalPlaneY = focalPlaneMap->
FocalPlaneY();
460 QString time_utc = time.UTC();
483 while(wlon < 0.0) wlon += 360.0;
484 if (tproj->
IsSky()) {
492 setText(QString::number(lat,
'f', 15));
494 setText(QString::number(glat,
'f', 15));
496 setText(QString::number(lon,
'f', 15));
511 while(wlon < 0.0) wlon += 360.0;
516 setText(QString::number(lon,
'f', 15));
538 int iMosaicOrigin = -1;
539 QString sSrcFileName =
"";
540 QString sSrcSerialNum =
"";
541 TrackMosaicOrigin(cvp, iline, isample, iMosaicOrigin, sSrcFileName, sSrcSerialNum);
545 setText(QString(sSrcSerialNum));
566 int piSample,
int &piOrigin, QString &psSrcFileName,
567 QString &psSrcSerialNum) {
572 if(cCube->
hasTable(TABLE_MOSAIC_SRC)) {
576 for(
int i = 0; i < cGrpBandBin.
keywords(); i++) {
578 for(
int j = 0; j < cKeyTrackBand.
size(); j++) {
579 if(cKeyTrackBand[j] ==
"TRACKING") {
586 if(iTrackBand > 0 && iTrackBand <= cCube->bandCount()) {
589 cOrgPortal.
SetPosition(piSample, piLine, iTrackBand + 1);
590 cCube->
read(cOrgPortal);
591 piOrigin = (int)cOrgPortal[0];
594 piOrigin -= VALID_MIN1;
598 piOrigin -= VALID_MIN2;
602 piOrigin -= FLOAT_MIN;
607 Table cFileTable(TABLE_MOSAIC_SRC);
608 cCube->
read(cFileTable);
609 int iRecs = cFileTable.
Records();
610 if(piOrigin >= 0 && piOrigin < iRecs) {
611 psSrcFileName = QString(cFileTable[piOrigin][0]);
612 psSrcSerialNum = QString(cFileTable[piOrigin][1]);
633 QVBoxLayout *dialogLayout =
new QVBoxLayout;
634 helpDialog->setLayout(dialogLayout);
635 QLabel *dialogTitle =
new QLabel(
"<h3>Advanced Tracking Tool</h3>");
636 dialogLayout->addWidget(dialogTitle);
638 QTabWidget *tabArea =
new QTabWidget;
639 dialogLayout->addWidget(tabArea);
641 QScrollArea *recordTab =
new QScrollArea;
643 QVBoxLayout *recordLayout =
new QVBoxLayout;
644 recordContainer->setLayout(recordLayout);
645 QLabel *recordText =
new QLabel(
"To record, click on the viewport of interest and"
646 " press (r) while the mouse is hovering over the image.");
647 recordText->setWordWrap(
true);
648 recordLayout->addWidget(recordText);
649 recordTab->setWidget(recordContainer);
651 QScrollArea *helpTab =
new QScrollArea;
653 QVBoxLayout *helpLayout =
new QVBoxLayout;
654 helpContainer->setLayout(helpLayout);
655 QLabel *helpText =
new QLabel(
"In order to use <i>ctrl+c</i> to copy and <i>ctrl+v</i> to"
656 " paste, you need to double click on the cell you are copying"
657 " from (the text should be highlighted). Then double click on"
658 " the cell you are pasting to (you should see a cursor if the"
659 " cell is blank). When a cell is in this editing mode, most"
660 " keyboard shortcuts work.");
661 helpText->setWordWrap(
true);
662 recordText->setWordWrap(
true);
663 helpLayout->addWidget(helpText);
664 helpTab->setWidget(helpContainer);
666 tabArea->addTab(recordTab,
"Record");
667 tabArea->addTab(helpTab,
"Table Help");
669 QPushButton *okButton =
new QPushButton(
"OK");
670 dialogLayout->addStretch();
671 dialogLayout->addWidget(okButton);
673 connect(okButton, SIGNAL(clicked()), helpDialog, SLOT(accept()));
692 QTableWidgetItem *item =
new QTableWidgetItem(
"");
699 QAbstractItemView::PositionAtBottom);
773 if (QApplication::applicationName() ==
"") {
775 "application name before using the Isis::MainWindow class. Window "
776 "state and geometry can not be saved and restored",
_FILEINFO_);
779 FileName config(
FileName(
"$HOME/.Isis/" + QApplication::applicationName() +
"/").path() +
"/" +
780 "advancedTrackTool.config");
782 return config.expanded();
Cube display widget for certain Isis MDI applications.
void LocalPhotometricAngles(Angle &phase, Angle &incidence, Angle &emission, bool &success)
Calculates LOCAL photometric angles using the DEM (not ellipsoid).
double RightAscension()
Returns the right ascension angle (sky longitude).
int Records() const
Returns the number of records.
QTableWidget * table() const
Returns the table.
int size() const
Returns the number of values stored in this keyword.
void setStatusMessage(QString message)
sets the status message in the lower lefthand corner of the window.
bool IsSky() const
Returns true if projection is sky and false if it is land.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
double SunAzimuth()
Returns the Sun Azimuth.
PixelType pixelType() const
double degrees() const
Get the angle in units of Degrees.
QString name() const
Gets the shape name.
File name manipulation and expansion.
Parse and return pieces of a time string.
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
bool isGray() const
Is the viewport shown in gray / b&w.
double SlantDistance() const
Return the distance between the spacecraft and surface point in kmv.
Buffer for containing a two dimensional section of an image.
Base class for Map TProjections.
void clearRow(int row)
This method clears the text of the given row.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
double SpacecraftAzimuth()
Return the Spacecraft Azimuth.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
int keywords() const
Returns the number of keywords contained in the PvlContainer.
void radii(Distance r[3]) const
Returns the radii of the body in km.
int SizeOf(Isis::PixelType pixelType)
Returns the number of bytes of the specified PixelType.
double ToPlanetographic(const double lat) const
This method converts a planetocentric latitude to a planetographic latitude.
int cubeSamples() const
Return the number of samples in the cube.
double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
void instrumentPosition(double p[3]) const
Returns the spacecraft position in body-fixed frame km units.
double XCoord() const
This returns the projection X provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
double UndistortedFocalPlaneY() const
Return undistorted focal plane y.
double LocalRadius(double lat) const
This method returns the local radius in meters at the specified latitude position.
double UniversalLongitude()
This returns a universal longitude (positive east in 0 to 360 domain).
int currentRow() const
Returns the current row.
int redBand() const
Return the red band currently viewed.
Projection * projection() const
Return the projection associated with cube (NULL implies none)
bool IsValidPixel(const double d)
Returns if the input pixel is valid.
void read(Blob &blob) const
This method will read data from the specified Blob object.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
This error is for when a programmer made an API call that was illegal.
Distance measurement, usually in meters.
double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
double redPixel(int sample, int line)
Return the red pixel value at a sample/line.
void setTrackListItems(bool track=false)
If this property is true, the class will keep track of the checked/unchecked items in the dock area w...
bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
double grayPixel(int sample, int line)
Return the gray pixel value at a sample/line.
Target * target() const
Returns a pointer to the target object.
iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions...
double meters() const
Get the distance in meters.
Cube * cube() const
Return the cube associated with viewport.
Convert between distorted focal plane and detector coordinates.
int grayBand() const
Return the gray band currently viewed.
static double To180Domain(const double lon)
This method converts a longitude into the -180 to 180 domain.
bool hasTable(const QString &name)
Check to see if the cube contains a pvl table by the provided name.
double EmissionAngle() const
Returns the emission angle in degrees.
Contains multiple PvlContainers.
#define _FILEINFO_
Macro for the filename and line number.
double PhaseAngle() const
Returns the phase angle in degrees.
Camera * camera() const
Return the camera associated with the cube (NULL implies none)
A single keyword-value pair.
double UniversalRingRadius()
This returns a universal radius, which is just the radius in meters.
bool isLinked() const
Is the viewport linked with other viewports.
Distort/undistort focal plane coordinates.
double NorthAzimuth()
Returns the North Azimuth.
void viewportToCube(int x, int y, double &sample, double &line) const
Convert a viewport x/y to a cube sample/line (may be outside the cube)
Container for cube-like labels.
void SetPosition(const double sample, const double line, const int band)
Sets the line and sample position of the buffer.
void setCurrentRow(int row)
Sets the current row to row.
double UniversalLatitude()
This returns a universal latitude (planetocentric).
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
double UndistortedFocalPlaneZ() const
Return undistorted focal plane z.
a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks.
double YCoord() const
This returns the projection Y provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
void Coordinate(double p[3]) const
Returns the x,y,z of the surface intersection in BodyFixed km.
bool SetWorld(const double x, const double y)
This method is used to set a world coordinate.
Defines an angle and provides unit conversions.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Distance LocalRadius() const
Returns the local radius at the intersection point.
double Longitude() const
This returns a longitude with correct longitude direction and domain as specified in the label object...
Base class for Map Projections of plane shapes.
Class for storing Table blobs information.
QString toString() const
Returns a string representation of this exception.
double FocalPlaneY() const
Return distorted focal plane y.
QString PixelToString(double d)
Takes a double pixel value and returns the name of the pixel type as a string.
int currentIndex() const
Returns the current index.
double PixelResolution()
Returns the pixel resolution at the current position in meters/pixel.
QString fileName() const
Returns the opened cube's filename.
double FocalPlaneX() const
Return distorted focal plane x.
void addToTable(bool setOn, const QString &heading, const QString &menuText="", int insertAt=-1, Qt::Orientation o=Qt::Horizontal, QString toolTip="")
Adds a new column to the table when a new curve is added to the plot.
double LocalSolarTime()
Return the local solar time in hours.
ShapeModel * shape() const
Return the shape.
ProjectionType projectionType() const
Returns an enum value for the projection type.
static double To180Domain(const double lon)
This method converts a ring longitude into the -180 to 180 domain.
void showTable()
This method checks to see if the table has been created.
int cubeLines() const
Return the number of lines in the cube.
double IncidenceAngle() const
Returns the incidence angle in degrees.
Contains Pvl Groups and Pvl Objects.
QString path() const
Returns the path.
double UndistortedFocalPlaneX() const
Return undistorted focal plane x.
Longitude solarLongitude()
Returns the solar longitude.
ProjectionType
This enum defines the subclasses of Projection supported in Isis.
double UniversalRingLongitude()
This returns a universal ring longitude (clockwise in 0 to 360 domain).
void setCurrentIndex(int currentIndex)
Sets the current index to currentIndex.
double Declination()
Returns the declination angle (sky latitude).
These projections are used to map triaxial and irregular-shaped bodies.
IO Handler for Isis Cubes.