Isis Developer Reference
AbstractFilter.h
Go to the documentation of this file.
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:
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 
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
Isis::AbstractFilter::getImageDescription
virtual QString getImageDescription() const
Definition: AbstractFilter.cpp:98
Isis::AbstractFilter::canFilterMeasures
virtual bool canFilterMeasures() const
Definition: AbstractFilter.cpp:93
Isis::ControlMeasure::Parent
ControlPoint * Parent()
Definition: ControlMeasure.h:260
QWidget
Isis::ControlPoint::getMeasures
QList< ControlMeasure * > getMeasures(bool excludeIgnored=false) const
Definition: ControlPoint.cpp:1873
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::AbstractFilter::evaluate
virtual bool evaluate(const ControlMeasure *) const =0
Isis::AbstractFilter::getMainLayout
QBoxLayout * getMainLayout() const
Definition: AbstractFilter.cpp:258
QFlags
Definition: AbstractFilter.h:19
Isis::AbstractFilter::evaluateImageFromPointFilter
bool evaluateImageFromPointFilter(const QPair< QString, ControlNet * > *) const
Definition: AbstractFilter.cpp:295
Isis::AbstractFilter
Base class for control net filters.
Definition: AbstractFilter.h:46
Isis::AbstractFilter::evaluatePointFromMeasureFilter
bool evaluatePointFromMeasureFilter(const ControlPoint *) const
Definition: AbstractFilter.cpp:321
Isis::AbstractFilter::evaluate
virtual bool evaluate(const ControlPoint *) const =0
Isis::AbstractFilter::filterChanged
void filterChanged()
AbstractFilter.h
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
Isis::AbstractFilter::canFilterPoints
virtual bool canFilterPoints() const
Definition: AbstractFilter.cpp:88
ControlNet.h
Isis::AbstractFilter::clone
virtual AbstractFilter * clone() const =0
Isis::AbstractFilter::inclusive
bool inclusive() const
Definition: AbstractFilter.cpp:247
Isis::AbstractFilter::getInclusiveExclusiveLayout
QBoxLayout * getInclusiveExclusiveLayout() const
Definition: AbstractFilter.cpp:265
Isis::AbstractFilter::Measures
@ Measures
Definition: AbstractFilter.h:53
Isis::AbstractFilter::getPointDescription
virtual QString getPointDescription() const
Definition: AbstractFilter.cpp:103
Isis::AbstractFilter::getEffectivenessFlags
AbstractFilter::FilterEffectivenessFlag * getEffectivenessFlags() const
Definition: AbstractFilter.cpp:253
ControlPoint.h
Isis::AbstractFilter::getMinForSuccess
int getMinForSuccess() const
Definition: AbstractFilter.h:84
Isis::AbstractFilter::canFilterImages
virtual bool canFilterImages() const
Definition: AbstractFilter.cpp:83
Isis::AbstractFilter::Images
@ Images
Definition: AbstractFilter.h:51
ASSERT
#define ASSERT(x)
Definition: IsisDebug.h:134
Isis::AbstractFilter::AbstractFilter
AbstractFilter(FilterEffectivenessFlag, int minimumForSuccess=-1)
Definition: AbstractFilter.cpp:41
QPair
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:23
AbstractFilterSelector.h
Isis::AbstractFilter::FilterEffectiveness
FilterEffectiveness
Definition: AbstractFilter.h:50
IsisDebug.h
Isis::AbstractFilter::~AbstractFilter
virtual ~AbstractFilter()
Definition: AbstractFilter.cpp:71
Isis::AbstractFilter::evaluateImageFromMeasureFilter
bool evaluateImageFromMeasureFilter(const QPair< QString, ControlNet * > *) const
Definition: AbstractFilter.cpp:308
ControlMeasure.h
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
QSpinBox
Isis::AbstractFilter::Points
@ Points
Definition: AbstractFilter.h:52
Isis::AbstractFilter::evaluate
virtual bool evaluate(const QPair< QString, ControlNet * > *) const =0
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175
Isis::AbstractFilter::getMeasureDescription
virtual QString getMeasureDescription() const
Definition: AbstractFilter.cpp:108