9#include "LatLonGridTool.h"
13#include <QStackedWidget>
18#include "MdiCubeViewport.h"
41 action->setIcon(QPixmap(
toolIconDir() +
"/grid.png"));
42 action->setToolTip(
"Lat Lon Grid Tool (G)");
43 action->setShortcut(Qt::Key_G);
46 "<b>Function:</b> View lat lon grid \
47 <p><b>Shortcut:</b> G</p> ";
48 action->setWhatsThis(text);
63 container->setObjectName(
"LatLonGridToolActiveToolBarWidget");
65 m_gridCheckBox =
new QCheckBox;
66 m_gridCheckBox->setText(
"Show Grid");
68 QHBoxLayout *layout =
new QHBoxLayout;
70 layout->addWidget(m_gridCheckBox);
71 layout->addStretch(1);
72 container->setLayout(layout);
74 m_container = container;
90 QBrush brush(Qt::gray);
94 if (m_gridCheckBox->isChecked()) {
97 painter->setFont(font);
101 if (mvp->
camera() != NULL) {
105 lon = ceil(lon * 100.0) / 100.0;
109 painter->drawLine(x1, y1, x1, y2);
111 painter->drawText(x1, y2 + 10,
toString(lon));
117 if (mvp->
camera() != NULL) {
121 lat = ceil(lat * 100.0) / 100.0;
125 painter->drawLine(x1, y1, x2, y1);
127 painter->drawText(x2 + 5, y1,
toString(lat));
144 if (vp->
camera() == NULL) {
145 m_gridCheckBox->setEnabled(
false);
148 m_gridCheckBox->setEnabled(
true);
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
int cubeLines() const
Return the number of lines in the cube.
int cubeSamples() const
Return the number of samples in the cube.
void cubeToViewport(double sample, double line, int &x, int &y) const
Turns a cube into a viewport.
Cube display widget for certain Isis MDI applications.
virtual double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
virtual double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.