Isis 3 Programmer Reference
MeasureTool.cpp
1 #include "IsisDebug.h"
2 #include "MeasureTool.h"
3 
4 #include <QApplication>
5 #include <QCheckBox>
6 #include <QFileDialog>
7 #include <QHBoxLayout>
8 #include <QLineEdit>
9 #include <QMenu>
10 #include <QMenuBar>
11 #include <QMessageBox>
12 #include <QStackedWidget>
13 #include <QStatusBar>
14 #include <QTableWidget>
15 #include <QToolButton>
16 
17 #include <geos/geom/Geometry.h>
18 #include <geos/geom/Point.h>
19 
20 #include "Camera.h"
21 #include "Distance.h"
22 #include "FileName.h"
23 #include "Latitude.h"
24 #include "Longitude.h"
25 #include "MdiCubeViewport.h"
26 #include "Projection.h"
27 #include "RingPlaneProjection.h"
28 #include "TProjection.h"
29 #include "SurfacePoint.h"
30 #include "ToolPad.h"
31 #include "Constants.h"
32 
33 namespace Isis {
40  MeasureTool::MeasureTool(QWidget *parent) : Tool(parent) {
41  m_rubberBand = NULL;
42  m_tableWin = new TableMainWindow("Measurements", parent);
44 
45  // Create the action for showing the table
46  m_action = new QAction(parent);
47  m_action->setText("Measuring ...");
48 
49  connect(m_action, SIGNAL(triggered()), m_tableWin, SLOT(showTable()));
50  connect(m_action, SIGNAL(triggered()), m_tableWin, SLOT(raise()));
51  connect(m_action, SIGNAL(triggered()), m_tableWin, SLOT(syncColumns()));
52  //m_tableWin->installEventFilter(this);
53 
54  m_tableWin->addToTable(false, "Feature\nName", "Feature Name");
55  m_tableWin->addToTable(false, "Feature\nType", "Feature Type");
56  m_tableWin->addToTable(true,
57  "Start\nLatitude:Start\nLongitude:End\nLatitude:End\nLongitude",
58  "Ground Range", -1, Qt::Horizontal, "Start Latitude/Longitude to End Latitude/Longitude");
59  m_tableWin->addToTable(false, "Start\nSample:Start\nLine:End\nSample:End\nLine",
60  "Pixel Range", -1, Qt::Horizontal, "Start Sample/Line to End Sample/Line");
61  m_tableWin->addToTable(true, "Kilometer\nDistance", "Kilometer Distance");
62  m_tableWin->addToTable(false, "Meter\nDistance", "Meter Distance");
63  m_tableWin->addToTable(false, "Pixel\nDistance", "Pixel Distance");
64  m_tableWin->addToTable(false, "Degree\nAngle", "Degree Angle");
65  m_tableWin->addToTable(false, "Radian\nAngle", "Radian Angle");
66  m_tableWin->addToTable(false, "Kilometer\nArea", "Kilometer Area");
67  m_tableWin->addToTable(false, "Meter\nArea", "Meter Area");
68  m_tableWin->addToTable(false, "Pixel\nArea", "Pixel Area");
69  m_tableWin->addToTable(false, "Planar \nDistance", "Planar Kilometer Distance");
70  m_tableWin->addToTable(false, "Segments Sum\nkm", "Segments Sum", -1, Qt::Horizontal, "Sum of Segment lengths in kilometers");
71  m_tableWin->addToTable(false, "Segment Number", "Segment Number", -1, Qt::Horizontal, "Segment number of a segmented line");
72  m_tableWin->addToTable(false, "Path", "Path");
73  m_tableWin->addToTable(false, "FileName", "FileName");
74  m_tableWin->addToTable(false, "Notes", "Notes");
75 
76  m_tableWin->setStatusMessage("Click, Drag, and Release to Measure a Line");
77 
78  addRow();
79  }
80 
81 
91  QAction *action = new QAction(toolpad);
92  action->setIcon(QPixmap(toolIconDir() + "/measure.png"));
93  action->setToolTip("Measure (M)");
94  action->setShortcut(Qt::Key_M);
95 
96  QString text =
97  "<b>Function:</b> Measure features in active viewport \
98  <p><b>Shortcut:</b> M</p> ";
99  action->setWhatsThis(text);
100 
101  return action;
102  }
103 
104 
113  QWidget *MeasureTool::createToolBarWidget(QStackedWidget *parent) {
114  QWidget *hbox = new QWidget(parent);
115  QToolButton *measureButton = new QToolButton(hbox);
116  measureButton->setText("Table");
117  measureButton->setToolTip("Record Measurement Data in Table");
118  QString text =
119  "<b>Function:</b> This button will bring up a table that will record the \
120  starting and ending points of the line, along with the distance between \
121  the two points on the image. To measure the distance between two points, \
122  click on the first point and releasing the mouse at the second point. \
123  <p><b>Shortcut:</b> CTRL+M</p>";
124  measureButton->setWhatsThis(text);
125  measureButton->setShortcut(Qt::CTRL + Qt::Key_M);
126  connect(measureButton, SIGNAL(clicked()), m_tableWin, SLOT(showTable()));
127  connect(measureButton, SIGNAL(clicked()), m_tableWin, SLOT(syncColumns()));
128  connect(measureButton, SIGNAL(clicked()), m_tableWin, SLOT(raise()));
129  measureButton->setEnabled(true);
130 
131  m_rubberBand = new RubberBandComboBox(this,
140  RubberBandComboBox::Line // default
141 
142  );
143 
144  m_distLineEdit = new QLineEdit(hbox);
145  m_distLineEdit->setText("");
146  m_distLineEdit->setMaxLength(12);
147  m_distLineEdit->setToolTip("Line Length");
148  QString text2 = "<b>Function: </b> Shows the length of the line drawn on \
149  the image.";
150  m_distLineEdit->setWhatsThis(text2);
151  m_distLineEdit->setReadOnly(true);
152 
153  m_showAllSegments = new QCheckBox(hbox);
154  m_showAllSegments->setText("Show All Segments");
155 
156  m_unitsComboBox = new QComboBox(hbox);
157  m_unitsComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
158 
159  miComboUnit = -1;
160 
162  connect(m_unitsComboBox, SIGNAL(activated(int)), this, SLOT(updateDistEdit()));
163  connect(rubberBandTool(), SIGNAL(modeChanged()), this, SLOT(updateUnitsCombo()));
164 
165  QHBoxLayout *layout = new QHBoxLayout(hbox);
166  layout->setMargin(0);
167  layout->addWidget(m_rubberBand);
168  layout->addWidget(m_distLineEdit);
169  layout->addWidget(m_unitsComboBox);
170  layout->addWidget(measureButton);
171  layout->addWidget(m_showAllSegments);
172  layout->addStretch(1);
173  hbox->setLayout(layout);
174  return hbox;
175  }
176 
177 
183  // get the previous index if not initializing
184  if (miComboUnit >= 0) {
185  miComboUnit = m_unitsComboBox->currentIndex();
186  }
187 
188  m_unitsComboBox->clear();
189  m_showAllSegments->setEnabled(false);
190 
191  if (rubberBandTool()->currentMode() == RubberBandTool::LineMode) {
192  m_unitsComboBox->addItem("km");
193  m_unitsComboBox->addItem("m");
194  m_unitsComboBox->addItem("pixels");
195  m_unitsComboBox->addItem("planar km");
196 
197  if (miComboUnit < 0 || miComboUnit > 3) { // default && error checking
198  miComboUnit = 2;
199  }
200  }
201  else if (rubberBandTool()->currentMode() == RubberBandTool::SegmentedLineMode) {
202 
203  if (rubberBandTool()->currentMode() == RubberBandTool::SegmentedLineMode) {
204  m_showAllSegments->setEnabled(true);
205  }
206 
207  m_unitsComboBox->addItem("km");
208  m_unitsComboBox->addItem("m");
209  m_unitsComboBox->addItem("pixels");
210  if (miComboUnit < 0 || miComboUnit > 2) { // default && error checking
211  miComboUnit = 2;
212  }
213  }
214  else if (rubberBandTool()->currentMode() == RubberBandTool::AngleMode) {
215  m_unitsComboBox->addItem("degrees");
216  m_unitsComboBox->addItem("radians");
217  if (miComboUnit > 1 || miComboUnit < 0) { // default && error checking
218  miComboUnit = 0;
219  }
220  }
221  else {
222  m_unitsComboBox->addItem("km^2");
223  m_unitsComboBox->addItem("m^2");
224  m_unitsComboBox->addItem("pix^2");
225  if (miComboUnit < 0 || miComboUnit > 2) { // default && error checking
226  miComboUnit = 2;
227  }
228  }
229 
230  m_unitsComboBox->setCurrentIndex(miComboUnit);
231  }
232 
233 
240  void MeasureTool::addTo(QMenu *menu) {
241  menu->addAction(m_action);
242  }
243 
244 
250  MdiCubeViewport *cvp = cubeViewport();
251  MdiCubeViewport *d;
252  m_numLinked = 0;
253 
254  int currentRow = m_tableWin->currentRow();
255 
256  while (currentRow >= m_tableWin->table()->rowCount()) {
257  addRow();
258  }
259 
260  if (cvp == NULL) {
262  }
263  else {
264  updateDist(cvp, currentRow);
265  m_tableWin->table()->selectRow(currentRow);
266 
267  if (cvp->isLinked()) {
268  for (int i = 0; i < (int)cubeViewportList()->size(); i++) {
269  d = (*(cubeViewportList()))[i];
270 
271  if (d->isLinked() && d != cvp) {
272  m_numLinked++;
273 
274  if (currentRow + m_numLinked >= m_tableWin->table()->rowCount()) {
275  addRow();
276  }
277 
278  updateDist(d, currentRow + m_numLinked);
279  }
280  }
281  }
282  }
283  }
284 
285 
291  updateMeasure();
292 
293  if (rubberBandTool()->currentMode() != RubberBandTool::AngleMode && m_unitsComboBox->currentIndex() != 2) {
294  if (cubeViewport()->camera() == NULL && cubeViewport()->projection() == NULL) {
295  QMessageBox::information((QWidget *)parent(), "Error",
296  "File must have a Camera Model or Projection to measure in km or m");
297  return;
298  }
299  }
300 
301  if (!m_tableWin->table()->isVisible()) return;
302  if (m_tableWin->table()->item(m_tableWin->currentRow(), StartLineIndex)->text() == "N/A" &&
303  m_tableWin->table()->item(m_tableWin->currentRow(), AngleDegIndex)->text() == "N/A" &&
304  m_tableWin->table()->item(m_tableWin->currentRow(), AreaPixIndex)->text() == "N/A") return;
305 
306  addRow();
307  m_tableWin->setCurrentRow(m_tableWin->table()->rowCount() - 1);
308 
309  QApplication::sendPostedEvents(m_tableWin->table(), 0);
310  }
311 
312 
318  //m_tableWin->clearRow(m_tableWin->currentRow());
319  }
320 
321 
327  if (m_rubberBand) {
328  m_rubberBand->reset();
329  rubberBandTool()->setDrawActiveViewportOnly(false);
330  }
331  }
332 
333 
341  void MeasureTool::updateRow(int row) {
342  ASSERT(row < m_tableWin->table()->rowCount());
343 
344  if (row >= m_tableWin->table()->rowCount()) {
345  return;
346  }
347 
348  // Blank out the row to remove stuff left over from previous cvps
349  for (int c = 0; c < m_tableWin->table()->columnCount(); c++) {
350  m_tableWin->table()->item(row, c)->setText("");
351  }
352 
353  // Write all the new info to the current row
354  if (m_startLat != Null && m_startLon != Null) {
355  m_tableWin->table()->item(row, StartLatIndex)->setText(QString::number(m_startLat));
356  m_tableWin->table()->item(row, StartLonIndex)->setText(QString::number(m_startLon));
357  }
358  else {
359  m_tableWin->table()->item(row, StartLatIndex)->setText("N/A");
360  m_tableWin->table()->item(row, StartLonIndex)->setText("N/A");
361  }
362 
363  if (m_endLat != Null && m_endLon != Null) {
364  m_tableWin->table()->item(row, EndLatIndex)->setText(QString::number(m_endLat));
365  m_tableWin->table()->item(row, EndLonIndex)->setText(QString::number(m_endLon));
366  }
367  else {
368  m_tableWin->table()->item(row, EndLatIndex)->setText("N/A");
369  m_tableWin->table()->item(row, EndLonIndex)->setText("N/A");
370  }
371 
372  if (m_mDist != Null && m_kmDist != Null) {
373  m_tableWin->table()->item(row, DistanceMIndex)->setText(QString::number(m_mDist));
374  m_tableWin->table()->item(row, DistanceKmIndex)->setText(QString::number(m_kmDist));
375  }
376  else {
377  m_tableWin->table()->item(row, DistanceKmIndex)->setText("N/A");
378  m_tableWin->table()->item(row, DistanceMIndex)->setText("N/A");
379  }
380 
381  if (m_degAngle != Null && m_radAngle != Null) {
382  m_tableWin->table()->item(row, AngleDegIndex)->setText(QString::number(m_degAngle));
383  m_tableWin->table()->item(row, AngleRadIndex)->setText(QString::number(m_radAngle));
384  }
385  else {
386  m_tableWin->table()->item(row, AngleDegIndex)->setText("N/A");
387  m_tableWin->table()->item(row, AngleRadIndex)->setText("N/A");
388  }
389 
390  if (m_startSamp != Null && m_startLine != Null) {
391  m_tableWin->table()->item(row, StartSampIndex)->setText(QString::number(m_startSamp));
392  m_tableWin->table()->item(row, StartLineIndex)->setText(QString::number(m_startLine));
393  }
394  else {
395  m_tableWin->table()->item(row, StartSampIndex)->setText("N/A");
396  m_tableWin->table()->item(row, StartLineIndex)->setText("N/A");
397  }
398 
399  if (m_endSamp != Null && m_endLine != Null) {
400  m_tableWin->table()->item(row, EndSampIndex)->setText(QString::number(m_endSamp));
401  m_tableWin->table()->item(row, EndLineIndex)->setText(QString::number(m_endLine));
402  m_tableWin->table()->item(row, DistancePixIndex)->setText(QString::number(m_pixDist));
403  }
404  else {
405  m_tableWin->table()->item(row, EndSampIndex)->setText("N/A");
406  m_tableWin->table()->item(row, EndLineIndex)->setText("N/A");
407  m_tableWin->table()->item(row, DistancePixIndex)->setText("N/A");
408  }
409 
410  if (m_pixArea != Null) {
411  m_tableWin->table()->item(row, AreaPixIndex)->setText(QString::number(m_pixArea));
412  }
413  else {
414  m_tableWin->table()->item(row, AreaPixIndex)->setText("N/A");
415  }
416 
417  if (m_mArea != Null) {
418  m_tableWin->table()->item(row, AreaKmIndex)->setText(QString::number(m_kmArea));
419  m_tableWin->table()->item(row, AreaMIndex)->setText(QString::number(m_mArea));
420  }
421  else {
422  m_tableWin->table()->item(row, AreaKmIndex)->setText("N/A");
423  m_tableWin->table()->item(row, AreaMIndex)->setText("N/A");
424  }
425 
426  if (m_kmPlanarDist != Null) {
427  m_tableWin->table()->item(row, PlanarDistanceIndex)->setText(QString::number(m_kmPlanarDist));
428  }
429  else {
430  m_tableWin->table()->item(row, PlanarDistanceIndex)->setText("N/A");
431  }
432 
433  m_tableWin->table()->item(row, PathIndex)->setText(m_path);
434  m_tableWin->table()->item(row, FileNameIndex)->setText(m_fname);
435  }
436 
437 
438 
446  void MeasureTool::updateRows(int row) {
447  int requiredRows = m_distanceSegments.size() + row;
448  int rowDiff = (int)(requiredRows - m_tableWin->table()->rowCount());
449 
450  //Make sure we have all the necessary rows and items in each table cell.
451  if (requiredRows > m_tableWin->table()->rowCount()) {
452  for (int r = 0; r < rowDiff; r++) {
453  addRow();
454  }
455  }
456 
457  if (rubberBandTool()->currentMode() == RubberBandTool::SegmentedLineMode &&
458  m_distanceSegments.size() > 0) {
459  double distanceSum = 0;
460  for (int i = 0; i < m_distanceSegments.size(); i++) {
461  //write a new row for each segment...
462  if (m_startLatSegments[i] != Null && m_startLonSegments[i] != Null) {
463  m_tableWin->table()->item(row + i, StartLatIndex)->setText(QString::number(m_startLatSegments[i]));
464  m_tableWin->table()->item(row + i, StartLonIndex)->setText(QString::number(m_startLonSegments[i]));
465  }
466  else {
467  m_tableWin->table()->item(row + i, StartLatIndex)->setText("N/A");
468  m_tableWin->table()->item(row + i, StartLonIndex)->setText("N/A");
469  }
470 
471  if (m_endLatSegments[i] != Null && m_endLonSegments[i] != Null) {
472  m_tableWin->table()->item(row + i, EndLatIndex)->setText(QString::number(m_endLatSegments[i]));
473  m_tableWin->table()->item(row + i, EndLonIndex)->setText(QString::number(m_endLonSegments[i]));
474  }
475  else {
476  m_tableWin->table()->item(row + i, EndLatIndex)->setText("N/A");
477  m_tableWin->table()->item(row + i, EndLonIndex)->setText("N/A");
478  }
479 
480  if (m_startSampSegments[i] != Null && m_startLineSegments[i] != Null) {
481  m_tableWin->table()->item(row + i, StartSampIndex)->setText(QString::number(m_startSampSegments[i]));
482  m_tableWin->table()->item(row + i, StartLineIndex)->setText(QString::number(m_startLineSegments[i]));
483  }
484  else {
485  m_tableWin->table()->item(row + i, StartSampIndex)->setText("N/A");
486  m_tableWin->table()->item(row + i, StartLineIndex)->setText("N/A");
487  }
488 
489  if (m_endSampSegments[i] != Null && m_endLineSegments[i] != Null) {
490  m_tableWin->table()->item(row + i, EndSampIndex)->setText(QString::number(m_endSampSegments[i]));
491  m_tableWin->table()->item(row + i, EndLineIndex)->setText(QString::number(m_endLineSegments[i]));
492  }
493  else {
494  m_tableWin->table()->item(row + i, EndSampIndex)->setText("N/A");
495  m_tableWin->table()->item(row + i, EndLineIndex)->setText("N/A");
496  }
497 
498  if (m_pixDistSegments[i] != Null) {
499  m_tableWin->table()->item(row + i, DistancePixIndex)->setText(QString::number(m_pixDistSegments[i]));
500  }
501  else {
502  m_tableWin->table()->item(row + i, DistancePixIndex)->setText("N/A");
503  }
504 
505  if (m_distanceSegments[i] != Null) {
506  m_tableWin->table()->item(row + i, DistanceKmIndex)->setText(QString::number(m_distanceSegments[i]));
507  m_tableWin->table()->item(row + i, DistanceMIndex)->setText(QString::number(m_distanceSegments[i] * 1000.0));
508  }
509  else {
510  m_tableWin->table()->item(row + i, DistanceKmIndex)->setText("N/A");
511  m_tableWin->table()->item(row + i, DistanceMIndex)->setText("N/A");
512  }
513 
514  m_tableWin->table()->item(row + i, PathIndex)->setText(m_path);
515  m_tableWin->table()->item(row + i, FileNameIndex)->setText(m_fname);
516 
517  distanceSum = (Distance(distanceSum, Distance::Kilometers) +
518  Distance(m_distanceSegments[i], Distance::Kilometers)).kilometers();
519 
520  if (distanceSum != Null) {
521  m_tableWin->table()->item(row + i, SegmentsSumIndex)->setText(QString::number(distanceSum));
522  }
523  else {
524  m_tableWin->table()->item(row + i, SegmentsSumIndex)->setText("N/A");
525  }
526 
527  m_tableWin->table()->item(row + i, SegmentNumberIndex)->setText(QString::number(i + 1));
528  }
529  }
530  }
531 
538  // Initialize the class data
539  m_startSamp = Null;
540  m_endSamp = Null;
541  m_startLine = Null;
542  m_endLine = Null;
543  m_kmDist = Null;
544  m_mDist = Null;
545  m_pixDist = Null;
546  m_startLon = Null;
547  m_startLat = Null;
548  m_endLon = Null;
549  m_endLat = Null;
550  m_radAngle = Null;
551  m_degAngle = Null;
552  m_pixArea = Null;
553  m_kmArea = Null;
554  m_mArea = Null;
556  }
557 
558 
559  void MeasureTool::addRow() {
560  int newRowPos = m_tableWin->table()->rowCount();
561  m_tableWin->table()->insertRow(newRowPos);
562  for (int c = 0; c < m_tableWin->table()->columnCount(); c++) {
563  QTableWidgetItem *item = new QTableWidgetItem("");
564  m_tableWin->table()->setItem(newRowPos, c, item);
565  }
566  m_tableWin->table()->scrollToItem(m_tableWin->table()->item(newRowPos, 0),
567  QAbstractItemView::PositionAtBottom);
568  }
569 
570 
581  // Initialize class data
582  initData();
583 
584  // Write out col 8 (the file name)
586  cvp->cube()->fileName()).expanded();
587  m_path = fname.path();
588  m_fname = fname.name();
589 
590  m_pixDist = Null;
591  m_mDist = Null;
592  m_kmDist = Null;
593 
594  // reset the distnace gui
595  m_distLineEdit->setText("");
596 
597  if (rubberBandTool()->currentMode() == RubberBandTool::LineMode ||
598  rubberBandTool()->currentMode() == RubberBandTool::SegmentedLineMode) {
599  m_distanceSegments.clear();
600  m_pixDistSegments.clear();
601  m_startSampSegments.clear();
602  m_endSampSegments.clear();
603  m_startLineSegments.clear();
604  m_endLineSegments.clear();
605  m_startLatSegments.clear();
606  m_endLatSegments.clear();
607  m_startLonSegments.clear();
608  m_endLonSegments.clear();
609 
610  for (int startIndex = 0; startIndex < rubberBandTool()->vertices().size() - 1; startIndex++) {
611  QPoint start = rubberBandTool()->vertices()[startIndex];
612  QPoint end = rubberBandTool()->vertices()[startIndex + 1];
613 
614  setDistances(cvp, start, end);
615 
616  if (rubberBandTool()->currentMode() == RubberBandTool::SegmentedLineMode) {
617  if (m_distanceSegments.size() < 75) {
618  m_distanceSegments.append(m_kmDist);
619  m_pixDistSegments.append(m_pixDist);
620  m_startSampSegments.append(m_startSamp);
621  m_endSampSegments.append(m_endSamp);
622  m_startLineSegments.append(m_startLine);
623  m_endLineSegments.append(m_endLine);
624  m_startLatSegments.append(m_startLat);
625  m_endLatSegments.append(m_endLat);
626  m_startLonSegments.append(m_startLon);
627  m_endLonSegments.append(m_endLon);
628  }
629  }
630  }
631 
632  if (rubberBandTool()->currentMode() == RubberBandTool::SegmentedLineMode &&
633  m_pixDistSegments.size()) {
634  m_pixDist = m_pixDistSegments[0];
635  m_kmDist = m_distanceSegments[0];
637 
638  for (int i = 1; i < m_pixDistSegments.size(); i++) {
640  Distance(m_pixDistSegments[i], Distance::Pixels)).pixels();
641 
642  Distance thisDistance(m_distanceSegments[i], Distance::Kilometers);
644  thisDistance).kilometers();
646  thisDistance).meters();
647  }
648  }
649  }
650  else if (rubberBandTool()->currentMode() == RubberBandTool::AngleMode) {
651  m_radAngle = rubberBandTool()->angle().radians();
652  m_degAngle = rubberBandTool()->angle().degrees();
653  }
654  else {
655  geos::geom::Geometry *polygon = rubberBandTool()->geometry();
656  if (polygon != NULL) {
657  // pix area = screenpix^2 / scale^2
658  m_pixArea = polygon->getArea() / pow(cvp->scale(), 2);
659  geos::geom::Point *center = polygon->getCentroid();
660  double line, sample;
661  cvp->viewportToCube((int)center->getX(), (int)center->getY(), sample, line);
662 
663  if (cvp->camera() != NULL) {
664  cvp->camera()->SetImage(sample, line);
665  // pix^2 * (m/pix)^2 = m^2
666  m_mArea = m_pixArea * pow(cvp->camera()->PixelResolution(), 2);
667  // m^2 * (km/m)^2 = km^2
668  m_kmArea = m_mArea * pow(1 / 1000.0, 2);
669  }
670 
671  if (cvp->projection() != NULL) {
672  cvp->projection()->SetWorld(sample, line);
673  // pix^2 * (m/pix)^2 = m^2
674  m_mArea = m_pixArea * pow(cvp->projection()->Resolution(), 2);
675  // m^2 * (km/m)^2 = km^2
676  m_kmArea = m_mArea * pow(1 / 1000.0, 2);
677  }
678  }
679 
680  if (rubberBandTool()->currentMode() == RubberBandTool::RectangleMode) {
681  setDistances(cvp, rubberBandTool()->vertices()[0],
682  rubberBandTool()->vertices()[2]);
683  }
684  }
685 
686  updateDistEdit();
687 
688  if (m_showAllSegments->isChecked() &&
689  rubberBandTool()->currentMode() == RubberBandTool::SegmentedLineMode) {
690  updateRows(row);
691  }
692  else {
693  updateRow(row);
694  }
695  }
696 
697 
698  void MeasureTool::setDistances(MdiCubeViewport *cvp, QPoint lineStart,
699  QPoint lineEnd) {
700  // Convert rubber band line to cube coordinates
701  cvp->viewportToCube(lineStart.x(), lineStart.y(), m_startSamp, m_startLine);
702  cvp->viewportToCube(lineEnd.x(), lineEnd.y(), m_endSamp, m_endLine);
703 
704  m_mDist = Null;
705  m_kmDist = Null;
707  double radius = Null;
708  TProjection *tproj = NULL;
709  RingPlaneProjection *rproj = NULL;
711 
712  // Get set for dealing with projection types
713  if (cvp->projection() != NULL) projType = cvp->projection()->projectionType();
714 
715  // Don't write anything if we are outside the cube
716  if ((m_startSamp >= 0.5) && (m_endSamp >= 0.5) &&
717  (m_startLine >= 0.5) && (m_endLine >= 0.5) &&
718  (m_startSamp <= cvp->cubeSamples() + 0.5) &&
719  (m_endSamp <= cvp->cubeSamples() + 0.5) &&
720  (m_startLine <= cvp->cubeLines() + 0.5) &&
721  (m_endLine <= cvp->cubeLines() + 0.5)) {
722  // Check if the image is projected (Projected Images also have camera
723  // except for mosaics)
724  if (cvp->projection() != NULL) {
725  if (cvp->projection()->SetWorld(m_startSamp, m_startLine)) {
726  // If our projection is sky, the lat & lons are switched
727  if (cvp->projection()->IsSky()) {
728 
729  tproj = (TProjection *) cvp->projection();
730  m_startLat = tproj->UniversalLatitude();
731  m_startLon = tproj->UniversalLongitude();
732  }
733  else if (projType == Projection::Triaxial) {
734  tproj = (TProjection *) cvp->projection();
735  m_startLat = tproj->UniversalLatitude();
736  m_startLon = tproj->UniversalLongitude();
737  }
738  else { // RingPlaneProjection
739  rproj = (RingPlaneProjection *) cvp->projection();
740  m_startLat = rproj->UniversalRingRadius();
742  }
743 
744  if (cvp->projection()->SetWorld(m_endSamp, m_endLine)) {
745  // If our projection is sky, the lat & lons are switched
746  if (cvp->projection()->IsSky()) {
747  m_endLat = tproj->UniversalLatitude();
748  m_endLon = tproj->UniversalLongitude();
749  }
750  else if (projType == Projection::Triaxial) {
751  m_endLat = tproj->UniversalLatitude();
752  m_endLon = tproj->UniversalLongitude();
753  } // RingPlaneProjection
754  else {
755  m_endLat = rproj->UniversalRingRadius();
756  m_endLon = rproj->UniversalRingLongitude();
757  }
758  }
759 
760  // Calculate and write out the distance between the two points
761  if (projType != Projection::RingPlane) {
762  radius = tproj->LocalRadius();
763  }
764  else {
765  radius = rproj->RingRadius();
766  }
767  }
768  }
769  // Do we have a camera model?
770  else if (cvp->camera() != NULL &&
772  // Write columns 2-3 (Start lat/lon)
773  m_startLat = cvp->camera()->UniversalLatitude();
775 
776  if (cvp->camera()->SetImage(m_endSamp, m_endLine)) {
777  // Write columns 4-5 (End lat/lon)
778  m_endLat = cvp->camera()->UniversalLatitude();
779  m_endLon = cvp->camera()->UniversalLongitude();
780 
781  radius = cvp->camera()->LocalRadius().meters();
782  }
783  }
784  }
785 
786  // Calculate the pixel difference
787  double lineDif = m_startLine - m_endLine;
788  double sampDif = m_startSamp - m_endSamp;
789  double pixDist = sqrt(lineDif * lineDif + sampDif * sampDif);
790  m_pixDist = pixDist;
791 
792  Latitude startLat(m_startLat, Angle::Degrees);
793  Longitude startLon(m_startLon, Angle::Degrees);
794  Latitude endLat(m_endLat, Angle::Degrees);
795  Longitude endLon(m_endLon, Angle::Degrees);
796  Distance radiusDist(radius, Distance::Meters);
797 
798  SurfacePoint startPoint;
799  SurfacePoint endPoint;
800 
801  if (startLat.isValid() && startLon.isValid() &&
802  endLat.isValid() && endLon.isValid() && radiusDist.isValid()) {
803  startPoint = SurfacePoint(startLat, startLon, radiusDist);
804  endPoint = SurfacePoint(endLat, endLon, radiusDist);
805  }
806 
807  Distance distance = startPoint.GetDistanceToPoint(endPoint, radiusDist);
808 
809  m_mDist = distance.meters();
810  m_kmDist = distance.kilometers();
811 
812  if (cvp->camera() != NULL) {
813 
814  // Make sure start line or end line setimage succeeds, otherwise fail.
815  bool statusStart = cvp->camera()->SetImage(m_startSamp, m_startLine);
816  double slantDist = 0;
817  if (statusStart) {
818  slantDist = cvp->camera()->SlantDistance();
819  }
820 
821  double ra1 = cvp->camera()->RightAscension() * DEG2RAD;
822  double dec1 = cvp->camera()->Declination()* DEG2RAD;
823 
824  bool statusEnd = cvp->camera()->SetImage(m_endSamp, m_endLine);
825  if ((!statusStart)&&statusEnd) {
826  slantDist = cvp->camera()->SlantDistance();
827  }
828 
829  // Cannot calculate a planar distance with no point on the target.
830  if (!(statusStart||statusEnd)) {
831  return;
832  }
833 
834  double ra2 = cvp->camera()->RightAscension() * DEG2RAD;
835  double dec2 = cvp->camera()->Declination()* DEG2RAD;
836 
837  double dRA = (ra1 - ra2);
838 
839  double angle = acos(sin(dec1)*sin(dec2) + cos(dec1)*cos(dec2)*cos(dRA));
840  double half_angle = angle/2.0;
841  double length = slantDist * sin(half_angle) * 2.0;
842 
843  m_kmPlanarDist = length;
844  }
845  }
846 
847 
850  if (rubberBandTool()->currentMode() == RubberBandTool::LineMode ||
851  rubberBandTool()->currentMode() == RubberBandTool::SegmentedLineMode) {
852  if (m_unitsComboBox->currentIndex() == 0) {
853  if (m_kmDist == Null) {
854  m_distLineEdit->setText("N/A");
855  }
856  else {
857  m_distLineEdit->setText(QString::number(m_kmDist));
858  }
859  }
860  else if (m_unitsComboBox->currentIndex() == 1) {
861  if (m_mDist == Null) {
862  m_distLineEdit->setText("N/A");
863  }
864  else {
865  m_distLineEdit->setText(QString::number(m_mDist));
866  }
867  }
868  else if (m_unitsComboBox->currentIndex() == 3) {
869  if (m_kmPlanarDist == Null) {
870  m_distLineEdit->setText("N/A");
871  }
872  else {
873  m_distLineEdit->setText(QString::number(m_kmPlanarDist));
874  }
875  }
876  else {
877  m_distLineEdit->setText(QString::number(m_pixDist));
878  }
879  }
880  else if (rubberBandTool()->currentMode() == RubberBandTool::AngleMode) {
881  if (m_unitsComboBox->currentIndex() == 0) {
882  m_distLineEdit->setText(QString::number(m_degAngle));
883  }
884  else {
885  m_distLineEdit->setText(QString::number(m_radAngle));
886  }
887  }
888  else {
889  if (m_unitsComboBox->currentIndex() == 0) {
890  if (m_kmArea == Null) {
891  m_distLineEdit->setText("N/A");
892  }
893  else {
894  m_distLineEdit->setText(QString::number(m_kmArea));
895  }
896  }
897  else if (m_unitsComboBox->currentIndex() == 1) {
898  if (m_mArea == Null) {
899  m_distLineEdit->setText("N/A");
900  }
901  else {
902  m_distLineEdit->setText(QString::number(m_mArea));
903  }
904  }
905  else {
906  if (m_pixArea != Null) {
907  m_distLineEdit->setText(QString::number(m_pixArea));
908  }
909  else {
910  m_distLineEdit->setText("N/A");
911  }
912  }
913  }
914  }
915 
916 
924  // cvp->repaint();
925  cvp->update();
926  }
927 
928 
934  m_distLineEdit->clear();
935  }
936 
937 }
938 
Isis::MeasureTool::StartLatIndex
@ StartLatIndex
Starting latitude index.
Definition: MeasureTool.h:126
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::MeasureTool::m_pixDist
double m_pixDist
distance in pixels
Definition: MeasureTool.h:159
Isis::TProjection::LocalRadius
double LocalRadius(double lat) const
This method returns the local radius in meters at the specified latitude position.
Definition: TProjection.cpp:326
Isis::MeasureTool::m_degAngle
double m_degAngle
angle in degrees
Definition: MeasureTool.h:161
Isis::MeasureTool::m_startLat
double m_startLat
starting latitude
Definition: MeasureTool.h:153
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
Isis::MeasureTool::AreaMIndex
@ AreaMIndex
Area in meters index.
Definition: MeasureTool.h:140
Isis::RubberBandComboBox
Combo box for choosing a rubber band type.
Definition: RubberBandComboBox.h:26
Isis::MeasureTool::removeConnections
void removeConnections(MdiCubeViewport *cvp)
Removes the connection on the given cube viewport.
Definition: MeasureTool.cpp:923
Isis::MeasureTool::m_startLine
double m_startLine
starting line
Definition: MeasureTool.h:151
Isis::MeasureTool::StartLineIndex
@ StartLineIndex
Starting line index.
Definition: MeasureTool.h:131
Isis::MeasureTool::m_mArea
double m_mArea
area in meters
Definition: MeasureTool.h:163
Isis::RingPlaneProjection::UniversalRingLongitude
double UniversalRingLongitude()
This returns a universal ring longitude (clockwise in 0 to 360 domain).
Definition: RingPlaneProjection.cpp:589
Isis::TableMainWindow::table
QTableWidget * table() const
Returns the table.
Definition: TableMainWindow.h:70
Isis::RubberBandTool::setDrawActiveViewportOnly
void setDrawActiveViewportOnly(bool activeOnly=false)
This called to set whether rubber band is drawn on active viewport only rather than all linked viewpo...
Definition: RubberBandTool.cpp:333
Isis::MeasureTool::updateRows
void updateRows(int row)
This method is called instead of updateRows if the 'Show All Segment' checkbox is checked.
Definition: MeasureTool.cpp:446
Isis::Projection::Resolution
double Resolution() const
This method returns the resolution for mapping world coordinates into projection coordinates.
Definition: Projection.cpp:675
Isis::MeasureTool::enableRubberBandTool
void enableRubberBandTool()
Enables/resets the rubberband tool.
Definition: MeasureTool.cpp:326
Isis::MeasureTool::StartSampIndex
@ StartSampIndex
Starting sample index.
Definition: MeasureTool.h:130
Isis::Distance::Pixels
@ Pixels
The distance is being specified in pixels.
Definition: Distance.h:47
Isis::TProjection::UniversalLatitude
virtual double UniversalLatitude()
This returns a universal latitude (planetocentric).
Definition: TProjection.cpp:908
Isis::RubberBandComboBox::SegmentedLine
@ SegmentedLine
Segmented Line.
Definition: RubberBandComboBox.h:43
Isis::Tool::cubeViewportList
CubeViewportList * cubeViewportList() const
Return the list of cubeviewports.
Definition: Tool.cpp:390
Isis::RubberBandComboBox::Circle
@ Circle
Circle.
Definition: RubberBandComboBox.h:37
Isis::MeasureTool::m_distLineEdit
QLineEdit * m_distLineEdit
Distance line edit.
Definition: MeasureTool.h:89
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::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::DEG2RAD
const double DEG2RAD
Multiplier for converting from degrees to radians.
Definition: Constants.h:43
QMenu
Isis::Tool::toolIconDir
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:113
Isis::RubberBandComboBox::Polygon
@ Polygon
Polygon.
Definition: RubberBandComboBox.h:41
Isis::Sensor::Declination
virtual double Declination()
Returns the declination angle (sky latitude).
Definition: Sensor.cpp:574
Isis::MeasureTool::initData
void initData(void)
Initialize Class data.
Definition: MeasureTool.cpp:537
Isis::MeasureTool::m_kmPlanarDist
double m_kmPlanarDist
distance estimate used when at least one point is on the body (km)
Definition: MeasureTool.h:165
Isis::Projection::projectionType
ProjectionType projectionType() const
Returns an enum value for the projection type.
Definition: Projection.cpp:198
Isis::MeasureTool::AreaPixIndex
@ AreaPixIndex
Area in pixels index.
Definition: MeasureTool.h:141
Isis::RubberBandComboBox::Line
@ Line
Line.
Definition: RubberBandComboBox.h:42
Isis::MeasureTool::AreaKmIndex
@ AreaKmIndex
Area in kilometers index.
Definition: MeasureTool.h:139
Isis::MeasureTool::m_numLinked
int m_numLinked
number of linked viewports
Definition: MeasureTool.h:180
Isis::RubberBandComboBox::Rectangle
@ Rectangle
Rectangle.
Definition: RubberBandComboBox.h:39
Isis::MeasureTool::m_rubberBand
RubberBandComboBox * m_rubberBand
rubberband combo box
Definition: MeasureTool.h:185
Isis::MeasureTool::m_kmArea
double m_kmArea
area in kilometers
Definition: MeasureTool.h:162
Isis::MeasureTool::AngleRadIndex
@ AngleRadIndex
Angle in radians index.
Definition: MeasureTool.h:138
Isis::MeasureTool::m_endLon
double m_endLon
ending longitude
Definition: MeasureTool.h:156
Isis::MeasureTool::m_startLon
double m_startLon
starting longitude
Definition: MeasureTool.h:155
Isis::Sensor::RightAscension
virtual double RightAscension()
Returns the right ascension angle (sky longitude).
Definition: Sensor.cpp:561
Isis::MeasureTool::DistanceKmIndex
@ DistanceKmIndex
Distance in kilometers index.
Definition: MeasureTool.h:134
Isis::RubberBandComboBox::Angle
@ Angle
Angle.
Definition: RubberBandComboBox.h:44
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::CubeViewport::camera
Camera * camera() const
Definition: CubeViewport.h:348
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::MeasureTool::m_startSamp
double m_startSamp
starting sample
Definition: MeasureTool.h:149
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::MeasureTool::m_action
QAction * m_action
Measure tool's action.
Definition: MeasureTool.h:88
Isis::Distance::Kilometers
@ Kilometers
The distance is being specified in kilometers.
Definition: Distance.h:45
Isis::TableMainWindow::clearRow
void clearRow(int row)
This method clears the text of the given row.
Definition: TableMainWindow.cpp:452
Isis::MeasureTool::m_endLat
double m_endLat
ending latitude
Definition: MeasureTool.h:154
Isis::MeasureTool::rubberBandComplete
virtual void rubberBandComplete()
Called when the rubberBanding by the user is finished.
Definition: MeasureTool.cpp:290
Isis::MeasureTool::m_path
QString m_path
filename path
Definition: MeasureTool.h:181
Isis::Distance::Meters
@ Meters
The distance is being specified in meters.
Definition: Distance.h:43
Isis::MeasureTool::addTo
void addTo(QMenu *menu)
Adds the measure action to the given menu.
Definition: MeasureTool.cpp:240
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
Isis::RingPlaneProjection
Base class for Map Projections of plane shapes.
Definition: RingPlaneProjection.h:147
Isis::MeasureTool::AngleDegIndex
@ AngleDegIndex
Angle in degrees index.
Definition: MeasureTool.h:137
Isis::MeasureTool::MeasureTool
MeasureTool(QWidget *parent)
MeasureTool constructor.
Definition: MeasureTool.cpp:40
Isis::MeasureTool::DistanceMIndex
@ DistanceMIndex
Distance in meters index.
Definition: MeasureTool.h:135
Isis::Sensor::UniversalLongitude
virtual double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
Definition: Sensor.cpp:233
Isis::MeasureTool::updateUnitsCombo
void updateUnitsCombo()
Updates the units combo box.
Definition: MeasureTool.cpp:182
Isis::MeasureTool::createToolBarWidget
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget (button) that goes on the tool bar.
Definition: MeasureTool.cpp:113
Isis::MeasureTool::PathIndex
@ PathIndex
FileName path index.
Definition: MeasureTool.h:145
Isis::MeasureTool::updateDistEdit
void updateDistEdit()
Change the value in the distance edit to match the units.
Definition: MeasureTool.cpp:849
Isis::RubberBandComboBox::Ellipse
@ Ellipse
Ellipse.
Definition: RubberBandComboBox.h:38
Isis::RingPlaneProjection::RingRadius
double RingRadius() const
This returns a radius.
Definition: RingPlaneProjection.cpp:506
Isis::MeasureTool::updateTool
void updateTool()
Updates the measure tool.
Definition: MeasureTool.cpp:933
Isis::TProjection
Base class for Map TProjections.
Definition: TProjection.h:166
Isis::MeasureTool::m_fname
QString m_fname
filename
Definition: MeasureTool.h:182
Isis::MeasureTool::EndLineIndex
@ EndLineIndex
Ending line index.
Definition: MeasureTool.h:133
Isis::MeasureTool::EndLatIndex
@ EndLatIndex
Ending latitude index.
Definition: MeasureTool.h:128
Isis::MeasureTool::EndSampIndex
@ EndSampIndex
Ending sample index.
Definition: MeasureTool.h:132
Isis::MdiCubeViewport::isLinked
bool isLinked() const
Is the viewport linked with other viewports.
Definition: MdiCubeViewport.h:50
Isis::TableMainWindow::setCurrentRow
void setCurrentRow(int row)
Sets the current row to row.
Definition: TableMainWindow.cpp:896
Isis::Projection::RingPlane
@ RingPlane
These projections are used to map ring planes.
Definition: Projection.h:168
Isis::TableMainWindow
a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks.
Definition: TableMainWindow.h:57
Isis::Projection::SetWorld
virtual bool SetWorld(const double x, const double y)
This method is used to set a world coordinate.
Definition: Projection.cpp:497
Isis::MeasureTool::updateDist
void updateDist(MdiCubeViewport *cvp, int row)
This method updates the distance variables.
Definition: MeasureTool.cpp:580
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::MeasureTool::m_endLine
double m_endLine
ending line
Definition: MeasureTool.h:152
Isis::MeasureTool::m_kmDist
double m_kmDist
distance in kilometers
Definition: MeasureTool.h:157
Isis::MeasureTool::m_unitsComboBox
QComboBox * m_unitsComboBox
Units selection.
Definition: MeasureTool.h:90
Isis::MeasureTool::FileNameIndex
@ FileNameIndex
FileName index.
Definition: MeasureTool.h:146
Isis::ToolPad
Definition: ToolPad.h:14
Isis::RubberBandComboBox::reset
void reset()
Resets the selection.
Definition: RubberBandComboBox.cpp:226
Isis::MeasureTool::toolPadAction
QAction * toolPadAction(ToolPad *pad)
Add the measure tool action to the toolpad.
Definition: MeasureTool.cpp:90
Isis::MeasureTool::SegmentNumberIndex
@ SegmentNumberIndex
Segment number.
Definition: MeasureTool.h:144
Isis::RubberBandTool::geometry
geos::geom::Geometry * geometry()
Definition: RubberBandTool.cpp:823
Isis::Camera::PixelResolution
virtual double PixelResolution()
Returns the pixel resolution at the current position in meters/pixel.
Definition: Camera.cpp:670
Isis::TableMainWindow::setStatusMessage
void setStatusMessage(QString message)
sets the status message in the lower lefthand corner of the window.
Definition: TableMainWindow.cpp:191
Isis::MeasureTool::StartLonIndex
@ StartLonIndex
Starting longitude index.
Definition: MeasureTool.h:127
Isis::TProjection::UniversalLongitude
virtual double UniversalLongitude()
This returns a universal longitude (positive east in 0 to 360 domain).
Definition: TProjection.cpp:922
Isis::MeasureTool::SegmentsSumIndex
@ SegmentsSumIndex
Segment lengths in kilometers.
Definition: MeasureTool.h:143
Isis::Distance::meters
double meters() const
Get the distance in meters.
Definition: Distance.cpp:85
Isis::MeasureTool::m_tableWin
TableMainWindow * m_tableWin
table window
Definition: MeasureTool.h:184
Isis::Angle::degrees
double degrees() const
Get the angle in units of Degrees.
Definition: Angle.h:232
Isis::MeasureTool::EndLonIndex
@ EndLonIndex
Ending longitude index.
Definition: MeasureTool.h:129
Isis::CubeViewport::scale
double scale() const
Definition: CubeViewport.h:214
Isis::TableMainWindow::currentRow
int currentRow() const
Returns the current row.
Definition: TableMainWindow.h:114
Isis::Projection::Triaxial
@ Triaxial
These projections are used to map triaxial and irregular-shaped bodies.
Definition: Projection.h:166
Isis::RubberBandComboBox::RotatedRectangle
@ RotatedRectangle
RotatedRectangle.
Definition: RubberBandComboBox.h:40
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::MeasureTool::m_pixArea
double m_pixArea
area in pixels
Definition: MeasureTool.h:164
Isis::MeasureTool::mouseLeave
virtual void mouseLeave()
Mouse leave event.
Definition: MeasureTool.cpp:317
Isis::Projection::IsSky
bool IsSky() const
Returns true if projection is sky and false if it is land.
Definition: Projection.cpp:208
Isis::MeasureTool::DistancePixIndex
@ DistancePixIndex
Distance in pixels index.
Definition: MeasureTool.h:136
Isis::MeasureTool::m_mDist
double m_mDist
distance in meters
Definition: MeasureTool.h:158
Isis::MeasureTool::m_radAngle
double m_radAngle
angle in radians
Definition: MeasureTool.h:160
QAction
Isis::CubeViewport::cube
Cube * cube() const
Definition: CubeViewport.h:338
Isis::MeasureTool::updateMeasure
virtual void updateMeasure()
Updates the Measure specifications.
Definition: MeasureTool.cpp:249
Isis::Projection::ProjectionType
ProjectionType
This enum defines the subclasses of Projection supported in Isis.
Definition: Projection.h:166
Isis::MeasureTool::updateRow
void updateRow(int row)
This method updates the row in the table window with the current measure information.
Definition: MeasureTool.cpp:341
Isis::Tool::cubeViewport
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition: Tool.h:197
Isis::FileName::path
QString path() const
Returns the path of the file name.
Definition: FileName.cpp:103
Isis::MeasureTool::PlanarDistanceIndex
@ PlanarDistanceIndex
Planar distance in kilometers.
Definition: MeasureTool.h:142
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::MeasureTool::m_endSamp
double m_endSamp
ending sample
Definition: MeasureTool.h:150
Isis::Sensor::SlantDistance
virtual double SlantDistance() const
Return the distance between the spacecraft and surface point in kmv.
Definition: Sensor.cpp:637
Isis::Sensor::LocalRadius
Distance LocalRadius() const
Returns the local radius at the intersection point.
Definition: Sensor.cpp:267
Isis::CubeViewport::projection
Projection * projection() const
Definition: CubeViewport.h:343
Isis::RingPlaneProjection::UniversalRingRadius
double UniversalRingRadius()
This returns a universal radius, which is just the radius in meters.
Definition: RingPlaneProjection.cpp:575
Isis::Sensor::UniversalLatitude
virtual double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
Definition: Sensor.cpp:210
Isis::Angle::radians
double radians() const
Convert an angle to a double.
Definition: Angle.h:226
Isis::RubberBandTool::vertices
QList< QPoint > vertices()
This method returns the vertices.
Definition: RubberBandTool.cpp:672