Isis 3 Programmer Reference
SunShadowTool.cpp
1 #include "IsisDebug.h"
2 #include "SunShadowTool.h"
3 
4 #include <QApplication>
5 #include <QComboBox>
6 #include <QCheckBox>
7 #include <QFileDialog>
8 #include <QHBoxLayout>
9 #include <QLineEdit>
10 #include <QMenu>
11 #include <QMenuBar>
12 #include <QMessageBox>
13 #include <QStatusBar>
14 #include <QStackedWidget>
15 #include <QTableWidget>
16 #include <QToolButton>
17 
18 #include "Angle.h"
19 #include "Camera.h"
20 #include "Distance.h"
21 #include "FileName.h"
22 #include "Latitude.h"
23 #include "Longitude.h"
24 #include "MdiCubeViewport.h"
25 #include "Projection.h"
26 #include "SurfacePoint.h"
27 #include "ToolPad.h"
28 
29 namespace Isis {
36  m_enabled = false;
37  m_tracking = false;
38  m_shadowHeight = NULL;
39  m_shadowLength = NULL;
40  m_trackingAngle = NULL;
41  m_drawInSunDirection = NULL;
42  m_startSurfacePoint = NULL;
43  m_endSurfacePoint = NULL;
44  m_incidenceAngle = NULL;
45 
46  m_tableWin = new TableMainWindow("Sun Shadow Measurements", parent);
48  m_tableWin->installEventFilter(this);
49 
50  m_tableWin->addToTable(false, "Feature\nName", "Feature Name");
51  m_tableWin->addToTable(false, "Feature\nType", "Feature Type");
52  m_tableWin->addToTable(true,
53  "Start\nLatitude:Start\nLongitude:End\nLatitude:End\nLongitude",
54  "Ground Range", -1, Qt::Horizontal,
55  "Start Latitude/Longitude to End Latitude/Longitude");
56  m_tableWin->addToTable(false,
57  "Start\nSample:Start\nLine:End\nSample:End\nLine",
58  "Pixel Range", -1, Qt::Horizontal,
59  "Start Sample/Line to End Sample/Line");
60  m_tableWin->addToTable(true, "Shadow Length\n(km)", "Shadow Length (km)");
61  m_tableWin->addToTable(true, "Shadow Length\n(m)", "Shadow Length (m)");
62  m_tableWin->addToTable(true, "Shadow Height\n(km)", "Shadow Height (km)");
63  m_tableWin->addToTable(true, "Shadow Height\n(m)", "Shadow Height (m)");
64  m_tableWin->addToTable(true, "Incidence Angle\n(degrees)",
65  "Incidence Angle (degrees)");
66  m_tableWin->addToTable(true, "Incidence Angle\n(radians)",
67  "Incidence Angle (radians)");
68  m_tableWin->addToTable(false, "Path", "Path");
69  m_tableWin->addToTable(false, "FileName", "FileName");
70  m_tableWin->addToTable(false, "Notes", "Notes");
71 
72  m_tableWin->setStatusMessage("Click, Drag, and Release to Measure a Line");
73 
74  connect(this, SIGNAL(viewportChanged()),
75  this, SLOT(reinitialize()));
76 
79  m_trackingAngle = new Angle;
82  m_incidenceAngle = new Angle;
83  }
84 
85 
93  QAction *action = new QAction(toolpad);
94  action->setIcon(QPixmap(toolIconDir() + "/sunshadow.png"));
95  action->setToolTip("Sun Shadow (U)");
96  action->setShortcut(Qt::Key_U);
97 
98  QString text =
99  "<b>Function:</b> Calculate heights or depths of features in the active "
100  "viewport given the measurement of a shadow. The shadow measurement "
101  "should originate from the top of the feature and end when the shadow "
102  "ends.\n"
103  "<p><b>Shortcut:</b> U</p> ";
104  action->setWhatsThis(text);
105 
106  return action;
107  }
108 
109 
118  QWidget *SunShadowTool::createToolBarWidget(QStackedWidget *parent) {
119  QWidget *hbox = new QWidget(parent);
120  QToolButton *showTableButton = new QToolButton(hbox);
121  showTableButton->setText("Table");
122  showTableButton->setToolTip("Record Measurement Data in Table");
123  QString text =
124  "<b>Function:</b> This button will bring up a table that will record "
125  "the starting and ending points of the line, along with the calculated "
126  "values for the two points on the image. To measure a shadow, "
127  "click on the first point and releasing the mouse at the second point."
128  "\n<p><b>Shortcut:</b> CTRL+M</p>";
129  showTableButton->setWhatsThis(text);
130  showTableButton->setShortcut(Qt::CTRL + Qt::Key_M);
131  connect(showTableButton, SIGNAL(clicked()), m_tableWin, SLOT(showTable()));
132  connect(showTableButton, SIGNAL(clicked()), m_tableWin, SLOT(syncColumns()));
133  connect(showTableButton, SIGNAL(clicked()), m_tableWin, SLOT(raise()));
134  showTableButton->setEnabled(true);
135 
136  m_shadowHeightLineEdit = new QLineEdit(hbox);
137  m_shadowHeightLineEdit->setText("");
138  m_shadowHeightLineEdit->setMaxLength(12);
139  m_shadowHeightLineEdit->setToolTip("Shadow Height");
140  text = "<b>Function: </b> Shows the height of the shadow drawn on "
141  "the image.";
142  m_shadowHeightLineEdit->setWhatsThis(text);
143  m_shadowHeightLineEdit->setReadOnly(true);
144 
145  m_unitsComboBox = new QComboBox(hbox);
146  m_unitsComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
147  m_unitsComboBox->addItem("Meters", Distance::Meters);
148  m_unitsComboBox->addItem("Kilometers", Distance::Kilometers);
149 
150  connect(m_unitsComboBox, SIGNAL(activated(int)),
151  this, SLOT(updateShadowHeightEdit()));
152 
153  m_drawInSunDirection = new QCheckBox("Draw in Sun Direction");
154  m_drawInSunDirection->setChecked(true);
155 
156  QHBoxLayout *layout = new QHBoxLayout(hbox);
157  layout->setMargin(0);
158  layout->addWidget(m_drawInSunDirection);
159  layout->addWidget(m_shadowHeightLineEdit);
160  layout->addWidget(m_unitsComboBox);
161  layout->addWidget(showTableButton);
162  layout->addStretch(1);
163  hbox->setLayout(layout);
164  return hbox;
165  }
166 
167 
175  }
176 
177 
185  void SunShadowTool::paintViewport(MdiCubeViewport *vp, QPainter *painter) {
186  if (vp == cubeViewport()) {
187  if (m_startSamp != Null && m_endSamp != Null &&
188  m_startLine != Null && m_endLine != Null) {
189  int vpStartX;
190  int vpStartY;
192  vpStartX, vpStartY);
193 
194  int vpEndX;
195  int vpEndY;
197  vpEndX, vpEndY);
198 
199  painter->setPen(QPen(Qt::red));
200  painter->drawLine(QPoint(vpStartX, vpStartY), QPoint(vpEndX, vpEndY));
201  }
202  }
203  }
204 
205 
212  void SunShadowTool::mouseMove(QPoint p) {
213  if (m_tracking && m_trackingAngle->isValid()) {
214  cubeViewport()->viewportToCube(p.x(), p.y(),
216 
217  if (m_drawInSunDirection->isChecked()) {
218  // Recalculate the end line based on our drawing angle...
219  // y = x * tan(angle) for the right triangle created from the
220  // user drawing a line.
221  //
222  // E
223  // / |
224  // / |
225  // / | L
226  // / |
227  // /A |
228  // S-------|
229  // S = Mouse Start Pos
230  // A = sun angle
231  // E = mouse end pos
232  // L = Line height of the triangle
233  // (needs calculated, L = m_endLine - m_startLine)
234  //
235  Angle verticalDown(90, Angle::Degrees);
236  Angle verticalUp(270, Angle::Degrees);
237  bool adjustLine = true;
238 
239  if (*m_trackingAngle == verticalDown ||
240  *m_trackingAngle == verticalUp) {
242 
243  adjustLine = false;
244  }
245 
246  if (adjustLine) {
249  }
250  }
251 
253 
254  if (m_tableWin->table()->rowCount()) {
255  updateRow(m_tableWin->table()->rowCount() - 1);
256  }
257 
258  cubeViewport()->viewport()->update();
259  }
260  }
261 
262 
269  void SunShadowTool::mouseButtonPress(QPoint p, Qt::MouseButton s) {
270  if (m_enabled && s == Qt::LeftButton) {
271  if (m_tableWin->isVisible())
272  addRow();
273 
274  reinitialize();
275 
276  cubeViewport()->viewportToCube(p.x(), p.y(),
278 
279  Camera *cam = cubeViewport()->cube()->camera();
280 
281  if (cam->SetImage(m_startSamp, m_startLine)) {
282  m_tracking = true;
284  }
285  else {
286  m_tracking = false;
287  m_startSamp = Null;
288  m_startLine = Null;
289  }
290  cubeViewport()->viewport()->update();
291  }
292  }
293 
294 
301  void SunShadowTool::mouseButtonRelease(QPoint p, Qt::MouseButton s) {
302  if (s == Qt::LeftButton && m_tracking) {
303  mouseMove(p);
304  }
305 
306  m_tracking = false;
307  }
308 
309 
310 
318  void SunShadowTool::updateRow(int row) {
319  ASSERT(row < m_tableWin->table()->rowCount());
320 
321  if (row >= m_tableWin->table()->rowCount() || !
322  m_tableWin->isVisible()) {
323  return;
324  }
325 
326  // Blank out the row to remove stuff left over from previous cvps
327  for (int c = 0; c < m_tableWin->table()->columnCount(); c++) {
328  m_tableWin->table()->item(row, c)->setText("");
329  }
330 
331  // Write all the new info to the current row
332  if (m_startSurfacePoint->Valid()) {
333  m_tableWin->table()->item(row, StartLatIndex)->setText(
334  QString::number(m_startSurfacePoint->GetLatitude().degrees()));
335  m_tableWin->table()->item(row, StartLonIndex)->setText(
336  QString::number(m_startSurfacePoint->GetLongitude().degrees()));
337  }
338  else {
339  m_tableWin->table()->item(row, StartLatIndex)->setText("N/A");
340  m_tableWin->table()->item(row, StartLonIndex)->setText("N/A");
341  }
342 
343  if (m_endSurfacePoint->Valid()) {
344  m_tableWin->table()->item(row, EndLatIndex)->setText(
345  QString::number(m_endSurfacePoint->GetLatitude().degrees()));
346  m_tableWin->table()->item(row, EndLonIndex)->setText(
347  QString::number(m_endSurfacePoint->GetLongitude().degrees()));
348  }
349  else {
350  m_tableWin->table()->item(row, EndLatIndex)->setText("N/A");
351  m_tableWin->table()->item(row, EndLonIndex)->setText("N/A");
352  }
353 
354  if (m_startSamp != Null && m_startLine != Null) {
355  m_tableWin->table()->item(row, StartSampIndex)->setText(
356  QString::number(m_startSamp));
357  m_tableWin->table()->item(row, StartLineIndex)->setText(
358  QString::number(m_startLine));
359  }
360  else {
361  m_tableWin->table()->item(row, StartSampIndex)->setText("N/A");
362  m_tableWin->table()->item(row, StartLineIndex)->setText("N/A");
363  }
364 
365  if (m_endSamp != Null && m_endLine != Null) {
366  m_tableWin->table()->item(row, EndSampIndex)->setText(
367  QString::number(m_endSamp));
368  m_tableWin->table()->item(row, EndLineIndex)->setText(
369  QString::number(m_endLine));
370  }
371  else {
372  m_tableWin->table()->item(row, EndSampIndex)->setText("N/A");
373  m_tableWin->table()->item(row, EndLineIndex)->setText("N/A");
374  }
375 
376  if (m_shadowLength->isValid()) {
377  m_tableWin->table()->item(row, ShadowLengthKmIndex)->setText(
378  QString::number(m_shadowLength->kilometers()));
379  m_tableWin->table()->item(row, ShadowLengthMIndex)->setText(
380  QString::number(m_shadowLength->meters()));
381  }
382  else {
383  m_tableWin->table()->item(row, ShadowLengthKmIndex)->setText("N/A");
384  m_tableWin->table()->item(row, ShadowLengthMIndex)->setText("N/A");
385  }
386 
387  if (m_shadowHeight->isValid()) {
388  m_tableWin->table()->item(row, ShadowHeightKmIndex)->setText(
389  QString::number(m_shadowHeight->kilometers()));
390  m_tableWin->table()->item(row, ShadowHeightMIndex)->setText(
391  QString::number(m_shadowHeight->meters()));
392  }
393  else {
394  m_tableWin->table()->item(row, ShadowHeightKmIndex)->setText("N/A");
395  m_tableWin->table()->item(row, ShadowHeightMIndex)->setText("N/A");
396  }
397 
398  if (m_incidenceAngle->isValid()) {
399  m_tableWin->table()->item(row, IncidenceAngleDegreesIndex)->setText(
400  QString::number(m_incidenceAngle->degrees()));
401  m_tableWin->table()->item(row, IncidenceAngleRadiansIndex)->setText(
402  QString::number(m_incidenceAngle->radians()));
403  }
404  else {
405  m_tableWin->table()->item(row, IncidenceAngleDegreesIndex)->setText("N/A");
406  m_tableWin->table()->item(row, IncidenceAngleRadiansIndex)->setText("N/A");
407  }
408 
409  m_tableWin->table()->item(row, PathIndex)->setText(m_path);
410  m_tableWin->table()->item(row, FileNameIndex)->setText(m_fileName);
411  }
412 
413 
418  m_startSamp = Null;
419  m_endSamp = Null;
420  m_startLine = Null;
421  m_endLine = Null;
422 
427  *m_incidenceAngle = Angle();
428 
430  }
431 
432 
437  int newRowPos = m_tableWin->table()->rowCount();
438  m_tableWin->table()->insertRow(newRowPos);
439  for (int c = 0; c < m_tableWin->table()->columnCount(); c++) {
440  QTableWidgetItem *item = new QTableWidgetItem("");
441  m_tableWin->table()->setItem(newRowPos, c, item);
442  }
443  m_tableWin->table()->scrollToItem(m_tableWin->table()->item(newRowPos, 0),
444  QAbstractItemView::PositionAtBottom);
445  }
446 
447 
453  try {
454  if (m_startSamp != Null && m_startLine != Null &&
455  m_endSamp != Null && m_endLine != Null) {
456  m_path = FileName(cubeViewport()->cube()->fileName()).path();
457  m_fileName = FileName(cubeViewport()->cube()->fileName()).name();
458 
459  /* |
460  * \ _ /
461  * -= (_) =- THE SUN
462  * / \ -
463  * | - <--- vector from the sun that intersects P1 and P2
464  * -
465  * -_ |
466  * /^\- |
467  * / | \ - |
468  * / H| \ - |
469  * ________/ | \__T_-|_________
470  * P1 ^ P2
471  * Shadow
472  *
473  * T: Angle from the horizon to the sun
474  * H: Difference in planetary radius between P1 and P2
475  * L : length(Shadow)
476  * H = L * tan(T)
477  *
478  * We do not want the local incidence angle for T.
479  *
480  * Equation to variable mapping:
481  * T: theta
482  * H: m_shadowHeight
483  * L: m_shadowLength
484  * P1: m_startSurfacePoint
485  * P2: m_endSurfacePoint
486  */
487 
488  bool success = true;
489  Camera *cam = cubeViewport()->cube()->camera();
490  success = cam->SetImage(m_startSamp, m_startLine);
491 
492  // Vector is in meters
493  QVector3D sunDirection;
494 
495  if (success) {
497  double sunPosition[3];
498  cam->sunPosition(sunPosition);
499 
500  Distance targetRadii[3];
501  cam->radii(targetRadii);
502 
503  double origin[3] = {0.0, 0.0, 0.0};
504  SpiceBoolean surfptSuccess;
505  // Vector is in kilometers
506  double naifVectorFromSunToP1[3] = {0.0, 0.0, 0.0};
507 
508  surfpt_c(origin, sunPosition, targetRadii[0].kilometers(),
509  targetRadii[1].kilometers(), targetRadii[2].kilometers(),
510  naifVectorFromSunToP1, &surfptSuccess);
511  success = surfptSuccess;
512 
513  if (success) {
514  sunDirection = QVector3D(
515  naifVectorFromSunToP1[0] * 1000.0,
516  naifVectorFromSunToP1[1] * 1000.0,
517  naifVectorFromSunToP1[2] * 1000.0).normalized();
518  }
519  }
520 
521  if (success) {
522  success = cam->SetImage(m_endSamp, m_endLine);
523  }
524 
525  if (success) {
527 
529  Angle theta = Angle(90.0, Angle::Degrees) - *m_incidenceAngle;
530 
531  Displacement deltaX = m_startSurfacePoint->GetX() - m_endSurfacePoint->GetX();
532 
533  Displacement deltaY = m_startSurfacePoint->GetY() - m_endSurfacePoint->GetY();
534 
535  Displacement deltaZ = m_startSurfacePoint->GetZ() - m_endSurfacePoint->GetZ();
536 
537  *m_shadowLength = Distance(sqrt( deltaX.meters() * deltaX.meters() +
538  deltaY.meters() * deltaY.meters() +
539  deltaZ.meters() * deltaZ.meters() ),
541 
542  *m_shadowHeight = Distance(m_shadowLength->meters() * tan( theta.radians() ),
544  }
545  }
546  }
547  catch (IException &) {
548  reinitialize();
549  }
550 
552  }
553 
554 
557  if (m_shadowHeight->isValid()) {
558  Distance::Units displayUnits =
559  (Distance::Units)m_unitsComboBox->itemData(
560  m_unitsComboBox->currentIndex()).toInt();
561 
562  switch (displayUnits) {
563  case Distance::Meters:
564  m_shadowHeightLineEdit->setText(
566  break;
568  m_shadowHeightLineEdit->setText(
570  break;
572  case Distance::Pixels:
573  m_shadowHeightLineEdit->setText("Not Supported");
574  break;
575  }
576 
577  }
578  else {
579  m_shadowHeightLineEdit->setText("");
580  }
581  }
582 
583 
589  MdiCubeViewport *activeViewport = cubeViewport();
590 
591  bool hasCamera = true;
592  try {
593  hasCamera = activeViewport &&
594  (activeViewport->cube()->camera() != NULL);
595  }
596  catch (IException &) {
597  hasCamera = false;
598  }
599 
600  m_shadowHeightLineEdit->setEnabled(hasCamera);
601  m_unitsComboBox->setEnabled(hasCamera);
602  m_enabled = hasCamera;
603 
605  }
606 
607 }
608 
Isis::Distance::kilometers
double kilometers() const
Get the distance in kilometers.
Definition: Distance.cpp:106
Isis::Spice::radii
void radii(Distance r[3]) const
Returns the radii of the body in km.
Definition: Spice.cpp:930
Isis::Angle::Degrees
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Definition: Angle.h:56
Isis::SunShadowTool::SunShadowTool
SunShadowTool(QWidget *parent)
Construct a sun shadow tool.
Definition: SunShadowTool.cpp:35
Isis::SunShadowTool::m_shadowHeightLineEdit
QLineEdit * m_shadowHeightLineEdit
This displays the currently calculated height of the measured shadow.
Definition: SunShadowTool.h:70
Isis::Spice::sunPosition
virtual void sunPosition(double p[3]) const
Fills the input vector with sun position information, in either body-fixed or J2000 reference frame a...
Definition: Spice.cpp:902
Isis::SunShadowTool::StartLonIndex
@ StartLonIndex
Start lon table column index.
Definition: SunShadowTool.h:83
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
Isis::TableMainWindow::table
QTableWidget * table() const
Returns the table.
Definition: TableMainWindow.h:70
Isis::SunShadowTool::updateShadowHeightEdit
void updateShadowHeightEdit()
Change the value in the distance edit to match the units.
Definition: SunShadowTool.cpp:556
Isis::SunShadowTool::EndLatIndex
@ EndLatIndex
End lat table column index.
Definition: SunShadowTool.h:85
Isis::SunShadowTool::mouseButtonPress
virtual void mouseButtonPress(QPoint p, Qt::MouseButton s)
When the mouse left button is pressed we start tracking.
Definition: SunShadowTool.cpp:269
Isis::SunShadowTool::m_unitsComboBox
QComboBox * m_unitsComboBox
User can choose the height line edit's units (M or KM)
Definition: SunShadowTool.h:72
Isis::Distance::Pixels
@ Pixels
The distance is being specified in pixels.
Definition: Distance.h:47
Isis::SunShadowTool::m_drawInSunDirection
QCheckBox * m_drawInSunDirection
Check box to enable/disable confining tracking to sun direction.
Definition: SunShadowTool.h:74
Isis::Camera::SetImage
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
Definition: Camera.cpp:154
Isis::FileName::name
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
Isis::SunShadowTool::recalculateShadowHeight
void recalculateShadowHeight()
Try to calculate the shadow height.
Definition: SunShadowTool.cpp:452
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::SunShadowTool::m_path
QString m_path
Current cube file path.
Definition: SunShadowTool.h:137
QMenu
Isis::SunShadowTool::m_shadowHeight
Distance * m_shadowHeight
Calculated shadow height.
Definition: SunShadowTool.h:132
Isis::Tool::toolIconDir
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:113
Isis::SunShadowTool::addRow
void addRow()
Add a results row to the table.
Definition: SunShadowTool.cpp:436
Isis::SunShadowTool::EndLineIndex
@ EndLineIndex
End cube line table column index.
Definition: SunShadowTool.h:95
Isis::SunShadowTool::m_incidenceAngle
Angle * m_incidenceAngle
Incidence angle from the normal at the end point.
Definition: SunShadowTool.h:129
Isis::SunShadowTool::PathIndex
@ PathIndex
Cube file path table column index.
Definition: SunShadowTool.h:109
Isis::SunShadowTool::addTo
void addTo(QMenu *menu)
Adds the measure action to the given menu.
Definition: SunShadowTool.cpp:174
Isis::SunShadowTool::m_startSamp
double m_startSamp
Start sample of the measurement.
Definition: SunShadowTool.h:115
Isis::SunShadowTool::m_tableWin
TableMainWindow * m_tableWin
Table window for displaying all of the table information.
Definition: SunShadowTool.h:142
Isis::SurfacePoint::GetLatitude
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
Definition: SurfacePoint.cpp:1665
Isis::SunShadowTool::reinitialize
void reinitialize()
Clear all calculated values and then re-calculate them.
Definition: SunShadowTool.cpp:417
Isis::SunShadowTool::m_trackingAngle
Angle * m_trackingAngle
The angle that we want mouse tracking to be in.
Definition: SunShadowTool.h:151
Isis::Distance::Units
Units
This is a list of available units to access and store Distances in.
Definition: Distance.h:41
Isis::Distance::SolarRadii
@ SolarRadii
"Solar radius is a unit of distance used to express the size of stars in astronomy equal to the curre...
Definition: Distance.h:59
Isis::Sensor::GetSurfacePoint
SurfacePoint GetSurfacePoint() const
Returns the surface point (most efficient accessor).
Definition: Sensor.cpp:255
Isis::Camera
Definition: Camera.h:236
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::SunShadowTool::m_endLine
double m_endLine
End line of the measurement.
Definition: SunShadowTool.h:124
QComboBox
Isis::TableMainWindow::addToTable
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.
Definition: TableMainWindow.cpp:208
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::SunShadowTool::mouseMove
virtual void mouseMove(QPoint p)
When the mouse moves, if we're tracking then we go ahead and update all of our calculated values for ...
Definition: SunShadowTool.cpp:212
Isis::TableMainWindow::setTrackListItems
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...
Definition: TableMainWindow.cpp:875
Isis::SunShadowTool::mouseButtonRelease
virtual void mouseButtonRelease(QPoint p, Qt::MouseButton s)
When the mouse left button is released we finish tracking.
Definition: SunShadowTool.cpp:301
Isis::Distance::Kilometers
@ Kilometers
The distance is being specified in kilometers.
Definition: Distance.h:45
Isis::SunShadowTool::m_endSamp
double m_endSamp
End sample of the measurement.
Definition: SunShadowTool.h:122
Isis::Displacement
Displacement is a signed length, usually in meters.
Definition: Displacement.h:31
Isis::SunShadowTool::ShadowHeightMIndex
@ ShadowHeightMIndex
Shadow height in meters table column index.
Definition: SunShadowTool.h:103
Isis::CubeViewport::cubeToViewport
void cubeToViewport(double sample, double line, int &x, int &y) const
Turns a cube into a viewport.
Definition: CubeViewport.cpp:852
Isis::Distance::Meters
@ Meters
The distance is being specified in meters.
Definition: Distance.h:43
Isis::SunShadowTool::createToolBarWidget
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget (button) that goes on the tool bar.
Definition: SunShadowTool.cpp:118
Isis::Displacement::meters
double meters() const
Get the displacement in meters.
Definition: Displacement.cpp:73
Isis::SunShadowTool::toolPadAction
QAction * toolPadAction(ToolPad *pad)
Create an action for activating this tool.
Definition: SunShadowTool.cpp:92
Isis::SunShadowTool::m_shadowLength
Distance * m_shadowLength
Calculated shadow length.
Definition: SunShadowTool.h:134
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
Isis::Distance::isValid
bool isValid() const
Test if this distance has been initialized or not.
Definition: Distance.cpp:192
Isis::TableMainWindow
a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks.
Definition: TableMainWindow.h:57
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::SunShadowTool::EndLonIndex
@ EndLonIndex
End lon table column index.
Definition: SunShadowTool.h:87
Isis::Angle
Defines an angle and provides unit conversions.
Definition: Angle.h:45
Isis::Sensor::IncidenceAngle
virtual double IncidenceAngle() const
Returns the incidence angle in degrees.
Definition: Sensor.cpp:335
Isis::SunShadowTool::updateTool
void updateTool()
This enables/disables this tool's functionality based on the active viewport's compatibility.
Definition: SunShadowTool.cpp:588
Isis::SurfacePoint::GetLongitude
Longitude GetLongitude() const
Return the body-fixed longitude for the surface point.
Definition: SurfacePoint.cpp:1685
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::ToolPad
Definition: ToolPad.h:14
Isis::Cube::camera
Camera * camera()
Return a camera associated with the cube.
Definition: Cube.cpp:1451
Isis::SunShadowTool::paintViewport
void paintViewport(MdiCubeViewport *vp, QPainter *painter)
Paint anything we need to on the viewport.
Definition: SunShadowTool.cpp:185
Isis::Angle::isValid
bool isValid() const
This indicates whether we have a legitimate angle stored or are in an unset, or invalid,...
Definition: Angle.cpp:95
Isis::TableMainWindow::setStatusMessage
void setStatusMessage(QString message)
sets the status message in the lower lefthand corner of the window.
Definition: TableMainWindow.cpp:191
Isis::SunShadowTool::ShadowLengthMIndex
@ ShadowLengthMIndex
Shadow length in meters table column index.
Definition: SunShadowTool.h:99
Isis::SunShadowTool::EndSampIndex
@ EndSampIndex
End cube sample table column index.
Definition: SunShadowTool.h:93
Isis::SunShadowTool::m_fileName
QString m_fileName
Current cube file name.
Definition: SunShadowTool.h:139
Isis::Distance::meters
double meters() const
Get the distance in meters.
Definition: Distance.cpp:85
Isis::Angle::degrees
double degrees() const
Get the angle in units of Degrees.
Definition: Angle.h:232
Isis::CubeViewport::viewportToCube
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
Definition: CubeViewport.cpp:815
Isis::SunShadowTool::StartLineIndex
@ StartLineIndex
Start cube line table column index.
Definition: SunShadowTool.h:91
Isis::SunShadowTool::IncidenceAngleDegreesIndex
@ IncidenceAngleDegreesIndex
Incidence angle in degrees table column index.
Definition: SunShadowTool.h:105
Isis::SunShadowTool::ShadowLengthKmIndex
@ ShadowLengthKmIndex
Shadow length in kilometers table column index.
Definition: SunShadowTool.h:97
Isis::SunShadowTool::m_tracking
bool m_tracking
True if currently tracking the user's mouse position and calculating values on every mouse move.
Definition: SunShadowTool.h:149
Isis::SunShadowTool::StartLatIndex
@ StartLatIndex
Start lat table column index.
Definition: SunShadowTool.h:81
QAction
Isis::CubeViewport::cube
Cube * cube() const
Definition: CubeViewport.h:338
Isis::SunShadowTool::StartSampIndex
@ StartSampIndex
Start cube sample table column index.
Definition: SunShadowTool.h:89
Isis::SunShadowTool::IncidenceAngleRadiansIndex
@ IncidenceAngleRadiansIndex
Incidence angle in radians table column index.
Definition: SunShadowTool.h:107
Isis::Camera::SunAzimuth
double SunAzimuth()
Returns the Sun Azimuth.
Definition: Camera.cpp:1920
Isis::SunShadowTool::m_enabled
bool m_enabled
True if this tool is enabled (capable of working). Requires a camera.
Definition: SunShadowTool.h:144
Isis::SunShadowTool::FileNameIndex
@ FileNameIndex
Cube file name table column index.
Definition: SunShadowTool.h:111
Isis::Tool::cubeViewport
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition: Tool.h:197
Isis::SurfacePoint
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:132
Isis::SunShadowTool::m_startSurfacePoint
SurfacePoint * m_startSurfacePoint
Start ground coordinate of the measurement.
Definition: SunShadowTool.h:119
Isis::SunShadowTool::m_endSurfacePoint
SurfacePoint * m_endSurfacePoint
End ground coordinate of the measurement.
Definition: SunShadowTool.h:126
Isis::SunShadowTool::ShadowHeightKmIndex
@ ShadowHeightKmIndex
Shadow height in kilometers table column index.
Definition: SunShadowTool.h:101
Isis::FileName::path
QString path() const
Returns the path of the file name.
Definition: FileName.cpp:103
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::SunShadowTool::m_startLine
double m_startLine
Start line of the measurement.
Definition: SunShadowTool.h:117
Isis::SunShadowTool::updateRow
void updateRow(int row)
This method updates the row in the table window with the current measure information.
Definition: SunShadowTool.cpp:318
Isis::Angle::radians
double radians() const
Convert an angle to a double.
Definition: Angle.h:226