Isis 3 Developer Reference
AbstractFilter.h
Go to the documentation of this file.
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:
43  Images = 1,
44  Points = 2,
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 
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
virtual ~AbstractFilter()
Definition: AbstractFilter.cpp:63
virtual QString getImageDescription() const
Definition: AbstractFilter.cpp:90
Definition: AbstractFilter.h:43
AbstractFilter::FilterEffectivenessFlag * getEffectivenessFlags() const
Definition: AbstractFilter.cpp:245
bool inclusive() const
Definition: AbstractFilter.cpp:239
virtual bool evaluate(const QPair< QString, ControlNet *> *) const =0
virtual QString getMeasureDescription() const
Definition: AbstractFilter.cpp:100
virtual bool canFilterMeasures() const
Definition: AbstractFilter.cpp:85
A single control point.
Definition: ControlPoint.h:369
Definition: AbstractFilter.h:44
Definition: AbstractFilter.h:11
virtual bool canFilterImages() const
Definition: AbstractFilter.cpp:75
int getMinForSuccess() const
Definition: AbstractFilter.h:76
virtual bool canFilterPoints() const
Definition: AbstractFilter.cpp:80
AbstractFilter(FilterEffectivenessFlag, int minimumForSuccess=-1)
Definition: AbstractFilter.cpp:33
Definition: BoxcarCachingAlgorithm.h:29
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
bool evaluateImageFromPointFilter(const QPair< QString, ControlNet *> *) const
Definition: AbstractFilter.cpp:287
a control measurement
Definition: ControlMeasure.h:189
Base class for control net filters.
Definition: AbstractFilter.h:38
QBoxLayout * getInclusiveExclusiveLayout() const
Definition: AbstractFilter.cpp:257
QBoxLayout * getMainLayout() const
Definition: AbstractFilter.cpp:250
virtual QString getPointDescription() const
Definition: AbstractFilter.cpp:95
Definition: CubeIoHandler.h:39
bool evaluateImageFromMeasureFilter(const QPair< QString, ControlNet *> *) const
Definition: AbstractFilter.cpp:300
FilterEffectiveness
Definition: AbstractFilter.h:42
Definition: AbstractFilter.h:45
virtual AbstractFilter * clone() const =0
bool evaluatePointFromMeasureFilter(const ControlPoint *) const
Definition: AbstractFilter.cpp:313