Isis Developer Reference
SunShadowTool.h
Go to the documentation of this file.
1 #ifndef SunShadowTool_h
2 #define SunShadowTool_h
3 
4 #include "Tool.h"
5 
6 #include <QAction>
7 
8 #include "IString.h"
9 #include "TableMainWindow.h"
10 
11 class QCheckBox;
12 class QComboBox;
13 class QDialog;
14 class QLineEdit;
15 class QMenu;
16 class QString;
17 
18 namespace Isis {
19  class Angle;
20  class Distance;
21  class MdiCubeViewport;
22  class SurfacePoint;
23 
39  class SunShadowTool : public Tool {
40  Q_OBJECT
41 
42  public:
43  SunShadowTool(QWidget *parent);
44  void addTo(QMenu *menu);
45 
46  void paintViewport(MdiCubeViewport *vp, QPainter *painter);
47 
48  protected slots:
49  virtual void mouseMove(QPoint p);
50  virtual void mouseButtonPress(QPoint p, Qt::MouseButton s);
51  virtual void mouseButtonRelease(QPoint p, Qt::MouseButton s);
52 
53  protected:
54  QWidget *createToolBarWidget(QStackedWidget *parent);
56 
57  void updateTool();
58 
59  private slots:
60  void updateShadowHeightEdit();
61  void reinitialize();
62 
63  private:
64  void addRow();
65  void recalculateShadowHeight();
66  void updateRow(int row);
67 
68  private:
70  QLineEdit *m_shadowHeightLineEdit;
72  QComboBox *m_unitsComboBox;
74  QCheckBox *m_drawInSunDirection;
75 
79  enum TableColumnIndex {
81  StartLatIndex = 2,
83  StartLonIndex,
85  EndLatIndex,
87  EndLonIndex,
89  StartSampIndex,
91  StartLineIndex,
93  EndSampIndex,
95  EndLineIndex,
97  ShadowLengthKmIndex,
99  ShadowLengthMIndex,
101  ShadowHeightKmIndex,
103  ShadowHeightMIndex,
105  IncidenceAngleDegreesIndex,
107  IncidenceAngleRadiansIndex,
109  PathIndex,
111  FileNameIndex
112  };
113 
115  double m_startSamp;
117  double m_startLine;
119  SurfacePoint *m_startSurfacePoint;
120 
122  double m_endSamp;
124  double m_endLine;
126  SurfacePoint *m_endSurfacePoint;
127 
129  Angle *m_incidenceAngle;
130 
132  Distance *m_shadowHeight;
134  Distance *m_shadowLength;
135 
137  QString m_path;
139  QString m_fileName;
140 
142  TableMainWindow *m_tableWin;
144  bool m_enabled;
149  bool m_tracking;
151  Angle *m_trackingAngle;
152  };
153 
154 };
155 
156 #endif
Isis::Distance::kilometers
double kilometers() const
Get the distance in kilometers.
Definition: Distance.cpp:106
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
Tool for measuring shadow heights.
Definition: SunShadowTool.h:39
Isis::SunShadowTool::SunShadowTool
SunShadowTool(QWidget *parent)
Construct a sun shadow tool.
Definition: SunShadowTool.cpp:35
FileName.h
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
Isis::SurfacePoint::GetX
Displacement GetX() const
Definition: SurfacePoint.cpp:1436
MdiCubeViewport.h
Isis::TableMainWindow::table
QTableWidget * table() const
Returns the table.
Definition: TableMainWindow.h:70
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::Distance::Pixels
@ Pixels
The distance is being specified in pixels.
Definition: Distance.h:47
Isis::Tool::viewportChanged
void viewportChanged()
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::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
QMenu
Isis::Tool::toolIconDir
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:113
Longitude.h
Isis::SunShadowTool::addTo
void addTo(QMenu *menu)
Adds the measure action to the given menu.
Definition: SunShadowTool.cpp:174
Tool.h
Isis::SurfacePoint::GetZ
Displacement GetZ() const
Definition: SurfacePoint.cpp:1450
Isis::SurfacePoint::GetLatitude
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
Definition: SurfacePoint.cpp:1665
Isis::Distance::Units
Units
This is a list of available units to access and store Distances in.
Definition: Distance.h:41
ToolPad.h
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::Camera
Definition: Camera.h:236
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
IString.h
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::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
Latitude.h
Isis::SunShadowTool::toolPadAction
QAction * toolPadAction(ToolPad *pad)
Create an action for activating this tool.
Definition: SunShadowTool.cpp:92
Isis::SurfacePoint::Valid
bool Valid() const
Definition: SurfacePoint.cpp:947
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
SurfacePoint.h
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
TableMainWindow.h
Isis::IException
Isis exception class.
Definition: IException.h:91
ASSERT
#define ASSERT(x)
Definition: IsisDebug.h:134
Isis::Angle
Defines an angle and provides unit conversions.
Definition: Angle.h:45
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
Camera.h
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
Angle.h
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
Projection.h
QDialog
Isis::CubeViewport::viewportToCube
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
Definition: CubeViewport.cpp:815
Distance.h
IsisDebug.h
QAction
Isis::CubeViewport::cube
Cube * cube() const
Definition: CubeViewport.h:338
Isis::Camera::SunAzimuth
double SunAzimuth()
Returns the Sun Azimuth.
Definition: Camera.cpp:1920
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::SurfacePoint::GetY
Displacement GetY() const
Definition: SurfacePoint.cpp:1443
SunShadowTool.h
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::Angle::radians
double radians() const
Convert an angle to a double.
Definition: Angle.h:226