Isis 3 Programmer Reference
AbstractFilter.h
1 #ifndef AbstractFilter_H
2 #define AbstractFilter_H
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QWidget>
13 
14 class QBoxLayout;
15 class QButtonGroup;
16 class QCheckBox;
17 template< typename U, typename V > struct QPair;
18 class QString;
19 template< typename T > class QFlags;
20 
21 
22 namespace Isis {
23  class AbstractFilterSelector;
24  class ControlPoint;
25  class ControlMeasure;
26  class ControlNet;
27 
46  class AbstractFilter : public QWidget {
47  Q_OBJECT
48 
49  public:
50  enum FilterEffectiveness {
51  Images = 1,
52  Points = 2,
53  Measures = 4
54  };
55  Q_DECLARE_FLAGS(FilterEffectivenessFlag, FilterEffectiveness)
56 
57 
58  public:
59  AbstractFilter(FilterEffectivenessFlag, int minimumForSuccess = -1);
60  AbstractFilter(const AbstractFilter &other);
61  virtual ~AbstractFilter();
62 
63  virtual bool canFilterImages() const;
64  virtual bool canFilterPoints() const;
65  virtual bool canFilterMeasures() const;
66 
67  virtual bool evaluate(const QPair<QString, ControlNet *> *) const = 0;
68  virtual bool evaluate(const ControlPoint *) const = 0;
69  virtual bool evaluate(const ControlMeasure *) const = 0;
70 
71  virtual AbstractFilter *clone() const = 0;
72 
73  virtual QString getImageDescription() const;
74  virtual QString getPointDescription() const;
75  virtual QString getMeasureDescription() const;
76 
77 
78  signals:
79  void filterChanged();
80 
81 
82  protected:
83  bool inclusive() const;
84  int getMinForSuccess() const {
85  return m_minForSuccess;
86  }
87  AbstractFilter::FilterEffectivenessFlag *getEffectivenessFlags() const;
88  QBoxLayout *getMainLayout() const;
89  QBoxLayout *getInclusiveExclusiveLayout() const;
90 
91  bool evaluateImageFromPointFilter(const QPair<QString, ControlNet *> *) const;
92  bool evaluateImageFromMeasureFilter(const QPair<QString, ControlNet *> *) const;
93  bool evaluatePointFromMeasureFilter(const ControlPoint *) const;
94 
95  virtual bool evaluate(const ControlPoint *,
96  bool (ControlPoint:: *)() const) const;
97  virtual bool evaluate(const ControlMeasure *,
98  bool (ControlMeasure:: *)() const) const;
99 
100 
101  private:
102  void createWidget();
103  bool evaluateFromCount(QList< ControlMeasure * >, bool) const;
104  void nullify();
105 
106 
107  private slots:
108  void updateEffectiveness();
109  void updateMinForSuccess(int);
110 
111 
112  private:
113  QCheckBox *createEffectivenessCheckBox(QString);
114 
115 
116  private:
117  QBoxLayout *m_mainLayout;
118  QBoxLayout *m_inclusiveExclusiveLayout;
119  QButtonGroup *m_inclusiveExclusiveGroup;
120  QButtonGroup *m_effectivenessGroup;
121  QWidget *m_minWidget;
122 
123 
124  private:
125  int m_minForSuccess;
126  FilterEffectivenessFlag *m_effectivenessFlags;
127  QFont *m_smallFont;
128  };
129 
130  Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractFilter::FilterEffectivenessFlag)
131 }
132 
133 #endif
QWidget
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
QFlags
Definition: AbstractFilter.h:19
Isis::AbstractFilter
Base class for control net filters.
Definition: AbstractFilter.h:46
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
QPair
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:23
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175