1#include "SunShadowTool.h"
13#include <QStackedWidget>
14#include <QTableWidget>
23#include "MdiCubeViewport.h"
24#include "Projection.h"
25#include "SurfacePoint.h"
52 "Start\nLatitude:Start\nLongitude:End\nLatitude:End\nLongitude",
53 "Ground Range", -1, Qt::Horizontal,
54 "Start Latitude/Longitude to End Latitude/Longitude");
56 "Start\nSample:Start\nLine:End\nSample:End\nLine",
57 "Pixel Range", -1, Qt::Horizontal,
58 "Start Sample/Line to End Sample/Line");
64 "Incidence Angle (degrees)");
66 "Incidence Angle (radians)");
73 connect(
this, SIGNAL(viewportChanged()),
93 action->setIcon(QPixmap(
toolIconDir() +
"/sunshadow.png"));
94 action->setToolTip(
"Sun Shadow (U)");
95 action->setShortcut(Qt::Key_U);
98 "<b>Function:</b> Calculate heights or depths of features in the active "
99 "viewport given the measurement of a shadow. The shadow measurement "
100 "should originate from the top of the feature and end when the shadow "
102 "<p><b>Shortcut:</b> U</p> ";
103 action->setWhatsThis(text);
119 QToolButton *showTableButton =
new QToolButton(hbox);
120 showTableButton->setText(
"Table");
121 showTableButton->setToolTip(
"Record Measurement Data in Table");
123 "<b>Function:</b> This button will bring up a table that will record "
124 "the starting and ending points of the line, along with the calculated "
125 "values for the two points on the image. To measure a shadow, "
126 "click on the first point and releasing the mouse at the second point."
127 "\n<p><b>Shortcut:</b> CTRL+M</p>";
128 showTableButton->setWhatsThis(text);
129 showTableButton->setShortcut(Qt::CTRL + Qt::Key_M);
130 connect(showTableButton, SIGNAL(clicked()),
m_tableWin, SLOT(showTable()));
131 connect(showTableButton, SIGNAL(clicked()),
m_tableWin, SLOT(syncColumns()));
132 connect(showTableButton, SIGNAL(clicked()),
m_tableWin, SLOT(raise()));
133 showTableButton->setEnabled(
true);
139 text =
"<b>Function: </b> Shows the height of the shadow drawn on "
155 QHBoxLayout *layout =
new QHBoxLayout(hbox);
156 layout->setMargin(0);
160 layout->addWidget(showTableButton);
161 layout->addStretch(1);
162 hbox->setLayout(layout);
198 painter->setPen(QPen(Qt::red));
199 painter->drawLine(QPoint(vpStartX, vpStartY), QPoint(vpEndX, vpEndY));
236 bool adjustLine =
true;
438 QTableWidgetItem *item =
new QTableWidgetItem(
"");
442 QAbstractItemView::PositionAtBottom);
491 QVector3D sunDirection;
495 double sunPosition[3];
496 cam->sunPosition(sunPosition);
499 cam->radii(targetRadii);
501 double origin[3] = {0.0, 0.0, 0.0};
502 SpiceBoolean surfptSuccess;
504 double naifVectorFromSunToP1[3] = {0.0, 0.0, 0.0};
506 surfpt_c(origin, sunPosition, targetRadii[0].kilometers(),
507 targetRadii[1].kilometers(), targetRadii[2].kilometers(),
508 naifVectorFromSunToP1, &surfptSuccess);
509 success = surfptSuccess;
512 sunDirection = QVector3D(
513 naifVectorFromSunToP1[0] * 1000.0,
514 naifVectorFromSunToP1[1] * 1000.0,
515 naifVectorFromSunToP1[2] * 1000.0).normalized();
536 deltaY.meters() * deltaY.meters() +
537 deltaZ.meters() * deltaZ.meters() ),
560 switch (displayUnits) {
589 bool hasCamera =
true;
591 hasCamera = activeViewport &&
592 (activeViewport->cube()->camera() != NULL);
Defines an angle and provides unit conversions.
bool isValid() const
This indicates whether we have a legitimate angle stored or are in an unset, or invalid,...
double radians() const
Convert an angle to a double.
double degrees() const
Get the angle in units of Degrees.
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Camera * camera()
Return a camera associated with the cube.
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
Displacement is a signed length, usually in meters.
Distance measurement, usually in meters.
bool isValid() const
Test if this distance has been initialized or not.
double kilometers() const
Get the distance in kilometers.
Units
This is a list of available units to access and store Distances in.
@ SolarRadii
"Solar radius is a unit of distance used to express the size of stars in astronomy equal to the curre...
@ Pixels
The distance is being specified in pixels.
@ Kilometers
The distance is being specified in kilometers.
@ Meters
The distance is being specified in meters.
double meters() const
Get the distance in meters.
File name manipulation and expansion.
QString path() const
Returns the path of the file name.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Cube display widget for certain Isis MDI applications.
This class defines a body-fixed surface point.
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
Longitude GetLongitude() const
Return the body-fixed longitude for the surface point.
a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks.
QTableWidget * table() const
Returns the table.
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.
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...
void setStatusMessage(QString message)
sets the status message in the lower lefthand corner of the window.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
int toInt(const QString &string)
Global function to convert from a string to an integer.
const double Null
Value for an Isis Null pixel.