4 #include <QApplication> 6 #include <QListIterator> 10 #include <QPushButton> 11 #include <QScrollArea> 13 #include <QTableWidget> 14 #include <QTableWidgetItem> 16 #include <QVBoxLayout> 30 #include "TableMainWindow.h" 38 #define FLOAT_MIN -16777215 53 p_action->setShortcut(Qt::CTRL + Qt::Key_T);
54 p_action->setWhatsThis(
"<b>Function: </b> Opens the Advanced Tracking Tool \ 55 window. This window will track sample/line positions,\ 56 lat/lon positions, and many other pieces of \ 57 information. All of the data in the window can be \ 58 saved to a text file. <p><b>Shortcut: </b> Ctrl+T</p>");
69 for (iter = checkBoxItems.begin(); iter != checkBoxItems.end(); ++iter) {
71 QString header = currentList[0];
72 QString menuText = currentList[2];
73 QString toolTip = currentList[3];
75 if (currentList[1] == QString(
"true")) {
82 if (toolTip != QString(
"")) {
84 -1, Qt::Horizontal, toolTip);
96 for(
int r = 0; r < 10; r++) {
99 QTableWidgetItem *item =
new QTableWidgetItem(
"");
106 recordAction->setShortcut(Qt::Key_R);
107 parent->addAction(recordAction);
108 connect(recordAction, SIGNAL(triggered()),
this, SLOT(
record()));
110 " --- Double click on a cell to enable crtl+c (copy) and" 115 QMenu *helpMenu = menuBar->addMenu(
"&Help");
117 help->setText(
"&Tool Help");
118 help->setShortcut(Qt::CTRL + Qt::Key_H);
119 connect(help, SIGNAL(triggered()),
this, SLOT(
helpDialog()));
120 helpMenu->addAction(help);
137 if(e->type() == QEvent::Show) {
145 else if(e->type() == QEvent::Hide) {
148 return Tool::eventFilter(o, e);
239 for (iter = checkBoxItems.begin(); iter != checkBoxItems.end(); ++iter) {
243 for (headerIter = splitHeader.begin(); headerIter != splitHeader.end(); ++headerIter) {
244 QString header = *headerIter;
245 if (header.toLower() == keyword.toLower()) {
251 IString msg =
"Header [" + keyword +
"] not found; make sure spelling is correct";
266 int isample = int (sample + 0.5);
267 int iline = int (line + 0.5);
284 QTableWidgetItem *item =
new QTableWidgetItem(
"");
296 if(sample < 0.5)
return;
297 if(line < 0.5)
return;
299 if(line > cvp->
cubeLines() + 0.5)
return;
316 QString fnamePath = fname.
path();
317 QString fnameName = fname.
name();
325 if((sample < 0.5) || (line < 0.5) ||
334 QString p = grayPixel;
339 QString p = redPixel;
344 if(cvp->
camera() != NULL) {
352 setText(QString::number(lat,
'f', 15));
354 setText(QString::number(lon,
'f', 15));
356 setText(QString::number(radius,
'f', 15));
364 while(lon < 0.0) lon += 360.0;
369 setText(QString::number(lat,
'f', 15));
371 setText(QString::number(lon,
'f', 15));
397 setText(QString::number(obliquePRes));
415 Angle phaseAngle, incidenceAngle, emissionAngle;
416 bool bSuccess =
false;
420 setText(QString::number(incidenceAngle.
degrees()));
422 setText(QString::number(emissionAngle.
degrees()));
435 setText(QString::number(northAzi));
444 setText(QString::number(sunAzi));
453 setText(QString::number(spacecraftAzi));
462 setText(QString::number(solarLon));
465 setText(QString::number(slantDistance));
468 setText(QString::number(lst));
475 setText(QString::number(undistortedFocalPlaneX));
478 setText(QString::number(undistortedFocalPlaneY));
481 setText(QString::number(undistortedFocalPlaneZ));
485 double distortedFocalPlaneX = focalPlaneMap->
FocalPlaneX();
487 setText(QString::number(distortedFocalPlaneX));
488 double distortedFocalPlaneY = focalPlaneMap->
FocalPlaneY();
490 setText(QString::number(distortedFocalPlaneY));
501 setText(QString::number(time.Et(),
'f', 15));
502 QString time_utc = time.UTC();
525 while(wlon < 0.0) wlon += 360.0;
526 if (tproj->
IsSky()) {
529 setText(QString::number(lon,
'f', 15));
531 setText(QString::number(lat,
'f', 15));
536 setText(QString::number(lat,
'f', 15));
538 setText(QString::number(glat,
'f', 15));
540 setText(QString::number(lon,
'f', 15));
544 setText(QString::number(wlon,
'f', 15));
556 while(wlon < 0.0) wlon += 360.0;
561 setText(QString::number(lon,
'f', 15));
565 setText(QString::number(wlon,
'f', 15));
569 setText(QString::number(radius,
'f', 15));
580 setText(QString::number(projX,
'f', 15));
582 setText(QString::number(projY,
'f', 15));
588 int iMosaicOrigin = -1;
589 QString sSrcFileName =
"";
590 QString sSrcSerialNum =
"";
591 TrackMosaicOrigin(cvp, iline, isample, iMosaicOrigin, sSrcFileName, sSrcSerialNum);
593 setText(QString::number(iMosaicOrigin));
595 setText(QString(sSrcFileName));
597 setText(QString(sSrcSerialNum));
619 int piSample,
int &piOrigin, QString &psSrcFileName,
620 QString &psSrcSerialNum) {
633 trackingCube = cCube;
639 trackingCube->
read(trackingPortal);
641 unsigned int currentPixel = trackingPortal[0];
642 if (currentPixel != NULLUI4) {
643 Table table(trackingTableName);
644 trackingCube->
read(table);
648 psSrcFileName = trackingFileName.
name();
649 psSrcSerialNum = trackingTable.
pixelToSN(currentPixel);
650 piOrigin = trackingTable.
fileNameToIndex(trackingFileName, psSrcSerialNum);
654 else if(cCube->
hasTable(trackingTableName)) {
658 for(
int i = 0; i < cGrpBandBin.
keywords(); i++) {
660 for(
int j = 0; j < cKeyTrackBand.
size(); j++) {
661 if(cKeyTrackBand[j] ==
"TRACKING") {
668 if(iTrackBand > 0 && iTrackBand <= cCube->bandCount()) {
671 cOrgPortal.
SetPosition(piSample, piLine, iTrackBand + 1);
672 cCube->
read(cOrgPortal);
673 piOrigin = (int)cOrgPortal[0];
676 piOrigin -= VALID_MIN1;
680 piOrigin -= VALID_MIN2;
684 piOrigin -= FLOAT_MIN;
689 Table cFileTable(trackingTableName);
690 cCube->
read(cFileTable);
691 int iRecs = cFileTable.
Records();
692 if(piOrigin >= 0 && piOrigin < iRecs) {
693 psSrcFileName = QString(cFileTable[piOrigin][0]);
694 psSrcSerialNum = QString(cFileTable[piOrigin][1]);
699 if (piOrigin == -1) {
700 psSrcFileName =
"N/A";
701 psSrcSerialNum =
"N/A";
719 QVBoxLayout *dialogLayout =
new QVBoxLayout;
721 QLabel *dialogTitle =
new QLabel(
"<h3>Advanced Tracking Tool</h3>");
722 dialogLayout->addWidget(dialogTitle);
724 QTabWidget *tabArea =
new QTabWidget;
725 dialogLayout->addWidget(tabArea);
727 QScrollArea *recordTab =
new QScrollArea;
729 QVBoxLayout *recordLayout =
new QVBoxLayout;
730 recordContainer->setLayout(recordLayout);
731 QLabel *recordText =
new QLabel(
"To record, click on the viewport of interest and" 732 " press (r) while the mouse is hovering over the image.");
733 recordText->setWordWrap(
true);
734 recordLayout->addWidget(recordText);
735 recordTab->setWidget(recordContainer);
737 QScrollArea *helpTab =
new QScrollArea;
739 QVBoxLayout *helpLayout =
new QVBoxLayout;
740 helpContainer->setLayout(helpLayout);
741 QLabel *helpText =
new QLabel(
"In order to use <i>ctrl+c</i> to copy and <i>ctrl+v</i> to" 742 " paste, you need to double click on the cell you are copying" 743 " from (the text should be highlighted). Then double click on" 744 " the cell you are pasting to (you should see a cursor if the" 745 " cell is blank). When a cell is in this editing mode, most" 746 " keyboard shortcuts work.");
747 helpText->setWordWrap(
true);
748 recordText->setWordWrap(
true);
749 helpLayout->addWidget(helpText);
750 helpTab->setWidget(helpContainer);
752 tabArea->addTab(recordTab,
"Record");
753 tabArea->addTab(helpTab,
"Table Help");
755 QPushButton *okButton =
new QPushButton(
"OK");
756 dialogLayout->addStretch();
757 dialogLayout->addWidget(okButton);
759 connect(okButton, SIGNAL(clicked()),
helpDialog, SLOT(accept()));
780 QTableWidgetItem *item =
new QTableWidgetItem(
"");
787 QAbstractItemView::PositionAtBottom);
864 if (QApplication::applicationName() ==
"") {
866 "application name before using the Isis::MainWindow class. Window " 867 "state and geometry can not be saved and restored",
_FILEINFO_);
870 FileName config(
FileName(
"$HOME/.Isis/" + QApplication::applicationName() +
"/").path() +
"/" +
871 "advancedTrackTool.config");
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).
int Records() const
Returns the number of records.
void Coordinate(double p[3]) const
Returns the x,y,z of the surface intersection in BodyFixed km.
int keywords() const
Returns the number of keywords contained in the PvlContainer.
QString path() const
Returns the path of the file name.
double RightAscension()
Returns the right ascension angle (sky longitude).
double meters() const
Get the distance in meters.
int cubeLines() const
Return the number of lines in the cube.
const double Null
Value for an Isis Null pixel.
void setStatusMessage(QString message)
sets the status message in the lower lefthand corner of the window.
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.
File name manipulation and expansion.
ProjectionType projectionType() const
Returns an enum value for the projection type.
Parse and return pieces of a time string.
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
double FocalPlaneX() const
double UndistortedFocalPlaneZ() const
Gets the z-value in the undistorted focal plane coordinate system.
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.
int SizeOf(Isis::PixelType pixelType)
Returns the number of bytes of the specified PixelType.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
double UniversalLongitude()
This returns a universal longitude (positive east in 0 to 360 domain).
double ObliquePixelResolution()
Returns the oblique pixel resolution at the current position in meters/pixel.
double XCoord() const
This returns the projection X provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
bool IsValidPixel(const double d)
Returns if the input pixel is valid.
double SlantDistance() const
Return the distance between the spacecraft and surface point in kmv.
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.
A type of error that occurred when performing an actual I/O operation.
Distance measurement, usually in meters.
double degrees() const
Get the angle in units of Degrees.
static QString Compose(Pvl &label, bool def2filename=false)
Compose a SerialNumber from a PVL.
Distance LocalRadius() const
Returns the local radius at the intersection point.
double redPixel(int sample, int line)
Gets the red pixel.
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...
double EmissionAngle() const
Returns the emission angle in degrees.
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)
Gets the gray pixel.
FileName pixelToFileName(unsigned int pixel)
Returns the FileName that corresponds to a pixel value.
int size() const
Returns the number of values stored in this keyword.
Convert between distorted focal plane and detector coordinates.
void instrumentPosition(double p[3]) const
Returns the spacecraft position in body-fixed frame km units.
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.
Target * target() const
Returns a pointer to the target object.
bool hasGroup(const QString &group) const
Return if the cube has a specified group in the labels.
double Longitude() const
This returns a longitude with correct longitude direction and domain as specified in the label object...
Contains multiple PvlContainers.
#define _FILEINFO_
Macro for the filename and line number.
int currentRow() const
Returns the current row.
bool IsSky() const
Returns true if projection is sky and false if it is land.
A single keyword-value pair.
double UniversalRingRadius()
This returns a universal radius, which is just the radius in meters.
double LocalRadius(double lat) const
This method returns the local radius in meters at the specified latitude position.
double YCoord() const
This returns the projection Y provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
void read(Blob &blob) const
This method will read data from the specified Blob object.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Distort/undistort focal plane coordinates.
double NorthAzimuth()
Returns the North Azimuth.
bool isLinked() const
Is the viewport linked with other viewports.
ShapeModel * shape() const
Return the shape.
Container for cube-like labels.
double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
double ToPlanetographic(const double lat) const
This method converts a planetocentric latitude to a planetographic latitude.
PixelType pixelType() const
double PhaseAngle() const
Returns the phase angle in degrees.
void SetPosition(const double sample, const double line, const int band)
Sets the line and sample position of the buffer.
int fileNameToIndex(FileName file, QString serialNumber)
Returns the index of the filename/serialnumber combination.
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 FocalPlaneY() const
a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks.
int cubeSamples() const
Return the number of samples in the cube.
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.
QTableWidget * table() const
Returns the table.
QString pixelToSN(unsigned int pixel)
Returns the serial number that corresponds to a pixel value.
QString name() const
Gets the shape name.
Base class for Map Projections of plane shapes.
QString toString() const
Returns a string representation of this exception.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Cube * trackingCube() const
Class for storing Table blobs information.
virtual QString fileName() const
Returns the opened cube's filename.
Table to store tracking information for a mosaic.
QString PixelToString(double d)
Takes a double pixel value and returns the name of the pixel type as a string.
double PixelResolution()
Returns the pixel resolution at the current position in meters/pixel.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
virtual int bandCount() const
Returns the number of virtual bands for the cube.
Projection * projection() const
double IncidenceAngle() const
Returns the incidence angle in degrees.
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.
static double To180Domain(const double lon)
This method converts a ring longitude into the -180 to 180 domain.
double UndistortedFocalPlaneY() const
Gets the y-value in the undistorted focal plane coordinate system.
void showTable()
This method checks to see if the table has been created.
void radii(Distance r[3]) const
Returns the radii of the body in km.
int currentIndex() const
Returns the current index.
Contains Pvl Groups and Pvl Objects.
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
Longitude solarLongitude()
Returns the solar longitude.
double UndistortedFocalPlaneX() const
Gets the x-value in the undistorted focal plane coordinate system.
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.
iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions...