Isis 3 Programmer Reference
AbstractFilter.h
1 #ifndef AbstractFilter_H
2 #define AbstractFilter_H
3 
4 #include <QWidget>
5 
6 class QBoxLayout;
7 class QButtonGroup;
8 class QCheckBox;
9 template< typename U, typename V > struct QPair;
10 class QString;
11 template< typename T > class QFlags;
12 
13 
14 namespace Isis {
15  class AbstractFilterSelector;
16  class ControlPoint;
17  class ControlMeasure;
18  class ControlNet;
19 
38  class AbstractFilter : public QWidget {
39  Q_OBJECT
40 
41  public:
42  enum FilterEffectiveness {
43  Images = 1,
44  Points = 2,
45  Measures = 4
46  };
47  Q_DECLARE_FLAGS(FilterEffectivenessFlag, FilterEffectiveness)
48 
49 
50  public:
51  AbstractFilter(FilterEffectivenessFlag, int minimumForSuccess = -1);
52  AbstractFilter(const AbstractFilter &other);
53  virtual ~AbstractFilter();
54 
55  virtual bool canFilterImages() const;
56  virtual bool canFilterPoints() const;
57  virtual bool canFilterMeasures() const;
58 
59  virtual bool evaluate(const QPair<QString, ControlNet *> *) const = 0;
60  virtual bool evaluate(const ControlPoint *) const = 0;
61  virtual bool evaluate(const ControlMeasure *) const = 0;
62 
63  virtual AbstractFilter *clone() const = 0;
64 
65  virtual QString getImageDescription() const;
66  virtual QString getPointDescription() const;
67  virtual QString getMeasureDescription() const;
68 
69 
70  signals:
71  void filterChanged();
72 
73 
74  protected:
75  bool inclusive() const;
76  int getMinForSuccess() const {
77  return m_minForSuccess;
78  }
79  AbstractFilter::FilterEffectivenessFlag *getEffectivenessFlags() const;
80  QBoxLayout *getMainLayout() const;
81  QBoxLayout *getInclusiveExclusiveLayout() const;
82 
83  bool evaluateImageFromPointFilter(const QPair<QString, ControlNet *> *) const;
84  bool evaluateImageFromMeasureFilter(const QPair<QString, ControlNet *> *) const;
85  bool evaluatePointFromMeasureFilter(const ControlPoint *) const;
86 
87  virtual bool evaluate(const ControlPoint *,
88  bool (ControlPoint:: *)() const) const;
89  virtual bool evaluate(const ControlMeasure *,
90  bool (ControlMeasure:: *)() const) const;
91 
92 
93  private:
94  void createWidget();
95  bool evaluateFromCount(QList< ControlMeasure * >, bool) const;
96  void nullify();
97 
98 
99  private slots:
100  void updateEffectiveness();
101  void updateMinForSuccess(int);
102 
103 
104  private:
105  QCheckBox *createEffectivenessCheckBox(QString);
106 
107 
108  private:
109  QBoxLayout *m_mainLayout;
110  QBoxLayout *m_inclusiveExclusiveLayout;
111  QButtonGroup *m_inclusiveExclusiveGroup;
112  QButtonGroup *m_effectivenessGroup;
113  QWidget *m_minWidget;
114 
115 
116  private:
117  int m_minForSuccess;
118  FilterEffectivenessFlag *m_effectivenessFlags;
119  QFont *m_smallFont;
120  };
121 
122  Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractFilter::FilterEffectivenessFlag)
123 }
124 
125 #endif
A single control point.
Definition: ControlPoint.h:369
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
a control measurement
Base class for control net filters.