Isis 3 Programmer Reference
FindTool.cpp
1 #include "FindTool.h"
2 
3 #include <QApplication>
4 #include <QCheckBox>
5 #include <QDialog>
6 #include <QHBoxLayout>
7 #include <QLabel>
8 #include <QLineEdit>
9 #include <QMenu>
10 #include <QMenuBar>
11 #include <QMessageBox>
12 #include <QPushButton>
13 #include <QToolButton>
14 #include <QValidator>
15 
16 #include <float.h>
17 
18 #include "Camera.h"
19 #include "Distance.h"
20 #include "Latitude.h"
21 #include "Longitude.h"
22 #include "MainWindow.h"
23 #include "MdiCubeViewport.h"
24 #include "Projection.h"
25 #include "SurfacePoint.h"
26 #include "Target.h"
27 #include "ToolPad.h"
28 #include "UniversalGroundMap.h"
29 #include "Workspace.h"
30 
31 
32 namespace Isis {
38  FindTool::FindTool(QWidget *parent) : Tool(parent) {
39  p_dialog = NULL;
40  p_findPoint = NULL;
41  p_showDialogButton = NULL;
42  p_linkViewportsButton = NULL;
43  p_syncScale = NULL;
44  p_statusEdit = NULL;
45  p_tabWidget = NULL;
46  p_groundTab = NULL;
47  p_imageTab = NULL;
48 
49  p_lat = DBL_MAX;
50  p_lon = DBL_MAX;
51  p_samp = DBL_MAX;
52  p_line = DBL_MAX;
53  p_pointVisible = true;
54 
55  //Set up dialog box
56  createDialog(parent);
57 
58  // Set up find point action
59  p_findPoint = new QAction(parent);
60  p_findPoint->setShortcut(Qt::CTRL + Qt::Key_F);
61  p_findPoint->setText("&Find Point");
62  p_findPoint->setIcon( QPixmap(toolIconDir() + "/find.png") );
63  QString text =
64  "<b>Function:</b> Centers all linked viewports to the selected lat/lon. \
65  The user can click anywhere on the image to have that point centered, or \
66  they can use the shortcut or button to bring up a window that they can \
67  enter a specific lat/lon position into. \
68  <p><b>Shortcut: </b> Ctrl+F </p> \
69  <p><b>Hint: </b> This option will only work if the image has a camera \
70  model or is projected, and will only center the point on images \
71  where the selected lat/lon position exists.</p>";
72  p_findPoint->setWhatsThis(text);
73  p_findPoint->setEnabled(false);
74  connect( p_findPoint, SIGNAL( triggered() ),
75  p_dialog, SLOT( show() ) );
76  }
77 
78  FindTool::~FindTool() {
79  delete p_groundTab->p_latLineEdit->validator();
80  delete p_groundTab->p_lonLineEdit->validator();
81  }
82 
83 
90  p_dialog = new QDialog(parent);
91  p_tabWidget = new QTabWidget(p_dialog);
92  p_dialog->setWindowTitle("Find Latitude/Longitude Coordinate");
93 
94  p_groundTab = new GroundTab();
95  p_imageTab = new ImageTab();
96  p_tabWidget->addTab(p_imageTab, "Image");
97  p_tabWidget->addTab(p_groundTab, "Ground");
98 
99  // Create the action buttons
100  QPushButton *okButton = new QPushButton("Ok");
101  connect( okButton, SIGNAL( clicked() ),
102  this, SLOT( handleOkClicked() ) );
103 
104  QPushButton *recordButton = new QPushButton("Record Point");
105  connect( recordButton, SIGNAL( clicked() ),
106  this, SLOT( handleRecordClicked() ) );
107 
108  QPushButton *closeButton = new QPushButton("Close");
109  connect( closeButton, SIGNAL( clicked() ),
110  p_dialog, SLOT( hide() ) );
111 
112  // Put the buttons in a horizontal orientation
113  QHBoxLayout *actionLayout = new QHBoxLayout();
114  actionLayout->addWidget(okButton);
115  actionLayout->addWidget(recordButton);
116  actionLayout->addWidget(closeButton);
117 
118  QVBoxLayout *dialogLayout = new QVBoxLayout;
119  dialogLayout->addWidget(p_tabWidget);
120  dialogLayout->addLayout(actionLayout);
121  p_dialog->setLayout(dialogLayout);
122  }
123 
124 
130  GroundTab::GroundTab(QWidget *parent) : QWidget(parent) {
131  p_latLineEdit = new QLineEdit();
132  p_latLineEdit->setText("");
133  p_latLineEdit->setValidator( new QDoubleValidator(-90.0, 90.0, 99, parent) );
134  p_lonLineEdit = new QLineEdit();
135  p_lonLineEdit->setText("");
136  p_lonLineEdit->setValidator( new QDoubleValidator(parent) );
137  QLabel *latLabel = new QLabel("Latitude");
138  QLabel *lonLabel = new QLabel("Longitude");
139 
140  // Put the buttons and text field in a gridlayout
141  QGridLayout *gridLayout = new QGridLayout();
142  gridLayout->addWidget(latLabel, 0, 0);
143  gridLayout->addWidget(p_latLineEdit, 0, 1);
144  gridLayout->addWidget(lonLabel, 1, 0);
145  gridLayout->addWidget(p_lonLineEdit, 1, 1);
146  setLayout(gridLayout);
147  }
148 
149 
155  ImageTab::ImageTab(QWidget *parent) : QWidget(parent) {
156  p_sampLineEdit = new QLineEdit();
157  p_sampLineEdit->setText("");
158  p_lineLineEdit = new QLineEdit();
159  p_lineLineEdit->setText("");
160  QLabel *sampleLabel = new QLabel("Sample");
161  QLabel *lineLabel = new QLabel("Line");
162 
163  // Put the buttons and text field in a gridlayout
164  QGridLayout *gridLayout = new QGridLayout();
165  gridLayout->addWidget(sampleLabel, 0, 0);
166  gridLayout->addWidget(p_sampLineEdit, 0, 1);
167  gridLayout->addWidget(lineLabel, 1, 0);
168  gridLayout->addWidget(p_lineLineEdit, 1, 1);
169  setLayout(gridLayout);
170  }
171 
172 
181  QAction *action = new QAction(toolpad);
182  action->setIcon( QPixmap(toolIconDir() + "/find.png") );
183  action->setToolTip("Find (F)");
184  action->setShortcut(Qt::Key_F);
185  QString text =
186  "<b>Function:</b> Find a lat/lon or line/sample coordinate in this cube. \
187  <p><b>Shortcut:</b>F</p> ";
188  action->setWhatsThis(text);
189  return action;
190  }
191 
192 
198  void FindTool::addTo(QMenu *menu) {
199  menu->addAction(p_findPoint);
200  }
201 
202 
210  QWidget *FindTool::createToolBarWidget(QStackedWidget *parent) {
211  QWidget *hbox = new QWidget;
212 
213  p_showDialogButton = new QToolButton(hbox);
214  p_showDialogButton->setIcon( QPixmap(toolIconDir() + "/find.png") );
215  p_showDialogButton->setToolTip("Find Point");
216  QString text =
217  "<b>Function:</b> Centers all linked viewports to the selected lat/lon. \
218  The user can click anywhere on the image to have that point centered, or \
219  they can use the shortcut or button to bring up a window that they can \
220  enter a specific lat/lon position into. \
221  <p><b>Shortcut: </b> Ctrl+F </p> \
222  <p><b>Hint: </b> This option will only work if the image has a camera \
223  model or is projected, and will only center the point on images \
224  where the selected lat/lon position exists.</p>";
225  p_showDialogButton->setWhatsThis(text);
226  connect( p_showDialogButton, SIGNAL( clicked() ),
227  p_dialog, SLOT( show() ) );
228  p_showDialogButton->setAutoRaise(true);
229  p_showDialogButton->setIconSize( QSize(22, 22) );
230 
231  p_syncScale = new QCheckBox("Sync Scale");
232  p_syncScale->setChecked(true);
233  p_syncScale->setToolTip("Synchronize Scale");
234  text = "<b>Function:</b> Syncronizes the scale of all linked viewports.";
235  p_syncScale->setWhatsThis(text);
236 
237  p_linkViewportsButton = new QToolButton(hbox);
238  p_linkViewportsButton->setIcon( QPixmap(toolIconDir() + "/link_valid.png") );
239  p_linkViewportsButton->setToolTip("Link Georeferenced Images");
240  p_linkViewportsButton->setWhatsThis("<b>Function: </b> Links all open images that have\
241  a camera model or are map projections");
242  connect( p_linkViewportsButton, SIGNAL( clicked() ),
243  this, SLOT( handleLinkClicked() ) );
244  p_linkViewportsButton->setAutoRaise(true);
245  p_linkViewportsButton->setIconSize( QSize(22, 22) );
246 
247  p_togglePointVisibleButton = new QToolButton(hbox);
248  p_togglePointVisibleButton->setIcon( QPixmap(toolIconDir() + "/redDot.png") );
249  p_togglePointVisibleButton->setToolTip("Hide red dot");
250  p_togglePointVisibleButton->setCheckable(true);
251  p_togglePointVisibleButton->setChecked(true);
252  connect( p_togglePointVisibleButton, SIGNAL( clicked() ),
253  this, SLOT( togglePointVisible() ) );
254 
255  p_statusEdit = new QLineEdit();
256  p_statusEdit->setReadOnly(true);
257  p_statusEdit->setToolTip("Cube Type");
258  p_statusEdit->setWhatsThis("<b>Function: </b> Displays whether the active cube \
259  is a camera model, projection, both, or none. <p> \
260  <b>Hint: </b> If the cube is 'None' the find tool \
261  will not be active</p>");
262 
263  QHBoxLayout *layout = new QHBoxLayout(hbox);
264  layout->setMargin(0);
265  layout->addWidget(p_statusEdit);
266  layout->addWidget(p_showDialogButton);
267  layout->addWidget(p_linkViewportsButton);
268  layout->addWidget(p_togglePointVisibleButton);
269  layout->addWidget(p_syncScale);
270  layout->addStretch(1);
271  hbox->setLayout(layout);
272 
273  return hbox;
274  }
275 
276 
289  MdiCubeViewport *activeViewport = cubeViewport();
290 
291  if (activeViewport == NULL) {
292  p_linkViewportsButton->setEnabled(false);
293  p_findPoint->setEnabled(false);
294  p_showDialogButton->setEnabled(false);
295  p_syncScale->setEnabled(false);
296  p_statusEdit->setText("None");
297  if ( p_dialog->isVisible() ) {
298  p_dialog->close();
299  }
300  }
301  else {
302  p_findPoint->setEnabled(true);
303  p_showDialogButton->setEnabled(true);
304  p_statusEdit->setText("None");
305 
306  if (cubeViewportList()->size() > 1) {
307  p_linkViewportsButton->setEnabled(true);
308  p_syncScale->setEnabled(true);
309  }
310  else {
311  p_linkViewportsButton->setEnabled(false);
312  p_syncScale->setEnabled(false);
313  }
314 
315  if (activeViewport->camera() != NULL) {
316  p_statusEdit->setText("Camera");
317  if ( cubeViewport()->camera()->HasProjection() ) {
318  p_statusEdit->setText("Both");
319  }
320  }
321  else if (activeViewport->projection() != NULL) {
322  p_statusEdit->setText("Projection");
323  }
324 
325  // from here until the rest of this method we are just updating the
326  // line edits within the dialog
327 
328  UniversalGroundMap *groundMap = activeViewport->universalGroundMap();
329 
330  if (p_samp != DBL_MAX && p_line != DBL_MAX) {
331  if ( groundMap && groundMap->SetImage(p_samp, p_line) ) {
332  QString latStr = QString::number( groundMap->UniversalLatitude() );
333  QString lonStr = QString::number( groundMap->UniversalLongitude() );
334  p_groundTab->p_latLineEdit->setText(latStr);
335  p_groundTab->p_lonLineEdit->setText(lonStr);
336  }
337  else {
338  p_groundTab->p_latLineEdit->setText("");
339  p_groundTab->p_lonLineEdit->setText("");
340  }
341 
342  p_imageTab->p_sampLineEdit->setText( QString::number(p_samp) );
343  p_imageTab->p_lineLineEdit->setText( QString::number(p_line) );
344  }
345  else if (p_lat != DBL_MAX && p_lon != DBL_MAX) {
346  // this should also work for rings (radius, azimuth)
347  if ( groundMap && groundMap->SetUniversalGround(p_lat, p_lon) ) {
348  QString lineStr = QString::number( groundMap->Line() );
349  QString sampStr = QString::number( groundMap->Sample() );
350  p_imageTab->p_lineLineEdit->setText(lineStr);
351  p_imageTab->p_sampLineEdit->setText(sampStr);
352  }
353  else {
354  p_imageTab->p_lineLineEdit->setText("");
355  p_imageTab->p_sampLineEdit->setText("");
356  }
357 
358  p_groundTab->p_latLineEdit->setText( QString::number(p_lat) );
359  p_groundTab->p_lonLineEdit->setText( QString::number(p_lon) );
360  }
361  } // of if activeViewport != NULL
362  }
363 
364 
373  p_samp = DBL_MAX;
374  p_line = DBL_MAX;
375  p_lat = DBL_MAX;
376  p_lon = DBL_MAX;
377 
378  if (p_tabWidget->tabText( p_tabWidget->currentIndex() ) == "Ground") {
379  p_lat = p_groundTab->p_latLineEdit->text().toDouble();
380  p_lon = p_groundTab->p_lonLineEdit->text().toDouble();
381  if (p_lat > 90 || p_lat < -90) {
382  QString mess = QString::number(p_lat) + " is an invalid latitude value. "
383  + "Please enter a latitude between -90 and 90.";
384  QMessageBox::warning((QWidget *)parent(), "Warning", mess);
385  p_lat = DBL_MAX;
386  p_lon = DBL_MAX;
387  }
388  }
389  else if (p_tabWidget->tabText( p_tabWidget->currentIndex() ) == "Image") {
390  p_line = p_imageTab->p_lineLineEdit->text().toDouble();
391  p_samp = p_imageTab->p_sampLineEdit->text().toDouble();
392  }
393 
395  refresh();
396  updateTool();
397  }
398 
399 
416  double line = p_line;
417  double samp = p_samp;
418 
419  if (p_lat != DBL_MAX && p_lon != DBL_MAX) {
420  MdiCubeViewport *cvp = cubeViewport();
421  UniversalGroundMap *groundMap = cvp->universalGroundMap();
422 
423  if (groundMap) {
424  if ( groundMap->SetUniversalGround(p_lat, p_lon) ) {
425  line = groundMap->Line();
426  samp = groundMap->Sample();
427  }
428  }
429  }
430 
431  if (line != DBL_MAX && samp != DBL_MAX) {
432  int x, y;
433  MdiCubeViewport *cvp = cubeViewport();
434  cvp->cubeToViewport(samp, line, x, y);
435  QPoint p(x, y);
436  emit recordPoint(p);
437  }
438  }
439 
440 
448  void FindTool::mouseButtonRelease(QPoint p, Qt::MouseButton s) {
449  MdiCubeViewport *activeViewport = cubeViewport();
450  UniversalGroundMap *groundMap = activeViewport->universalGroundMap();
451 
452  double samp, line;
453  activeViewport->viewportToCube(p.x(), p.y(), samp, line);
454 
455  p_samp = DBL_MAX;
456  p_line = DBL_MAX;
457  p_lat = DBL_MAX;
458  p_lon = DBL_MAX;
459 
460  if (groundMap) {
461  if ( groundMap->SetImage(samp, line) ) {
462  p_lat = groundMap->UniversalLatitude();
463  p_lon = groundMap->UniversalLongitude();
464  }
465  }
466  else {
467  p_samp = samp;
468  p_line = line;
469  }
470 
472  refresh();
473  updateTool();
474  }
475 
476 
489  void FindTool::paintViewport(MdiCubeViewport *vp, QPainter *painter) {
490  if ( (vp == cubeViewport() || ( cubeViewport()->isLinked() && vp->isLinked() ) )
491  && p_pointVisible) {
492  double samp = p_samp;
493  double line = p_line;
494 
495  UniversalGroundMap *groundMap = vp->universalGroundMap();
496 
497  if (p_lat != DBL_MAX && p_lon != DBL_MAX && groundMap) {
498  if ( groundMap->SetUniversalGround(p_lat, p_lon) ) {
499  samp = groundMap->Sample();
500  line = groundMap->Line();
501  }
502  }
503 
504  if (samp != DBL_MAX && line != DBL_MAX) {
505  // first find the point
506  int x, y;
507  vp->cubeToViewport(samp, line, x, y);
508 
509  // now that we have the point draw it!
510  QPen pen(Qt::red);
511  pen.setWidth(3);
512  pen.setStyle(Qt::SolidLine);
513  painter->setPen(pen);
514  painter->drawRoundRect(x - 2, y - 2, 4, 4);
515  }
516  }
517  }
518 
519 
522  // toggle the member boolean that specifies visibility
523  p_pointVisible = !p_pointVisible;
524 
525  // update the buttons text
526  if (p_pointVisible) {
527  p_togglePointVisibleButton->setChecked(true);
528  p_togglePointVisibleButton->setToolTip("Hide red dot");
529  }
530  else {
531  p_togglePointVisibleButton->setChecked(false);
532  p_togglePointVisibleButton->setToolTip("Show red dot");
533  }
534 
535  refresh();
536  }
537 
538 
541  MdiCubeViewport *d;
542  for (int i = 0; i < (int)cubeViewportList()->size(); i++) {
543  d = ( *( cubeViewportList() ) )[i];
544  if (d->universalGroundMap() != NULL) {
545  d->setLinked(true);
546  }
547  else {
548  d->setLinked(false);
549  }
550  }
551  }
552 
553 
556  MdiCubeViewport *activeViewport = cubeViewport();
557  bool syncScale = p_syncScale->isChecked();
558  // This will be the ground map resolution of the active viewport in meters
559  // per pixel.
560  Distance viewportResolutionToMatch;
561  UniversalGroundMap *groundMap = activeViewport->universalGroundMap();
562 
563  // Equation to match viewports:
564  // otherViewportZoomFactor = activeViewportZoomFactor *
565  // (otherViewportResolution / activeViewportResolution)
566  if (syncScale) {
567  viewportResolutionToMatch = distancePerPixel(activeViewport, p_lat, p_lon);
568  }
569 
570  for (int i = 0; i < cubeViewportList()->size(); i++) {
571  MdiCubeViewport *viewport = ( *( cubeViewportList() ) )[i];
572 
573  if ( viewport == activeViewport ||
574  ( activeViewport->isLinked() && viewport->isLinked() ) ) {
575  groundMap = viewport->universalGroundMap();
576  double otherViewportZoomFactor = viewport->scale();
577 
578  if ( groundMap && !IsSpecial(p_lat) && p_lat != DBL_MAX &&
579  !IsSpecial(p_lon) && p_lon != DBL_MAX &&
580  groundMap->SetUniversalGround(p_lat, p_lon) ) {
581  double samp = groundMap->Sample();
582  double line = groundMap->Line();
583 
584  if ( viewportResolutionToMatch.isValid() ) {
585  Distance otherViewportResolution = distancePerPixel(viewport,
586  p_lat, p_lon);
587  otherViewportZoomFactor = activeViewport->scale() *
588  (otherViewportResolution / viewportResolutionToMatch);
589  }
590 
591  if (p_lat != DBL_MAX && p_lon != DBL_MAX && groundMap) {
592  viewport->setScale(otherViewportZoomFactor, samp, line);
593  }
594  }
595 
596  if (p_line != DBL_MAX && p_samp != DBL_MAX) {
597  viewport->setScale(otherViewportZoomFactor, p_samp, p_line);
598  }
599  }
600  }
601  }
602 
603 
621  double lat, double lon) {
622  UniversalGroundMap *groundMap = viewport->universalGroundMap();
623  Distance viewportResolution;
624 
625  try {
626  if ( groundMap && !IsSpecial(lat) && !IsSpecial(lon) &&
627  lat != DBL_MAX && lon != DBL_MAX &&
628  groundMap->SetUniversalGround(lat, lon) ) {
629  // Distance/pixel
630  viewportResolution = Distance(groundMap->Resolution(), Distance::Meters);
631  double samp = groundMap->Sample();
632  double line = groundMap->Line();
633 
634  if ( groundMap->SetImage(samp - 0.5, line - 0.5) ) {
635  double lat1 = groundMap->UniversalLatitude();
636  double lon1 = groundMap->UniversalLongitude();
637 
638  if ( groundMap->SetImage(samp + 0.5, line + 0.5) ) {
639  double lat2 = groundMap->UniversalLatitude();
640  double lon2 = groundMap->UniversalLongitude();
641 
642  double radius = groundMap->HasProjection()?
643  groundMap->Projection()->LocalRadius() :
644  groundMap->Camera()->LocalRadius().meters();
645 
646  SurfacePoint point1( Latitude(lat1, Angle::Degrees),
647  Longitude(lon1, Angle::Degrees),
648  Distance(radius, Distance::Meters) );
649 
650  SurfacePoint point2( Latitude(lat2, Angle::Degrees),
651  Longitude(lon2, Angle::Degrees),
652  Distance(radius, Distance::Meters) );
653 
654  viewportResolution = point1.GetDistanceToPoint(point2);
655  }
656  }
657  }
658  }
659  catch (IException &e) {
660  p_samp = DBL_MAX;
661  p_line = DBL_MAX;
662  p_lat = DBL_MAX;
663  p_lon = DBL_MAX;
664  QMessageBox::warning((QWidget *)parent(), "Warning", e.toString());
665  }
666 
667  return viewportResolution;
668  }
669 
670 
673  MdiCubeViewport *activeVp = cubeViewport();
674  for (int i = 0; i < cubeViewportList()->size(); i++) {
675  MdiCubeViewport *vp = ( *( cubeViewportList() ) )[i];
676 
677  if ( vp == activeVp || (activeVp->isLinked() && vp->isLinked() ) )
678  vp->viewport()->repaint();
679  }
680  }
681 }
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:148
Cube display widget for certain Isis MDI applications.
FindTool(QWidget *parent)
Constructs a FindTool object.
Definition: FindTool.cpp:38
double meters() const
Get the distance in meters.
Definition: Distance.cpp:97
ImageTab(QWidget *parent=0)
The image tab used by the dialog in the FindTool.
Definition: FindTool.cpp:155
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:127
double Line() const
Returns the current line value of the camera model or projection.
void updateTool()
Overriden method to update this tool - Checks if cube is open and checks if the image has camera and/...
Definition: FindTool.cpp:288
void centerLinkedViewports()
centers all linked viewports
Definition: FindTool.cpp:555
Universal Ground Map.
void handleOkClicked()
Actions to take when the dialog&#39;s ok button is clicked.
Definition: FindTool.cpp:372
Distance GetDistanceToPoint(const SurfacePoint &other) const
Computes and returns the distance between two surface points.
CubeViewportList * cubeViewportList() const
Return the list of cubeviewports.
Definition: Tool.cpp:390
QLineEdit * p_lineLineEdit
Input for line.
Definition: FindTool.h:66
void recordPoint(QPoint p)
Emitted when point should be recorded.
void setScale(double scale)
Change the scale of the cube to the given parameter value.
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:63
QLineEdit * p_sampLineEdit
Input for sample.
Definition: FindTool.h:65
void cubeToViewport(double sample, double line, int &x, int &y) const
Turns a cube into a viewport.
QLineEdit * p_latLineEdit
Input for latitude.
Definition: FindTool.h:51
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Distance measurement, usually in meters.
Definition: Distance.h:47
void setLinked(bool b)
Change the linked state of the viewport.
Distance LocalRadius() const
Returns the local radius at the intersection point.
Definition: Sensor.cpp:282
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:52
QAction * toolPadAction(ToolPad *toolpad)
Adds the find tool to the toolpad.
Definition: FindTool.cpp:180
Camera * camera() const
Definition: CubeViewport.h:358
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Definition: Angle.h:73
UniversalGroundMap * universalGroundMap() const
Definition: CubeViewport.h:363
void refresh()
does a repaint for active viewport and also for any linked viewports
Definition: FindTool.cpp:672
Isis::Projection * Projection() const
Return the projection associated with the ground map (NULL implies none)
double UniversalLatitude() const
Returns the universal latitude of the camera model or projection.
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:212
bool isLinked() const
Is the viewport linked with other viewports.
bool isValid() const
Test if this distance has been initialized or not.
Definition: Distance.cpp:204
GroundTab(QWidget *parent=0)
The ground tab used by the dialog in the FindTool.
Definition: FindTool.cpp:130
void handleLinkClicked()
Links all cubes that have camera models or are map projections.
Definition: FindTool.cpp:540
QLineEdit * p_lonLineEdit
Input for longitude.
Definition: FindTool.h:50
bool SetImage(double sample, double line)
Returns whether the sample/line postion was set successfully in the camera model or projection...
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Handles mouse clickes in the CubeViewport.
Definition: FindTool.cpp:448
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Distance distancePerPixel(MdiCubeViewport *viewport, double lat, double lon)
This computes the distance covered by a pixel at the given lat/lon in the given viewport.
Definition: FindTool.cpp:620
void addTo(QMenu *menu)
Adds the find tool to the menu.
Definition: FindTool.cpp:198
QString toString() const
Returns a string representation of this exception.
Definition: IException.cpp:553
void togglePointVisible()
toggles visibility of the red circle
Definition: FindTool.cpp:521
Isis exception class.
Definition: IException.h:107
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Isis::Camera * Camera() const
Return the camera associated with the ground map (NULL implies none)
Projection * projection() const
Definition: CubeViewport.h:353
bool SetUniversalGround(double lat, double lon)
Returns whether the lat/lon position was set successfully in the camera model or projection.
Base class for the Qisis tools.
Definition: Tool.h:81
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the tool bar for the find tool.
Definition: FindTool.cpp:210
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition: Tool.h:211
The distance is being specified in meters.
Definition: Distance.h:56
double Sample() const
Returns the current line value of the camera model or projection.
void paintViewport(MdiCubeViewport *vp, QPainter *painter)
This method paints the viewport.
Definition: FindTool.cpp:489
double UniversalLongitude() const
Returns the universal longitude of the camera model or projection.
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
void createDialog(QWidget *parent)
Creates the dialog used by this tool.
Definition: FindTool.cpp:89
double Resolution() const
Returns the resolution of the camera model or projection.
bool HasProjection()
Returns whether the ground map has a projection or not.
void handleRecordClicked()
Slot called when the record button is clicked.
Definition: FindTool.cpp:415
double scale() const
Definition: CubeViewport.h:224
Unless noted otherwise, the portions of Isis written by the USGS are public domain.