Isis 3 Programmer Reference
RubberBandComboBox.h
1 #ifndef RubberBandComboBox_h
2 #define RubberBandComboBox_h
3 
4 #include <QComboBox>
5 
6 #include "FileName.h"
7 #include "RubberBandTool.h"
8 
9 namespace Isis {
26  class RubberBandComboBox : public QComboBox {
27  Q_OBJECT
28 
29  public:
30  RubberBandComboBox(Tool *tool, unsigned int bandingOptions, unsigned int defaultOption,
31  bool showIndicatorColors = false);
32 
37  Circle = 1,
38  Ellipse = 2,
39  Rectangle = 4,
41  Polygon = 16,
42  Line = 32,
44  Angle = 128
45  };
46 
48  QString toolIconDir() const {
49  return m_tool->toolIconDir();
50  }
51  void reset();
52 
53  protected slots:
54  void selectionChanged(int index);
55 
56  private:
58  unsigned int getDefault(unsigned int defaultOption, unsigned int bandingOptions);
59 
61  void showAngle() {
62  m_tool->rubberBandTool()->enable(RubberBandTool::AngleMode, m_showIndicatorColors);
63  }
65  void showCircle() {
66  m_tool->rubberBandTool()->enable(RubberBandTool::CircleMode, m_showIndicatorColors);
67  }
69  void showEllipse() {
70  m_tool->rubberBandTool()->enable(RubberBandTool::EllipseMode, m_showIndicatorColors);
71  }
73  void showLine() {
74  m_tool->rubberBandTool()->enable(RubberBandTool::LineMode, m_showIndicatorColors);
75  }
77  void showRectangle() {
78  m_tool->rubberBandTool()->enable(RubberBandTool::RectangleMode, m_showIndicatorColors);
79  }
82  m_tool->rubberBandTool()->enable(RubberBandTool::RotatedRectangleMode,
84  }
86  void showPolygon() {
87  m_tool->rubberBandTool()->enable(RubberBandTool::PolygonMode, m_showIndicatorColors);
88  }
91  m_tool->rubberBandTool()->enable(RubberBandTool::SegmentedLineMode, m_showIndicatorColors);
92  }
93 
96  Tool *m_tool;
97  };
98 };
99 
100 #endif
void showRectangle()
Enables the rectangle shape.
void showLine()
Enables the line.
void reset()
Resets the selection.
void showCircle()
Enables the circle shape.
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:127
QString toolIconDir() const
Returns the icon directory.
Combo box for choosing a rubber band type.
void showSegmentedLine()
Enables the segmented line shape.
void showRotatedRectangle()
Enables the rotated rectangle shape.
bool m_showIndicatorColors
Show colors?
RubberBandOptions
Enum to store rubber band shapes.
void showAngle()
Enables the angle shape.
RubberBandComboBox(Tool *tool, unsigned int bandingOptions, unsigned int defaultOption, bool showIndicatorColors=false)
RubberBandComboBox constructor.
void showPolygon()
Enables the polygon shape.
void selectionChanged(int index)
This slot is called whenever the rubberband shape selection has changed.
Defines an angle and provides unit conversions.
Definition: Angle.h:62
unsigned int getDefault(unsigned int defaultOption, unsigned int bandingOptions)
This is used to figure out which option should be defaulted.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Base class for the Qisis tools.
Definition: Tool.h:81
void showEllipse()
Enables the ellipse shape.
QStringList m_bandingOptionStrings
List of rubberband options.
void enable(RubberBandMode mode, bool showIndicatorColors=false)
This is called when changing modes or turning on.