Isis Developer Reference
RubberBandComboBox.h
Go to the documentation of this file.
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  }
81  void showRotatedRectangle() {
83  m_showIndicatorColors);
84  }
86  void showPolygon() {
87  m_tool->rubberBandTool()->enable(RubberBandTool::PolygonMode, m_showIndicatorColors);
88  }
90  void showSegmentedLine() {
91  m_tool->rubberBandTool()->enable(RubberBandTool::SegmentedLineMode, m_showIndicatorColors);
92  }
93 
94  QStringList m_bandingOptionStrings;
95  bool m_showIndicatorColors;
96  Tool *m_tool;
97  };
98 };
99 
100 #endif
FileName.h
Isis::RubberBandTool::PolygonMode
@ PolygonMode
Definition: RubberBandTool.h:64
Isis::RubberBandComboBox
Combo box for choosing a rubber band type.
Definition: RubberBandComboBox.h:26
Isis::RubberBandTool::RectangleMode
@ RectangleMode
Definition: RubberBandTool.h:62
Isis::RubberBandComboBox::SegmentedLine
@ SegmentedLine
Segmented Line.
Definition: RubberBandComboBox.h:43
Isis::RubberBandComboBox::Circle
@ Circle
Circle.
Definition: RubberBandComboBox.h:37
Isis::RubberBandTool::CircleMode
@ CircleMode
Definition: RubberBandTool.h:59
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
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::RubberBandTool::enable
void enable(RubberBandMode mode, bool showIndicatorColors=false)
This is called when changing modes or turning on.
Definition: RubberBandTool.cpp:302
Isis::Tool::rubberBandTool
RubberBandTool * rubberBandTool()
Definition: Tool.cpp:57
Isis::RubberBandComboBox::toolIconDir
QString toolIconDir() const
Returns the icon directory.
Definition: RubberBandComboBox.h:48
Isis::RubberBandComboBox::Line
@ Line
Line.
Definition: RubberBandComboBox.h:42
Tool.h
Isis::RubberBandComboBox::Rectangle
@ Rectangle
Rectangle.
Definition: RubberBandComboBox.h:39
QStringList
Isis::RubberBandTool::RotatedRectangleMode
@ RotatedRectangleMode
Definition: RubberBandTool.h:63
Isis::RubberBandComboBox::Angle
@ Angle
Angle.
Definition: RubberBandComboBox.h:44
QComboBox
Isis::RubberBandTool::SegmentedLineMode
@ SegmentedLineMode
Definition: RubberBandTool.h:65
Isis::RubberBandTool::AngleMode
@ AngleMode
Definition: RubberBandTool.h:58
Isis::RubberBandComboBox::Ellipse
@ Ellipse
Ellipse.
Definition: RubberBandComboBox.h:38
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
Isis::RubberBandComboBox::selectionChanged
void selectionChanged(int index)
This slot is called whenever the rubberband shape selection has changed.
Definition: RubberBandComboBox.cpp:189
Isis::Angle
Defines an angle and provides unit conversions.
Definition: Angle.h:45
Isis::RubberBandComboBox::reset
void reset()
Resets the selection.
Definition: RubberBandComboBox.cpp:226
RubberBandTool.h
Isis::RubberBandComboBox::RubberBandComboBox
RubberBandComboBox(Tool *tool, unsigned int bandingOptions, unsigned int defaultOption, bool showIndicatorColors=false)
RubberBandComboBox constructor.
Definition: RubberBandComboBox.cpp:16
Isis::RubberBandComboBox::RotatedRectangle
@ RotatedRectangle
RotatedRectangle.
Definition: RubberBandComboBox.h:40
Isis::RubberBandTool::LineMode
@ LineMode
Definition: RubberBandTool.h:61
Isis::RubberBandComboBox::RubberBandOptions
RubberBandOptions
Enum to store rubber band shapes.
Definition: RubberBandComboBox.h:36
Ellipse
This is free and unencumbered software released into the public domain.
Definition: Selection.h:14
QAction
Isis::RubberBandTool::EllipseMode
@ EllipseMode
Definition: RubberBandTool.h:60
Isis::RubberBandTool::disable
void disable()
This is called when something is not using me, so turn off events, reset & repaint to clear the clear...
Definition: RubberBandTool.cpp:322
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
RubberBandComboBox.h