USGS

Isis 3.0 Developer's Reference (API)

Home

RubberBandComboBox.h

Go to the documentation of this file.
00001 #ifndef RubberBandComboBox_h
00002 #define RubberBandComboBox_h
00003 
00004 #include <QComboBox>
00005 
00006 // FIXME: Remove this include!
00007 #include "RubberBandTool.h"
00008 
00009 namespace Isis {
00026   class RubberBandComboBox : public QComboBox {
00027       Q_OBJECT
00028 
00029     public:
00030       RubberBandComboBox(unsigned int bandingOptions, unsigned int defaultOption, bool showIndicatorColors = false);
00031 
00035       enum RubberBandOptions {
00036         Circle           = 1,   
00037         Ellipse          = 2,   
00038         Rectangle        = 4,   
00039         RotatedRectangle = 8,   
00040         Polygon          = 16,  
00041         Line             = 32,  
00042         SegmentedLine    = 64,  
00043         Angle            = 128  
00044       };
00045 
00047       QString toolIconDir() const {
00048         return RubberBandTool::getInstance()->toolIconDir();
00049       }
00050       void reset();
00051 
00052     protected slots:
00053       void selectionChanged(int index);
00054 
00055     private:
00057       unsigned int getDefault(unsigned int defaultOption, unsigned int bandingOptions);
00058 
00060       void showAngle()             {
00061         RubberBandTool::enable(RubberBandTool::Angle, p_showIndicatorColors);
00062       };
00064       void showCircle()            {
00065         RubberBandTool::enable(RubberBandTool::Circle, p_showIndicatorColors);
00066       };
00068       void showEllipse()           {
00069         RubberBandTool::enable(RubberBandTool::Ellipse, p_showIndicatorColors);
00070       };
00072       void showLine()              {
00073         RubberBandTool::enable(RubberBandTool::Line, p_showIndicatorColors);
00074       };
00076       void showRectangle()         {
00077         RubberBandTool::enable(RubberBandTool::Rectangle, p_showIndicatorColors);
00078       };
00080       void showRotatedRectangle()  {
00081         RubberBandTool::enable(RubberBandTool::RotatedRectangle, p_showIndicatorColors);
00082       };
00084       void showPolygon()           {
00085         RubberBandTool::enable(RubberBandTool::Polygon, p_showIndicatorColors);
00086       };
00088       void showSegmentedLine()     {
00089         RubberBandTool::enable(RubberBandTool::SegmentedLine, p_showIndicatorColors);
00090       };
00091 
00092       QStringList p_bandingOptionStrings; 
00093       bool p_showIndicatorColors; 
00094   };
00095 };
00096 
00097 #endif